From 521d662bc9d4a26535b1572eed6653e788392797 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 13 Nov 2024 15:58:41 -0800 Subject: [PATCH 1/6] Work to do --- .../native_cupertino_bindings.m | 238 +- .../Sources/cupertino_http/utils.m | 9 - pkgs/cupertino_http/example/pubspec.yaml | 6 + .../lib/src/native_cupertino_bindings.dart | 68485 +++++++++------- pkgs/cupertino_http/pubspec.yaml | 6 + 5 files changed, 40863 insertions(+), 27881 deletions(-) diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m index 20bed4c2b7..39dea970c2 100644 --- a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m +++ b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m @@ -20,7 +20,7 @@ id objc_retainBlock(id); typedef void (^_ListenerTrampoline)(); -_ListenerTrampoline _wrapListenerBlock_ksby9f(_ListenerTrampoline block) NS_RETURNS_RETAINED { +_ListenerTrampoline _NativeCupertinoHttp_wrapListenerBlock_1pl9qdv(_ListenerTrampoline block) NS_RETURNS_RETAINED { return ^void() { objc_retainBlock(block); block(); @@ -28,151 +28,211 @@ _ListenerTrampoline _wrapListenerBlock_ksby9f(_ListenerTrampoline block) NS_RETU } typedef void (^_ListenerTrampoline1)(void * arg0); -_ListenerTrampoline1 _wrapListenerBlock_hepzs(_ListenerTrampoline1 block) NS_RETURNS_RETAINED { +_ListenerTrampoline1 _NativeCupertinoHttp_wrapListenerBlock_ovsamd(_ListenerTrampoline1 block) NS_RETURNS_RETAINED { return ^void(void * arg0) { objc_retainBlock(block); block(arg0); }; } +Protocol* _NativeCupertinoHttp_NSObject() { return @protocol(NSObject); } + +Protocol* _NativeCupertinoHttp_NSCopying() { return @protocol(NSCopying); } + +Protocol* _NativeCupertinoHttp_NSMutableCopying() { return @protocol(NSMutableCopying); } + typedef void (^_ListenerTrampoline2)(void * arg0, id arg1); -_ListenerTrampoline2 _wrapListenerBlock_sjfpmz(_ListenerTrampoline2 block) NS_RETURNS_RETAINED { +_ListenerTrampoline2 _NativeCupertinoHttp_wrapListenerBlock_wjovn7(_ListenerTrampoline2 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1) { objc_retainBlock(block); block(arg0, objc_retain(arg1)); }; } +Protocol* _NativeCupertinoHttp_NSCoding() { return @protocol(NSCoding); } + +Protocol* _NativeCupertinoHttp_NSSecureCoding() { return @protocol(NSSecureCoding); } + +Protocol* _NativeCupertinoHttp_NSDiscardableContent() { return @protocol(NSDiscardableContent); } + typedef void (^_ListenerTrampoline3)(id arg0); -_ListenerTrampoline3 _wrapListenerBlock_ukcdfq(_ListenerTrampoline3 block) NS_RETURNS_RETAINED { +_ListenerTrampoline3 _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(_ListenerTrampoline3 block) NS_RETURNS_RETAINED { return ^void(id arg0) { objc_retainBlock(block); block(objc_retain(arg0)); }; } -typedef void (^_ListenerTrampoline4)(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); -_ListenerTrampoline4 _wrapListenerBlock_ttt6u1(_ListenerTrampoline4 block) NS_RETURNS_RETAINED { +Protocol* _NativeCupertinoHttp_NSProgressReporting() { return @protocol(NSProgressReporting); } + +Protocol* _NativeCupertinoHttp_NSFastEnumeration() { return @protocol(NSFastEnumeration); } + +typedef void (^_ListenerTrampoline4)(id arg0, id arg1, BOOL * arg2); +_ListenerTrampoline4 _NativeCupertinoHttp_wrapListenerBlock_1krhfwz(_ListenerTrampoline4 block) NS_RETURNS_RETAINED { + return ^void(id arg0, id arg1, BOOL * arg2) { + objc_retainBlock(block); + block(objc_retain(arg0), objc_retain(arg1), arg2); + }; +} + +Protocol* _NativeCupertinoHttp_OS_sec_object() { return @protocol(OS_sec_object); } + +typedef void (^_ListenerTrampoline5)(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); +_ListenerTrampoline5 _NativeCupertinoHttp_wrapListenerBlock_tg5tbv(_ListenerTrampoline5 block) NS_RETURNS_RETAINED { return ^void(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1) { objc_retainBlock(block); block(arg0, arg1); }; } -typedef void (^_ListenerTrampoline5)(struct __CFRunLoopTimer * arg0); -_ListenerTrampoline5 _wrapListenerBlock_1txhfzs(_ListenerTrampoline5 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline6)(struct __CFRunLoopTimer * arg0); +_ListenerTrampoline6 _NativeCupertinoHttp_wrapListenerBlock_1dqvvol(_ListenerTrampoline6 block) NS_RETURNS_RETAINED { return ^void(struct __CFRunLoopTimer * arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_ListenerTrampoline6)(size_t arg0); -_ListenerTrampoline6 _wrapListenerBlock_1hmngv6(_ListenerTrampoline6 block) NS_RETURNS_RETAINED { +Protocol* _NativeCupertinoHttp_OS_os_workgroup_interval() { return @protocol(OS_os_workgroup_interval); } + +Protocol* _NativeCupertinoHttp_OS_os_workgroup_parallel() { return @protocol(OS_os_workgroup_parallel); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_object() { return @protocol(OS_dispatch_object); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_queue() { return @protocol(OS_dispatch_queue); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_queue_global() { return @protocol(OS_dispatch_queue_global); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_queue_serial_executor() { return @protocol(OS_dispatch_queue_serial_executor); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_queue_serial() { return @protocol(OS_dispatch_queue_serial); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_queue_main() { return @protocol(OS_dispatch_queue_main); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_queue_concurrent() { return @protocol(OS_dispatch_queue_concurrent); } + +typedef void (^_ListenerTrampoline7)(size_t arg0); +_ListenerTrampoline7 _NativeCupertinoHttp_wrapListenerBlock_6enxqz(_ListenerTrampoline7 block) NS_RETURNS_RETAINED { return ^void(size_t arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_ListenerTrampoline7)(id arg0, int arg1); -_ListenerTrampoline7 _wrapListenerBlock_108ugvk(_ListenerTrampoline7 block) NS_RETURNS_RETAINED { +Protocol* _NativeCupertinoHttp_OS_dispatch_queue_attr() { return @protocol(OS_dispatch_queue_attr); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_source() { return @protocol(OS_dispatch_source); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_group() { return @protocol(OS_dispatch_group); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_semaphore() { return @protocol(OS_dispatch_semaphore); } + +Protocol* _NativeCupertinoHttp_OS_dispatch_data() { return @protocol(OS_dispatch_data); } + +typedef void (^_ListenerTrampoline8)(id arg0, int arg1); +_ListenerTrampoline8 _NativeCupertinoHttp_wrapListenerBlock_qxvyq2(_ListenerTrampoline8 block) NS_RETURNS_RETAINED { return ^void(id arg0, int arg1) { objc_retainBlock(block); block(objc_retain(arg0), arg1); }; } -typedef void (^_ListenerTrampoline8)(int arg0); -_ListenerTrampoline8 _wrapListenerBlock_1afulej(_ListenerTrampoline8 block) NS_RETURNS_RETAINED { +Protocol* _NativeCupertinoHttp_OS_dispatch_io() { return @protocol(OS_dispatch_io); } + +typedef void (^_ListenerTrampoline9)(int arg0); +_ListenerTrampoline9 _NativeCupertinoHttp_wrapListenerBlock_9o8504(_ListenerTrampoline9 block) NS_RETURNS_RETAINED { return ^void(int arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_ListenerTrampoline9)(BOOL arg0, id arg1, int arg2); -_ListenerTrampoline9 _wrapListenerBlock_elldw5(_ListenerTrampoline9 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline10)(BOOL arg0, id arg1, int arg2); +_ListenerTrampoline10 _NativeCupertinoHttp_wrapListenerBlock_12a4qua(_ListenerTrampoline10 block) NS_RETURNS_RETAINED { return ^void(BOOL arg0, id arg1, int arg2) { objc_retainBlock(block); block(arg0, objc_retain(arg1), arg2); }; } -typedef void (^_ListenerTrampoline10)(struct __SecTrust * arg0, SecTrustResultType arg1); -_ListenerTrampoline10 _wrapListenerBlock_129ffij(_ListenerTrampoline10 block) NS_RETURNS_RETAINED { +Protocol* _NativeCupertinoHttp_OS_dispatch_workloop() { return @protocol(OS_dispatch_workloop); } + +typedef void (^_ListenerTrampoline11)(struct __SecTrust * arg0, SecTrustResultType arg1); +_ListenerTrampoline11 _NativeCupertinoHttp_wrapListenerBlock_gwxhxt(_ListenerTrampoline11 block) NS_RETURNS_RETAINED { return ^void(struct __SecTrust * arg0, SecTrustResultType arg1) { objc_retainBlock(block); block(arg0, arg1); }; } -typedef void (^_ListenerTrampoline11)(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); -_ListenerTrampoline11 _wrapListenerBlock_1458n52(_ListenerTrampoline11 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline12)(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); +_ListenerTrampoline12 _NativeCupertinoHttp_wrapListenerBlock_k73ff5(_ListenerTrampoline12 block) NS_RETURNS_RETAINED { return ^void(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2) { objc_retainBlock(block); block(arg0, arg1, arg2); }; } -typedef void (^_ListenerTrampoline12)(uint16_t arg0); -_ListenerTrampoline12 _wrapListenerBlock_yo3tv0(_ListenerTrampoline12 block) NS_RETURNS_RETAINED { +Protocol* _NativeCupertinoHttp_OS_sec_trust() { return @protocol(OS_sec_trust); } + +Protocol* _NativeCupertinoHttp_OS_sec_identity() { return @protocol(OS_sec_identity); } + +Protocol* _NativeCupertinoHttp_OS_sec_certificate() { return @protocol(OS_sec_certificate); } + +Protocol* _NativeCupertinoHttp_OS_sec_protocol_metadata() { return @protocol(OS_sec_protocol_metadata); } + +typedef void (^_ListenerTrampoline13)(uint16_t arg0); +_ListenerTrampoline13 _NativeCupertinoHttp_wrapListenerBlock_15f11yh(_ListenerTrampoline13 block) NS_RETURNS_RETAINED { return ^void(uint16_t arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_ListenerTrampoline13)(id arg0, id arg1); -_ListenerTrampoline13 _wrapListenerBlock_1tjlcwl(_ListenerTrampoline13 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline14)(id arg0, id arg1); +_ListenerTrampoline14 _NativeCupertinoHttp_wrapListenerBlock_wjvic9(_ListenerTrampoline14 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1) { objc_retainBlock(block); block(objc_retain(arg0), objc_retain(arg1)); }; } -typedef void (^_ListenerTrampoline14)(id arg0, id arg1, id arg2); -_ListenerTrampoline14 _wrapListenerBlock_10t0qpd(_ListenerTrampoline14 block) NS_RETURNS_RETAINED { +Protocol* _NativeCupertinoHttp_OS_sec_protocol_options() { return @protocol(OS_sec_protocol_options); } + +typedef void (^_ListenerTrampoline15)(id arg0, id arg1, id arg2); +_ListenerTrampoline15 _NativeCupertinoHttp_wrapListenerBlock_91c9gi(_ListenerTrampoline15 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block(objc_retain(arg0), objc_retain(arg1), objc_retainBlock(arg2)); }; } -typedef void (^_ListenerTrampoline15)(id arg0, id arg1); -_ListenerTrampoline15 _wrapListenerBlock_cmbt6k(_ListenerTrampoline15 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline16)(id arg0, id arg1); +_ListenerTrampoline16 _NativeCupertinoHttp_wrapListenerBlock_14pxqbs(_ListenerTrampoline16 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1) { objc_retainBlock(block); block(objc_retain(arg0), objc_retainBlock(arg1)); }; } -typedef void (^_ListenerTrampoline16)(BOOL arg0); -_ListenerTrampoline16 _wrapListenerBlock_117qins(_ListenerTrampoline16 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline17)(BOOL arg0); +_ListenerTrampoline17 _NativeCupertinoHttp_wrapListenerBlock_1s56lr9(_ListenerTrampoline17 block) NS_RETURNS_RETAINED { return ^void(BOOL arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_ListenerTrampoline17)(id arg0, id arg1, id arg2); -_ListenerTrampoline17 _wrapListenerBlock_tenbla(_ListenerTrampoline17 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline18)(id arg0, id arg1, id arg2); +_ListenerTrampoline18 _NativeCupertinoHttp_wrapListenerBlock_1hcfngn(_ListenerTrampoline18 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block(objc_retain(arg0), objc_retain(arg1), objc_retain(arg2)); }; } -typedef void (^_ListenerTrampoline18)(id arg0, BOOL arg1, id arg2); -_ListenerTrampoline18 _wrapListenerBlock_hfhq9m(_ListenerTrampoline18 block) NS_RETURNS_RETAINED { - return ^void(id arg0, BOOL arg1, id arg2) { - objc_retainBlock(block); - block(objc_retain(arg0), arg1, objc_retain(arg2)); - }; -} - typedef void (^_ListenerTrampoline19)(void * arg0, id arg1, id arg2); -_ListenerTrampoline19 _wrapListenerBlock_tm2na8(_ListenerTrampoline19 block) NS_RETURNS_RETAINED { +_ListenerTrampoline19 _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(_ListenerTrampoline19 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2)); @@ -180,7 +240,7 @@ _ListenerTrampoline19 _wrapListenerBlock_tm2na8(_ListenerTrampoline19 block) NS_ } typedef void (^_ListenerTrampoline20)(NSURLSessionAuthChallengeDisposition arg0, id arg1); -_ListenerTrampoline20 _wrapListenerBlock_1najo2h(_ListenerTrampoline20 block) NS_RETURNS_RETAINED { +_ListenerTrampoline20 _NativeCupertinoHttp_wrapListenerBlock_37btrl(_ListenerTrampoline20 block) NS_RETURNS_RETAINED { return ^void(NSURLSessionAuthChallengeDisposition arg0, id arg1) { objc_retainBlock(block); block(arg0, objc_retain(arg1)); @@ -188,15 +248,17 @@ _ListenerTrampoline20 _wrapListenerBlock_1najo2h(_ListenerTrampoline20 block) NS } typedef void (^_ListenerTrampoline21)(void * arg0, id arg1, id arg2, id arg3); -_ListenerTrampoline21 _wrapListenerBlock_1wmulza(_ListenerTrampoline21 block) NS_RETURNS_RETAINED { +_ListenerTrampoline21 _NativeCupertinoHttp_wrapListenerBlock_12nszru(_ListenerTrampoline21 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retainBlock(arg3)); }; } +Protocol* _NativeCupertinoHttp_NSURLSessionDelegate() { return @protocol(NSURLSessionDelegate); } + typedef void (^_ListenerTrampoline22)(NSURLSessionDelayedRequestDisposition arg0, id arg1); -_ListenerTrampoline22 _wrapListenerBlock_wnmjgj(_ListenerTrampoline22 block) NS_RETURNS_RETAINED { +_ListenerTrampoline22 _NativeCupertinoHttp_wrapListenerBlock_mn1xu3(_ListenerTrampoline22 block) NS_RETURNS_RETAINED { return ^void(NSURLSessionDelayedRequestDisposition arg0, id arg1) { objc_retainBlock(block); block(arg0, objc_retain(arg1)); @@ -204,7 +266,7 @@ _ListenerTrampoline22 _wrapListenerBlock_wnmjgj(_ListenerTrampoline22 block) NS_ } typedef void (^_ListenerTrampoline23)(void * arg0, id arg1, id arg2, id arg3, id arg4); -_ListenerTrampoline23 _wrapListenerBlock_1nnj9ov(_ListenerTrampoline23 block) NS_RETURNS_RETAINED { +_ListenerTrampoline23 _NativeCupertinoHttp_wrapListenerBlock_1f43wec(_ListenerTrampoline23 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3), objc_retainBlock(arg4)); @@ -212,7 +274,7 @@ _ListenerTrampoline23 _wrapListenerBlock_1nnj9ov(_ListenerTrampoline23 block) NS } typedef void (^_ListenerTrampoline24)(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); -_ListenerTrampoline24 _wrapListenerBlock_dmve6(_ListenerTrampoline24 block) NS_RETURNS_RETAINED { +_ListenerTrampoline24 _NativeCupertinoHttp_wrapListenerBlock_13vswqm(_ListenerTrampoline24 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3), objc_retain(arg4), objc_retainBlock(arg5)); @@ -220,7 +282,7 @@ _ListenerTrampoline24 _wrapListenerBlock_dmve6(_ListenerTrampoline24 block) NS_R } typedef void (^_ListenerTrampoline25)(void * arg0, id arg1, id arg2, int64_t arg3, id arg4); -_ListenerTrampoline25 _wrapListenerBlock_qxeqyf(_ListenerTrampoline25 block) NS_RETURNS_RETAINED { +_ListenerTrampoline25 _NativeCupertinoHttp_wrapListenerBlock_qm01og(_ListenerTrampoline25 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, int64_t arg3, id arg4) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, objc_retainBlock(arg4)); @@ -228,7 +290,7 @@ _ListenerTrampoline25 _wrapListenerBlock_qxeqyf(_ListenerTrampoline25 block) NS_ } typedef void (^_ListenerTrampoline26)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); -_ListenerTrampoline26 _wrapListenerBlock_jzggzf(_ListenerTrampoline26 block) NS_RETURNS_RETAINED { +_ListenerTrampoline26 _NativeCupertinoHttp_wrapListenerBlock_1uuez7b(_ListenerTrampoline26 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, arg4, arg5); @@ -236,47 +298,113 @@ _ListenerTrampoline26 _wrapListenerBlock_jzggzf(_ListenerTrampoline26 block) NS_ } typedef void (^_ListenerTrampoline27)(void * arg0, id arg1, id arg2, id arg3); -_ListenerTrampoline27 _wrapListenerBlock_1a6kixf(_ListenerTrampoline27 block) NS_RETURNS_RETAINED { +_ListenerTrampoline27 _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(_ListenerTrampoline27 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3)); }; } +Protocol* _NativeCupertinoHttp_NSURLSessionTaskDelegate() { return @protocol(NSURLSessionTaskDelegate); } + typedef void (^_ListenerTrampoline28)(NSURLSessionResponseDisposition arg0); -_ListenerTrampoline28 _wrapListenerBlock_ci81hw(_ListenerTrampoline28 block) NS_RETURNS_RETAINED { +_ListenerTrampoline28 _NativeCupertinoHttp_wrapListenerBlock_16sve1d(_ListenerTrampoline28 block) NS_RETURNS_RETAINED { return ^void(NSURLSessionResponseDisposition arg0) { objc_retainBlock(block); block(arg0); }; } +Protocol* _NativeCupertinoHttp_NSURLSessionDataDelegate() { return @protocol(NSURLSessionDataDelegate); } + typedef void (^_ListenerTrampoline29)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); -_ListenerTrampoline29 _wrapListenerBlock_1wl7fts(_ListenerTrampoline29 block) NS_RETURNS_RETAINED { +_ListenerTrampoline29 _NativeCupertinoHttp_wrapListenerBlock_9qxjkl(_ListenerTrampoline29 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, arg4); }; } +Protocol* _NativeCupertinoHttp_NSURLSessionDownloadDelegate() { return @protocol(NSURLSessionDownloadDelegate); } + typedef void (^_ListenerTrampoline30)(void * arg0, id arg1, id arg2, id arg3, id arg4); -_ListenerTrampoline30 _wrapListenerBlock_no6pyg(_ListenerTrampoline30 block) NS_RETURNS_RETAINED { +_ListenerTrampoline30 _NativeCupertinoHttp_wrapListenerBlock_62mtml(_ListenerTrampoline30 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3), objc_retain(arg4)); }; } +Protocol* _NativeCupertinoHttp_NSURLSessionStreamDelegate() { return @protocol(NSURLSessionStreamDelegate); } + typedef void (^_ListenerTrampoline31)(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); -_ListenerTrampoline31 _wrapListenerBlock_10hgvcc(_ListenerTrampoline31 block) NS_RETURNS_RETAINED { +_ListenerTrampoline31 _NativeCupertinoHttp_wrapListenerBlock_3lo3bb(_ListenerTrampoline31 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, objc_retain(arg4)); }; } -typedef void (^_ListenerTrampoline32)(id arg0, id arg1, id arg2, id arg3); -_ListenerTrampoline32 _wrapListenerBlock_19b8ge5(_ListenerTrampoline32 block) NS_RETURNS_RETAINED { +Protocol* _NativeCupertinoHttp_NSURLSessionWebSocketDelegate() { return @protocol(NSURLSessionWebSocketDelegate); } + +typedef void (^_ListenerTrampoline32)(id arg0, unsigned long arg1, BOOL * arg2); +_ListenerTrampoline32 _NativeCupertinoHttp_wrapListenerBlock_16ko9u(_ListenerTrampoline32 block) NS_RETURNS_RETAINED { + return ^void(id arg0, unsigned long arg1, BOOL * arg2) { + objc_retainBlock(block); + block(objc_retain(arg0), arg1, arg2); + }; +} + +Protocol* _NativeCupertinoHttp_NSItemProviderWriting() { return @protocol(NSItemProviderWriting); } + +Protocol* _NativeCupertinoHttp_NSItemProviderReading() { return @protocol(NSItemProviderReading); } + +typedef void (^_ListenerTrampoline33)(id arg0, id arg1, id arg2); +_ListenerTrampoline33 _NativeCupertinoHttp_wrapListenerBlock_1j2nt86(_ListenerTrampoline33 block) NS_RETURNS_RETAINED { + return ^void(id arg0, id arg1, id arg2) { + objc_retainBlock(block); + block(objc_retainBlock(arg0), objc_retain(arg1), objc_retain(arg2)); + }; +} + +typedef void (^_ListenerTrampoline34)(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3); +_ListenerTrampoline34 _NativeCupertinoHttp_wrapListenerBlock_8wbg7l(_ListenerTrampoline34 block) NS_RETURNS_RETAINED { + return ^void(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3) { + objc_retainBlock(block); + block(objc_retain(arg0), arg1, arg2, arg3); + }; +} + +typedef void (^_ListenerTrampoline35)(id arg0, BOOL * arg1); +_ListenerTrampoline35 _NativeCupertinoHttp_wrapListenerBlock_148br51(_ListenerTrampoline35 block) NS_RETURNS_RETAINED { + return ^void(id arg0, BOOL * arg1) { + objc_retainBlock(block); + block(objc_retain(arg0), arg1); + }; +} + +typedef void (^_ListenerTrampoline36)(unsigned short * arg0, unsigned long arg1); +_ListenerTrampoline36 _NativeCupertinoHttp_wrapListenerBlock_vhbh5h(_ListenerTrampoline36 block) NS_RETURNS_RETAINED { + return ^void(unsigned short * arg0, unsigned long arg1) { + objc_retainBlock(block); + block(arg0, arg1); + }; +} + +typedef void (^_ListenerTrampoline37)(void * arg0, unsigned long arg1); +_ListenerTrampoline37 _NativeCupertinoHttp_wrapListenerBlock_zuf90e(_ListenerTrampoline37 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, unsigned long arg1) { + objc_retainBlock(block); + block(arg0, arg1); + }; +} + +Protocol* _NativeCupertinoHttp_NSURLHandleClient() { return @protocol(NSURLHandleClient); } + +Protocol* _NativeCupertinoHttp_NSLocking() { return @protocol(NSLocking); } + +typedef void (^_ListenerTrampoline38)(id arg0, id arg1, id arg2, id arg3); +_ListenerTrampoline38 _NativeCupertinoHttp_wrapListenerBlock_4ya7yd(_ListenerTrampoline38 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2, id arg3) { objc_retainBlock(block); block(objc_retain(arg0), objc_retain(arg1), objc_retain(arg2), objc_retain(arg3)); diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m index ff5f771f5d..4f17a3415e 100644 --- a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m +++ b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m @@ -10,12 +10,3 @@ _DidFinish adaptFinishWithLock(_DidFinishWithLock block) { [lock unlock]; }; } - -void doNotCall() { - // TODO(https://github.com/dart-lang/native/issues/1672): Remove - // when fixed. - // Force the protocol information to be available at runtime. - @protocol (NSURLSessionDataDelegate); - @protocol (NSURLSessionDownloadDelegate); - @protocol (NSURLSessionWebSocketDelegate); -} diff --git a/pkgs/cupertino_http/example/pubspec.yaml b/pkgs/cupertino_http/example/pubspec.yaml index 153a11826e..d52e1151ea 100644 --- a/pkgs/cupertino_http/example/pubspec.yaml +++ b/pkgs/cupertino_http/example/pubspec.yaml @@ -38,3 +38,9 @@ dev_dependencies: flutter: uses-material-design: true + +dependency_overrides: + ffi: + path: /Users/bquinlan/dart/native/pkgs/ffi + objective_c: + path: /Users/bquinlan/dart/native/pkgs/objective_c \ No newline at end of file diff --git a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart index a4f2e61ccf..d71ecc7b05 100644 --- a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart +++ b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart @@ -11,6 +11,7 @@ // ignore_for_file: type=lint import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; +import 'package:ffi/ffi.dart' as pkg_ffi; /// Bindings for the Foundation URL Loading System and supporting libraries. /// @@ -23375,17 +23376,23 @@ class NativeCupertinoHttp { late final _os_workgroup_copy_port = _os_workgroup_copy_portPtr .asFunction)>(); - Dartos_workgroup_t os_workgroup_create_with_port( + Dartos_workgroup_t? os_workgroup_create_with_port( ffi.Pointer name, Dart__darwin_natural_t mach_port, ) { - return OS_os_workgroup.castFromPointer( - _os_workgroup_create_with_port( - name, - mach_port, - ), - retain: false, - release: true); + return _os_workgroup_create_with_port( + name, + mach_port, + ).address == + 0 + ? null + : OS_os_workgroup.castFromPointer( + _os_workgroup_create_with_port( + name, + mach_port, + ), + retain: false, + release: true); } late final _os_workgroup_create_with_portPtr = _lookup< @@ -23395,17 +23402,23 @@ class NativeCupertinoHttp { late final _os_workgroup_create_with_port = _os_workgroup_create_with_portPtr .asFunction, int)>(); - Dartos_workgroup_t os_workgroup_create_with_workgroup( + Dartos_workgroup_t? os_workgroup_create_with_workgroup( ffi.Pointer name, Dartos_workgroup_t wg, ) { - return OS_os_workgroup.castFromPointer( - _os_workgroup_create_with_workgroup( - name, - wg.ref.pointer, - ), - retain: false, - release: true); + return _os_workgroup_create_with_workgroup( + name, + wg.ref.pointer, + ).address == + 0 + ? null + : OS_os_workgroup.castFromPointer( + _os_workgroup_create_with_workgroup( + name, + wg.ref.pointer, + ), + retain: false, + release: true); } late final _os_workgroup_create_with_workgroupPtr = _lookup< @@ -23603,17 +23616,23 @@ class NativeCupertinoHttp { int Function( os_workgroup_interval_t, os_workgroup_interval_data_t)>(); - Dartos_workgroup_parallel_t os_workgroup_parallel_create( + Dartos_workgroup_parallel_t? os_workgroup_parallel_create( ffi.Pointer name, os_workgroup_attr_t attr, ) { - return OS_os_workgroup.castFromPointer( - _os_workgroup_parallel_create( - name, - attr, - ), - retain: false, - release: true); + return _os_workgroup_parallel_create( + name, + attr, + ).address == + 0 + ? null + : OS_os_workgroup.castFromPointer( + _os_workgroup_parallel_create( + name, + attr, + ), + retain: false, + release: true); } late final _os_workgroup_parallel_createPtr = _lookup< @@ -24028,12 +24047,12 @@ class NativeCupertinoHttp { void dispatch_apply( int iterations, - Dartdispatch_queue_t queue, + Dartdispatch_queue_t? queue, objc.ObjCBlock block, ) { return _dispatch_apply( iterations, - queue.ref.pointer, + queue?.ref.pointer ?? ffi.nullptr, block.ref.pointer, ); } @@ -24047,7 +24066,7 @@ class NativeCupertinoHttp { void dispatch_apply_f( int iterations, - Dartdispatch_queue_t queue, + Dartdispatch_queue_t? queue, ffi.Pointer context, ffi.Pointer< ffi.NativeFunction< @@ -24057,7 +24076,7 @@ class NativeCupertinoHttp { ) { return _dispatch_apply_f( iterations, - queue.ref.pointer, + queue?.ref.pointer ?? ffi.nullptr, context, work, ); @@ -24127,11 +24146,11 @@ class NativeCupertinoHttp { __dispatch_queue_attr_concurrent; Dartdispatch_queue_attr_t dispatch_queue_attr_make_initially_inactive( - Dartdispatch_queue_attr_t attr, + Dartdispatch_queue_attr_t? attr, ) { return objc.NSObject.castFromPointer( _dispatch_queue_attr_make_initially_inactive( - attr.ref.pointer, + attr?.ref.pointer ?? ffi.nullptr, ), retain: true, release: true); @@ -24146,12 +24165,12 @@ class NativeCupertinoHttp { .asFunction(); Dartdispatch_queue_attr_t dispatch_queue_attr_make_with_autorelease_frequency( - Dartdispatch_queue_attr_t attr, + Dartdispatch_queue_attr_t? attr, dispatch_autorelease_frequency_t frequency, ) { return objc.NSObject.castFromPointer( _dispatch_queue_attr_make_with_autorelease_frequency( - attr.ref.pointer, + attr?.ref.pointer ?? ffi.nullptr, frequency.value, ), retain: true, @@ -24168,13 +24187,13 @@ class NativeCupertinoHttp { dispatch_queue_attr_t Function(dispatch_queue_attr_t, int)>(); Dartdispatch_queue_attr_t dispatch_queue_attr_make_with_qos_class( - Dartdispatch_queue_attr_t attr, + Dartdispatch_queue_attr_t? attr, qos_class_t qos_class, int relative_priority, ) { return objc.NSObject.castFromPointer( _dispatch_queue_attr_make_with_qos_class( - attr.ref.pointer, + attr?.ref.pointer ?? ffi.nullptr, qos_class.value, relative_priority, ), @@ -24192,14 +24211,14 @@ class NativeCupertinoHttp { Dartdispatch_queue_t dispatch_queue_create_with_target( ffi.Pointer label, - Dartdispatch_queue_attr_t attr, - Dartdispatch_queue_t target, + Dartdispatch_queue_attr_t? attr, + Dartdispatch_queue_t? target, ) { return objc.NSObject.castFromPointer( _dispatch_queue_create_with_target( label, - attr.ref.pointer, - target.ref.pointer, + attr?.ref.pointer ?? ffi.nullptr, + target?.ref.pointer ?? ffi.nullptr, ), retain: false, release: true); @@ -24218,12 +24237,12 @@ class NativeCupertinoHttp { Dartdispatch_queue_t dispatch_queue_create( ffi.Pointer label, - Dartdispatch_queue_attr_t attr, + Dartdispatch_queue_attr_t? attr, ) { return objc.NSObject.castFromPointer( _dispatch_queue_create( label, - attr.ref.pointer, + attr?.ref.pointer ?? ffi.nullptr, ), retain: false, release: true); @@ -24238,10 +24257,10 @@ class NativeCupertinoHttp { ffi.Pointer, dispatch_queue_attr_t)>(); ffi.Pointer dispatch_queue_get_label( - Dartdispatch_queue_t queue, + Dartdispatch_queue_t? queue, ) { return _dispatch_queue_get_label( - queue.ref.pointer, + queue?.ref.pointer ?? ffi.nullptr, ); } @@ -24270,11 +24289,11 @@ class NativeCupertinoHttp { void dispatch_set_target_queue( Dartdispatch_object_t object, - Dartdispatch_queue_t queue, + Dartdispatch_queue_t? queue, ) { return _dispatch_set_target_queue( object.ref.pointer, - queue.ref.pointer, + queue?.ref.pointer ?? ffi.nullptr, ); } @@ -24871,14 +24890,14 @@ class NativeCupertinoHttp { dispatch_source_type_t type, int handle, int mask, - Dartdispatch_queue_t queue, + Dartdispatch_queue_t? queue, ) { return objc.NSObject.castFromPointer( _dispatch_source_create( type, handle, mask, - queue.ref.pointer, + queue?.ref.pointer ?? ffi.nullptr, ), retain: false, release: true); @@ -24894,11 +24913,11 @@ class NativeCupertinoHttp { void dispatch_source_set_event_handler( Dartdispatch_source_t source, - Dartdispatch_block_t handler, + Dartdispatch_block_t? handler, ) { return _dispatch_source_set_event_handler( source.ref.pointer, - handler.ref.pointer, + handler?.ref.pointer ?? ffi.nullptr, ); } @@ -24930,11 +24949,11 @@ class NativeCupertinoHttp { void dispatch_source_set_cancel_handler( Dartdispatch_source_t source, - Dartdispatch_block_t handler, + Dartdispatch_block_t? handler, ) { return _dispatch_source_set_cancel_handler( source.ref.pointer, - handler.ref.pointer, + handler?.ref.pointer ?? ffi.nullptr, ); } @@ -25074,11 +25093,11 @@ class NativeCupertinoHttp { void dispatch_source_set_registration_handler( Dartdispatch_source_t source, - Dartdispatch_block_t handler, + Dartdispatch_block_t? handler, ) { return _dispatch_source_set_registration_handler( source.ref.pointer, - handler.ref.pointer, + handler?.ref.pointer ?? ffi.nullptr, ); } @@ -25377,15 +25396,15 @@ class NativeCupertinoHttp { Dartdispatch_data_t dispatch_data_create( ffi.Pointer buffer, int size, - Dartdispatch_queue_t queue, - Dartdispatch_block_t destructor, + Dartdispatch_queue_t? queue, + Dartdispatch_block_t? destructor, ) { return objc.NSObject.castFromPointer( _dispatch_data_create( buffer, size, - queue.ref.pointer, - destructor.ref.pointer, + queue?.ref.pointer ?? ffi.nullptr, + destructor?.ref.pointer ?? ffi.nullptr, ), retain: false, release: true); @@ -25548,7 +25567,7 @@ class NativeCupertinoHttp { Dartdispatch_fd_t fd, Dartdispatch_data_t data, Dartdispatch_queue_t queue, - objc.ObjCBlock handler, + objc.ObjCBlock handler, ) { return _dispatch_write( fd, @@ -32789,12 +32808,12 @@ class NativeCupertinoHttp { DartSInt32 SecTrustEvaluateAsync( SecTrustRef trust, - Dartdispatch_queue_t queue, + Dartdispatch_queue_t? queue, DartSecTrustCallback result, ) { return _SecTrustEvaluateAsync( trust, - queue.ref.pointer, + queue?.ref.pointer ?? ffi.nullptr, result.ref.pointer, ); } @@ -33997,15 +34016,20 @@ class NativeCupertinoHttp { set kSecIdentityDomainKerberosKDC(CFStringRef value) => _kSecIdentityDomainKerberosKDC.value = value; - Dartsec_trust_t sec_trust_create( + Dartsec_trust_t? sec_trust_create( SecTrustRef trust, ) { - return objc.NSObject.castFromPointer( - _sec_trust_create( - trust, - ), - retain: false, - release: true); + return _sec_trust_create( + trust, + ).address == + 0 + ? null + : objc.NSObject.castFromPointer( + _sec_trust_create( + trust, + ), + retain: false, + release: true); } late final _sec_trust_createPtr = @@ -34028,15 +34052,20 @@ class NativeCupertinoHttp { late final _sec_trust_copy_ref = _sec_trust_copy_refPtr.asFunction(); - Dartsec_identity_t sec_identity_create( + Dartsec_identity_t? sec_identity_create( SecIdentityRef identity, ) { - return objc.NSObject.castFromPointer( - _sec_identity_create( - identity, - ), - retain: false, - release: true); + return _sec_identity_create( + identity, + ).address == + 0 + ? null + : objc.NSObject.castFromPointer( + _sec_identity_create( + identity, + ), + retain: false, + release: true); } late final _sec_identity_createPtr = @@ -34045,17 +34074,23 @@ class NativeCupertinoHttp { late final _sec_identity_create = _sec_identity_createPtr .asFunction(); - Dartsec_identity_t sec_identity_create_with_certificates( + Dartsec_identity_t? sec_identity_create_with_certificates( SecIdentityRef identity, CFArrayRef certificates, ) { - return objc.NSObject.castFromPointer( - _sec_identity_create_with_certificates( - identity, - certificates, - ), - retain: false, - release: true); + return _sec_identity_create_with_certificates( + identity, + certificates, + ).address == + 0 + ? null + : objc.NSObject.castFromPointer( + _sec_identity_create_with_certificates( + identity, + certificates, + ), + retain: false, + release: true); } late final _sec_identity_create_with_certificatesPtr = _lookup< @@ -34114,15 +34149,20 @@ class NativeCupertinoHttp { _sec_identity_copy_certificates_refPtr .asFunction(); - Dartsec_certificate_t sec_certificate_create( + Dartsec_certificate_t? sec_certificate_create( SecCertificateRef certificate, ) { - return objc.NSObject.castFromPointer( - _sec_certificate_create( - certificate, - ), - retain: false, - release: true); + return _sec_certificate_create( + certificate, + ).address == + 0 + ? null + : objc.NSObject.castFromPointer( + _sec_certificate_create( + certificate, + ), + retain: false, + release: true); } late final _sec_certificate_createPtr = _lookup< @@ -34161,15 +34201,20 @@ class NativeCupertinoHttp { _sec_protocol_metadata_get_negotiated_protocolPtr.asFunction< ffi.Pointer Function(sec_protocol_metadata_t)>(); - Dartdispatch_data_t sec_protocol_metadata_copy_peer_public_key( + Dartdispatch_data_t? sec_protocol_metadata_copy_peer_public_key( Dartsec_protocol_metadata_t metadata, ) { - return objc.NSObject.castFromPointer( - _sec_protocol_metadata_copy_peer_public_key( - metadata.ref.pointer, - ), - retain: false, - release: true); + return _sec_protocol_metadata_copy_peer_public_key( + metadata.ref.pointer, + ).address == + 0 + ? null + : objc.NSObject.castFromPointer( + _sec_protocol_metadata_copy_peer_public_key( + metadata.ref.pointer, + ), + retain: false, + release: true); } late final _sec_protocol_metadata_copy_peer_public_keyPtr = _lookup< @@ -34417,21 +34462,29 @@ class NativeCupertinoHttp { _sec_protocol_metadata_challenge_parameters_are_equalPtr.asFunction< bool Function(sec_protocol_metadata_t, sec_protocol_metadata_t)>(); - Dartdispatch_data_t sec_protocol_metadata_create_secret( + Dartdispatch_data_t? sec_protocol_metadata_create_secret( Dartsec_protocol_metadata_t metadata, int label_len, ffi.Pointer label, int exporter_length, ) { - return objc.NSObject.castFromPointer( - _sec_protocol_metadata_create_secret( - metadata.ref.pointer, - label_len, - label, - exporter_length, - ), - retain: false, - release: true); + return _sec_protocol_metadata_create_secret( + metadata.ref.pointer, + label_len, + label, + exporter_length, + ).address == + 0 + ? null + : objc.NSObject.castFromPointer( + _sec_protocol_metadata_create_secret( + metadata.ref.pointer, + label_len, + label, + exporter_length, + ), + retain: false, + release: true); } late final _sec_protocol_metadata_create_secretPtr = _lookup< @@ -34446,7 +34499,7 @@ class NativeCupertinoHttp { dispatch_data_t Function( sec_protocol_metadata_t, int, ffi.Pointer, int)>(); - Dartdispatch_data_t sec_protocol_metadata_create_secret_with_context( + Dartdispatch_data_t? sec_protocol_metadata_create_secret_with_context( Dartsec_protocol_metadata_t metadata, int label_len, ffi.Pointer label, @@ -34454,17 +34507,27 @@ class NativeCupertinoHttp { ffi.Pointer context, int exporter_length, ) { - return objc.NSObject.castFromPointer( - _sec_protocol_metadata_create_secret_with_context( - metadata.ref.pointer, - label_len, - label, - context_len, - context, - exporter_length, - ), - retain: false, - release: true); + return _sec_protocol_metadata_create_secret_with_context( + metadata.ref.pointer, + label_len, + label, + context_len, + context, + exporter_length, + ).address == + 0 + ? null + : objc.NSObject.castFromPointer( + _sec_protocol_metadata_create_secret_with_context( + metadata.ref.pointer, + label_len, + label, + context_len, + context, + exporter_length, + ), + retain: false, + release: true); } late final _sec_protocol_metadata_create_secret_with_contextPtr = _lookup< @@ -40439,234 +40502,338 @@ class NativeCupertinoHttp { @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_ksby9f( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_1pl9qdv( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_ovsamd( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_wjovn7( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_hepzs( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_sjfpmz( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_1krhfwz( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_ukcdfq( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_tg5tbv( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_ttt6u1( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_1dqvvol( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_1txhfzs( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_6enxqz( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_1hmngv6( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_qxvyq2( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_108ugvk( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_9o8504( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_1afulej( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_12a4qua( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_elldw5( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_gwxhxt( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_129ffij( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_k73ff5( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_1458n52( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_15f11yh( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_yo3tv0( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_wjvic9( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_1tjlcwl( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_91c9gi( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_10t0qpd( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_14pxqbs( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_cmbt6k( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_1s56lr9( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_117qins( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_1hcfngn( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_tenbla( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_ao4xm9( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_hfhq9m( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_37btrl( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_tm2na8( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_12nszru( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_1najo2h( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_mn1xu3( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_1wmulza( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_1f43wec( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_wnmjgj( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_13vswqm( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_1nnj9ov( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_qm01og( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_dmve6( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_1uuez7b( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_qxeqyf( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_jzggzf( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_16sve1d( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_1a6kixf( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_9qxjkl( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_ci81hw( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_62mtml( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_1wl7fts( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_3lo3bb( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_no6pyg( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_16ko9u( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_10hgvcc( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_1j2nt86( ffi.Pointer block, ); @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _wrapListenerBlock_19b8ge5( +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_8wbg7l( ffi.Pointer block, ); +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_148br51( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_vhbh5h( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_zuf90e( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_4ya7yd( + ffi.Pointer block, +); + +typedef __int8_t = ffi.SignedChar; +typedef Dart__int8_t = int; +typedef __uint8_t = ffi.UnsignedChar; +typedef Dart__uint8_t = int; +typedef __int16_t = ffi.Short; +typedef Dart__int16_t = int; +typedef __uint16_t = ffi.UnsignedShort; +typedef Dart__uint16_t = int; +typedef __int32_t = ffi.Int; +typedef Dart__int32_t = int; +typedef __uint32_t = ffi.UnsignedInt; +typedef Dart__uint32_t = int; +typedef __int64_t = ffi.LongLong; +typedef Dart__int64_t = int; +typedef __uint64_t = ffi.UnsignedLongLong; +typedef Dart__uint64_t = int; +typedef __darwin_intptr_t = ffi.Long; +typedef Dart__darwin_intptr_t = int; +typedef __darwin_natural_t = ffi.UnsignedInt; +typedef Dart__darwin_natural_t = int; +typedef __darwin_ct_rune_t = ffi.Int; +typedef Dart__darwin_ct_rune_t = int; + final class __mbstate_t extends ffi.Union { @ffi.Array.multi([128]) external ffi.Array __mbstate8; @@ -40675,6 +40842,46 @@ final class __mbstate_t extends ffi.Union { external int _mbstateL; } +typedef __darwin_mbstate_t = __mbstate_t; +typedef __darwin_ptrdiff_t = ffi.Long; +typedef Dart__darwin_ptrdiff_t = int; +typedef __darwin_size_t = ffi.UnsignedLong; +typedef Dart__darwin_size_t = int; +typedef __builtin_va_list = ffi.Pointer; +typedef __darwin_va_list = __builtin_va_list; +typedef __darwin_wchar_t = ffi.Int; +typedef Dart__darwin_wchar_t = int; +typedef __darwin_rune_t = __darwin_wchar_t; +typedef __darwin_wint_t = ffi.Int; +typedef Dart__darwin_wint_t = int; +typedef __darwin_clock_t = ffi.UnsignedLong; +typedef Dart__darwin_clock_t = int; +typedef __darwin_socklen_t = __uint32_t; +typedef __darwin_ssize_t = ffi.Long; +typedef Dart__darwin_ssize_t = int; +typedef __darwin_time_t = ffi.Long; +typedef Dart__darwin_time_t = int; +typedef __darwin_blkcnt_t = __int64_t; +typedef __darwin_blksize_t = __int32_t; +typedef __darwin_dev_t = __int32_t; +typedef __darwin_fsblkcnt_t = ffi.UnsignedInt; +typedef Dart__darwin_fsblkcnt_t = int; +typedef __darwin_fsfilcnt_t = ffi.UnsignedInt; +typedef Dart__darwin_fsfilcnt_t = int; +typedef __darwin_gid_t = __uint32_t; +typedef __darwin_id_t = __uint32_t; +typedef __darwin_ino64_t = __uint64_t; +typedef __darwin_ino_t = __darwin_ino64_t; +typedef __darwin_mach_port_name_t = __darwin_natural_t; +typedef __darwin_mach_port_t = __darwin_mach_port_name_t; +typedef __darwin_mode_t = __uint16_t; +typedef __darwin_off_t = __int64_t; +typedef __darwin_pid_t = __int32_t; +typedef __darwin_sigset_t = __uint32_t; +typedef __darwin_suseconds_t = __int32_t; +typedef __darwin_uid_t = __uint32_t; +typedef __darwin_useconds_t = __uint32_t; + final class __darwin_pthread_handler_rec extends ffi.Struct { external ffi .Pointer)>> @@ -40759,6 +40966,66 @@ final class _opaque_pthread_t extends ffi.Struct { external ffi.Array __opaque; } +typedef __darwin_pthread_attr_t = _opaque_pthread_attr_t; +typedef __darwin_pthread_cond_t = _opaque_pthread_cond_t; +typedef __darwin_pthread_condattr_t = _opaque_pthread_condattr_t; +typedef __darwin_pthread_key_t = ffi.UnsignedLong; +typedef Dart__darwin_pthread_key_t = int; +typedef __darwin_pthread_mutex_t = _opaque_pthread_mutex_t; +typedef __darwin_pthread_mutexattr_t = _opaque_pthread_mutexattr_t; +typedef __darwin_pthread_once_t = _opaque_pthread_once_t; +typedef __darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t; +typedef __darwin_pthread_rwlockattr_t = _opaque_pthread_rwlockattr_t; +typedef __darwin_pthread_t = ffi.Pointer<_opaque_pthread_t>; +typedef __darwin_nl_item = ffi.Int; +typedef Dart__darwin_nl_item = int; +typedef __darwin_wctrans_t = ffi.Int; +typedef Dart__darwin_wctrans_t = int; +typedef __darwin_wctype_t = __uint32_t; + +enum idtype_t { + P_ALL(0), + P_PID(1), + P_PGID(2); + + final int value; + const idtype_t(this.value); + + static idtype_t fromValue(int value) => switch (value) { + 0 => P_ALL, + 1 => P_PID, + 2 => P_PGID, + _ => throw ArgumentError("Unknown value for idtype_t: $value"), + }; +} + +typedef pid_t = __darwin_pid_t; +typedef id_t = __darwin_id_t; +typedef sig_atomic_t = ffi.Int; +typedef Dartsig_atomic_t = int; +typedef u_int8_t = ffi.UnsignedChar; +typedef Dartu_int8_t = int; +typedef u_int16_t = ffi.UnsignedShort; +typedef Dartu_int16_t = int; +typedef u_int32_t = ffi.UnsignedInt; +typedef Dartu_int32_t = int; +typedef u_int64_t = ffi.UnsignedLongLong; +typedef Dartu_int64_t = int; +typedef register_t = ffi.Int64; +typedef Dartregister_t = int; +typedef user_addr_t = u_int64_t; +typedef user_size_t = u_int64_t; +typedef user_ssize_t = ffi.Int64; +typedef Dartuser_ssize_t = int; +typedef user_long_t = ffi.Int64; +typedef Dartuser_long_t = int; +typedef user_ulong_t = u_int64_t; +typedef user_time_t = ffi.Int64; +typedef Dartuser_time_t = int; +typedef user_off_t = ffi.Int64; +typedef Dartuser_off_t = int; +typedef syscall_arg_t = u_int64_t; + final class __darwin_arm_exception_state extends ffi.Struct { @__uint32_t() external int __exception; @@ -40770,9 +41037,6 @@ final class __darwin_arm_exception_state extends ffi.Struct { external int __far; } -typedef __uint32_t = ffi.UnsignedInt; -typedef Dart__uint32_t = int; - final class __darwin_arm_exception_state64 extends ffi.Struct { @__uint64_t() external int __far; @@ -40784,9 +41048,6 @@ final class __darwin_arm_exception_state64 extends ffi.Struct { external int __exception; } -typedef __uint64_t = ffi.UnsignedLongLong; -typedef Dart__uint64_t = int; - final class __darwin_arm_thread_state extends ffi.Struct { @ffi.Array.multi([13]) external ffi.Array<__uint32_t> __r; @@ -40907,6 +41168,9 @@ final class __darwin_mcontext32 extends ffi.Struct { final class __darwin_mcontext64 extends ffi.Opaque {} +typedef mcontext_t = ffi.Pointer<__darwin_mcontext64>; +typedef pthread_attr_t = __darwin_pthread_attr_t; + final class __darwin_sigaltstack extends ffi.Struct { external ffi.Pointer ss_sp; @@ -40917,8 +41181,7 @@ final class __darwin_sigaltstack extends ffi.Struct { external int ss_flags; } -typedef __darwin_size_t = ffi.UnsignedLong; -typedef Dart__darwin_size_t = int; +typedef stack_t = __darwin_sigaltstack; final class __darwin_ucontext extends ffi.Struct { @ffi.Int() @@ -40937,7 +41200,9 @@ final class __darwin_ucontext extends ffi.Struct { external ffi.Pointer<__darwin_mcontext64> uc_mcontext; } -typedef __darwin_sigset_t = __uint32_t; +typedef ucontext_t = __darwin_ucontext; +typedef sigset_t = __darwin_sigset_t; +typedef uid_t = __darwin_uid_t; final class sigval extends ffi.Union { @ffi.Int() @@ -40961,9 +41226,6 @@ final class sigevent extends ffi.Struct { external ffi.Pointer sigev_notify_attributes; } -typedef pthread_attr_t = __darwin_pthread_attr_t; -typedef __darwin_pthread_attr_t = _opaque_pthread_attr_t; - final class __siginfo extends ffi.Struct { @ffi.Int() external int si_signo; @@ -40994,12 +41256,7 @@ final class __siginfo extends ffi.Struct { external ffi.Array __pad; } -typedef pid_t = __darwin_pid_t; -typedef __darwin_pid_t = __int32_t; -typedef __int32_t = ffi.Int; -typedef Dart__int32_t = int; -typedef uid_t = __darwin_uid_t; -typedef __darwin_uid_t = __uint32_t; +typedef siginfo_t = __siginfo; final class __sigaction_u extends ffi.Union { external ffi.Pointer> @@ -41027,9 +41284,6 @@ final class __sigaction extends ffi.Struct { external int sa_flags; } -typedef siginfo_t = __siginfo; -typedef sigset_t = __darwin_sigset_t; - final class sigaction extends ffi.Struct { external __sigaction_u __sigaction_u1; @@ -41040,6 +41294,10 @@ final class sigaction extends ffi.Struct { external int sa_flags; } +typedef sig_tFunction = ffi.Void Function(ffi.Int); +typedef Dartsig_tFunction = void Function(int); +typedef sig_t = ffi.Pointer>; + final class sigvec extends ffi.Struct { external ffi.Pointer> sv_handler; @@ -41058,6 +41316,43 @@ final class sigstack extends ffi.Struct { external int ss_onstack; } +typedef int_least8_t = ffi.Int8; +typedef Dartint_least8_t = int; +typedef int_least16_t = ffi.Int16; +typedef Dartint_least16_t = int; +typedef int_least32_t = ffi.Int32; +typedef Dartint_least32_t = int; +typedef int_least64_t = ffi.Int64; +typedef Dartint_least64_t = int; +typedef uint_least8_t = ffi.Uint8; +typedef Dartuint_least8_t = int; +typedef uint_least16_t = ffi.Uint16; +typedef Dartuint_least16_t = int; +typedef uint_least32_t = ffi.Uint32; +typedef Dartuint_least32_t = int; +typedef uint_least64_t = ffi.Uint64; +typedef Dartuint_least64_t = int; +typedef int_fast8_t = ffi.Int8; +typedef Dartint_fast8_t = int; +typedef int_fast16_t = ffi.Int16; +typedef Dartint_fast16_t = int; +typedef int_fast32_t = ffi.Int32; +typedef Dartint_fast32_t = int; +typedef int_fast64_t = ffi.Int64; +typedef Dartint_fast64_t = int; +typedef uint_fast8_t = ffi.Uint8; +typedef Dartuint_fast8_t = int; +typedef uint_fast16_t = ffi.Uint16; +typedef Dartuint_fast16_t = int; +typedef uint_fast32_t = ffi.Uint32; +typedef Dartuint_fast32_t = int; +typedef uint_fast64_t = ffi.Uint64; +typedef Dartuint_fast64_t = int; +typedef intmax_t = ffi.Long; +typedef Dartintmax_t = int; +typedef uintmax_t = ffi.UnsignedLong; +typedef Dartuintmax_t = int; + final class timeval extends ffi.Struct { @__darwin_time_t() external int tv_sec; @@ -41066,9 +41361,7 @@ final class timeval extends ffi.Struct { external int tv_usec; } -typedef __darwin_time_t = ffi.Long; -typedef Dart__darwin_time_t = int; -typedef __darwin_suseconds_t = __int32_t; +typedef rlim_t = __uint64_t; final class rusage extends ffi.Struct { external timeval ru_utime; @@ -41118,6 +41411,8 @@ final class rusage extends ffi.Struct { external int ru_nivcsw; } +typedef rusage_info_t = ffi.Pointer; + final class rusage_info_v0 extends ffi.Struct { @ffi.Array.multi([16]) external ffi.Array ri_uuid; @@ -41714,6 +42009,8 @@ final class rusage_info_v6 extends ffi.Struct { external ffi.Array ri_reserved; } +typedef rusage_info_current = rusage_info_v6; + final class rlimit extends ffi.Struct { @rlim_t() external int rlim_cur; @@ -41722,8 +42019,6 @@ final class rlimit extends ffi.Struct { external int rlim_max; } -typedef rlim_t = __uint64_t; - final class proc_rlimit_control_wakeupmon extends ffi.Struct { @ffi.Uint32() external int wm_flags; @@ -41732,9 +42027,6 @@ final class proc_rlimit_control_wakeupmon extends ffi.Struct { external int wm_rate; } -typedef id_t = __darwin_id_t; -typedef __darwin_id_t = __uint32_t; - @ffi.Packed(1) final class _OSUnalignedU16 extends ffi.Struct { @ffi.Uint16() @@ -41755,21 +42047,8 @@ final class _OSUnalignedU64 extends ffi.Struct { final class wait extends ffi.Opaque {} -enum idtype_t { - P_ALL(0), - P_PID(1), - P_PGID(2); - - final int value; - const idtype_t(this.value); - - static idtype_t fromValue(int value) => switch (value) { - 0 => P_ALL, - 1 => P_PID, - 2 => P_PGID, - _ => throw ArgumentError("Unknown value for idtype_t: $value"), - }; -} +typedef ct_rune_t = __darwin_ct_rune_t; +typedef rune_t = __darwin_rune_t; final class div_t extends ffi.Struct { @ffi.Int() @@ -41801,6 +42080,8 @@ typedef Dartmalloc_type_id_t = int; final class _malloc_zone_t extends ffi.Opaque {} typedef malloc_zone_t = _malloc_zone_t; +typedef dev_t = __darwin_dev_t; +typedef mode_t = __darwin_mode_t; void _ObjCBlock_ffiVoid_fnPtrTrampoline( ffi.Pointer block, ) => @@ -41877,7 +42158,7 @@ abstract final class ObjCBlock_ffiVoid { static objc.ObjCBlock listener(void Function() fn) { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_listenerCallable.nativeFunction.cast(), () => fn()); - final wrapper = _wrapListenerBlock_ksby9f(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1pl9qdv(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock(wrapper, retain: false, release: true); @@ -41992,18 +42273,70 @@ extension ObjCBlock_ffiInt_ffiVoid_ffiVoid_CallExtension on objc ffi.Pointer)>()(ref.pointer, arg0, arg1); } -typedef dev_t = __darwin_dev_t; -typedef __darwin_dev_t = __int32_t; -typedef mode_t = __darwin_mode_t; -typedef __darwin_mode_t = __uint16_t; -typedef __uint16_t = ffi.UnsignedShort; -typedef Dart__uint16_t = int; +typedef ptrdiff_t = ffi.Long; +typedef Dartptrdiff_t = int; +typedef rsize_t = ffi.UnsignedLong; +typedef Dartrsize_t = int; +typedef u_char = ffi.UnsignedChar; +typedef Dartu_char = int; +typedef u_short = ffi.UnsignedShort; +typedef Dartu_short = int; +typedef u_int = ffi.UnsignedInt; +typedef Dartu_int = int; +typedef u_long = ffi.UnsignedLong; +typedef Dartu_long = int; +typedef ushort = ffi.UnsignedShort; +typedef Dartushort = int; +typedef uint = ffi.UnsignedInt; +typedef Dartuint = int; +typedef u_quad_t = u_int64_t; +typedef quad_t = ffi.Int64; +typedef Dartquad_t = int; +typedef qaddr_t = ffi.Pointer; +typedef caddr_t = ffi.Pointer; +typedef daddr_t = ffi.Int32; +typedef Dartdaddr_t = int; +typedef fixpt_t = u_int32_t; +typedef blkcnt_t = __darwin_blkcnt_t; +typedef blksize_t = __darwin_blksize_t; +typedef gid_t = __darwin_gid_t; +typedef in_addr_t = __uint32_t; +typedef in_port_t = __uint16_t; +typedef ino_t = __darwin_ino_t; +typedef ino64_t = __darwin_ino64_t; +typedef key_t = __int32_t; +typedef nlink_t = __uint16_t; +typedef off_t = __darwin_off_t; +typedef segsz_t = ffi.Int32; +typedef Dartsegsz_t = int; +typedef swblk_t = ffi.Int32; +typedef Dartswblk_t = int; +typedef clock_t = __darwin_clock_t; +typedef ssize_t = __darwin_ssize_t; +typedef time_t = __darwin_time_t; +typedef useconds_t = __darwin_useconds_t; +typedef suseconds_t = __darwin_suseconds_t; +typedef errno_t = ffi.Int; +typedef Darterrno_t = int; final class fd_set extends ffi.Struct { @ffi.Array.multi([32]) external ffi.Array<__int32_t> fds_bits; } +typedef fd_mask = __int32_t; +typedef pthread_cond_t = __darwin_pthread_cond_t; +typedef pthread_condattr_t = __darwin_pthread_condattr_t; +typedef pthread_mutex_t = __darwin_pthread_mutex_t; +typedef pthread_mutexattr_t = __darwin_pthread_mutexattr_t; +typedef pthread_once_t = __darwin_pthread_once_t; +typedef pthread_rwlock_t = __darwin_pthread_rwlock_t; +typedef pthread_rwlockattr_t = __darwin_pthread_rwlockattr_t; +typedef pthread_t = __darwin_pthread_t; +typedef pthread_key_t = __darwin_pthread_key_t; +typedef fsblkcnt_t = __darwin_fsblkcnt_t; +typedef fsfilcnt_t = __darwin_fsfilcnt_t; + final class objc_class extends ffi.Opaque {} final class objc_object extends ffi.Struct { @@ -42012,660 +42345,220 @@ final class objc_object extends ffi.Struct { final class objc_selector extends ffi.Opaque {} +typedef IMPFunction = ffi.Void Function(); +typedef DartIMPFunction = void Function(); +typedef IMP = ffi.Pointer>; +typedef objc_zone_t = ffi.Pointer<_malloc_zone_t>; typedef objc_objectptr_t = ffi.Pointer; +typedef NSInteger = ffi.Long; +typedef DartNSInteger = int; +typedef NSUInteger = ffi.UnsignedLong; +typedef DartNSUInteger = int; +late final _protocol_NSObject = objc.getProtocol("NSObject"); +late final _sel_isEqual_ = objc.registerName("isEqual:"); +final _objc_msgSend_69e0x1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +bool _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrTrampoline, false) + .cast(); +bool _ObjCBlock_bool_ffiVoid_objcObjCObject_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as bool Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCObject_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_bool_ffiVoid_objcObjCObject_closureTrampoline, false) + .cast(); -/// NSObject -abstract final class NSObject { - /// Builds an object that implements the NSObject protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required bool Function(objc.ObjCObjectBase) isEqual_, - required objc.ObjCObjectBase Function() class1, - required objc.ObjCObjectBase Function() self, - required objc.ObjCObjectBase Function(ffi.Pointer) - performSelector_, - required objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase) - performSelector_withObject_, - required objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase) - performSelector_withObject_withObject_, - required bool Function() isProxy, - required bool Function(objc.ObjCObjectBase) isKindOfClass_, - required bool Function(objc.ObjCObjectBase) isMemberOfClass_, - required bool Function(objc.Protocol) conformsToProtocol_, - required bool Function(ffi.Pointer) - respondsToSelector_, - required objc.ObjCObjectBase Function() retain, - required void Function() release, - required objc.ObjCObjectBase Function() autorelease, - required DartNSUInteger Function() retainCount, - required ffi.Pointer<_NSZone> Function() zone, - required DartNSUInteger Function() hash, - required objc.ObjCObjectBase Function() superclass, - required objc.NSString Function() description, - objc.NSString Function()? debugDescription}) { - final builder = objc.ObjCProtocolBuilder(); - NSObject.isEqual_.implement(builder, isEqual_); - NSObject.class1.implement(builder, class1); - NSObject.self.implement(builder, self); - NSObject.performSelector_.implement(builder, performSelector_); - NSObject.performSelector_withObject_ - .implement(builder, performSelector_withObject_); - NSObject.performSelector_withObject_withObject_ - .implement(builder, performSelector_withObject_withObject_); - NSObject.isProxy.implement(builder, isProxy); - NSObject.isKindOfClass_.implement(builder, isKindOfClass_); - NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); - NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); - NSObject.respondsToSelector_.implement(builder, respondsToSelector_); - NSObject.retain.implement(builder, retain); - NSObject.release.implement(builder, release); - NSObject.autorelease.implement(builder, autorelease); - NSObject.retainCount.implement(builder, retainCount); - NSObject.zone.implement(builder, zone); - NSObject.hash.implement(builder, hash); - NSObject.superclass.implement(builder, superclass); - NSObject.description.implement(builder, description); - NSObject.debugDescription.implement(builder, debugDescription); - return builder.build(); - } +/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. +abstract final class ObjCBlock_bool_ffiVoid_objcObjCObject { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>( + pointer, + retain: retain, + release: release); - /// Adds the implementation of the NSObject protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required bool Function(objc.ObjCObjectBase) isEqual_, - required objc.ObjCObjectBase Function() class1, - required objc.ObjCObjectBase Function() self, - required objc.ObjCObjectBase Function(ffi.Pointer) - performSelector_, - required objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase) - performSelector_withObject_, - required objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase) - performSelector_withObject_withObject_, - required bool Function() isProxy, - required bool Function(objc.ObjCObjectBase) isKindOfClass_, - required bool Function(objc.ObjCObjectBase) isMemberOfClass_, - required bool Function(objc.Protocol) conformsToProtocol_, - required bool Function(ffi.Pointer) - respondsToSelector_, - required objc.ObjCObjectBase Function() retain, - required void Function() release, - required objc.ObjCObjectBase Function() autorelease, - required DartNSUInteger Function() retainCount, - required ffi.Pointer<_NSZone> Function() zone, - required DartNSUInteger Function() hash, - required objc.ObjCObjectBase Function() superclass, - required objc.NSString Function() description, - objc.NSString Function()? debugDescription}) { - NSObject.isEqual_.implement(builder, isEqual_); - NSObject.class1.implement(builder, class1); - NSObject.self.implement(builder, self); - NSObject.performSelector_.implement(builder, performSelector_); - NSObject.performSelector_withObject_ - .implement(builder, performSelector_withObject_); - NSObject.performSelector_withObject_withObject_ - .implement(builder, performSelector_withObject_withObject_); - NSObject.isProxy.implement(builder, isProxy); - NSObject.isKindOfClass_.implement(builder, isKindOfClass_); - NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); - NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); - NSObject.respondsToSelector_.implement(builder, respondsToSelector_); - NSObject.retain.implement(builder, retain); - NSObject.release.implement(builder, release); - NSObject.autorelease.implement(builder, autorelease); - NSObject.retainCount.implement(builder, retainCount); - NSObject.zone.implement(builder, zone); - NSObject.hash.implement(builder, hash); - NSObject.superclass.implement(builder, superclass); - NSObject.description.implement(builder, description); - NSObject.debugDescription.implement(builder, debugDescription); - } + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, ffi.Pointer)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Builds an object that implements the NSObject protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required bool Function(objc.ObjCObjectBase) isEqual_, - required objc.ObjCObjectBase Function() class1, - required objc.ObjCObjectBase Function() self, - required objc.ObjCObjectBase Function(ffi.Pointer) - performSelector_, - required objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase) - performSelector_withObject_, - required objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase) - performSelector_withObject_withObject_, - required bool Function() isProxy, - required bool Function(objc.ObjCObjectBase) isKindOfClass_, - required bool Function(objc.ObjCObjectBase) isMemberOfClass_, - required bool Function(objc.Protocol) conformsToProtocol_, - required bool Function(ffi.Pointer) - respondsToSelector_, - required objc.ObjCObjectBase Function() retain, - required void Function() release, - required objc.ObjCObjectBase Function() autorelease, - required DartNSUInteger Function() retainCount, - required ffi.Pointer<_NSZone> Function() zone, - required DartNSUInteger Function() hash, - required objc.ObjCObjectBase Function() superclass, - required objc.NSString Function() description, - objc.NSString Function()? debugDescription}) { - final builder = objc.ObjCProtocolBuilder(); - NSObject.isEqual_.implement(builder, isEqual_); - NSObject.class1.implement(builder, class1); - NSObject.self.implement(builder, self); - NSObject.performSelector_.implement(builder, performSelector_); - NSObject.performSelector_withObject_ - .implement(builder, performSelector_withObject_); - NSObject.performSelector_withObject_withObject_ - .implement(builder, performSelector_withObject_withObject_); - NSObject.isProxy.implement(builder, isProxy); - NSObject.isKindOfClass_.implement(builder, isKindOfClass_); - NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); - NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); - NSObject.respondsToSelector_.implement(builder, respondsToSelector_); - NSObject.retain.implement(builder, retain); - NSObject.release.implementAsListener(builder, release); - NSObject.autorelease.implement(builder, autorelease); - NSObject.retainCount.implement(builder, retainCount); - NSObject.zone.implement(builder, zone); - NSObject.hash.implement(builder, hash); - NSObject.superclass.implement(builder, superclass); - NSObject.description.implement(builder, description); - NSObject.debugDescription.implement(builder, debugDescription); - return builder.build(); - } + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, ffi.Pointer)> + fromFunction( + bool Function(ffi.Pointer, objc.ObjCObjectBase) fn) => + objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_bool_ffiVoid_objcObjCObject_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, objc.ObjCObjectBase(arg1, retain: true, release: true))), + retain: false, + release: true); +} - /// Adds the implementation of the NSObject protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required bool Function(objc.ObjCObjectBase) isEqual_, - required objc.ObjCObjectBase Function() class1, - required objc.ObjCObjectBase Function() self, - required objc.ObjCObjectBase Function(ffi.Pointer) - performSelector_, - required objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase) - performSelector_withObject_, - required objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase) - performSelector_withObject_withObject_, - required bool Function() isProxy, - required bool Function(objc.ObjCObjectBase) isKindOfClass_, - required bool Function(objc.ObjCObjectBase) isMemberOfClass_, - required bool Function(objc.Protocol) conformsToProtocol_, - required bool Function(ffi.Pointer) - respondsToSelector_, - required objc.ObjCObjectBase Function() retain, - required void Function() release, - required objc.ObjCObjectBase Function() autorelease, - required DartNSUInteger Function() retainCount, - required ffi.Pointer<_NSZone> Function() zone, - required DartNSUInteger Function() hash, - required objc.ObjCObjectBase Function() superclass, - required objc.NSString Function() description, - objc.NSString Function()? debugDescription}) { - NSObject.isEqual_.implement(builder, isEqual_); - NSObject.class1.implement(builder, class1); - NSObject.self.implement(builder, self); - NSObject.performSelector_.implement(builder, performSelector_); - NSObject.performSelector_withObject_ - .implement(builder, performSelector_withObject_); - NSObject.performSelector_withObject_withObject_ - .implement(builder, performSelector_withObject_withObject_); - NSObject.isProxy.implement(builder, isProxy); - NSObject.isKindOfClass_.implement(builder, isKindOfClass_); - NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); - NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); - NSObject.respondsToSelector_.implement(builder, respondsToSelector_); - NSObject.retain.implement(builder, retain); - NSObject.release.implementAsListener(builder, release); - NSObject.autorelease.implement(builder, autorelease); - NSObject.retainCount.implement(builder, retainCount); - NSObject.zone.implement(builder, zone); - NSObject.hash.implement(builder, hash); - NSObject.superclass.implement(builder, superclass); - NSObject.description.implement(builder, description); - NSObject.debugDescription.implement(builder, debugDescription); - } +/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. +extension ObjCBlock_bool_ffiVoid_objcObjCObject_CallExtension on objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, ffi.Pointer)> { + bool call(ffi.Pointer arg0, objc.ObjCObjectBase arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer); +} - /// isEqual: - static final isEqual_ = - objc.ObjCProtocolMethod( - _sel_isEqual_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_isEqual_, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function(objc.ObjCObjectBase) func) => - ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( - (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), - ); +late final _sel_hash = objc.registerName("hash"); +final _objc_msgSend_xw2lbc = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +int _ObjCBlock_NSUInteger_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi + .NativeFunction arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_NSUInteger_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSUInteger_ffiVoid_fnPtrTrampoline, 0) + .cast(); +int _ObjCBlock_NSUInteger_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as int Function(ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_NSUInteger_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSUInteger_ffiVoid_closureTrampoline, 0) + .cast(); - /// class - static final class1 = objc.ObjCProtocolMethod( - _sel_class, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_class, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function() func) => - ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSUInteger_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>( + pointer, + retain: retain, + release: release); - /// self - static final self = objc.ObjCProtocolMethod( - _sel_self, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_self, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function() func) => - ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.UnsignedLong Function(ffi.Pointer)> fromFunctionPointer( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_NSUInteger_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// performSelector: - static final performSelector_ = objc.ObjCProtocolMethod< - objc.ObjCObjectBase Function(ffi.Pointer)>( - _sel_performSelector_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_performSelector_, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function(ffi.Pointer) func) => - ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector.fromFunction( - (ffi.Pointer _, ffi.Pointer arg1) => - func(arg1)), - ); + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> + fromFunction(DartNSUInteger Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSUInteger_ffiVoid_closureCallable, + (ffi.Pointer arg0) => fn(arg0)), + retain: false, + release: true); +} - /// performSelector:withObject: - static final performSelector_withObject_ = objc.ObjCProtocolMethod< - objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase)>( - _sel_performSelector_withObject_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_performSelector_withObject_, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase) - func) => - ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject - .fromFunction((ffi.Pointer _, - ffi.Pointer arg1, - objc.ObjCObjectBase arg2) => - func(arg1, arg2)), - ); - - /// performSelector:withObject:withObject: - static final performSelector_withObject_withObject_ = objc.ObjCProtocolMethod< - objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase)>( - _sel_performSelector_withObject_withObject_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_performSelector_withObject_withObject_, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase) - func) => - ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject - .fromFunction((ffi.Pointer _, - ffi.Pointer arg1, - objc.ObjCObjectBase arg2, - objc.ObjCObjectBase arg3) => - func(arg1, arg2, arg3)), - ); - - /// isProxy - static final isProxy = objc.ObjCProtocolMethod( - _sel_isProxy, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_isProxy, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function() func) => ObjCBlock_bool_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); - - /// isKindOfClass: - static final isKindOfClass_ = - objc.ObjCProtocolMethod( - _sel_isKindOfClass_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_isKindOfClass_, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function(objc.ObjCObjectBase) func) => - ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( - (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), - ); - - /// isMemberOfClass: - static final isMemberOfClass_ = - objc.ObjCProtocolMethod( - _sel_isMemberOfClass_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_isMemberOfClass_, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function(objc.ObjCObjectBase) func) => - ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( - (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), - ); - - /// conformsToProtocol: - static final conformsToProtocol_ = - objc.ObjCProtocolMethod( - _sel_conformsToProtocol_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_conformsToProtocol_, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function(objc.Protocol) func) => - ObjCBlock_bool_ffiVoid_Protocol.fromFunction( - (ffi.Pointer _, objc.Protocol arg1) => func(arg1)), - ); - - /// respondsToSelector: - static final respondsToSelector_ = - objc.ObjCProtocolMethod)>( - _sel_respondsToSelector_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_respondsToSelector_, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function(ffi.Pointer) func) => - ObjCBlock_bool_ffiVoid_objcObjCSelector.fromFunction( - (ffi.Pointer _, ffi.Pointer arg1) => - func(arg1)), - ); - - /// retain - static final retain = objc.ObjCProtocolMethod( - _sel_retain, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_retain, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function() func) => - ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); - - /// release - static final release = objc.ObjCProtocolListenableMethod( - _sel_release, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_release, - isRequired: true, - isInstanceMethod: true, - ), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( - ffi.Pointer _, - ) => - func()), - ); - - /// autorelease - static final autorelease = - objc.ObjCProtocolMethod( - _sel_autorelease, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_autorelease, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function() func) => - ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); - - /// retainCount - static final retainCount = objc.ObjCProtocolMethod( - _sel_retainCount, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_retainCount, - isRequired: true, - isInstanceMethod: true, - ), - (DartNSUInteger Function() func) => - ObjCBlock_NSUInteger_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); - - /// zone - static final zone = objc.ObjCProtocolMethod Function()>( - _sel_zone, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_zone, - isRequired: true, - isInstanceMethod: true, - ), - (ffi.Pointer<_NSZone> Function() func) => - ObjCBlock_NSZone_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); - - /// hash - static final hash = objc.ObjCProtocolMethod( - _sel_hash, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_hash, - isRequired: true, - isInstanceMethod: true, - ), - (DartNSUInteger Function() func) => - ObjCBlock_NSUInteger_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); - - /// superclass - static final superclass = - objc.ObjCProtocolMethod( - _sel_superclass, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_superclass, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function() func) => - ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); - - /// description - static final description = objc.ObjCProtocolMethod( - _sel_description, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_description, - isRequired: true, - isInstanceMethod: true, - ), - (objc.NSString Function() func) => ObjCBlock_NSString_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); - - /// debugDescription - static final debugDescription = - objc.ObjCProtocolMethod( - _sel_debugDescription, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_debugDescription, - isRequired: false, - isInstanceMethod: true, - ), - (objc.NSString Function() func) => ObjCBlock_NSString_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); -} - -late final _protocol_NSObject = objc.getProtocol("NSObject"); -late final _sel_isEqual_ = objc.registerName("isEqual:"); -bool _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_ffiVoid_objcObjCObject_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCObject_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_objcObjCObject_closureTrampoline, false) - .cast(); - -/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. -abstract final class ObjCBlock_bool_ffiVoid_objcObjCObject { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, ffi.Pointer)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, ffi.Pointer)> - fromFunction( - bool Function(ffi.Pointer, objc.ObjCObjectBase) fn) => - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_bool_ffiVoid_objcObjCObject_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, objc.ObjCObjectBase(arg1, retain: true, release: true))), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. -extension ObjCBlock_bool_ffiVoid_objcObjCObject_CallExtension on objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, ffi.Pointer)> { - bool call(ffi.Pointer arg0, objc.ObjCObjectBase arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer); +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_NSUInteger_ffiVoid_CallExtension + on objc.ObjCBlock)> { + DartNSUInteger call(ffi.Pointer arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0); } -late final _sel_class = objc.registerName("class"); +late final _sel_superclass = objc.registerName("superclass"); +final _objc_msgSend_1x359cv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0) => block.ref.target @@ -42761,10 +42654,21 @@ extension ObjCBlock_objcObjCObject_ffiVoid_CallExtension on objc release: true); } +late final _sel_class = objc.registerName("class"); typedef instancetype = ffi.Pointer; typedef Dartinstancetype = objc.ObjCObjectBase; late final _sel_self = objc.registerName("self"); late final _sel_performSelector_ = objc.registerName("performSelector:"); +final _objc_msgSend_19hbqky = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_fnPtrTrampoline( ffi.Pointer block, @@ -42881,6 +42785,20 @@ extension ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_CallExtension late final _sel_performSelector_withObject_ = objc.registerName("performSelector:withObject:"); +final _objc_msgSend_1wlgx7q = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_fnPtrTrampoline( ffi.Pointer block, @@ -43012,6 +42930,22 @@ extension ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_CallE late final _sel_performSelector_withObject_withObject_ = objc.registerName("performSelector:withObject:withObject:"); +final _objc_msgSend_189974q = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_fnPtrTrampoline( ffi.Pointer block, @@ -43164,6 +43098,14 @@ extension ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcO } late final _sel_isProxy = objc.registerName("isProxy"); +final _objc_msgSend_91o635 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, ffi.Pointer)>(); bool _ObjCBlock_bool_ffiVoid_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0) => block.ref.target @@ -43335,6 +43277,16 @@ extension ObjCBlock_bool_ffiVoid_Protocol_CallExtension } late final _sel_respondsToSelector_ = objc.registerName("respondsToSelector:"); +final _objc_msgSend_1srf6wk = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); bool _ObjCBlock_bool_ffiVoid_objcObjCSelector_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, @@ -43438,6 +43390,14 @@ extension ObjCBlock_bool_ffiVoid_objcObjCSelector_CallExtension late final _sel_retain = objc.registerName("retain"); late final _sel_release = objc.registerName("release"); +final _objc_msgSend_1pl9qdv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>(); void _ObjCBlock_ffiVoid_ffiVoid_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0) => block.ref.target @@ -43526,7 +43486,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { final raw = objc.newClosureBlock( _ObjCBlock_ffiVoid_ffiVoid_listenerCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0)); - final wrapper = _wrapListenerBlock_hepzs(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ovsamd(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock)>(wrapper, retain: false, release: true); @@ -43547,89 +43507,19 @@ extension ObjCBlock_ffiVoid_ffiVoid_CallExtension } late final _sel_autorelease = objc.registerName("autorelease"); -typedef NSUInteger = ffi.UnsignedLong; -typedef DartNSUInteger = int; late final _sel_retainCount = objc.registerName("retainCount"); -int _ObjCBlock_NSUInteger_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_NSUInteger_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSUInteger_ffiVoid_fnPtrTrampoline, 0) - .cast(); -int _ObjCBlock_NSUInteger_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as int Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_NSUInteger_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSUInteger_ffiVoid_closureTrampoline, 0) - .cast(); - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_NSUInteger_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.UnsignedLong Function(ffi.Pointer)> fromFunctionPointer( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_NSUInteger_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(DartNSUInteger Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_NSUInteger_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0)), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_NSUInteger_ffiVoid_CallExtension - on objc.ObjCBlock)> { - DartNSUInteger call(ffi.Pointer arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0); -} final class _NSZone extends ffi.Opaque {} late final _sel_zone = objc.registerName("zone"); +final _objc_msgSend_sz90oi = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer<_NSZone> Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer<_NSZone> Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer<_NSZone> _ObjCBlock_NSZone_ffiVoid_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0) => block.ref.target @@ -43712,8 +43602,6 @@ extension ObjCBlock_NSZone_ffiVoid_CallExtension ffi.Pointer)>()(ref.pointer, arg0); } -late final _sel_hash = objc.registerName("hash"); -late final _sel_superclass = objc.registerName("superclass"); late final _sel_description = objc.registerName("description"); ffi.Pointer _ObjCBlock_NSString_ffiVoid_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0) => @@ -43804,84 +43692,877 @@ extension ObjCBlock_NSString_ffiVoid_CallExtension } late final _sel_debugDescription = objc.registerName("debugDescription"); -typedef va_list = __builtin_va_list; -typedef __builtin_va_list = ffi.Pointer; -typedef NSInteger = ffi.Long; -typedef DartNSInteger = int; -@ffi.Packed(2) -final class wide extends ffi.Struct { - @UInt32() - external int lo; - - @SInt32() - external int hi; -} - -typedef UInt32 = ffi.UnsignedInt; -typedef DartUInt32 = int; -typedef SInt32 = ffi.Int; -typedef DartSInt32 = int; +/// NSObject +abstract final class NSObject { + /// Builds an object that implements the NSObject protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required bool Function(objc.ObjCObjectBase) isEqual_, + required DartNSUInteger Function() hash, + required objc.ObjCObjectBase Function() superclass, + required objc.ObjCObjectBase Function() class1, + required objc.ObjCObjectBase Function() self, + required objc.ObjCObjectBase Function(ffi.Pointer) + performSelector_, + required objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase) + performSelector_withObject_, + required objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase) + performSelector_withObject_withObject_, + required bool Function() isProxy, + required bool Function(objc.ObjCObjectBase) isKindOfClass_, + required bool Function(objc.ObjCObjectBase) isMemberOfClass_, + required bool Function(objc.Protocol) conformsToProtocol_, + required bool Function(ffi.Pointer) + respondsToSelector_, + required objc.ObjCObjectBase Function() retain, + required void Function() release, + required objc.ObjCObjectBase Function() autorelease, + required DartNSUInteger Function() retainCount, + required ffi.Pointer<_NSZone> Function() zone, + required objc.NSString Function() description, + objc.NSString Function()? debugDescription}) { + final builder = objc.ObjCProtocolBuilder(); + NSObject.isEqual_.implement(builder, isEqual_); + NSObject.hash.implement(builder, hash); + NSObject.superclass.implement(builder, superclass); + NSObject.class1.implement(builder, class1); + NSObject.self.implement(builder, self); + NSObject.performSelector_.implement(builder, performSelector_); + NSObject.performSelector_withObject_ + .implement(builder, performSelector_withObject_); + NSObject.performSelector_withObject_withObject_ + .implement(builder, performSelector_withObject_withObject_); + NSObject.isProxy.implement(builder, isProxy); + NSObject.isKindOfClass_.implement(builder, isKindOfClass_); + NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); + NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); + NSObject.respondsToSelector_.implement(builder, respondsToSelector_); + NSObject.retain.implement(builder, retain); + NSObject.release.implement(builder, release); + NSObject.autorelease.implement(builder, autorelease); + NSObject.retainCount.implement(builder, retainCount); + NSObject.zone.implement(builder, zone); + NSObject.description.implement(builder, description); + NSObject.debugDescription.implement(builder, debugDescription); + return builder.build(); + } -@ffi.Packed(2) -final class UnsignedWide extends ffi.Struct { - @UInt32() - external int lo; + /// Adds the implementation of the NSObject protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required bool Function(objc.ObjCObjectBase) isEqual_, + required DartNSUInteger Function() hash, + required objc.ObjCObjectBase Function() superclass, + required objc.ObjCObjectBase Function() class1, + required objc.ObjCObjectBase Function() self, + required objc.ObjCObjectBase Function(ffi.Pointer) + performSelector_, + required objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase) + performSelector_withObject_, + required objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase) + performSelector_withObject_withObject_, + required bool Function() isProxy, + required bool Function(objc.ObjCObjectBase) isKindOfClass_, + required bool Function(objc.ObjCObjectBase) isMemberOfClass_, + required bool Function(objc.Protocol) conformsToProtocol_, + required bool Function(ffi.Pointer) + respondsToSelector_, + required objc.ObjCObjectBase Function() retain, + required void Function() release, + required objc.ObjCObjectBase Function() autorelease, + required DartNSUInteger Function() retainCount, + required ffi.Pointer<_NSZone> Function() zone, + required objc.NSString Function() description, + objc.NSString Function()? debugDescription}) { + NSObject.isEqual_.implement(builder, isEqual_); + NSObject.hash.implement(builder, hash); + NSObject.superclass.implement(builder, superclass); + NSObject.class1.implement(builder, class1); + NSObject.self.implement(builder, self); + NSObject.performSelector_.implement(builder, performSelector_); + NSObject.performSelector_withObject_ + .implement(builder, performSelector_withObject_); + NSObject.performSelector_withObject_withObject_ + .implement(builder, performSelector_withObject_withObject_); + NSObject.isProxy.implement(builder, isProxy); + NSObject.isKindOfClass_.implement(builder, isKindOfClass_); + NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); + NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); + NSObject.respondsToSelector_.implement(builder, respondsToSelector_); + NSObject.retain.implement(builder, retain); + NSObject.release.implement(builder, release); + NSObject.autorelease.implement(builder, autorelease); + NSObject.retainCount.implement(builder, retainCount); + NSObject.zone.implement(builder, zone); + NSObject.description.implement(builder, description); + NSObject.debugDescription.implement(builder, debugDescription); + } - @UInt32() - external int hi; -} + /// Builds an object that implements the NSObject protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required bool Function(objc.ObjCObjectBase) isEqual_, + required DartNSUInteger Function() hash, + required objc.ObjCObjectBase Function() superclass, + required objc.ObjCObjectBase Function() class1, + required objc.ObjCObjectBase Function() self, + required objc.ObjCObjectBase Function(ffi.Pointer) + performSelector_, + required objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase) + performSelector_withObject_, + required objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase) + performSelector_withObject_withObject_, + required bool Function() isProxy, + required bool Function(objc.ObjCObjectBase) isKindOfClass_, + required bool Function(objc.ObjCObjectBase) isMemberOfClass_, + required bool Function(objc.Protocol) conformsToProtocol_, + required bool Function(ffi.Pointer) + respondsToSelector_, + required objc.ObjCObjectBase Function() retain, + required void Function() release, + required objc.ObjCObjectBase Function() autorelease, + required DartNSUInteger Function() retainCount, + required ffi.Pointer<_NSZone> Function() zone, + required objc.NSString Function() description, + objc.NSString Function()? debugDescription}) { + final builder = objc.ObjCProtocolBuilder(); + NSObject.isEqual_.implement(builder, isEqual_); + NSObject.hash.implement(builder, hash); + NSObject.superclass.implement(builder, superclass); + NSObject.class1.implement(builder, class1); + NSObject.self.implement(builder, self); + NSObject.performSelector_.implement(builder, performSelector_); + NSObject.performSelector_withObject_ + .implement(builder, performSelector_withObject_); + NSObject.performSelector_withObject_withObject_ + .implement(builder, performSelector_withObject_withObject_); + NSObject.isProxy.implement(builder, isProxy); + NSObject.isKindOfClass_.implement(builder, isKindOfClass_); + NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); + NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); + NSObject.respondsToSelector_.implement(builder, respondsToSelector_); + NSObject.retain.implement(builder, retain); + NSObject.release.implementAsListener(builder, release); + NSObject.autorelease.implement(builder, autorelease); + NSObject.retainCount.implement(builder, retainCount); + NSObject.zone.implement(builder, zone); + NSObject.description.implement(builder, description); + NSObject.debugDescription.implement(builder, debugDescription); + return builder.build(); + } -final class Float80 extends ffi.Struct { - @SInt16() - external int exp; + /// Adds the implementation of the NSObject protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required bool Function(objc.ObjCObjectBase) isEqual_, + required DartNSUInteger Function() hash, + required objc.ObjCObjectBase Function() superclass, + required objc.ObjCObjectBase Function() class1, + required objc.ObjCObjectBase Function() self, + required objc.ObjCObjectBase Function(ffi.Pointer) + performSelector_, + required objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase) + performSelector_withObject_, + required objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase) + performSelector_withObject_withObject_, + required bool Function() isProxy, + required bool Function(objc.ObjCObjectBase) isKindOfClass_, + required bool Function(objc.ObjCObjectBase) isMemberOfClass_, + required bool Function(objc.Protocol) conformsToProtocol_, + required bool Function(ffi.Pointer) + respondsToSelector_, + required objc.ObjCObjectBase Function() retain, + required void Function() release, + required objc.ObjCObjectBase Function() autorelease, + required DartNSUInteger Function() retainCount, + required ffi.Pointer<_NSZone> Function() zone, + required objc.NSString Function() description, + objc.NSString Function()? debugDescription}) { + NSObject.isEqual_.implement(builder, isEqual_); + NSObject.hash.implement(builder, hash); + NSObject.superclass.implement(builder, superclass); + NSObject.class1.implement(builder, class1); + NSObject.self.implement(builder, self); + NSObject.performSelector_.implement(builder, performSelector_); + NSObject.performSelector_withObject_ + .implement(builder, performSelector_withObject_); + NSObject.performSelector_withObject_withObject_ + .implement(builder, performSelector_withObject_withObject_); + NSObject.isProxy.implement(builder, isProxy); + NSObject.isKindOfClass_.implement(builder, isKindOfClass_); + NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); + NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); + NSObject.respondsToSelector_.implement(builder, respondsToSelector_); + NSObject.retain.implement(builder, retain); + NSObject.release.implementAsListener(builder, release); + NSObject.autorelease.implement(builder, autorelease); + NSObject.retainCount.implement(builder, retainCount); + NSObject.zone.implement(builder, zone); + NSObject.description.implement(builder, description); + NSObject.debugDescription.implement(builder, debugDescription); + } - @ffi.Array.multi([4]) - external ffi.Array man; -} + /// isEqual: + static final isEqual_ = + objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_isEqual_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_isEqual_, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function(objc.ObjCObjectBase) func) => + ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( + (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), + ); -typedef SInt16 = ffi.Short; -typedef DartSInt16 = int; -typedef UInt16 = ffi.UnsignedShort; -typedef DartUInt16 = int; + /// hash + static final hash = objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_hash, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_hash, + isRequired: true, + isInstanceMethod: true, + ), + (DartNSUInteger Function() func) => + ObjCBlock_NSUInteger_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); -final class Float96 extends ffi.Struct { - @ffi.Array.multi([2]) - external ffi.Array exp; + /// superclass + static final superclass = + objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_superclass, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_superclass, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function() func) => + ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); - @ffi.Array.multi([4]) - external ffi.Array man; -} + /// class + static final class1 = objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_class, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_class, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function() func) => + ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); -@ffi.Packed(2) -final class Float32Point extends ffi.Struct { - @Float32() - external double x; + /// self + static final self = objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_self, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_self, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function() func) => + ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); - @Float32() - external double y; -} + /// performSelector: + static final performSelector_ = objc.ObjCProtocolMethod< + objc.ObjCObjectBase Function(ffi.Pointer)>( + _protocol_NSObject, + _sel_performSelector_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_performSelector_, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function(ffi.Pointer) func) => + ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector.fromFunction( + (ffi.Pointer _, ffi.Pointer arg1) => + func(arg1)), + ); -typedef Float32 = ffi.Float; -typedef DartFloat32 = double; + /// performSelector:withObject: + static final performSelector_withObject_ = objc.ObjCProtocolMethod< + objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase)>( + _protocol_NSObject, + _sel_performSelector_withObject_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_performSelector_withObject_, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase) + func) => + ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject + .fromFunction((ffi.Pointer _, + ffi.Pointer arg1, + objc.ObjCObjectBase arg2) => + func(arg1, arg2)), + ); -@ffi.Packed(2) -final class ProcessSerialNumber extends ffi.Struct { - @UInt32() - external int highLongOfPSN; + /// performSelector:withObject:withObject: + static final performSelector_withObject_withObject_ = objc.ObjCProtocolMethod< + objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase)>( + _protocol_NSObject, + _sel_performSelector_withObject_withObject_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_performSelector_withObject_withObject_, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase) + func) => + ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject + .fromFunction((ffi.Pointer _, + ffi.Pointer arg1, + objc.ObjCObjectBase arg2, + objc.ObjCObjectBase arg3) => + func(arg1, arg2, arg3)), + ); - @UInt32() - external int lowLongOfPSN; -} + /// isProxy + static final isProxy = objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_isProxy, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_isProxy, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function() func) => ObjCBlock_bool_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); -final class Point extends ffi.Struct { - @ffi.Short() - external int v; + /// isKindOfClass: + static final isKindOfClass_ = + objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_isKindOfClass_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_isKindOfClass_, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function(objc.ObjCObjectBase) func) => + ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( + (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), + ); + + /// isMemberOfClass: + static final isMemberOfClass_ = + objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_isMemberOfClass_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_isMemberOfClass_, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function(objc.ObjCObjectBase) func) => + ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( + (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), + ); + + /// conformsToProtocol: + static final conformsToProtocol_ = + objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_conformsToProtocol_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_conformsToProtocol_, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function(objc.Protocol) func) => + ObjCBlock_bool_ffiVoid_Protocol.fromFunction( + (ffi.Pointer _, objc.Protocol arg1) => func(arg1)), + ); + + /// respondsToSelector: + static final respondsToSelector_ = + objc.ObjCProtocolMethod)>( + _protocol_NSObject, + _sel_respondsToSelector_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_respondsToSelector_, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function(ffi.Pointer) func) => + ObjCBlock_bool_ffiVoid_objcObjCSelector.fromFunction( + (ffi.Pointer _, ffi.Pointer arg1) => + func(arg1)), + ); + + /// retain + static final retain = objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_retain, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_retain, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function() func) => + ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// release + static final release = objc.ObjCProtocolListenableMethod( + _protocol_NSObject, + _sel_release, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_release, + isRequired: true, + isInstanceMethod: true, + ), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( + ffi.Pointer _, + ) => + func()), + ); + + /// autorelease + static final autorelease = + objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_autorelease, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_autorelease, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function() func) => + ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// retainCount + static final retainCount = objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_retainCount, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_retainCount, + isRequired: true, + isInstanceMethod: true, + ), + (DartNSUInteger Function() func) => + ObjCBlock_NSUInteger_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// zone + static final zone = objc.ObjCProtocolMethod Function()>( + _protocol_NSObject, + _sel_zone, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_zone, + isRequired: true, + isInstanceMethod: true, + ), + (ffi.Pointer<_NSZone> Function() func) => + ObjCBlock_NSZone_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// description + static final description = objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_description, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_description, + isRequired: true, + isInstanceMethod: true, + ), + (objc.NSString Function() func) => ObjCBlock_NSString_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// debugDescription + static final debugDescription = + objc.ObjCProtocolMethod( + _protocol_NSObject, + _sel_debugDescription, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_debugDescription, + isRequired: false, + isInstanceMethod: true, + ), + (objc.NSString Function() func) => ObjCBlock_NSString_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); +} + +typedef va_list = __builtin_va_list; +typedef __gnuc_va_list = __builtin_va_list; +typedef NSExceptionName = ffi.Pointer; +typedef DartNSExceptionName = objc.NSString; +typedef NSRunLoopMode = ffi.Pointer; +typedef DartNSRunLoopMode = objc.NSString; +int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable = + ffi.Pointer.fromFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline, + 0) + .cast(); +int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as int Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable = + ffi.Pointer.fromFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline, + 0) + .cast(); + +/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. +abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + NSInteger Function( + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => + objc.ObjCBlock< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>( + objc.newPointerBlock( + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, ffi.Pointer)> + fromFunction(objc.NSComparisonResult Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => + objc.ObjCBlock, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true)) + .value), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. +extension ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_CallExtension + on objc.ObjCBlock< + NSInteger Function( + ffi.Pointer, ffi.Pointer)> { + objc.NSComparisonResult call( + objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1) => + objc.NSComparisonResult.fromValue(ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction, ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer)); +} + +typedef NSComparator = ffi.Pointer; +typedef DartNSComparator = objc.ObjCBlock< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>; + +enum NSQualityOfService { + NSQualityOfServiceUserInteractive(33), + NSQualityOfServiceUserInitiated(25), + NSQualityOfServiceUtility(17), + NSQualityOfServiceBackground(9), + NSQualityOfServiceDefault(-1); + + final int value; + const NSQualityOfService(this.value); + + static NSQualityOfService fromValue(int value) => switch (value) { + 33 => NSQualityOfServiceUserInteractive, + 25 => NSQualityOfServiceUserInitiated, + 17 => NSQualityOfServiceUtility, + 9 => NSQualityOfServiceBackground, + -1 => NSQualityOfServiceDefault, + _ => + throw ArgumentError("Unknown value for NSQualityOfService: $value"), + }; +} + +typedef ptrauth_extra_data_t = ffi.UnsignedLong; +typedef Dartptrauth_extra_data_t = int; +typedef ptrauth_generic_signature_t = ffi.UnsignedLong; +typedef Dartptrauth_generic_signature_t = int; +typedef UInt8 = ffi.UnsignedChar; +typedef DartUInt8 = int; +typedef SInt8 = ffi.SignedChar; +typedef DartSInt8 = int; +typedef UInt16 = ffi.UnsignedShort; +typedef DartUInt16 = int; +typedef SInt16 = ffi.Short; +typedef DartSInt16 = int; +typedef UInt32 = ffi.UnsignedInt; +typedef DartUInt32 = int; +typedef SInt32 = ffi.Int; +typedef DartSInt32 = int; + +@ffi.Packed(2) +final class wide extends ffi.Struct { + @UInt32() + external int lo; + + @SInt32() + external int hi; +} + +@ffi.Packed(2) +final class UnsignedWide extends ffi.Struct { + @UInt32() + external int lo; + + @UInt32() + external int hi; +} + +typedef SInt64 = ffi.LongLong; +typedef DartSInt64 = int; +typedef UInt64 = ffi.UnsignedLongLong; +typedef DartUInt64 = int; +typedef Fixed = SInt32; +typedef FixedPtr = ffi.Pointer; +typedef Fract = SInt32; +typedef FractPtr = ffi.Pointer; +typedef UnsignedFixed = UInt32; +typedef UnsignedFixedPtr = ffi.Pointer; +typedef ShortFixed = ffi.Short; +typedef DartShortFixed = int; +typedef ShortFixedPtr = ffi.Pointer; +typedef Float32 = ffi.Float; +typedef DartFloat32 = double; +typedef Float64 = ffi.Double; +typedef DartFloat64 = double; + +final class Float80 extends ffi.Struct { + @SInt16() + external int exp; + + @ffi.Array.multi([4]) + external ffi.Array man; +} + +final class Float96 extends ffi.Struct { + @ffi.Array.multi([2]) + external ffi.Array exp; + + @ffi.Array.multi([4]) + external ffi.Array man; +} + +@ffi.Packed(2) +final class Float32Point extends ffi.Struct { + @Float32() + external double x; + + @Float32() + external double y; +} + +typedef Ptr = ffi.Pointer; +typedef Handle = ffi.Pointer; +typedef Size = ffi.Long; +typedef DartSize = int; +typedef OSErr = SInt16; +typedef OSStatus = SInt32; +typedef LogicalAddress = ffi.Pointer; +typedef ConstLogicalAddress = ffi.Pointer; +typedef PhysicalAddress = ffi.Pointer; +typedef BytePtr = ffi.Pointer; +typedef ByteCount = ffi.UnsignedLong; +typedef DartByteCount = int; +typedef ByteOffset = ffi.UnsignedLong; +typedef DartByteOffset = int; +typedef Duration = SInt32; +typedef AbsoluteTime = UnsignedWide; +typedef OptionBits = UInt32; +typedef ItemCount = ffi.UnsignedLong; +typedef DartItemCount = int; +typedef PBVersion = UInt32; +typedef ScriptCode = SInt16; +typedef LangCode = SInt16; +typedef RegionCode = SInt16; +typedef FourCharCode = UInt32; +typedef OSType = FourCharCode; +typedef ResType = FourCharCode; +typedef OSTypePtr = ffi.Pointer; +typedef ResTypePtr = ffi.Pointer; +typedef Boolean = ffi.UnsignedChar; +typedef DartBoolean = int; +typedef ProcPtrFunction = ffi.Long Function(); +typedef DartProcPtrFunction = int Function(); +typedef ProcPtr = ffi.Pointer>; +typedef Register68kProcPtrFunction = ffi.Void Function(); +typedef DartRegister68kProcPtrFunction = void Function(); +typedef Register68kProcPtr + = ffi.Pointer>; +typedef UniversalProcPtr = ProcPtr; +typedef ProcHandle = ffi.Pointer; +typedef UniversalProcHandle = ffi.Pointer; +typedef PRefCon = ffi.Pointer; +typedef URefCon = ffi.Pointer; +typedef SRefCon = ffi.Pointer; +typedef UnicodeScalarValue = UInt32; +typedef UTF32Char = UInt32; +typedef UniChar = UInt16; +typedef UTF16Char = UInt16; +typedef UTF8Char = UInt8; +typedef UniCharPtr = ffi.Pointer; +typedef UniCharCount = ffi.UnsignedLong; +typedef DartUniCharCount = int; +typedef UniCharCountPtr = ffi.Pointer; +typedef StringPtr = ffi.Pointer; +typedef StringHandle = ffi.Pointer; +typedef ConstStringPtr = ffi.Pointer; +typedef ConstStr255Param = ffi.Pointer; +typedef ConstStr63Param = ffi.Pointer; +typedef ConstStr32Param = ffi.Pointer; +typedef ConstStr31Param = ffi.Pointer; +typedef ConstStr27Param = ffi.Pointer; +typedef ConstStr15Param = ffi.Pointer; +typedef ConstStrFileNameParam = ConstStr63Param; + +@ffi.Packed(2) +final class ProcessSerialNumber extends ffi.Struct { + @UInt32() + external int highLongOfPSN; + + @UInt32() + external int lowLongOfPSN; +} + +typedef ProcessSerialNumberPtr = ffi.Pointer; + +final class Point extends ffi.Struct { + @ffi.Short() + external int v; @ffi.Short() external int h; } +typedef PointPtr = ffi.Pointer; + final class Rect extends ffi.Struct { @ffi.Short() external int top; @@ -43896,6 +44577,8 @@ final class Rect extends ffi.Struct { external int right; } +typedef RectPtr = ffi.Pointer; + @ffi.Packed(2) final class FixedPoint extends ffi.Struct { @Fixed() @@ -43905,8 +44588,6 @@ final class FixedPoint extends ffi.Struct { external int y; } -typedef Fixed = SInt32; - @ffi.Packed(2) final class FixedRect extends ffi.Struct { @Fixed() @@ -43922,8 +44603,22 @@ final class FixedRect extends ffi.Struct { external int bottom; } +typedef CharParameter = ffi.Short; +typedef DartCharParameter = int; +typedef Style = ffi.UnsignedChar; +typedef DartStyle = int; +typedef StyleParameter = ffi.Short; +typedef DartStyleParameter = int; +typedef StyleField = Style; +typedef TimeValue = SInt32; +typedef TimeScale = SInt32; +typedef CompTimeValue = wide; +typedef TimeValue64 = SInt64; + final class TimeBaseRecord extends ffi.Opaque {} +typedef TimeBase = ffi.Pointer; + @ffi.Packed(2) final class TimeRecord extends ffi.Struct { external CompTimeValue value; @@ -43934,10 +44629,6 @@ final class TimeRecord extends ffi.Struct { external TimeBase base; } -typedef CompTimeValue = wide; -typedef TimeScale = SInt32; -typedef TimeBase = ffi.Pointer; - final class NumVersion extends ffi.Struct { @UInt8() external int nonRelRev; @@ -43952,9 +44643,6 @@ final class NumVersion extends ffi.Struct { external int majorRev; } -typedef UInt8 = ffi.UnsignedChar; -typedef DartUInt8 = int; - final class NumVersionVariant extends ffi.Union { external NumVersion parts; @@ -43962,6 +44650,9 @@ final class NumVersionVariant extends ffi.Union { external int whole; } +typedef NumVersionVariantPtr = ffi.Pointer; +typedef NumVersionVariantHandle = ffi.Pointer; + final class VersRec extends ffi.Struct { external NumVersion numericVersion; @@ -43975,12 +44666,58 @@ final class VersRec extends ffi.Struct { external ffi.Array reserved; } -typedef ConstStr255Param = ffi.Pointer; +typedef VersRecPtr = ffi.Pointer; +typedef VersRecHndl = ffi.Pointer; +typedef Byte = UInt8; +typedef SignedByte = SInt8; +typedef WidePtr = ffi.Pointer; +typedef UnsignedWidePtr = ffi.Pointer; +typedef extended80 = Float80; +typedef extended96 = Float96; +typedef VHSelect = SInt8; +typedef CFTypeID = ffi.UnsignedLong; +typedef DartCFTypeID = int; +typedef CFOptionFlags = ffi.UnsignedLong; +typedef DartCFOptionFlags = int; +typedef CFHashCode = ffi.UnsignedLong; +typedef DartCFHashCode = int; +typedef CFIndex = ffi.Long; +typedef DartCFIndex = int; +typedef CFTypeRef = ffi.Pointer; final class __CFString extends ffi.Opaque {} -typedef CFIndex = ffi.Long; -typedef DartCFIndex = int; +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFMutableStringRef = ffi.Pointer<__CFString>; +typedef CFPropertyListRef = CFTypeRef; + +enum CFComparisonResult { + kCFCompareLessThan(-1), + kCFCompareEqualTo(0), + kCFCompareGreaterThan(1); + + final int value; + const CFComparisonResult(this.value); + + static CFComparisonResult fromValue(int value) => switch (value) { + -1 => kCFCompareLessThan, + 0 => kCFCompareEqualTo, + 1 => kCFCompareGreaterThan, + _ => + throw ArgumentError("Unknown value for CFComparisonResult: $value"), + }; +} + +typedef CFComparatorFunctionFunction = CFIndex Function( + ffi.Pointer val1, + ffi.Pointer val2, + ffi.Pointer context); +typedef DartCFComparatorFunctionFunction = CFComparisonResult Function( + ffi.Pointer val1, + ffi.Pointer val2, + ffi.Pointer context); +typedef CFComparatorFunction + = ffi.Pointer>; final class CFRange extends ffi.Struct { @CFIndex() @@ -43992,61 +44729,32 @@ final class CFRange extends ffi.Struct { final class __CFNull extends ffi.Opaque {} -typedef CFTypeID = ffi.UnsignedLong; -typedef DartCFTypeID = int; typedef CFNullRef = ffi.Pointer<__CFNull>; final class __CFAllocator extends ffi.Opaque {} typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -final class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; - - external ffi.Pointer info; - - external CFAllocatorRetainCallBack retain; - - external CFAllocatorReleaseCallBack release; - - external CFAllocatorCopyDescriptionCallBack copyDescription; - - external CFAllocatorAllocateCallBack allocate; - - external CFAllocatorReallocateCallBack reallocate; - - external CFAllocatorDeallocateCallBack deallocate; - - external CFAllocatorPreferredSizeCallBack preferredSize; -} - -typedef CFAllocatorRetainCallBack - = ffi.Pointer>; typedef CFAllocatorRetainCallBackFunction = ffi.Pointer Function( ffi.Pointer info); -typedef CFAllocatorReleaseCallBack - = ffi.Pointer>; +typedef CFAllocatorRetainCallBack + = ffi.Pointer>; typedef CFAllocatorReleaseCallBackFunction = ffi.Void Function( ffi.Pointer info); typedef DartCFAllocatorReleaseCallBackFunction = void Function( ffi.Pointer info); -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer>; +typedef CFAllocatorReleaseCallBack + = ffi.Pointer>; typedef CFAllocatorCopyDescriptionCallBackFunction = CFStringRef Function( ffi.Pointer info); -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack - = ffi.Pointer>; +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer>; typedef CFAllocatorAllocateCallBackFunction = ffi.Pointer Function( CFIndex allocSize, CFOptionFlags hint, ffi.Pointer info); typedef DartCFAllocatorAllocateCallBackFunction = ffi.Pointer Function(DartCFIndex allocSize, DartCFOptionFlags hint, ffi.Pointer info); -typedef CFOptionFlags = ffi.UnsignedLong; -typedef DartCFOptionFlags = int; -typedef CFAllocatorReallocateCallBack - = ffi.Pointer>; +typedef CFAllocatorAllocateCallBack + = ffi.Pointer>; typedef CFAllocatorReallocateCallBackFunction = ffi.Pointer Function( ffi.Pointer ptr, CFIndex newsize, @@ -44058,61 +44766,43 @@ typedef DartCFAllocatorReallocateCallBackFunction DartCFIndex newsize, DartCFOptionFlags hint, ffi.Pointer info); -typedef CFAllocatorDeallocateCallBack - = ffi.Pointer>; +typedef CFAllocatorReallocateCallBack + = ffi.Pointer>; typedef CFAllocatorDeallocateCallBackFunction = ffi.Void Function( ffi.Pointer ptr, ffi.Pointer info); typedef DartCFAllocatorDeallocateCallBackFunction = void Function( ffi.Pointer ptr, ffi.Pointer info); -typedef CFAllocatorPreferredSizeCallBack - = ffi.Pointer>; +typedef CFAllocatorDeallocateCallBack + = ffi.Pointer>; typedef CFAllocatorPreferredSizeCallBackFunction = CFIndex Function( CFIndex size, CFOptionFlags hint, ffi.Pointer info); typedef DartCFAllocatorPreferredSizeCallBackFunction = DartCFIndex Function( DartCFIndex size, DartCFOptionFlags hint, ffi.Pointer info); -typedef CFTypeRef = ffi.Pointer; -typedef Boolean = ffi.UnsignedChar; -typedef DartBoolean = int; -typedef CFHashCode = ffi.UnsignedLong; -typedef DartCFHashCode = int; -typedef NSZone = _NSZone; +typedef CFAllocatorPreferredSizeCallBack + = ffi.Pointer>; -/// NSCopying -abstract final class NSCopying { - /// Builds an object that implements the NSCopying protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required objc.ObjCObjectBase Function(ffi.Pointer) - copyWithZone_}) { - final builder = objc.ObjCProtocolBuilder(); - NSCopying.copyWithZone_.implement(builder, copyWithZone_); - return builder.build(); - } +final class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; - /// Adds the implementation of the NSCopying protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required objc.ObjCObjectBase Function(ffi.Pointer) - copyWithZone_}) { - NSCopying.copyWithZone_.implement(builder, copyWithZone_); - } + external ffi.Pointer info; - /// copyWithZone: - static final copyWithZone_ = objc.ObjCProtocolMethod< - objc.ObjCObjectBase Function(ffi.Pointer)>( - _sel_copyWithZone_, - objc.getProtocolMethodSignature( - _protocol_NSCopying, - _sel_copyWithZone_, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function(ffi.Pointer) func) => - ObjCBlock_objcObjCObject_ffiVoid_NSZone.fromFunction( - (ffi.Pointer _, ffi.Pointer arg1) => func(arg1)), - ); + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; } +typedef NSZone = _NSZone; late final _protocol_NSCopying = objc.getProtocol("NSCopying"); late final _sel_copyWithZone_ = objc.registerName("copyWithZone:"); ffi.Pointer @@ -44225,35 +44915,34 @@ extension ObjCBlock_objcObjCObject_ffiVoid_NSZone_CallExtension release: true); } -/// NSMutableCopying -abstract final class NSMutableCopying { - /// Builds an object that implements the NSMutableCopying protocol. To implement +/// NSCopying +abstract final class NSCopying { + /// Builds an object that implements the NSCopying protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. static objc.ObjCObjectBase implement( {required objc.ObjCObjectBase Function(ffi.Pointer) - mutableCopyWithZone_}) { + copyWithZone_}) { final builder = objc.ObjCProtocolBuilder(); - NSMutableCopying.mutableCopyWithZone_ - .implement(builder, mutableCopyWithZone_); + NSCopying.copyWithZone_.implement(builder, copyWithZone_); return builder.build(); } - /// Adds the implementation of the NSMutableCopying protocol to an existing + /// Adds the implementation of the NSCopying protocol to an existing /// [objc.ObjCProtocolBuilder]. static void addToBuilder(objc.ObjCProtocolBuilder builder, {required objc.ObjCObjectBase Function(ffi.Pointer) - mutableCopyWithZone_}) { - NSMutableCopying.mutableCopyWithZone_ - .implement(builder, mutableCopyWithZone_); + copyWithZone_}) { + NSCopying.copyWithZone_.implement(builder, copyWithZone_); } - /// mutableCopyWithZone: - static final mutableCopyWithZone_ = objc.ObjCProtocolMethod< + /// copyWithZone: + static final copyWithZone_ = objc.ObjCProtocolMethod< objc.ObjCObjectBase Function(ffi.Pointer)>( - _sel_mutableCopyWithZone_, + _protocol_NSCopying, + _sel_copyWithZone_, objc.getProtocolMethodSignature( - _protocol_NSMutableCopying, - _sel_mutableCopyWithZone_, + _protocol_NSCopying, + _sel_copyWithZone_, isRequired: true, isInstanceMethod: true, ), @@ -44267,86 +44956,57 @@ late final _protocol_NSMutableCopying = objc.getProtocol("NSMutableCopying"); late final _sel_mutableCopyWithZone_ = objc.registerName("mutableCopyWithZone:"); -/// NSCoding -abstract final class NSCoding { - /// Builds an object that implements the NSCoding protocol. To implement +/// NSMutableCopying +abstract final class NSMutableCopying { + /// Builds an object that implements the NSMutableCopying protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. static objc.ObjCObjectBase implement( - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + {required objc.ObjCObjectBase Function(ffi.Pointer) + mutableCopyWithZone_}) { final builder = objc.ObjCProtocolBuilder(); - NSCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); - NSCoding.initWithCoder_.implement(builder, initWithCoder_); + NSMutableCopying.mutableCopyWithZone_ + .implement(builder, mutableCopyWithZone_); return builder.build(); } - /// Adds the implementation of the NSCoding protocol to an existing + /// Adds the implementation of the NSMutableCopying protocol to an existing /// [objc.ObjCProtocolBuilder]. static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - NSCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); - NSCoding.initWithCoder_.implement(builder, initWithCoder_); - } - - /// Builds an object that implements the NSCoding protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - final builder = objc.ObjCProtocolBuilder(); - NSCoding.encodeWithCoder_.implementAsListener(builder, encodeWithCoder_); - NSCoding.initWithCoder_.implement(builder, initWithCoder_); - return builder.build(); - } - - /// Adds the implementation of the NSCoding protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - NSCoding.encodeWithCoder_.implementAsListener(builder, encodeWithCoder_); - NSCoding.initWithCoder_.implement(builder, initWithCoder_); + {required objc.ObjCObjectBase Function(ffi.Pointer) + mutableCopyWithZone_}) { + NSMutableCopying.mutableCopyWithZone_ + .implement(builder, mutableCopyWithZone_); } - /// encodeWithCoder: - static final encodeWithCoder_ = - objc.ObjCProtocolListenableMethod( - _sel_encodeWithCoder_, - objc.getProtocolMethodSignature( - _protocol_NSCoding, - _sel_encodeWithCoder_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSCoder) func) => - ObjCBlock_ffiVoid_ffiVoid_NSCoder.fromFunction( - (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), - (void Function(objc.NSCoder) func) => - ObjCBlock_ffiVoid_ffiVoid_NSCoder.listener( - (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), - ); - - /// initWithCoder: - static final initWithCoder_ = - objc.ObjCProtocolMethod( - _sel_initWithCoder_, + /// mutableCopyWithZone: + static final mutableCopyWithZone_ = objc.ObjCProtocolMethod< + objc.ObjCObjectBase Function(ffi.Pointer)>( + _protocol_NSMutableCopying, + _sel_mutableCopyWithZone_, objc.getProtocolMethodSignature( - _protocol_NSCoding, - _sel_initWithCoder_, + _protocol_NSMutableCopying, + _sel_mutableCopyWithZone_, isRequired: true, isInstanceMethod: true, ), - (Dartinstancetype? Function(objc.NSCoder) func) => - ObjCBlock_instancetype_ffiVoid_NSCoder.fromFunction( - (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), + (objc.ObjCObjectBase Function(ffi.Pointer) func) => + ObjCBlock_objcObjCObject_ffiVoid_NSZone.fromFunction( + (ffi.Pointer _, ffi.Pointer arg1) => func(arg1)), ); } late final _protocol_NSCoding = objc.getProtocol("NSCoding"); late final _sel_encodeWithCoder_ = objc.registerName("encodeWithCoder:"); +final _objc_msgSend_1jdvcbf = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, @@ -44456,7 +45116,7 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { (ffi.Pointer arg0, ffi.Pointer arg1) => fn( arg0, objc.NSCoder.castFromPointer(arg1, retain: false, release: true))); - final wrapper = _wrapListenerBlock_sjfpmz(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjovn7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< ffi.Void Function(ffi.Pointer, objc.NSCoder)>(wrapper, @@ -44482,6 +45142,16 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSCoder_CallExtension } late final _sel_initWithCoder_ = objc.registerName("initWithCoder:"); +final _objc_msgSend_62nh5j = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, @@ -44588,17 +45258,96 @@ extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension release: true); } +/// NSCoding +abstract final class NSCoding { + /// Builds an object that implements the NSCoding protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + final builder = objc.ObjCProtocolBuilder(); + NSCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); + NSCoding.initWithCoder_.implement(builder, initWithCoder_); + return builder.build(); + } + + /// Adds the implementation of the NSCoding protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + NSCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); + NSCoding.initWithCoder_.implement(builder, initWithCoder_); + } + + /// Builds an object that implements the NSCoding protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + final builder = objc.ObjCProtocolBuilder(); + NSCoding.encodeWithCoder_.implementAsListener(builder, encodeWithCoder_); + NSCoding.initWithCoder_.implement(builder, initWithCoder_); + return builder.build(); + } + + /// Adds the implementation of the NSCoding protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + NSCoding.encodeWithCoder_.implementAsListener(builder, encodeWithCoder_); + NSCoding.initWithCoder_.implement(builder, initWithCoder_); + } + + /// encodeWithCoder: + static final encodeWithCoder_ = + objc.ObjCProtocolListenableMethod( + _protocol_NSCoding, + _sel_encodeWithCoder_, + objc.getProtocolMethodSignature( + _protocol_NSCoding, + _sel_encodeWithCoder_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSCoder) func) => + ObjCBlock_ffiVoid_ffiVoid_NSCoder.fromFunction( + (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), + (void Function(objc.NSCoder) func) => + ObjCBlock_ffiVoid_ffiVoid_NSCoder.listener( + (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), + ); + + /// initWithCoder: + static final initWithCoder_ = + objc.ObjCProtocolMethod( + _protocol_NSCoding, + _sel_initWithCoder_, + objc.getProtocolMethodSignature( + _protocol_NSCoding, + _sel_initWithCoder_, + isRequired: true, + isInstanceMethod: true, + ), + (Dartinstancetype? Function(objc.NSCoder) func) => + ObjCBlock_instancetype_ffiVoid_NSCoder.fromFunction( + (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), + ); +} + +late final _protocol_NSSecureCoding = objc.getProtocol("NSSecureCoding"); + /// NSSecureCoding abstract final class NSSecureCoding { /// Builds an object that implements the NSSecureCoding protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. static objc.ObjCObjectBase implement( - {required bool Function() supportsSecureCoding, - required void Function(objc.NSCoder) encodeWithCoder_, + {required void Function(objc.NSCoder) encodeWithCoder_, required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { final builder = objc.ObjCProtocolBuilder(); - NSSecureCoding.supportsSecureCoding - .implement(builder, supportsSecureCoding); NSSecureCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); return builder.build(); @@ -44607,11 +45356,8 @@ abstract final class NSSecureCoding { /// Adds the implementation of the NSSecureCoding protocol to an existing /// [objc.ObjCProtocolBuilder]. static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required bool Function() supportsSecureCoding, - required void Function(objc.NSCoder) encodeWithCoder_, + {required void Function(objc.NSCoder) encodeWithCoder_, required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - NSSecureCoding.supportsSecureCoding - .implement(builder, supportsSecureCoding); NSSecureCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); } @@ -44620,12 +45366,9 @@ abstract final class NSSecureCoding { /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All /// methods that can be implemented as listeners will be. static objc.ObjCObjectBase implementAsListener( - {required bool Function() supportsSecureCoding, - required void Function(objc.NSCoder) encodeWithCoder_, + {required void Function(objc.NSCoder) encodeWithCoder_, required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { final builder = objc.ObjCProtocolBuilder(); - NSSecureCoding.supportsSecureCoding - .implement(builder, supportsSecureCoding); NSSecureCoding.encodeWithCoder_ .implementAsListener(builder, encodeWithCoder_); NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); @@ -44636,34 +45379,17 @@ abstract final class NSSecureCoding { /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will /// be. static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required bool Function() supportsSecureCoding, - required void Function(objc.NSCoder) encodeWithCoder_, + {required void Function(objc.NSCoder) encodeWithCoder_, required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - NSSecureCoding.supportsSecureCoding - .implement(builder, supportsSecureCoding); NSSecureCoding.encodeWithCoder_ .implementAsListener(builder, encodeWithCoder_); NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); } - /// supportsSecureCoding - static final supportsSecureCoding = objc.ObjCProtocolMethod( - _sel_supportsSecureCoding, - objc.getProtocolMethodSignature( - _protocol_NSSecureCoding, - _sel_supportsSecureCoding, - isRequired: true, - isInstanceMethod: false, - ), - (bool Function() func) => ObjCBlock_bool_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); - /// encodeWithCoder: static final encodeWithCoder_ = objc.ObjCProtocolListenableMethod( + _protocol_NSSecureCoding, _sel_encodeWithCoder_, objc.getProtocolMethodSignature( _protocol_NSSecureCoding, @@ -44682,6 +45408,7 @@ abstract final class NSSecureCoding { /// initWithCoder: static final initWithCoder_ = objc.ObjCProtocolMethod( + _protocol_NSSecureCoding, _sel_initWithCoder_, objc.getProtocolMethodSignature( _protocol_NSSecureCoding, @@ -44695,9 +45422,86 @@ abstract final class NSSecureCoding { ); } -late final _protocol_NSSecureCoding = objc.getProtocol("NSSecureCoding"); -late final _sel_supportsSecureCoding = - objc.registerName("supportsSecureCoding"); +late final _class_NSObject = objc.getClass("NSObject"); +late final _sel_version = objc.registerName("version"); +final _objc_msgSend_1hz7y9r = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setVersion_ = objc.registerName("setVersion:"); +final _objc_msgSend_4sp4xj = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_classForCoder = objc.registerName("classForCoder"); +late final _sel_replacementObjectForCoder_ = + objc.registerName("replacementObjectForCoder:"); +late final _sel_awakeAfterUsingCoder_ = + objc.registerName("awakeAfterUsingCoder:"); + +/// NSCoderMethods +extension NSCoderMethods on objc.NSObject { + /// version + static DartNSInteger version() { + return _objc_msgSend_1hz7y9r(_class_NSObject, _sel_version); + } + + /// setVersion: + static void setVersion_(DartNSInteger aVersion) { + _objc_msgSend_4sp4xj(_class_NSObject, _sel_setVersion_, aVersion); + } + + /// classForCoder + objc.ObjCObjectBase get classForCoder { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_classForCoder); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// replacementObjectForCoder: + objc.ObjCObjectBase? replacementObjectForCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_replacementObjectForCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// awakeAfterUsingCoder: + objc.ObjCObjectBase? awakeAfterUsingCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_awakeAfterUsingCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } +} + +late final _sel_poseAsClass_ = objc.registerName("poseAsClass:"); + +/// NSDeprecatedMethods +extension NSDeprecatedMethods on objc.NSObject { + /// poseAsClass: + static void poseAsClass_(objc.ObjCObjectBase aClass) { + _objc_msgSend_1jdvcbf( + _class_NSObject, _sel_poseAsClass_, aClass.ref.pointer); + } +} + +late final _protocol_NSDiscardableContent = + objc.getProtocol("NSDiscardableContent"); +late final _sel_beginContentAccess = objc.registerName("beginContentAccess"); +late final _sel_endContentAccess = objc.registerName("endContentAccess"); +late final _sel_discardContentIfPossible = + objc.registerName("discardContentIfPossible"); +late final _sel_isContentDiscarded = objc.registerName("isContentDiscarded"); /// NSDiscardableContent abstract final class NSDiscardableContent { @@ -44775,6 +45579,7 @@ abstract final class NSDiscardableContent { /// beginContentAccess static final beginContentAccess = objc.ObjCProtocolMethod( + _protocol_NSDiscardableContent, _sel_beginContentAccess, objc.getProtocolMethodSignature( _protocol_NSDiscardableContent, @@ -44791,6 +45596,7 @@ abstract final class NSDiscardableContent { /// endContentAccess static final endContentAccess = objc.ObjCProtocolListenableMethod( + _protocol_NSDiscardableContent, _sel_endContentAccess, objc.getProtocolMethodSignature( _protocol_NSDiscardableContent, @@ -44811,6 +45617,7 @@ abstract final class NSDiscardableContent { /// discardContentIfPossible static final discardContentIfPossible = objc.ObjCProtocolListenableMethod( + _protocol_NSDiscardableContent, _sel_discardContentIfPossible, objc.getProtocolMethodSignature( _protocol_NSDiscardableContent, @@ -44830,6 +45637,7 @@ abstract final class NSDiscardableContent { /// isContentDiscarded static final isContentDiscarded = objc.ObjCProtocolMethod( + _protocol_NSDiscardableContent, _sel_isContentDiscarded, objc.getProtocolMethodSignature( _protocol_NSDiscardableContent, @@ -44844,257 +45652,264 @@ abstract final class NSDiscardableContent { ); } -late final _protocol_NSDiscardableContent = - objc.getProtocol("NSDiscardableContent"); -late final _sel_beginContentAccess = objc.registerName("beginContentAccess"); -late final _sel_endContentAccess = objc.registerName("endContentAccess"); -late final _sel_discardContentIfPossible = - objc.registerName("discardContentIfPossible"); -late final _sel_isContentDiscarded = objc.registerName("isContentDiscarded"); +late final _sel_autoContentAccessingProxy = + objc.registerName("autoContentAccessingProxy"); -/// NSURLCache -class NSURLCache extends objc.NSObject { - NSURLCache._(ffi.Pointer pointer, +/// NSDiscardableContentProxy +extension NSDiscardableContentProxy on objc.NSObject { + /// autoContentAccessingProxy + objc.ObjCObjectBase get autoContentAccessingProxy { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_autoContentAccessingProxy); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +/// ! +/// @enum NSURLCacheStoragePolicy +/// +/// @discussion The NSURLCacheStoragePolicy enum defines constants that +/// can be used to specify the type of storage that is allowable for an +/// NSCachedURLResponse object that is to be stored in an NSURLCache. +/// +/// @constant NSURLCacheStorageAllowed Specifies that storage in an +/// NSURLCache is allowed without restriction. +/// +/// @constant NSURLCacheStorageAllowedInMemoryOnly Specifies that +/// storage in an NSURLCache is allowed; however storage should be +/// done in memory only, no disk storage should be done. +/// +/// @constant NSURLCacheStorageNotAllowed Specifies that storage in an +/// NSURLCache is not allowed in any fashion, either in memory or on +/// disk. +enum NSURLCacheStoragePolicy { + NSURLCacheStorageAllowed(0), + NSURLCacheStorageAllowedInMemoryOnly(1), + NSURLCacheStorageNotAllowed(2); + + final int value; + const NSURLCacheStoragePolicy(this.value); + + static NSURLCacheStoragePolicy fromValue(int value) => switch (value) { + 0 => NSURLCacheStorageAllowed, + 1 => NSURLCacheStorageAllowedInMemoryOnly, + 2 => NSURLCacheStorageNotAllowed, + _ => throw ArgumentError( + "Unknown value for NSURLCacheStoragePolicy: $value"), + }; +} + +/// WARNING: NSCachedURLResponse is a stub. To generate bindings for this class, include +/// NSCachedURLResponse in your config's objc-interfaces list. +/// +/// ! +/// @class NSCachedURLResponse +/// NSCachedURLResponse is a class whose objects functions as a wrapper for +/// objects that are stored in the framework's caching system. +/// It is used to maintain characteristics and attributes of a cached +/// object. +class NSCachedURLResponse extends objc.NSObject { + NSCachedURLResponse._(ffi.Pointer pointer, {bool retain = false, bool release = false}) : super.castFromPointer(pointer, retain: retain, release: release); - /// Constructs a [NSURLCache] that points to the same underlying object as [other]. - NSURLCache.castFrom(objc.ObjCObjectBase other) + /// Constructs a [NSCachedURLResponse] that points to the same underlying object as [other]. + NSCachedURLResponse.castFrom(objc.ObjCObjectBase other) : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSURLCache] that wraps the given raw object pointer. - NSURLCache.castFromPointer(ffi.Pointer other, + /// Constructs a [NSCachedURLResponse] that wraps the given raw object pointer. + NSCachedURLResponse.castFromPointer(ffi.Pointer other, {bool retain = false, bool release = false}) : this._(other, retain: retain, release: release); +} - /// Returns whether [obj] is an instance of [NSURLCache]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLCache); - } - - /// ! - /// @property sharedURLCache - /// @abstract Returns the shared NSURLCache instance or - /// sets the NSURLCache instance shared by all clients of - /// the current process. This will be the new object returned when - /// calls to the sharedURLCache method are made. - /// @discussion Unless set explicitly through a call to - /// +setSharedURLCache:, this method returns an NSURLCache - /// instance created with the following default values: - ///
    - ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) - ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) - ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) - ///
- ///

Users who do not have special caching requirements or - /// constraints should find the default shared cache instance - /// acceptable. If this default shared cache instance is not - /// acceptable, +setSharedURLCache: can be called to set a - /// different NSURLCache instance to be returned from this method. - /// Callers should take care to ensure that the setter is called - /// at a time when no other caller has a reference to the previously-set - /// shared URL cache. This is to prevent storing cache data from - /// becoming unexpectedly unretrievable. - /// @result the shared NSURLCache instance. - static NSURLCache getSharedURLCache() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLCache, _sel_sharedURLCache); - return NSURLCache.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @property sharedURLCache - /// @abstract Returns the shared NSURLCache instance or - /// sets the NSURLCache instance shared by all clients of - /// the current process. This will be the new object returned when - /// calls to the sharedURLCache method are made. - /// @discussion Unless set explicitly through a call to - /// +setSharedURLCache:, this method returns an NSURLCache - /// instance created with the following default values: - ///

    - ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) - ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) - ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) - ///
- ///

Users who do not have special caching requirements or - /// constraints should find the default shared cache instance - /// acceptable. If this default shared cache instance is not - /// acceptable, +setSharedURLCache: can be called to set a - /// different NSURLCache instance to be returned from this method. - /// Callers should take care to ensure that the setter is called - /// at a time when no other caller has a reference to the previously-set - /// shared URL cache. This is to prevent storing cache data from - /// becoming unexpectedly unretrievable. - /// @result the shared NSURLCache instance. - static void setSharedURLCache(NSURLCache value) { - return _objc_msgSend_ukcdfq( - _class_NSURLCache, _sel_setSharedURLCache_, value.ref.pointer); - } - - /// ! - /// @method initWithMemoryCapacity:diskCapacity:diskPath: - /// @abstract Initializes an NSURLCache with the given capacity and - /// path. - /// @discussion The returned NSURLCache is backed by disk, so - /// developers can be more liberal with space when choosing the - /// capacity for this kind of cache. A disk cache measured in the tens - /// of megabytes should be acceptable in most cases. - /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. - /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. - /// @param path the path on disk where the cache data is stored. - /// @result an initialized NSURLCache, with the given capacity, backed - /// by disk. - NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( - DartNSUInteger memoryCapacity, - DartNSUInteger diskCapacity, - objc.NSString? path) { - final _ret = _objc_msgSend_ebb7er( - this.ref.retainAndReturnPointer(), - _sel_initWithMemoryCapacity_diskCapacity_diskPath_, - memoryCapacity, - diskCapacity, - path?.ref.pointer ?? ffi.nullptr); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// ! - /// @method initWithMemoryCapacity:diskCapacity:directoryURL: - /// @abstract Initializes an NSURLCache with the given capacity and directory. - /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. Or 0 to disable memory cache. - /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. Or 0 to disable disk cache. - /// @param directoryURL the path to a directory on disk where the cache data is stored. Or nil for default directory. - /// @result an initialized NSURLCache, with the given capacity, optionally backed by disk. - NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( - DartNSUInteger memoryCapacity, - DartNSUInteger diskCapacity, - objc.NSURL? directoryURL) { - final _ret = _objc_msgSend_ebb7er( - this.ref.retainAndReturnPointer(), - _sel_initWithMemoryCapacity_diskCapacity_directoryURL_, - memoryCapacity, - diskCapacity, - directoryURL?.ref.pointer ?? ffi.nullptr); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } +late final _class_NSURLCache = objc.getClass("NSURLCache"); - /// ! - /// @method cachedResponseForRequest: - /// @abstract Returns the NSCachedURLResponse stored in the cache with - /// the given request. - /// @discussion The method returns nil if there is no - /// NSCachedURLResponse stored using the given request. - /// @param request the NSURLRequest to use as a key for the lookup. - /// @result The NSCachedURLResponse stored in the cache with the given - /// request, or nil if there is no NSCachedURLResponse stored with the - /// given request. - NSCachedURLResponse? cachedResponseForRequest_(NSURLRequest request) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_cachedResponseForRequest_, request.ref.pointer); - return _ret.address == 0 - ? null - : NSCachedURLResponse.castFromPointer(_ret, - retain: true, release: true); - } +/// WARNING: NSURLSessionDataTask is a stub. To generate bindings for this class, include +/// NSURLSessionDataTask in your config's objc-interfaces list. +/// +/// NSURLSessionDataTask +class NSURLSessionDataTask extends NSURLSessionTask { + NSURLSessionDataTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// ! - /// @method storeCachedResponse:forRequest: - /// @abstract Stores the given NSCachedURLResponse in the cache using - /// the given request. - /// @param cachedResponse The cached response to store. - /// @param request the NSURLRequest to use as a key for the storage. - void storeCachedResponse_forRequest_( - NSCachedURLResponse cachedResponse, NSURLRequest request) { - _objc_msgSend_1tjlcwl( - this.ref.pointer, - _sel_storeCachedResponse_forRequest_, - cachedResponse.ref.pointer, - request.ref.pointer); - } + /// Constructs a [NSURLSessionDataTask] that points to the same underlying object as [other]. + NSURLSessionDataTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// ! - /// @method removeCachedResponseForRequest: - /// @abstract Removes the NSCachedURLResponse from the cache that is - /// stored using the given request. - /// @discussion No action is taken if there is no NSCachedURLResponse - /// stored with the given request. - /// @param request the NSURLRequest to use as a key for the lookup. - void removeCachedResponseForRequest_(NSURLRequest request) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_removeCachedResponseForRequest_, - request.ref.pointer); - } + /// Constructs a [NSURLSessionDataTask] that wraps the given raw object pointer. + NSURLSessionDataTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} - /// ! - /// @method removeAllCachedResponses - /// @abstract Clears the given cache, removing all NSCachedURLResponse - /// objects that it stores. - void removeAllCachedResponses() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_removeAllCachedResponses); - } +late final _sel_storeCachedResponse_forDataTask_ = + objc.registerName("storeCachedResponse:forDataTask:"); +final _objc_msgSend_wjvic9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +void _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} - /// ! - /// @method removeCachedResponsesSince: - /// @abstract Clears the given cache of any cached responses since the provided date. - void removeCachedResponsesSinceDate_(objc.NSDate date) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_removeCachedResponsesSinceDate_, - date.ref.pointer); - } +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline) + ..keepIsolateAlive = false; - /// ! - /// @abstract In-memory capacity of the receiver. - /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. - /// @result The in-memory capacity, measured in bytes, for the receiver. - DartNSUInteger get memoryCapacity { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_memoryCapacity); - } +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - /// ! - /// @abstract In-memory capacity of the receiver. - /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. - /// @result The in-memory capacity, measured in bytes, for the receiver. - set memoryCapacity(DartNSUInteger value) { - return _objc_msgSend_1k4zaz5( - this.ref.pointer, _sel_setMemoryCapacity_, value); - } + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - /// ! - /// @abstract The on-disk capacity of the receiver. - /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. - DartNSUInteger get diskCapacity { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_diskCapacity); - } + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(NSCachedURLResponse?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); - /// ! - /// @abstract The on-disk capacity of the receiver. - /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. - set diskCapacity(DartNSUInteger value) { - return _objc_msgSend_1k4zaz5( - this.ref.pointer, _sel_setDiskCapacity_, value); + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(NSCachedURLResponse?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(arg0, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } +} - /// ! - /// @abstract Returns the current amount of space consumed by the - /// in-memory cache of the receiver. - /// @discussion This size, measured in bytes, indicates the current - /// usage of the in-memory cache. - /// @result the current usage of the in-memory cache of the receiver. - DartNSUInteger get currentMemoryUsage { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_currentMemoryUsage); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSCachedURLResponse_CallExtension + on objc.ObjCBlock { + void call(NSCachedURLResponse? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} - /// ! - /// @abstract Returns the current amount of space consumed by the - /// on-disk cache of the receiver. - /// @discussion This size, measured in bytes, indicates the current - /// usage of the on-disk cache. - /// @result the current usage of the on-disk cache of the receiver. - DartNSUInteger get currentDiskUsage { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_currentDiskUsage); - } +late final _sel_getCachedResponseForDataTask_completionHandler_ = + objc.registerName("getCachedResponseForDataTask:completionHandler:"); +final _objc_msgSend_14pxqbs = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removeCachedResponseForDataTask_ = + objc.registerName("removeCachedResponseForDataTask:"); +/// NSURLSessionTaskAdditions +extension NSURLSessionTaskAdditions on NSURLCache { /// storeCachedResponse:forDataTask: void storeCachedResponse_forDataTask_( NSCachedURLResponse cachedResponse, NSURLSessionDataTask dataTask) { - _objc_msgSend_1tjlcwl( + _objc_msgSend_wjvic9( this.ref.pointer, _sel_storeCachedResponse_forDataTask_, cachedResponse.ref.pointer, @@ -45106,7 +45921,7 @@ class NSURLCache extends objc.NSObject { NSURLSessionDataTask dataTask, objc.ObjCBlock completionHandler) { - _objc_msgSend_cmbt6k( + _objc_msgSend_14pxqbs( this.ref.pointer, _sel_getCachedResponseForDataTask_completionHandler_, dataTask.ref.pointer, @@ -45115,71 +45930,26 @@ class NSURLCache extends objc.NSObject { /// removeCachedResponseForDataTask: void removeCachedResponseForDataTask_(NSURLSessionDataTask dataTask) { - _objc_msgSend_ukcdfq(this.ref.pointer, + _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_removeCachedResponseForDataTask_, dataTask.ref.pointer); } - - /// init - NSURLCache init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSURLCache new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLCache, _sel_new); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSURLCache allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSURLCache, _sel_allocWithZone_, zone); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSURLCache alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLCache, _sel_alloc); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } } -late final _class_NSURLCache = objc.getClass("NSURLCache"); late final _sel_sharedURLCache = objc.registerName("sharedURLCache"); -final _objc_msgSend_1unuoxw = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); late final _sel_setSharedURLCache_ = objc.registerName("setSharedURLCache:"); -final _objc_msgSend_ukcdfq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_ = objc.registerName("initWithMemoryCapacity:diskCapacity:diskPath:"); -final _objc_msgSend_ebb7er = objc.msgSendPointer +final _objc_msgSend_1dlfwfh = objc.msgSendPointer .cast< ffi.NativeFunction< - instancetype Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - NSUInteger, - NSUInteger, + ffi.UnsignedLong, + ffi.UnsignedLong, ffi.Pointer)>>() .asFunction< - instancetype Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, int, @@ -45187,478 +45957,368 @@ final _objc_msgSend_ebb7er = objc.msgSendPointer ffi.Pointer)>(); late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_ = objc.registerName("initWithMemoryCapacity:diskCapacity:directoryURL:"); +late final _class_NSURLRequest = objc.getClass("NSURLRequest"); +late final _sel_HTTPMethod = objc.registerName("HTTPMethod"); +late final _sel_allHTTPHeaderFields = objc.registerName("allHTTPHeaderFields"); +late final _sel_valueForHTTPHeaderField_ = + objc.registerName("valueForHTTPHeaderField:"); +late final _sel_HTTPBody = objc.registerName("HTTPBody"); +late final _sel_HTTPBodyStream = objc.registerName("HTTPBodyStream"); +late final _sel_HTTPShouldHandleCookies = + objc.registerName("HTTPShouldHandleCookies"); +late final _sel_HTTPShouldUsePipelining = + objc.registerName("HTTPShouldUsePipelining"); /// ! -/// @class NSCachedURLResponse -/// NSCachedURLResponse is a class whose objects functions as a wrapper for -/// objects that are stored in the framework's caching system. -/// It is used to maintain characteristics and attributes of a cached -/// object. -class NSCachedURLResponse extends objc.NSObject { - NSCachedURLResponse._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSCachedURLResponse] that points to the same underlying object as [other]. - NSCachedURLResponse.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSCachedURLResponse] that wraps the given raw object pointer. - NSCachedURLResponse.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSCachedURLResponse]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSCachedURLResponse); +/// @category NSURLRequest(NSHTTPURLRequest) +/// The NSHTTPURLRequest on NSURLRequest provides methods for accessing +/// information specific to HTTP protocol requests. +extension NSHTTPURLRequest on NSURLRequest { + /// ! + /// @abstract Returns the HTTP request method of the receiver. + /// @result the HTTP request method of the receiver. + objc.NSString? get HTTPMethod { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPMethod); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } /// ! - /// @method initWithResponse:data - /// @abstract Initializes an NSCachedURLResponse with the given - /// response and data. - /// @discussion A default NSURLCacheStoragePolicy is used for - /// NSCachedURLResponse objects initialized with this method: - /// NSURLCacheStorageAllowed. - /// @param response a NSURLResponse object. - /// @param data an NSData object representing the URL content - /// corresponding to the given response. - /// @result an initialized NSCachedURLResponse. - NSCachedURLResponse initWithResponse_data_( - NSURLResponse response, objc.NSData data) { - final _ret = _objc_msgSend_iq11qg(this.ref.retainAndReturnPointer(), - _sel_initWithResponse_data_, response.ref.pointer, data.ref.pointer); - return NSCachedURLResponse.castFromPointer(_ret, - retain: false, release: true); + /// @abstract Returns a dictionary containing all the HTTP header fields + /// of the receiver. + /// @result a dictionary containing all the HTTP header fields of the + /// receiver. + objc.NSDictionary? get allHTTPHeaderFields { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_allHTTPHeaderFields); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } /// ! - /// @method initWithResponse:data:userInfo:storagePolicy: - /// @abstract Initializes an NSCachedURLResponse with the given - /// response, data, user-info dictionary, and storage policy. - /// @param response a NSURLResponse object. - /// @param data an NSData object representing the URL content - /// corresponding to the given response. - /// @param userInfo a dictionary user-specified information to be - /// stored with the NSCachedURLResponse. - /// @param storagePolicy an NSURLCacheStoragePolicy constant. - /// @result an initialized NSCachedURLResponse. - NSCachedURLResponse initWithResponse_data_userInfo_storagePolicy_( - NSURLResponse response, - objc.NSData data, - objc.NSDictionary? userInfo, - NSURLCacheStoragePolicy storagePolicy) { - final _ret = _objc_msgSend_nhp99d( - this.ref.retainAndReturnPointer(), - _sel_initWithResponse_data_userInfo_storagePolicy_, - response.ref.pointer, - data.ref.pointer, - userInfo?.ref.pointer ?? ffi.nullptr, - storagePolicy.value); - return NSCachedURLResponse.castFromPointer(_ret, - retain: false, release: true); - } - - /// ! - /// @abstract Returns the response wrapped by this instance. - /// @result The response wrapped by this instance. - NSURLResponse get response { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_response); - return NSURLResponse.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Returns the data of the receiver. - /// @result The data of the receiver. - objc.NSData get data { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_data); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Returns the userInfo dictionary of the receiver. - /// @result The userInfo dictionary of the receiver. - objc.NSDictionary? get userInfo { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_userInfo); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Returns the NSURLCacheStoragePolicy constant of the receiver. - /// @result The NSURLCacheStoragePolicy constant of the receiver. - NSURLCacheStoragePolicy get storagePolicy { - final _ret = _objc_msgSend_1xh4qg4(this.ref.pointer, _sel_storagePolicy); - return NSURLCacheStoragePolicy.fromValue(_ret); - } - - /// init - NSCachedURLResponse init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSCachedURLResponse.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSCachedURLResponse new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSCachedURLResponse, _sel_new); - return NSCachedURLResponse.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSCachedURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSCachedURLResponse, _sel_allocWithZone_, zone); - return NSCachedURLResponse.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSCachedURLResponse alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSCachedURLResponse, _sel_alloc); - return NSCachedURLResponse.castFromPointer(_ret, - retain: false, release: true); - } - - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1( - _class_NSCachedURLResponse, _sel_supportsSecureCoding); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } - - /// initWithCoder: - NSCachedURLResponse? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); + /// @method valueForHTTPHeaderField: + /// @abstract Returns the value which corresponds to the given header + /// field. Note that, in keeping with the HTTP RFC, HTTP header field + /// names are case-insensitive. + /// @param field the header field name to use for the lookup + /// (case-insensitive). + /// @result the value associated with the given header field, or nil if + /// there is no value associated with the given header field. + objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); return _ret.address == 0 ? null - : NSCachedURLResponse.castFromPointer(_ret, - retain: false, release: true); - } -} - -late final _class_NSCachedURLResponse = objc.getClass("NSCachedURLResponse"); - -/// NSURLResponse -class NSURLResponse extends objc.NSObject { - NSURLResponse._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSURLResponse] that points to the same underlying object as [other]. - NSURLResponse.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLResponse] that wraps the given raw object pointer. - NSURLResponse.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLResponse]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLResponse); - } - - /// ! - /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: - /// @abstract Initialize an NSURLResponse with the provided values. - /// @param URL the URL - /// @param MIMEType the MIME content type of the response - /// @param length the expected content length of the associated data - /// @param name the name of the text encoding for the associated data, if applicable, else nil - /// @result The initialized NSURLResponse. - /// @discussion This is the designated initializer for NSURLResponse. - NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( - objc.NSURL URL, - objc.NSString? MIMEType, - DartNSInteger length, - objc.NSString? name) { - final _ret = _objc_msgSend_eyseqq( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, - URL.ref.pointer, - MIMEType?.ref.pointer ?? ffi.nullptr, - length, - name?.ref.pointer ?? ffi.nullptr); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } /// ! - /// @abstract Returns the URL of the receiver. - /// @result The URL of the receiver. - objc.NSURL? get URL { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_URL); + /// @abstract Returns the request body data of the receiver. + /// @discussion This data is sent as the message body of the request, as + /// in done in an HTTP POST request. + /// @result The request body data of the receiver. + objc.NSData? get HTTPBody { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBody); return _ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + : objc.NSData.castFromPointer(_ret, retain: true, release: true); } /// ! - /// @abstract Returns the MIME type of the receiver. - /// @discussion The MIME type is based on the information provided - /// from an origin source. However, that value may be changed or - /// corrected by a protocol implementation if it can be determined - /// that the origin server or source reported the information - /// incorrectly or imprecisely. An attempt to guess the MIME type may - /// be made if the origin source did not report any such information. - /// @result The MIME type of the receiver. - objc.NSString? get MIMEType { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_MIMEType); + /// @abstract Returns the request body stream of the receiver + /// if any has been set + /// @discussion The stream is returned for examination only; it is + /// not safe for the caller to manipulate the stream in any way. Also + /// note that the HTTPBodyStream and HTTPBody are mutually exclusive - only + /// one can be set on a given request. Also note that the body stream is + /// preserved across copies, but is LOST when the request is coded via the + /// NSCoding protocol + /// @result The request body stream of the receiver. + objc.NSInputStream? get HTTPBodyStream { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBodyStream); return _ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Returns the expected content length of the receiver. - /// @discussion Some protocol implementations report a content length - /// as part of delivering load metadata, but not all protocols - /// guarantee the amount of data that will be delivered in actuality. - /// Hence, this method returns an expected amount. Clients should use - /// this value as an advisory, and should be prepared to deal with - /// either more or less data. - /// @result The expected content length of the receiver, or -1 if - /// there is no expectation that can be arrived at regarding expected - /// content length. - int get expectedContentLength { - return _objc_msgSend_e94jsr(this.ref.pointer, _sel_expectedContentLength); + : objc.NSInputStream.castFromPointer(_ret, retain: true, release: true); } /// ! - /// @abstract Returns the name of the text encoding of the receiver. - /// @discussion This name will be the actual string reported by the - /// origin source during the course of performing a protocol-specific - /// URL load. Clients can inspect this string and convert it to an - /// NSStringEncoding or CFStringEncoding using the methods and - /// functions made available in the appropriate framework. - /// @result The name of the text encoding of the receiver, or nil if no - /// text encoding was specified. - objc.NSString? get textEncodingName { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_textEncodingName); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + /// @abstract Determine whether default cookie handling will happen for + /// this request. + /// @discussion NOTE: This value is not used prior to 10.3 + /// @result YES if cookies will be sent with and set for this request; + /// otherwise NO. + bool get HTTPShouldHandleCookies { + return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldHandleCookies); } /// ! - /// @abstract Returns a suggested filename if the resource were saved to disk. - /// @discussion The method first checks if the server has specified a filename using the - /// content disposition header. If no valid filename is specified using that mechanism, - /// this method checks the last path component of the URL. If no valid filename can be - /// obtained using the last path component, this method uses the URL's host as the filename. - /// If the URL's host can't be converted to a valid filename, the filename "unknown" is used. - /// In most cases, this method appends the proper file extension based on the MIME type. - /// This method always returns a valid filename. - /// @result A suggested filename to use if saving the resource to disk. - objc.NSString? get suggestedFilename { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_suggestedFilename); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSURLResponse init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + /// @abstract Reports whether the receiver is not expected to wait for the + /// previous response before transmitting. + /// @result YES if the receiver should transmit before the previous response + /// is received. NO if the receiver should wait for the previous response + /// before transmitting. + bool get HTTPShouldUsePipelining { + return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); } +} - /// new - static NSURLResponse new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLResponse, _sel_new); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); - } +late final _sel_requestWithURL_ = objc.registerName("requestWithURL:"); +late final _sel_supportsSecureCoding = + objc.registerName("supportsSecureCoding"); - /// allocWithZone: - static NSURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSURLResponse, _sel_allocWithZone_, zone); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); - } +/// ! +/// @enum NSURLRequestCachePolicy +/// +/// @discussion The NSURLRequestCachePolicy enum defines constants that +/// can be used to specify the type of interactions that take place with +/// the caching system when the URL loading system processes a request. +/// Specifically, these constants cover interactions that have to do +/// with whether already-existing cache data is returned to satisfy a +/// URL load request. +/// +/// @constant NSURLRequestUseProtocolCachePolicy Specifies that the +/// caching logic defined in the protocol implementation, if any, is +/// used for a particular URL load request. This is the default policy +/// for URL load requests. +/// +/// @constant NSURLRequestReloadIgnoringLocalCacheData Specifies that the +/// data for the URL load should be loaded from the origin source. No +/// existing local cache data, regardless of its freshness or validity, +/// should be used to satisfy a URL load request. +/// +/// @constant NSURLRequestReloadIgnoringLocalAndRemoteCacheData Specifies that +/// not only should the local cache data be ignored, but that proxies and +/// other intermediates should be instructed to disregard their caches +/// so far as the protocol allows. +/// +/// @constant NSURLRequestReloadIgnoringCacheData Older name for +/// NSURLRequestReloadIgnoringLocalCacheData. +/// +/// @constant NSURLRequestReturnCacheDataElseLoad Specifies that the +/// existing cache data should be used to satisfy a URL load request, +/// regardless of its age or expiration date. However, if there is no +/// existing data in the cache corresponding to a URL load request, +/// the URL is loaded from the origin source. +/// +/// @constant NSURLRequestReturnCacheDataDontLoad Specifies that the +/// existing cache data should be used to satisfy a URL load request, +/// regardless of its age or expiration date. However, if there is no +/// existing data in the cache corresponding to a URL load request, no +/// attempt is made to load the URL from the origin source, and the +/// load is considered to have failed. This constant specifies a +/// behavior that is similar to an "offline" mode. +/// +/// @constant NSURLRequestReloadRevalidatingCacheData Specifies that +/// the existing cache data may be used provided the origin source +/// confirms its validity, otherwise the URL is loaded from the +/// origin source. +enum NSURLRequestCachePolicy { + NSURLRequestUseProtocolCachePolicy(0), + NSURLRequestReloadIgnoringLocalCacheData(1), + NSURLRequestReloadIgnoringLocalAndRemoteCacheData(4), + NSURLRequestReturnCacheDataElseLoad(2), + NSURLRequestReturnCacheDataDontLoad(3), + NSURLRequestReloadRevalidatingCacheData(5); - /// alloc - static NSURLResponse alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLResponse, _sel_alloc); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); - } + static const NSURLRequestReloadIgnoringCacheData = + NSURLRequestReloadIgnoringLocalCacheData; - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1( - _class_NSURLResponse, _sel_supportsSecureCoding); - } + final int value; + const NSURLRequestCachePolicy(this.value); - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } + static NSURLRequestCachePolicy fromValue(int value) => switch (value) { + 0 => NSURLRequestUseProtocolCachePolicy, + 1 => NSURLRequestReloadIgnoringLocalCacheData, + 4 => NSURLRequestReloadIgnoringLocalAndRemoteCacheData, + 2 => NSURLRequestReturnCacheDataElseLoad, + 3 => NSURLRequestReturnCacheDataDontLoad, + 5 => NSURLRequestReloadRevalidatingCacheData, + _ => throw ArgumentError( + "Unknown value for NSURLRequestCachePolicy: $value"), + }; - /// initWithCoder: - NSURLResponse? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSURLResponse.castFromPointer(_ret, retain: false, release: true); + @override + String toString() { + if (this == NSURLRequestReloadIgnoringLocalCacheData) + return "NSURLRequestCachePolicy.NSURLRequestReloadIgnoringLocalCacheData, NSURLRequestCachePolicy.NSURLRequestReloadIgnoringCacheData"; + return super.toString(); } } -late final _class_NSURLResponse = objc.getClass("NSURLResponse"); -late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_ = - objc.registerName( - "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); -final _objc_msgSend_eyseqq = objc.msgSendPointer +typedef NSTimeInterval = ffi.Double; +typedef DartNSTimeInterval = double; +late final _sel_requestWithURL_cachePolicy_timeoutInterval_ = + objc.registerName("requestWithURL:cachePolicy:timeoutInterval:"); +final _objc_msgSend_3phu9v = objc.msgSendPointer .cast< ffi.NativeFunction< - instancetype Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)>>() + NSUInteger, + ffi.Double)>>() .asFunction< - instancetype Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, - ffi.Pointer)>(); + double)>(); +late final _sel_initWithURL_ = objc.registerName("initWithURL:"); +late final _sel_initWithURL_cachePolicy_timeoutInterval_ = + objc.registerName("initWithURL:cachePolicy:timeoutInterval:"); late final _sel_URL = objc.registerName("URL"); -late final _sel_MIMEType = objc.registerName("MIMEType"); -late final _sel_expectedContentLength = - objc.registerName("expectedContentLength"); -final _objc_msgSend_e94jsr = objc.msgSendPointer +late final _sel_cachePolicy = objc.registerName("cachePolicy"); +final _objc_msgSend_8jm3uo = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.LongLong Function(ffi.Pointer, + NSUInteger Function(ffi.Pointer, ffi.Pointer)>>() .asFunction< int Function( ffi.Pointer, ffi.Pointer)>(); -late final _sel_textEncodingName = objc.registerName("textEncodingName"); -late final _sel_suggestedFilename = objc.registerName("suggestedFilename"); -late final _sel_init = objc.registerName("init"); -late final _sel_new = objc.registerName("new"); -late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); -final _objc_msgSend_1b3ihd0 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); -late final _sel_alloc = objc.registerName("alloc"); -final _objc_msgSend_olxnu1 = objc.msgSendPointer +late final _sel_timeoutInterval = objc.registerName("timeoutInterval"); +final _objc_msgSend_1ukqyt8 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, + ffi.Double Function(ffi.Pointer, ffi.Pointer)>>() .asFunction< - bool Function( + double Function( ffi.Pointer, ffi.Pointer)>(); -final _objc_msgSend_juohf7 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_initWithResponse_data_ = - objc.registerName("initWithResponse:data:"); -final _objc_msgSend_iq11qg = objc.msgSendPointer +final _objc_msgSend_1ukqyt8Fpret = objc.msgSendFpretPointer .cast< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() + ffi.Double Function(ffi.Pointer, + ffi.Pointer)>>() .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + double Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_mainDocumentURL = objc.registerName("mainDocumentURL"); /// ! -/// @enum NSURLCacheStoragePolicy +/// @enum NSURLRequestNetworkServiceType /// -/// @discussion The NSURLCacheStoragePolicy enum defines constants that -/// can be used to specify the type of storage that is allowable for an -/// NSCachedURLResponse object that is to be stored in an NSURLCache. +/// @discussion The NSURLRequestNetworkServiceType enum defines constants that +/// can be used to specify the service type to associate with this request. The +/// service type is used to provide the networking layers a hint of the purpose +/// of the request. /// -/// @constant NSURLCacheStorageAllowed Specifies that storage in an -/// NSURLCache is allowed without restriction. +/// @constant NSURLNetworkServiceTypeDefault Is the default value for an NSURLRequest +/// when created. This value should be left unchanged for the vast majority of requests. /// -/// @constant NSURLCacheStorageAllowedInMemoryOnly Specifies that -/// storage in an NSURLCache is allowed; however storage should be -/// done in memory only, no disk storage should be done. +/// @constant NSURLNetworkServiceTypeVoIP Specifies that the request is for voice over IP +/// control traffic. /// -/// @constant NSURLCacheStorageNotAllowed Specifies that storage in an -/// NSURLCache is not allowed in any fashion, either in memory or on -/// disk. -enum NSURLCacheStoragePolicy { - NSURLCacheStorageAllowed(0), - NSURLCacheStorageAllowedInMemoryOnly(1), - NSURLCacheStorageNotAllowed(2); +/// @constant NSURLNetworkServiceTypeVideo Specifies that the request is for video +/// traffic. +/// +/// @constant NSURLNetworkServiceTypeBackground Specifies that the request is for background +/// traffic (such as a file download). +/// +/// @constant NSURLNetworkServiceTypeVoice Specifies that the request is for voice data. +/// +/// @constant NSURLNetworkServiceTypeResponsiveData Specifies that the request is for responsive (time sensitive) data. +/// +/// @constant NSURLNetworkServiceTypeAVStreaming Specifies that the request is streaming audio/video data. +/// +/// @constant NSURLNetworkServiceTypeResponsiveAV Specifies that the request is for responsive (time sensitive) audio/video data. +/// +/// @constant NSURLNetworkServiceTypeCallSignaling Specifies that the request is for call signaling. +enum NSURLRequestNetworkServiceType { + /// Standard internet traffic + NSURLNetworkServiceTypeDefault(0), + + /// Voice over IP control traffic + NSURLNetworkServiceTypeVoIP(1), + + /// Video traffic + NSURLNetworkServiceTypeVideo(2), + + /// Background traffic + NSURLNetworkServiceTypeBackground(3), + + /// Voice data + NSURLNetworkServiceTypeVoice(4), + + /// Responsive data + NSURLNetworkServiceTypeResponsiveData(6), + + /// Multimedia Audio/Video Streaming + NSURLNetworkServiceTypeAVStreaming(8), + + /// Responsive Multimedia Audio/Video + NSURLNetworkServiceTypeResponsiveAV(9), + + /// Call Signaling + NSURLNetworkServiceTypeCallSignaling(11); final int value; - const NSURLCacheStoragePolicy(this.value); + const NSURLRequestNetworkServiceType(this.value); - static NSURLCacheStoragePolicy fromValue(int value) => switch (value) { - 0 => NSURLCacheStorageAllowed, - 1 => NSURLCacheStorageAllowedInMemoryOnly, - 2 => NSURLCacheStorageNotAllowed, + static NSURLRequestNetworkServiceType fromValue(int value) => switch (value) { + 0 => NSURLNetworkServiceTypeDefault, + 1 => NSURLNetworkServiceTypeVoIP, + 2 => NSURLNetworkServiceTypeVideo, + 3 => NSURLNetworkServiceTypeBackground, + 4 => NSURLNetworkServiceTypeVoice, + 6 => NSURLNetworkServiceTypeResponsiveData, + 8 => NSURLNetworkServiceTypeAVStreaming, + 9 => NSURLNetworkServiceTypeResponsiveAV, + 11 => NSURLNetworkServiceTypeCallSignaling, _ => throw ArgumentError( - "Unknown value for NSURLCacheStoragePolicy: $value"), + "Unknown value for NSURLRequestNetworkServiceType: $value"), }; } -late final _sel_initWithResponse_data_userInfo_storagePolicy_ = - objc.registerName("initWithResponse:data:userInfo:storagePolicy:"); -final _objc_msgSend_nhp99d = objc.msgSendPointer +late final _sel_networkServiceType = objc.registerName("networkServiceType"); +final _objc_msgSend_t4uaw1 = objc.msgSendPointer .cast< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>>() + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_response = objc.registerName("response"); -late final _sel_data = objc.registerName("data"); -late final _sel_userInfo = objc.registerName("userInfo"); -late final _sel_storagePolicy = objc.registerName("storagePolicy"); -final _objc_msgSend_1xh4qg4 = objc.msgSendPointer + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_allowsCellularAccess = + objc.registerName("allowsCellularAccess"); +late final _sel_allowsExpensiveNetworkAccess = + objc.registerName("allowsExpensiveNetworkAccess"); +late final _sel_allowsConstrainedNetworkAccess = + objc.registerName("allowsConstrainedNetworkAccess"); +late final _sel_assumesHTTP3Capable = objc.registerName("assumesHTTP3Capable"); + +/// ! +/// @enum NSURLRequestAttribution +/// +/// @discussion The NSURLRequestAttribution enum is used to indicate whether the +/// user or developer specified the URL. +/// +/// @constant NSURLRequestAttributionDeveloper Indicates that the URL was specified +/// by the developer. This is the default value for an NSURLRequest when created. +/// +/// @constant NSURLRequestAttributionUser Indicates that the URL was specified by +/// the user. +enum NSURLRequestAttribution { + NSURLRequestAttributionDeveloper(0), + NSURLRequestAttributionUser(1); + + final int value; + const NSURLRequestAttribution(this.value); + + static NSURLRequestAttribution fromValue(int value) => switch (value) { + 0 => NSURLRequestAttributionDeveloper, + 1 => NSURLRequestAttributionUser, + _ => throw ArgumentError( + "Unknown value for NSURLRequestAttribution: $value"), + }; +} + +late final _sel_attribution = objc.registerName("attribution"); +final _objc_msgSend_i3avs9 = objc.msgSendPointer .cast< ffi.NativeFunction< NSUInteger Function(ffi.Pointer, @@ -45666,6 +46326,20 @@ final _objc_msgSend_1xh4qg4 = objc.msgSendPointer .asFunction< int Function( ffi.Pointer, ffi.Pointer)>(); +late final _sel_requiresDNSSECValidation = + objc.registerName("requiresDNSSECValidation"); +late final _sel_init = objc.registerName("init"); +late final _sel_new = objc.registerName("new"); +late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); +final _objc_msgSend_hzlb60 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); +late final _sel_alloc = objc.registerName("alloc"); /// NSURLRequest class NSURLRequest extends objc.NSObject { @@ -45684,7 +46358,7 @@ class NSURLRequest extends objc.NSObject { /// Returns whether [obj] is an instance of [NSURLRequest]. static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( + return _objc_msgSend_69e0x1( obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLRequest); } @@ -45698,17 +46372,14 @@ class NSURLRequest extends objc.NSObject { /// @param URL The URL for the request. /// @result A newly-created and autoreleased NSURLRequest instance. static NSURLRequest requestWithURL_(objc.NSURL URL) { - final _ret = _objc_msgSend_juohf7( + final _ret = _objc_msgSend_62nh5j( _class_NSURLRequest, _sel_requestWithURL_, URL.ref.pointer); return NSURLRequest.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @property supportsSecureCoding - /// @abstract Indicates that NSURLRequest implements the NSSecureCoding protocol. - /// @result A BOOL value set to YES. + /// supportsSecureCoding static bool getSupportsSecureCoding() { - return _objc_msgSend_olxnu1(_class_NSURLRequest, _sel_supportsSecureCoding); + return _objc_msgSend_91o635(_class_NSURLRequest, _sel_supportsSecureCoding); } /// ! @@ -45725,7 +46396,7 @@ class NSURLRequest extends objc.NSObject { objc.NSURL URL, NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { - final _ret = _objc_msgSend_191svj( + final _ret = _objc_msgSend_3phu9v( _class_NSURLRequest, _sel_requestWithURL_cachePolicy_timeoutInterval_, URL.ref.pointer, @@ -45743,7 +46414,7 @@ class NSURLRequest extends objc.NSObject { /// @param URL The URL for the request. /// @result An initialized NSURLRequest. NSURLRequest initWithURL_(objc.NSURL URL) { - final _ret = _objc_msgSend_juohf7( + final _ret = _objc_msgSend_62nh5j( this.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer); return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } @@ -45762,7 +46433,7 @@ class NSURLRequest extends objc.NSObject { /// @result An initialized NSURLRequest. NSURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { - final _ret = _objc_msgSend_191svj( + final _ret = _objc_msgSend_3phu9v( this.ref.retainAndReturnPointer(), _sel_initWithURL_cachePolicy_timeoutInterval_, URL.ref.pointer, @@ -45775,7 +46446,7 @@ class NSURLRequest extends objc.NSObject { /// @abstract Returns the URL of the receiver. /// @result The URL of the receiver. objc.NSURL? get URL { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_URL); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_URL); return _ret.address == 0 ? null : objc.NSURL.castFromPointer(_ret, retain: true, release: true); @@ -45785,7 +46456,7 @@ class NSURLRequest extends objc.NSObject { /// @abstract Returns the cache policy of the receiver. /// @result The cache policy of the receiver. NSURLRequestCachePolicy get cachePolicy { - final _ret = _objc_msgSend_2xak1q(this.ref.pointer, _sel_cachePolicy); + final _ret = _objc_msgSend_8jm3uo(this.ref.pointer, _sel_cachePolicy); return NSURLRequestCachePolicy.fromValue(_ret); } @@ -45803,7 +46474,9 @@ class NSURLRequest extends objc.NSObject { /// in seconds. /// @result The timeout interval of the receiver. DartNSTimeInterval get timeoutInterval { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_timeoutInterval); + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_timeoutInterval) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeoutInterval); } /// ! @@ -45814,7 +46487,7 @@ class NSURLRequest extends objc.NSObject { /// See setMainDocumentURL: /// @result The main document URL. objc.NSURL? get mainDocumentURL { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_mainDocumentURL); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_mainDocumentURL); return _ret.address == 0 ? null : objc.NSURL.castFromPointer(_ret, retain: true, release: true); @@ -45827,7 +46500,7 @@ class NSURLRequest extends objc.NSObject { /// @result The NSURLRequestNetworkServiceType associated with this request. NSURLRequestNetworkServiceType get networkServiceType { final _ret = - _objc_msgSend_ttt73t(this.ref.pointer, _sel_networkServiceType); + _objc_msgSend_t4uaw1(this.ref.pointer, _sel_networkServiceType); return NSURLRequestNetworkServiceType.fromValue(_ret); } @@ -45837,7 +46510,7 @@ class NSURLRequest extends objc.NSObject { /// @result YES if the receiver is allowed to use the built in cellular radios to /// satisfy the request, NO otherwise. bool get allowsCellularAccess { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_allowsCellularAccess); + return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); } /// ! @@ -45846,7 +46519,7 @@ class NSURLRequest extends objc.NSObject { /// @result YES if the receiver is allowed to use an interface marked as expensive to /// satisfy the request, NO otherwise. bool get allowsExpensiveNetworkAccess { - return _objc_msgSend_olxnu1( + return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsExpensiveNetworkAccess); } @@ -45856,7 +46529,7 @@ class NSURLRequest extends objc.NSObject { /// @result YES if the receiver is allowed to use an interface marked as constrained to /// satisfy the request, NO otherwise. bool get allowsConstrainedNetworkAccess { - return _objc_msgSend_olxnu1( + return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsConstrainedNetworkAccess); } @@ -45866,7 +46539,7 @@ class NSURLRequest extends objc.NSObject { /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. /// The default may be YES in a future OS update. bool get assumesHTTP3Capable { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_assumesHTTP3Capable); + return _objc_msgSend_91o635(this.ref.pointer, _sel_assumesHTTP3Capable); } /// ! @@ -45875,7 +46548,7 @@ class NSURLRequest extends objc.NSObject { /// have not explicitly set an attribution. /// @result The NSURLRequestAttribution associated with this request. NSURLRequestAttribution get attribution { - final _ret = _objc_msgSend_t5yka9(this.ref.pointer, _sel_attribution); + final _ret = _objc_msgSend_i3avs9(this.ref.pointer, _sel_attribution); return NSURLRequestAttribution.fromValue(_ret); } @@ -45884,97 +46557,63 @@ class NSURLRequest extends objc.NSObject { /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, /// No otherwise. Defaults to NO. bool get requiresDNSSECValidation { - return _objc_msgSend_olxnu1( + return _objc_msgSend_91o635( this.ref.pointer, _sel_requiresDNSSECValidation); } - /// HTTPMethod - objc.NSString? get HTTPMethod { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPMethod); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// allHTTPHeaderFields - objc.NSDictionary? get allHTTPHeaderFields { + /// init + NSURLRequest init() { final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_allHTTPHeaderFields); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } - /// valueForHTTPHeaderField: - objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// HTTPBody - objc.NSData? get HTTPBody { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPBody); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// HTTPBodyStream - objc.NSInputStream? get HTTPBodyStream { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPBodyStream); - return _ret.address == 0 - ? null - : objc.NSInputStream.castFromPointer(_ret, retain: true, release: true); - } - - /// HTTPShouldHandleCookies - bool get HTTPShouldHandleCookies { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldHandleCookies); - } - - /// HTTPShouldUsePipelining - bool get HTTPShouldUsePipelining { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldUsePipelining); - } - - /// init - NSURLRequest init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSURLRequest new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLRequest, _sel_new); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + /// new + static NSURLRequest new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLRequest, _sel_new); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: static NSURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { final _ret = - _objc_msgSend_1b3ihd0(_class_NSURLRequest, _sel_allocWithZone_, zone); + _objc_msgSend_hzlb60(_class_NSURLRequest, _sel_allocWithZone_, zone); return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } /// alloc static NSURLRequest alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLRequest, _sel_alloc); + final _ret = _objc_msgSend_1x359cv(_class_NSURLRequest, _sel_alloc); return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } + /// self + NSURLRequest self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// retain + NSURLRequest retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + + /// autorelease + NSURLRequest autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } + /// encodeWithCoder: void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( + _objc_msgSend_1jdvcbf( this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); } /// initWithCoder: NSURLRequest? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), _sel_initWithCoder_, coder.ref.pointer); return _ret.address == 0 ? null @@ -45982,317 +46621,23 @@ class NSURLRequest extends objc.NSObject { } } -late final _class_NSURLRequest = objc.getClass("NSURLRequest"); -late final _sel_requestWithURL_ = objc.registerName("requestWithURL:"); - -/// ! -/// @enum NSURLRequestCachePolicy -/// -/// @discussion The NSURLRequestCachePolicy enum defines constants that -/// can be used to specify the type of interactions that take place with -/// the caching system when the URL loading system processes a request. -/// Specifically, these constants cover interactions that have to do -/// with whether already-existing cache data is returned to satisfy a -/// URL load request. -/// -/// @constant NSURLRequestUseProtocolCachePolicy Specifies that the -/// caching logic defined in the protocol implementation, if any, is -/// used for a particular URL load request. This is the default policy -/// for URL load requests. -/// -/// @constant NSURLRequestReloadIgnoringLocalCacheData Specifies that the -/// data for the URL load should be loaded from the origin source. No -/// existing local cache data, regardless of its freshness or validity, -/// should be used to satisfy a URL load request. -/// -/// @constant NSURLRequestReloadIgnoringLocalAndRemoteCacheData Specifies that -/// not only should the local cache data be ignored, but that proxies and -/// other intermediates should be instructed to disregard their caches -/// so far as the protocol allows. -/// -/// @constant NSURLRequestReloadIgnoringCacheData Older name for -/// NSURLRequestReloadIgnoringLocalCacheData. -/// -/// @constant NSURLRequestReturnCacheDataElseLoad Specifies that the -/// existing cache data should be used to satisfy a URL load request, -/// regardless of its age or expiration date. However, if there is no -/// existing data in the cache corresponding to a URL load request, -/// the URL is loaded from the origin source. -/// -/// @constant NSURLRequestReturnCacheDataDontLoad Specifies that the -/// existing cache data should be used to satisfy a URL load request, -/// regardless of its age or expiration date. However, if there is no -/// existing data in the cache corresponding to a URL load request, no -/// attempt is made to load the URL from the origin source, and the -/// load is considered to have failed. This constant specifies a -/// behavior that is similar to an "offline" mode. -/// -/// @constant NSURLRequestReloadRevalidatingCacheData Specifies that -/// the existing cache data may be used provided the origin source -/// confirms its validity, otherwise the URL is loaded from the -/// origin source. -enum NSURLRequestCachePolicy { - NSURLRequestUseProtocolCachePolicy(0), - NSURLRequestReloadIgnoringLocalCacheData(1), - NSURLRequestReloadIgnoringLocalAndRemoteCacheData(4), - NSURLRequestReturnCacheDataElseLoad(2), - NSURLRequestReturnCacheDataDontLoad(3), - NSURLRequestReloadRevalidatingCacheData(5); - - static const NSURLRequestReloadIgnoringCacheData = - NSURLRequestReloadIgnoringLocalCacheData; - - final int value; - const NSURLRequestCachePolicy(this.value); - - static NSURLRequestCachePolicy fromValue(int value) => switch (value) { - 0 => NSURLRequestUseProtocolCachePolicy, - 1 => NSURLRequestReloadIgnoringLocalCacheData, - 4 => NSURLRequestReloadIgnoringLocalAndRemoteCacheData, - 2 => NSURLRequestReturnCacheDataElseLoad, - 3 => NSURLRequestReturnCacheDataDontLoad, - 5 => NSURLRequestReloadRevalidatingCacheData, - _ => throw ArgumentError( - "Unknown value for NSURLRequestCachePolicy: $value"), - }; - - @override - String toString() { - if (this == NSURLRequestReloadIgnoringLocalCacheData) - return "NSURLRequestCachePolicy.NSURLRequestReloadIgnoringLocalCacheData, NSURLRequestCachePolicy.NSURLRequestReloadIgnoringCacheData"; - return super.toString(); - } -} - -typedef NSTimeInterval = ffi.Double; -typedef DartNSTimeInterval = double; -late final _sel_requestWithURL_cachePolicy_timeoutInterval_ = - objc.registerName("requestWithURL:cachePolicy:timeoutInterval:"); -final _objc_msgSend_191svj = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSTimeInterval)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - double)>(); -late final _sel_initWithURL_ = objc.registerName("initWithURL:"); -late final _sel_initWithURL_cachePolicy_timeoutInterval_ = - objc.registerName("initWithURL:cachePolicy:timeoutInterval:"); -late final _sel_cachePolicy = objc.registerName("cachePolicy"); -final _objc_msgSend_2xak1q = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_timeoutInterval = objc.registerName("timeoutInterval"); -final _objc_msgSend_10noklm = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSTimeInterval Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_mainDocumentURL = objc.registerName("mainDocumentURL"); - -/// ! -/// @enum NSURLRequestNetworkServiceType -/// -/// @discussion The NSURLRequestNetworkServiceType enum defines constants that -/// can be used to specify the service type to associate with this request. The -/// service type is used to provide the networking layers a hint of the purpose -/// of the request. -/// -/// @constant NSURLNetworkServiceTypeDefault Is the default value for an NSURLRequest -/// when created. This value should be left unchanged for the vast majority of requests. -/// -/// @constant NSURLNetworkServiceTypeVoIP Specifies that the request is for voice over IP -/// control traffic. -/// -/// @constant NSURLNetworkServiceTypeVideo Specifies that the request is for video -/// traffic. -/// -/// @constant NSURLNetworkServiceTypeBackground Specifies that the request is for background -/// traffic (such as a file download). -/// -/// @constant NSURLNetworkServiceTypeVoice Specifies that the request is for voice data. -/// -/// @constant NSURLNetworkServiceTypeResponsiveData Specifies that the request is for responsive (time sensitive) data. -/// -/// @constant NSURLNetworkServiceTypeAVStreaming Specifies that the request is streaming audio/video data. -/// -/// @constant NSURLNetworkServiceTypeResponsiveAV Specifies that the request is for responsive (time sensitive) audio/video data. -/// -/// @constant NSURLNetworkServiceTypeCallSignaling Specifies that the request is for call signaling. -enum NSURLRequestNetworkServiceType { - /// Standard internet traffic - NSURLNetworkServiceTypeDefault(0), - - /// Voice over IP control traffic - NSURLNetworkServiceTypeVoIP(1), - - /// Video traffic - NSURLNetworkServiceTypeVideo(2), - - /// Background traffic - NSURLNetworkServiceTypeBackground(3), - - /// Voice data - NSURLNetworkServiceTypeVoice(4), - - /// Responsive data - NSURLNetworkServiceTypeResponsiveData(6), - - /// Multimedia Audio/Video Streaming - NSURLNetworkServiceTypeAVStreaming(8), - - /// Responsive Multimedia Audio/Video - NSURLNetworkServiceTypeResponsiveAV(9), - - /// Call Signaling - NSURLNetworkServiceTypeCallSignaling(11); - - final int value; - const NSURLRequestNetworkServiceType(this.value); - - static NSURLRequestNetworkServiceType fromValue(int value) => switch (value) { - 0 => NSURLNetworkServiceTypeDefault, - 1 => NSURLNetworkServiceTypeVoIP, - 2 => NSURLNetworkServiceTypeVideo, - 3 => NSURLNetworkServiceTypeBackground, - 4 => NSURLNetworkServiceTypeVoice, - 6 => NSURLNetworkServiceTypeResponsiveData, - 8 => NSURLNetworkServiceTypeAVStreaming, - 9 => NSURLNetworkServiceTypeResponsiveAV, - 11 => NSURLNetworkServiceTypeCallSignaling, - _ => throw ArgumentError( - "Unknown value for NSURLRequestNetworkServiceType: $value"), - }; -} - -late final _sel_networkServiceType = objc.registerName("networkServiceType"); -final _objc_msgSend_ttt73t = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_allowsCellularAccess = - objc.registerName("allowsCellularAccess"); -late final _sel_allowsExpensiveNetworkAccess = - objc.registerName("allowsExpensiveNetworkAccess"); -late final _sel_allowsConstrainedNetworkAccess = - objc.registerName("allowsConstrainedNetworkAccess"); -late final _sel_assumesHTTP3Capable = objc.registerName("assumesHTTP3Capable"); - -/// ! -/// @enum NSURLRequestAttribution -/// -/// @discussion The NSURLRequestAttribution enum is used to indicate whether the -/// user or developer specified the URL. -/// -/// @constant NSURLRequestAttributionDeveloper Indicates that the URL was specified -/// by the developer. This is the default value for an NSURLRequest when created. -/// -/// @constant NSURLRequestAttributionUser Indicates that the URL was specified by -/// the user. -enum NSURLRequestAttribution { - NSURLRequestAttributionDeveloper(0), - NSURLRequestAttributionUser(1); - - final int value; - const NSURLRequestAttribution(this.value); - - static NSURLRequestAttribution fromValue(int value) => switch (value) { - 0 => NSURLRequestAttributionDeveloper, - 1 => NSURLRequestAttributionUser, - _ => throw ArgumentError( - "Unknown value for NSURLRequestAttribution: $value"), - }; -} - -late final _sel_attribution = objc.registerName("attribution"); -final _objc_msgSend_t5yka9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_requiresDNSSECValidation = - objc.registerName("requiresDNSSECValidation"); -late final _sel_HTTPMethod = objc.registerName("HTTPMethod"); -late final _sel_allHTTPHeaderFields = objc.registerName("allHTTPHeaderFields"); -late final _sel_valueForHTTPHeaderField_ = - objc.registerName("valueForHTTPHeaderField:"); -late final _sel_HTTPBody = objc.registerName("HTTPBody"); -late final _sel_HTTPBodyStream = objc.registerName("HTTPBodyStream"); -late final _sel_HTTPShouldHandleCookies = - objc.registerName("HTTPShouldHandleCookies"); -late final _sel_HTTPShouldUsePipelining = - objc.registerName("HTTPShouldUsePipelining"); late final _sel_cachedResponseForRequest_ = objc.registerName("cachedResponseForRequest:"); late final _sel_storeCachedResponse_forRequest_ = objc.registerName("storeCachedResponse:forRequest:"); -final _objc_msgSend_1tjlcwl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); late final _sel_removeCachedResponseForRequest_ = objc.registerName("removeCachedResponseForRequest:"); late final _sel_removeAllCachedResponses = objc.registerName("removeAllCachedResponses"); -final _objc_msgSend_ksby9f = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, ffi.Pointer)>(); late final _sel_removeCachedResponsesSinceDate_ = objc.registerName("removeCachedResponsesSinceDate:"); late final _sel_memoryCapacity = objc.registerName("memoryCapacity"); -final _objc_msgSend_eldhrq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); late final _sel_setMemoryCapacity_ = objc.registerName("setMemoryCapacity:"); -final _objc_msgSend_1k4zaz5 = objc.msgSendPointer +final _objc_msgSend_1i9r4xy = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>() + ffi.Pointer, ffi.UnsignedLong)>>() .asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); @@ -46301,1629 +46646,1079 @@ late final _sel_setDiskCapacity_ = objc.registerName("setDiskCapacity:"); late final _sel_currentMemoryUsage = objc.registerName("currentMemoryUsage"); late final _sel_currentDiskUsage = objc.registerName("currentDiskUsage"); -/// NSURLSessionDataTask -class NSURLSessionDataTask extends NSURLSessionTask { - NSURLSessionDataTask._(ffi.Pointer pointer, +/// NSURLCache +class NSURLCache extends objc.NSObject { + NSURLCache._(ffi.Pointer pointer, {bool retain = false, bool release = false}) : super.castFromPointer(pointer, retain: retain, release: release); - /// Constructs a [NSURLSessionDataTask] that points to the same underlying object as [other]. - NSURLSessionDataTask.castFrom(objc.ObjCObjectBase other) + /// Constructs a [NSURLCache] that points to the same underlying object as [other]. + NSURLCache.castFrom(objc.ObjCObjectBase other) : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSURLSessionDataTask] that wraps the given raw object pointer. - NSURLSessionDataTask.castFromPointer(ffi.Pointer other, + /// Constructs a [NSURLCache] that wraps the given raw object pointer. + NSURLCache.castFromPointer(ffi.Pointer other, {bool retain = false, bool release = false}) : this._(other, retain: retain, release: release); - /// Returns whether [obj] is an instance of [NSURLSessionDataTask]. + /// Returns whether [obj] is an instance of [NSURLCache]. static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionDataTask); - } - - /// init - NSURLSessionDataTask init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSessionDataTask.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSURLSessionDataTask new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionDataTask, _sel_new); - return NSURLSessionDataTask.castFromPointer(_ret, - retain: false, release: true); + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLCache); } - /// allocWithZone: - static NSURLSessionDataTask allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSURLSessionDataTask, _sel_allocWithZone_, zone); - return NSURLSessionDataTask.castFromPointer(_ret, - retain: false, release: true); + /// ! + /// @property sharedURLCache + /// @abstract Returns the shared NSURLCache instance or + /// sets the NSURLCache instance shared by all clients of + /// the current process. This will be the new object returned when + /// calls to the sharedURLCache method are made. + /// @discussion Unless set explicitly through a call to + /// +setSharedURLCache:, this method returns an NSURLCache + /// instance created with the following default values: + ///

    + ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) + ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) + ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) + ///
+ ///

Users who do not have special caching requirements or + /// constraints should find the default shared cache instance + /// acceptable. If this default shared cache instance is not + /// acceptable, +setSharedURLCache: can be called to set a + /// different NSURLCache instance to be returned from this method. + /// Callers should take care to ensure that the setter is called + /// at a time when no other caller has a reference to the previously-set + /// shared URL cache. This is to prevent storing cache data from + /// becoming unexpectedly unretrievable. + /// @result the shared NSURLCache instance. + static NSURLCache getSharedURLCache() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLCache, _sel_sharedURLCache); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); } - /// alloc - static NSURLSessionDataTask alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionDataTask, _sel_alloc); - return NSURLSessionDataTask.castFromPointer(_ret, - retain: false, release: true); + /// ! + /// @property sharedURLCache + /// @abstract Returns the shared NSURLCache instance or + /// sets the NSURLCache instance shared by all clients of + /// the current process. This will be the new object returned when + /// calls to the sharedURLCache method are made. + /// @discussion Unless set explicitly through a call to + /// +setSharedURLCache:, this method returns an NSURLCache + /// instance created with the following default values: + ///

    + ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) + ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) + ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) + ///
+ ///

Users who do not have special caching requirements or + /// constraints should find the default shared cache instance + /// acceptable. If this default shared cache instance is not + /// acceptable, +setSharedURLCache: can be called to set a + /// different NSURLCache instance to be returned from this method. + /// Callers should take care to ensure that the setter is called + /// at a time when no other caller has a reference to the previously-set + /// shared URL cache. This is to prevent storing cache data from + /// becoming unexpectedly unretrievable. + /// @result the shared NSURLCache instance. + static void setSharedURLCache(NSURLCache value) { + return _objc_msgSend_1jdvcbf( + _class_NSURLCache, _sel_setSharedURLCache_, value.ref.pointer); } -} - -late final _class_NSURLSessionDataTask = objc.getClass("NSURLSessionDataTask"); - -/// NSURLSessionTask - a cancelable object that refers to the lifetime -/// of processing a given request. -class NSURLSessionTask extends objc.NSObject { - NSURLSessionTask._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSURLSessionTask] that points to the same underlying object as [other]. - NSURLSessionTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionTask] that wraps the given raw object pointer. - NSURLSessionTask.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - /// Returns whether [obj] is an instance of [NSURLSessionTask]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionTask); + /// ! + /// @method initWithMemoryCapacity:diskCapacity:diskPath: + /// @abstract Initializes an NSURLCache with the given capacity and + /// path. + /// @discussion The returned NSURLCache is backed by disk, so + /// developers can be more liberal with space when choosing the + /// capacity for this kind of cache. A disk cache measured in the tens + /// of megabytes should be acceptable in most cases. + /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. + /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. + /// @param path the path on disk where the cache data is stored. + /// @result an initialized NSURLCache, with the given capacity, backed + /// by disk. + NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( + DartNSUInteger memoryCapacity, + DartNSUInteger diskCapacity, + objc.NSString? path) { + final _ret = _objc_msgSend_1dlfwfh( + this.ref.retainAndReturnPointer(), + _sel_initWithMemoryCapacity_diskCapacity_diskPath_, + memoryCapacity, + diskCapacity, + path?.ref.pointer ?? ffi.nullptr); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } - /// an identifier for this task, assigned by and unique to the owning session - DartNSUInteger get taskIdentifier { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_taskIdentifier); + /// ! + /// @method initWithMemoryCapacity:diskCapacity:directoryURL: + /// @abstract Initializes an NSURLCache with the given capacity and directory. + /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. Or 0 to disable memory cache. + /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. Or 0 to disable disk cache. + /// @param directoryURL the path to a directory on disk where the cache data is stored. Or nil for default directory. + /// @result an initialized NSURLCache, with the given capacity, optionally backed by disk. + NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( + DartNSUInteger memoryCapacity, + DartNSUInteger diskCapacity, + objc.NSURL? directoryURL) { + final _ret = _objc_msgSend_1dlfwfh( + this.ref.retainAndReturnPointer(), + _sel_initWithMemoryCapacity_diskCapacity_directoryURL_, + memoryCapacity, + diskCapacity, + directoryURL?.ref.pointer ?? ffi.nullptr); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } - /// may be nil if this is a stream task - NSURLRequest? get originalRequest { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_originalRequest); + /// ! + /// @method cachedResponseForRequest: + /// @abstract Returns the NSCachedURLResponse stored in the cache with + /// the given request. + /// @discussion The method returns nil if there is no + /// NSCachedURLResponse stored using the given request. + /// @param request the NSURLRequest to use as a key for the lookup. + /// @result The NSCachedURLResponse stored in the cache with the given + /// request, or nil if there is no NSCachedURLResponse stored with the + /// given request. + NSCachedURLResponse? cachedResponseForRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_cachedResponseForRequest_, request.ref.pointer); return _ret.address == 0 ? null - : NSURLRequest.castFromPointer(_ret, retain: true, release: true); + : NSCachedURLResponse.castFromPointer(_ret, + retain: true, release: true); } - /// may differ from originalRequest due to http server redirection - NSURLRequest? get currentRequest { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_currentRequest); - return _ret.address == 0 - ? null - : NSURLRequest.castFromPointer(_ret, retain: true, release: true); + /// ! + /// @method storeCachedResponse:forRequest: + /// @abstract Stores the given NSCachedURLResponse in the cache using + /// the given request. + /// @param cachedResponse The cached response to store. + /// @param request the NSURLRequest to use as a key for the storage. + void storeCachedResponse_forRequest_( + NSCachedURLResponse cachedResponse, NSURLRequest request) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_storeCachedResponse_forRequest_, + cachedResponse.ref.pointer, request.ref.pointer); } - /// may be nil if no response has been received - NSURLResponse? get response { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_response); - return _ret.address == 0 - ? null - : NSURLResponse.castFromPointer(_ret, retain: true, release: true); + /// ! + /// @method removeCachedResponseForRequest: + /// @abstract Removes the NSCachedURLResponse from the cache that is + /// stored using the given request. + /// @discussion No action is taken if there is no NSCachedURLResponse + /// stored with the given request. + /// @param request the NSURLRequest to use as a key for the lookup. + void removeCachedResponseForRequest_(NSURLRequest request) { + _objc_msgSend_1jdvcbf(this.ref.pointer, + _sel_removeCachedResponseForRequest_, request.ref.pointer); } - /// Sets a task-specific delegate. Methods not implemented on this delegate will - /// still be forwarded to the session delegate. - /// - /// Cannot be modified after task resumes. Not supported on background session. - /// - /// Delegate is strongly referenced until the task completes, after which it is - /// reset to `nil`. - objc.ObjCObjectBase? get delegate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// Sets a task-specific delegate. Methods not implemented on this delegate will - /// still be forwarded to the session delegate. - /// - /// Cannot be modified after task resumes. Not supported on background session. - /// - /// Delegate is strongly referenced until the task completes, after which it is - /// reset to `nil`. - set delegate(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); - } - - /// NSProgress object which represents the task progress. - /// It can be used for task progress tracking. - NSProgress get progress { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_progress); - return NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// Start the network load for this task no earlier than the specified date. If - /// not specified, no start delay is used. - /// - /// Only applies to tasks created from background NSURLSession instances; has no - /// effect for tasks created from other session types. - objc.NSDate? get earliestBeginDate { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_earliestBeginDate); - return _ret.address == 0 - ? null - : objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// Start the network load for this task no earlier than the specified date. If - /// not specified, no start delay is used. - /// - /// Only applies to tasks created from background NSURLSession instances; has no - /// effect for tasks created from other session types. - set earliestBeginDate(objc.NSDate? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setEarliestBeginDate_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// The number of bytes that the client expects (a best-guess upper-bound) will - /// be sent and received by this task. These values are used by system scheduling - /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. - int get countOfBytesClientExpectsToSend { - return _objc_msgSend_1voti03( - this.ref.pointer, _sel_countOfBytesClientExpectsToSend); - } - - /// The number of bytes that the client expects (a best-guess upper-bound) will - /// be sent and received by this task. These values are used by system scheduling - /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. - set countOfBytesClientExpectsToSend(int value) { - return _objc_msgSend_rrr3q( - this.ref.pointer, _sel_setCountOfBytesClientExpectsToSend_, value); - } - - /// countOfBytesClientExpectsToReceive - int get countOfBytesClientExpectsToReceive { - return _objc_msgSend_1voti03( - this.ref.pointer, _sel_countOfBytesClientExpectsToReceive); - } - - /// setCountOfBytesClientExpectsToReceive: - set countOfBytesClientExpectsToReceive(int value) { - return _objc_msgSend_rrr3q( - this.ref.pointer, _sel_setCountOfBytesClientExpectsToReceive_, value); - } - - /// number of body bytes already sent - int get countOfBytesSent { - return _objc_msgSend_1voti03(this.ref.pointer, _sel_countOfBytesSent); - } - - /// number of body bytes already received - int get countOfBytesReceived { - return _objc_msgSend_1voti03(this.ref.pointer, _sel_countOfBytesReceived); - } - - /// number of body bytes we expect to send, derived from the Content-Length of the HTTP request - int get countOfBytesExpectedToSend { - return _objc_msgSend_1voti03( - this.ref.pointer, _sel_countOfBytesExpectedToSend); - } - - /// number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response. - int get countOfBytesExpectedToReceive { - return _objc_msgSend_1voti03( - this.ref.pointer, _sel_countOfBytesExpectedToReceive); - } - - /// The taskDescription property is available for the developer to - /// provide a descriptive label for the task. - objc.NSString? get taskDescription { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_taskDescription); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// The taskDescription property is available for the developer to - /// provide a descriptive label for the task. - set taskDescription(objc.NSString? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setTaskDescription_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// -cancel returns immediately, but marks a task as being canceled. - /// The task will signal -URLSession:task:didCompleteWithError: with an - /// error value of { NSURLErrorDomain, NSURLErrorCancelled }. In some - /// cases, the task may signal other work before it acknowledges the - /// cancelation. -cancel may be sent to a task that has been suspended. - void cancel() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancel); - } - - /// The current state of the task within the session. - NSURLSessionTaskState get state { - final _ret = _objc_msgSend_8b7yc1(this.ref.pointer, _sel_state); - return NSURLSessionTaskState.fromValue(_ret); + /// ! + /// @method removeAllCachedResponses + /// @abstract Clears the given cache, removing all NSCachedURLResponse + /// objects that it stores. + void removeAllCachedResponses() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllCachedResponses); } - /// The error, if any, delivered via -URLSession:task:didCompleteWithError: - /// This property will be nil in the event that no error occurred. - objc.NSError? get error { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_error); - return _ret.address == 0 - ? null - : objc.NSError.castFromPointer(_ret, retain: true, release: true); + /// ! + /// @method removeCachedResponsesSince: + /// @abstract Clears the given cache of any cached responses since the provided date. + void removeCachedResponsesSinceDate_(objc.NSDate date) { + _objc_msgSend_1jdvcbf(this.ref.pointer, + _sel_removeCachedResponsesSinceDate_, date.ref.pointer); } - /// Suspending a task will prevent the NSURLSession from continuing to - /// load data. There may still be delegate calls made on behalf of - /// this task (for instance, to report data received while suspending) - /// but no further transmissions will be made on behalf of the task - /// until -resume is sent. The timeout timer associated with the task - /// will be disabled while a task is suspended. -suspend and -resume are - /// nestable. - void suspend() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_suspend); + /// ! + /// @abstract In-memory capacity of the receiver. + /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. + /// @result The in-memory capacity, measured in bytes, for the receiver. + DartNSUInteger get memoryCapacity { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_memoryCapacity); } - /// resume - void resume() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_resume); + /// ! + /// @abstract In-memory capacity of the receiver. + /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. + /// @result The in-memory capacity, measured in bytes, for the receiver. + set memoryCapacity(DartNSUInteger value) { + return _objc_msgSend_1i9r4xy( + this.ref.pointer, _sel_setMemoryCapacity_, value); } - /// Sets a scaling factor for the priority of the task. The scaling factor is a - /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest - /// priority and 1.0 is considered the highest. - /// - /// The priority is a hint and not a hard requirement of task performance. The - /// priority of a task may be changed using this API at any time, but not all - /// protocols support this; in these cases, the last priority that took effect - /// will be used. - /// - /// If no priority is specified, the task will operate with the default priority - /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional - /// priority levels are provided: NSURLSessionTaskPriorityLow and - /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. - double get priority { - return objc.useMsgSendVariants - ? _objc_msgSend_fcilgxFpret(this.ref.pointer, _sel_priority) - : _objc_msgSend_fcilgx(this.ref.pointer, _sel_priority); + /// ! + /// @abstract The on-disk capacity of the receiver. + /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. + DartNSUInteger get diskCapacity { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_diskCapacity); } - /// Sets a scaling factor for the priority of the task. The scaling factor is a - /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest - /// priority and 1.0 is considered the highest. - /// - /// The priority is a hint and not a hard requirement of task performance. The - /// priority of a task may be changed using this API at any time, but not all - /// protocols support this; in these cases, the last priority that took effect - /// will be used. - /// - /// If no priority is specified, the task will operate with the default priority - /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional - /// priority levels are provided: NSURLSessionTaskPriorityLow and - /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. - set priority(double value) { - return _objc_msgSend_s9gjzc(this.ref.pointer, _sel_setPriority_, value); + /// ! + /// @abstract The on-disk capacity of the receiver. + /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. + set diskCapacity(DartNSUInteger value) { + return _objc_msgSend_1i9r4xy( + this.ref.pointer, _sel_setDiskCapacity_, value); } - /// Provides a hint indicating if incremental delivery of a partial response body - /// would be useful for the application, or if it cannot process the response - /// until it is complete. Indicating that incremental delivery is not desired may - /// improve task performance. For example, if a response cannot be decoded until - /// the entire content is received, set this property to false. - /// - /// Defaults to true unless this task is created with completion-handler based - /// convenience methods, or if it is a download task. - bool get prefersIncrementalDelivery { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_prefersIncrementalDelivery); + /// ! + /// @abstract Returns the current amount of space consumed by the + /// in-memory cache of the receiver. + /// @discussion This size, measured in bytes, indicates the current + /// usage of the in-memory cache. + /// @result the current usage of the in-memory cache of the receiver. + DartNSUInteger get currentMemoryUsage { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_currentMemoryUsage); } - /// Provides a hint indicating if incremental delivery of a partial response body - /// would be useful for the application, or if it cannot process the response - /// until it is complete. Indicating that incremental delivery is not desired may - /// improve task performance. For example, if a response cannot be decoded until - /// the entire content is received, set this property to false. - /// - /// Defaults to true unless this task is created with completion-handler based - /// convenience methods, or if it is a download task. - set prefersIncrementalDelivery(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setPrefersIncrementalDelivery_, value); + /// ! + /// @abstract Returns the current amount of space consumed by the + /// on-disk cache of the receiver. + /// @discussion This size, measured in bytes, indicates the current + /// usage of the on-disk cache. + /// @result the current usage of the on-disk cache of the receiver. + DartNSUInteger get currentDiskUsage { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_currentDiskUsage); } /// init - NSURLSessionTask init() { + NSURLCache init() { final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } /// new - static NSURLSessionTask new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionTask, _sel_new); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + static NSURLCache new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLCache, _sel_new); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSURLSessionTask allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSURLSessionTask, _sel_allocWithZone_, zone); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + static NSURLCache allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_hzlb60(_class_NSURLCache, _sel_allocWithZone_, zone); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } /// alloc - static NSURLSessionTask alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionTask, _sel_alloc); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); - } -} - -late final _class_NSURLSessionTask = objc.getClass("NSURLSessionTask"); -late final _sel_taskIdentifier = objc.registerName("taskIdentifier"); -late final _sel_originalRequest = objc.registerName("originalRequest"); -late final _sel_currentRequest = objc.registerName("currentRequest"); -late final _sel_delegate = objc.registerName("delegate"); -late final _sel_setDelegate_ = objc.registerName("setDelegate:"); - -/// NSProgress -class NSProgress extends objc.NSObject { - NSProgress._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSProgress] that points to the same underlying object as [other]. - NSProgress.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSProgress] that wraps the given raw object pointer. - NSProgress.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSProgress]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSProgress); - } - - /// currentProgress - static NSProgress? currentProgress() { - final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_currentProgress); - return _ret.address == 0 - ? null - : NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// progressWithTotalUnitCount: - static NSProgress progressWithTotalUnitCount_(int unitCount) { - final _ret = _objc_msgSend_n9eq1n( - _class_NSProgress, _sel_progressWithTotalUnitCount_, unitCount); - return NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// discreteProgressWithTotalUnitCount: - static NSProgress discreteProgressWithTotalUnitCount_(int unitCount) { - final _ret = _objc_msgSend_n9eq1n( - _class_NSProgress, _sel_discreteProgressWithTotalUnitCount_, unitCount); - return NSProgress.castFromPointer(_ret, retain: true, release: true); + static NSURLCache alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLCache, _sel_alloc); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } - /// progressWithTotalUnitCount:parent:pendingUnitCount: - static NSProgress progressWithTotalUnitCount_parent_pendingUnitCount_( - int unitCount, NSProgress parent, int portionOfParentTotalUnitCount) { - final _ret = _objc_msgSend_105mybv( - _class_NSProgress, - _sel_progressWithTotalUnitCount_parent_pendingUnitCount_, - unitCount, - parent.ref.pointer, - portionOfParentTotalUnitCount); - return NSProgress.castFromPointer(_ret, retain: true, release: true); + /// self + NSURLCache self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); } - /// initWithParent:userInfo: - NSProgress initWithParent_userInfo_( - NSProgress? parentProgressOrNil, objc.NSDictionary? userInfoOrNil) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithParent_userInfo_, - parentProgressOrNil?.ref.pointer ?? ffi.nullptr, - userInfoOrNil?.ref.pointer ?? ffi.nullptr); - return NSProgress.castFromPointer(_ret, retain: false, release: true); + /// retain + NSURLCache retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); } - /// becomeCurrentWithPendingUnitCount: - void becomeCurrentWithPendingUnitCount_(int unitCount) { - _objc_msgSend_rrr3q( - this.ref.pointer, _sel_becomeCurrentWithPendingUnitCount_, unitCount); + /// autorelease + NSURLCache autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); } +} - /// performAsCurrentWithPendingUnitCount:usingBlock: - void performAsCurrentWithPendingUnitCount_usingBlock_( - int unitCount, objc.ObjCBlock work) { - _objc_msgSend_19q84do( - this.ref.pointer, - _sel_performAsCurrentWithPendingUnitCount_usingBlock_, - unitCount, - work.ref.pointer); - } +typedef NSNotificationName = ffi.Pointer; +typedef DartNSNotificationName = objc.NSString; +late final _class_NSNotification = objc.getClass("NSNotification"); +late final _sel_notificationWithName_object_ = + objc.registerName("notificationWithName:object:"); +final _objc_msgSend_rsfdlh = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_notificationWithName_object_userInfo_ = + objc.registerName("notificationWithName:object:userInfo:"); +final _objc_msgSend_582s3n = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - /// resignCurrent - void resignCurrent() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_resignCurrent); +/// NSNotificationCreation +extension NSNotificationCreation on objc.NSNotification { + /// notificationWithName:object: + static objc.NSNotification notificationWithName_object_( + DartNSNotificationName aName, objc.ObjCObjectBase? anObject) { + final _ret = _objc_msgSend_rsfdlh( + _class_NSNotification, + _sel_notificationWithName_object_, + aName.ref.pointer, + anObject?.ref.pointer ?? ffi.nullptr); + return objc.NSNotification.castFromPointer(_ret, + retain: true, release: true); } - /// addChild:withPendingUnitCount: - void addChild_withPendingUnitCount_(NSProgress child, int inUnitCount) { - _objc_msgSend_2citz1(this.ref.pointer, _sel_addChild_withPendingUnitCount_, - child.ref.pointer, inUnitCount); + /// notificationWithName:object:userInfo: + static objc.NSNotification notificationWithName_object_userInfo_( + DartNSNotificationName aName, + objc.ObjCObjectBase? anObject, + objc.NSDictionary? aUserInfo) { + final _ret = _objc_msgSend_582s3n( + _class_NSNotification, + _sel_notificationWithName_object_userInfo_, + aName.ref.pointer, + anObject?.ref.pointer ?? ffi.nullptr, + aUserInfo?.ref.pointer ?? ffi.nullptr); + return objc.NSNotification.castFromPointer(_ret, + retain: true, release: true); } - /// totalUnitCount - int get totalUnitCount { - return _objc_msgSend_1voti03(this.ref.pointer, _sel_totalUnitCount); + /// init + objc.NSNotification init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return objc.NSNotification.castFromPointer(_ret, + retain: false, release: true); } +} - /// setTotalUnitCount: - set totalUnitCount(int value) { - return _objc_msgSend_rrr3q( - this.ref.pointer, _sel_setTotalUnitCount_, value); +late final _class_NSDate = objc.getClass("NSDate"); +late final _sel_timeIntervalSinceDate_ = + objc.registerName("timeIntervalSinceDate:"); +final _objc_msgSend_hlyk7w = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_hlyk7wFpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_timeIntervalSinceNow = + objc.registerName("timeIntervalSinceNow"); +late final _sel_timeIntervalSince1970 = + objc.registerName("timeIntervalSince1970"); +late final _sel_addTimeInterval_ = objc.registerName("addTimeInterval:"); +final _objc_msgSend_1x911p2 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, double)>(); +late final _sel_dateByAddingTimeInterval_ = + objc.registerName("dateByAddingTimeInterval:"); +late final _sel_earlierDate_ = objc.registerName("earlierDate:"); +late final _sel_laterDate_ = objc.registerName("laterDate:"); +late final _sel_compare_ = objc.registerName("compare:"); +final _objc_msgSend_1wpduvy = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_isEqualToDate_ = objc.registerName("isEqualToDate:"); +late final _sel_descriptionWithLocale_ = + objc.registerName("descriptionWithLocale:"); +late final _sel_timeIntervalSinceReferenceDate = + objc.registerName("timeIntervalSinceReferenceDate"); + +/// NSExtendedDate +extension NSExtendedDate on objc.NSDate { + /// timeIntervalSinceDate: + DartNSTimeInterval timeIntervalSinceDate_(objc.NSDate anotherDate) { + return objc.useMsgSendVariants + ? _objc_msgSend_hlyk7wFpret(this.ref.pointer, + _sel_timeIntervalSinceDate_, anotherDate.ref.pointer) + : _objc_msgSend_hlyk7w(this.ref.pointer, _sel_timeIntervalSinceDate_, + anotherDate.ref.pointer); } - /// completedUnitCount - int get completedUnitCount { - return _objc_msgSend_1voti03(this.ref.pointer, _sel_completedUnitCount); + /// timeIntervalSinceNow + DartNSTimeInterval get timeIntervalSinceNow { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret( + this.ref.pointer, _sel_timeIntervalSinceNow) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeIntervalSinceNow); } - /// setCompletedUnitCount: - set completedUnitCount(int value) { - return _objc_msgSend_rrr3q( - this.ref.pointer, _sel_setCompletedUnitCount_, value); + /// timeIntervalSince1970 + DartNSTimeInterval get timeIntervalSince1970 { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret( + this.ref.pointer, _sel_timeIntervalSince1970) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeIntervalSince1970); } - /// localizedDescription - objc.NSString get localizedDescription { + /// addTimeInterval: + objc.ObjCObjectBase addTimeInterval_(DartNSTimeInterval seconds) { final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_localizedDescription); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setLocalizedDescription: - set localizedDescription(objc.NSString value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setLocalizedDescription_, value.ref.pointer); - } - - /// localizedAdditionalDescription - objc.NSString get localizedAdditionalDescription { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_localizedAdditionalDescription); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setLocalizedAdditionalDescription: - set localizedAdditionalDescription(objc.NSString value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setLocalizedAdditionalDescription_, value.ref.pointer); + _objc_msgSend_1x911p2(this.ref.pointer, _sel_addTimeInterval_, seconds); + return objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// isCancellable - bool get cancellable { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancellable); + /// dateByAddingTimeInterval: + objc.NSDate dateByAddingTimeInterval_(DartNSTimeInterval ti) { + final _ret = _objc_msgSend_1x911p2( + this.ref.pointer, _sel_dateByAddingTimeInterval_, ti); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// setCancellable: - set cancellable(bool value) { - return _objc_msgSend_117qins(this.ref.pointer, _sel_setCancellable_, value); + /// earlierDate: + objc.NSDate earlierDate_(objc.NSDate anotherDate) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_earlierDate_, anotherDate.ref.pointer); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// isPausable - bool get pausable { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isPausable); + /// laterDate: + objc.NSDate laterDate_(objc.NSDate anotherDate) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_laterDate_, anotherDate.ref.pointer); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// setPausable: - set pausable(bool value) { - return _objc_msgSend_117qins(this.ref.pointer, _sel_setPausable_, value); + /// compare: + objc.NSComparisonResult compare_(objc.NSDate other) { + final _ret = _objc_msgSend_1wpduvy( + this.ref.pointer, _sel_compare_, other.ref.pointer); + return objc.NSComparisonResult.fromValue(_ret); } - /// isCancelled - bool get cancelled { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancelled); + /// isEqualToDate: + bool isEqualToDate_(objc.NSDate otherDate) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_isEqualToDate_, otherDate.ref.pointer); } - /// isPaused - bool get paused { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isPaused); + /// description + objc.NSString get description { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_description); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// cancellationHandler - objc.ObjCBlock? get cancellationHandler { - final _ret = - _objc_msgSend_2osec1(this.ref.pointer, _sel_cancellationHandler); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); + /// descriptionWithLocale: + objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// setCancellationHandler: - set cancellationHandler(objc.ObjCBlock? value) { - return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setCancellationHandler_, - value?.ref.pointer ?? ffi.nullptr); - } + /// timeIntervalSinceReferenceDate + static DartNSTimeInterval getTimeIntervalSinceReferenceDate() { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret( + _class_NSDate, _sel_timeIntervalSinceReferenceDate) + : _objc_msgSend_1ukqyt8( + _class_NSDate, _sel_timeIntervalSinceReferenceDate); + } +} + +late final _sel_date = objc.registerName("date"); +late final _sel_dateWithTimeIntervalSinceNow_ = + objc.registerName("dateWithTimeIntervalSinceNow:"); +late final _sel_dateWithTimeIntervalSinceReferenceDate_ = + objc.registerName("dateWithTimeIntervalSinceReferenceDate:"); +late final _sel_dateWithTimeIntervalSince1970_ = + objc.registerName("dateWithTimeIntervalSince1970:"); +late final _sel_dateWithTimeInterval_sinceDate_ = + objc.registerName("dateWithTimeInterval:sinceDate:"); +final _objc_msgSend_xh7c7e = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer)>(); +late final _sel_distantFuture = objc.registerName("distantFuture"); +late final _sel_distantPast = objc.registerName("distantPast"); +late final _sel_now = objc.registerName("now"); +late final _sel_initWithTimeIntervalSinceNow_ = + objc.registerName("initWithTimeIntervalSinceNow:"); +late final _sel_initWithTimeIntervalSince1970_ = + objc.registerName("initWithTimeIntervalSince1970:"); +late final _sel_initWithTimeInterval_sinceDate_ = + objc.registerName("initWithTimeInterval:sinceDate:"); - /// pausingHandler - objc.ObjCBlock? get pausingHandler { - final _ret = _objc_msgSend_2osec1(this.ref.pointer, _sel_pausingHandler); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); +/// NSDateCreation +extension NSDateCreation on objc.NSDate { + /// date + static objc.NSDate date() { + final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_date); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// setPausingHandler: - set pausingHandler(objc.ObjCBlock? value) { - return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setPausingHandler_, - value?.ref.pointer ?? ffi.nullptr); + /// dateWithTimeIntervalSinceNow: + static objc.NSDate dateWithTimeIntervalSinceNow_(DartNSTimeInterval secs) { + final _ret = _objc_msgSend_1x911p2( + _class_NSDate, _sel_dateWithTimeIntervalSinceNow_, secs); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// resumingHandler - objc.ObjCBlock? get resumingHandler { - final _ret = _objc_msgSend_2osec1(this.ref.pointer, _sel_resumingHandler); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); + /// dateWithTimeIntervalSinceReferenceDate: + static objc.NSDate dateWithTimeIntervalSinceReferenceDate_( + DartNSTimeInterval ti) { + final _ret = _objc_msgSend_1x911p2( + _class_NSDate, _sel_dateWithTimeIntervalSinceReferenceDate_, ti); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// setResumingHandler: - set resumingHandler(objc.ObjCBlock? value) { - return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setResumingHandler_, - value?.ref.pointer ?? ffi.nullptr); + /// dateWithTimeIntervalSince1970: + static objc.NSDate dateWithTimeIntervalSince1970_(DartNSTimeInterval secs) { + final _ret = _objc_msgSend_1x911p2( + _class_NSDate, _sel_dateWithTimeIntervalSince1970_, secs); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// setUserInfoObject:forKey: - void setUserInfoObject_forKey_( - objc.ObjCObjectBase? objectOrNil, DartNSProgressUserInfoKey key) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_setUserInfoObject_forKey_, - objectOrNil?.ref.pointer ?? ffi.nullptr, key.ref.pointer); + /// dateWithTimeInterval:sinceDate: + static objc.NSDate dateWithTimeInterval_sinceDate_( + DartNSTimeInterval secsToBeAdded, objc.NSDate date) { + final _ret = _objc_msgSend_xh7c7e(_class_NSDate, + _sel_dateWithTimeInterval_sinceDate_, secsToBeAdded, date.ref.pointer); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// isIndeterminate - bool get indeterminate { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isIndeterminate); + /// distantFuture + static objc.NSDate getDistantFuture() { + final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_distantFuture); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// fractionCompleted - double get fractionCompleted { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_fractionCompleted); + /// distantPast + static objc.NSDate getDistantPast() { + final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_distantPast); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// isFinished - bool get finished { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isFinished); + /// now + static objc.NSDate getNow() { + final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_now); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// cancel - void cancel() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancel); + /// initWithTimeIntervalSinceNow: + objc.NSDate initWithTimeIntervalSinceNow_(DartNSTimeInterval secs) { + final _ret = _objc_msgSend_1x911p2(this.ref.retainAndReturnPointer(), + _sel_initWithTimeIntervalSinceNow_, secs); + return objc.NSDate.castFromPointer(_ret, retain: false, release: true); } - /// pause - void pause() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_pause); + /// initWithTimeIntervalSince1970: + objc.NSDate initWithTimeIntervalSince1970_(DartNSTimeInterval secs) { + final _ret = _objc_msgSend_1x911p2(this.ref.retainAndReturnPointer(), + _sel_initWithTimeIntervalSince1970_, secs); + return objc.NSDate.castFromPointer(_ret, retain: false, release: true); } - /// resume - void resume() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_resume); + /// initWithTimeInterval:sinceDate: + objc.NSDate initWithTimeInterval_sinceDate_( + DartNSTimeInterval secsToBeAdded, objc.NSDate date) { + final _ret = _objc_msgSend_xh7c7e(this.ref.retainAndReturnPointer(), + _sel_initWithTimeInterval_sinceDate_, secsToBeAdded, date.ref.pointer); + return objc.NSDate.castFromPointer(_ret, retain: false, release: true); } +} - /// userInfo - objc.NSDictionary get userInfo { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_userInfo); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } +late final _class_NSMutableURLRequest = objc.getClass("NSMutableURLRequest"); +late final _sel_setHTTPMethod_ = objc.registerName("setHTTPMethod:"); +late final _sel_setAllHTTPHeaderFields_ = + objc.registerName("setAllHTTPHeaderFields:"); +late final _sel_setValue_forHTTPHeaderField_ = + objc.registerName("setValue:forHTTPHeaderField:"); +late final _sel_addValue_forHTTPHeaderField_ = + objc.registerName("addValue:forHTTPHeaderField:"); +late final _sel_setHTTPBody_ = objc.registerName("setHTTPBody:"); +late final _sel_setHTTPBodyStream_ = objc.registerName("setHTTPBodyStream:"); +late final _sel_setHTTPShouldHandleCookies_ = + objc.registerName("setHTTPShouldHandleCookies:"); +final _objc_msgSend_1s56lr9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, bool)>(); +late final _sel_setHTTPShouldUsePipelining_ = + objc.registerName("setHTTPShouldUsePipelining:"); - /// kind - DartNSProgressKind get kind { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_kind); +/// ! +/// @category NSMutableURLRequest(NSMutableHTTPURLRequest) +/// The NSMutableHTTPURLRequest on NSMutableURLRequest provides methods +/// for configuring information specific to HTTP protocol requests. +extension NSMutableHTTPURLRequest on NSMutableURLRequest { + /// ! + /// @abstract Sets the HTTP request method of the receiver. + objc.NSString get HTTPMethod { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPMethod); return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// setKind: - set kind(DartNSProgressKind value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setKind_, value.ref.pointer); + /// ! + /// @abstract Sets the HTTP request method of the receiver. + set HTTPMethod(objc.NSString value) { + return _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setHTTPMethod_, value.ref.pointer); } - /// estimatedTimeRemaining - objc.NSNumber? get estimatedTimeRemaining { + /// ! + /// @abstract Sets the HTTP header fields of the receiver to the given + /// dictionary. + /// @discussion This method replaces all header fields that may have + /// existed before this method call. + ///

Since HTTP header fields must be string values, each object and + /// key in the dictionary passed to this method must answer YES when + /// sent an -isKindOfClass:[NSString class] message. If either + /// the key or value for a key-value pair answers NO when sent this + /// message, the key-value pair is skipped. + objc.NSDictionary? get allHTTPHeaderFields { final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_estimatedTimeRemaining); - return _ret.address == 0 - ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// setEstimatedTimeRemaining: - set estimatedTimeRemaining(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setEstimatedTimeRemaining_, value?.ref.pointer ?? ffi.nullptr); - } - - /// throughput - objc.NSNumber? get throughput { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_throughput); + _objc_msgSend_1x359cv(this.ref.pointer, _sel_allHTTPHeaderFields); return _ret.address == 0 ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// setThroughput: - set throughput(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setThroughput_, + /// ! + /// @abstract Sets the HTTP header fields of the receiver to the given + /// dictionary. + /// @discussion This method replaces all header fields that may have + /// existed before this method call. + ///

Since HTTP header fields must be string values, each object and + /// key in the dictionary passed to this method must answer YES when + /// sent an -isKindOfClass:[NSString class] message. If either + /// the key or value for a key-value pair answers NO when sent this + /// message, the key-value pair is skipped. + set allHTTPHeaderFields(objc.NSDictionary? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setAllHTTPHeaderFields_, value?.ref.pointer ?? ffi.nullptr); } - /// fileOperationKind - DartNSProgressFileOperationKind get fileOperationKind { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileOperationKind); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setFileOperationKind: - set fileOperationKind(DartNSProgressFileOperationKind value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setFileOperationKind_, value.ref.pointer); - } - - /// fileURL - objc.NSURL? get fileURL { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileURL); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + /// ! + /// @method setValue:forHTTPHeaderField: + /// @abstract Sets the value of the given HTTP header field. + /// @discussion If a value was previously set for the given header + /// field, that value is replaced with the given value. Note that, in + /// keeping with the HTTP RFC, HTTP header field names are + /// case-insensitive. + /// @param value the header field value. + /// @param field the header field name (case-insensitive). + void setValue_forHTTPHeaderField_(objc.NSString? value, objc.NSString field) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_setValue_forHTTPHeaderField_, + value?.ref.pointer ?? ffi.nullptr, field.ref.pointer); } - /// setFileURL: - set fileURL(objc.NSURL? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setFileURL_, value?.ref.pointer ?? ffi.nullptr); + /// ! + /// @method addValue:forHTTPHeaderField: + /// @abstract Adds an HTTP header field in the current header + /// dictionary. + /// @discussion This method provides a way to add values to header + /// fields incrementally. If a value was previously set for the given + /// header field, the given value is appended to the previously-existing + /// value. The appropriate field delimiter, a comma in the case of HTTP, + /// is added by the implementation, and should not be added to the given + /// value by the caller. Note that, in keeping with the HTTP RFC, HTTP + /// header field names are case-insensitive. + /// @param value the header field value. + /// @param field the header field name (case-insensitive). + void addValue_forHTTPHeaderField_(objc.NSString value, objc.NSString field) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_addValue_forHTTPHeaderField_, + value.ref.pointer, field.ref.pointer); } - /// fileTotalCount - objc.NSNumber? get fileTotalCount { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileTotalCount); + /// ! + /// @abstract Sets the request body data of the receiver. + /// @discussion This data is sent as the message body of the request, as + /// in done in an HTTP POST request. + objc.NSData? get HTTPBody { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBody); return _ret.address == 0 ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + : objc.NSData.castFromPointer(_ret, retain: true, release: true); } - /// setFileTotalCount: - set fileTotalCount(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setFileTotalCount_, - value?.ref.pointer ?? ffi.nullptr); + /// ! + /// @abstract Sets the request body data of the receiver. + /// @discussion This data is sent as the message body of the request, as + /// in done in an HTTP POST request. + set HTTPBody(objc.NSData? value) { + return _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setHTTPBody_, value?.ref.pointer ?? ffi.nullptr); } - /// fileCompletedCount - objc.NSNumber? get fileCompletedCount { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileCompletedCount); + /// ! + /// @abstract Sets the request body to be the contents of the given stream. + /// @discussion The provided stream should be unopened; the request will take + /// over the stream's delegate. The entire stream's contents will be + /// transmitted as the HTTP body of the request. Note that the body stream + /// and the body data (set by setHTTPBody:, above) are mutually exclusive + /// - setting one will clear the other. + objc.NSInputStream? get HTTPBodyStream { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBodyStream); return _ret.address == 0 ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + : objc.NSInputStream.castFromPointer(_ret, retain: true, release: true); } - /// setFileCompletedCount: - set fileCompletedCount(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setFileCompletedCount_, + /// ! + /// @abstract Sets the request body to be the contents of the given stream. + /// @discussion The provided stream should be unopened; the request will take + /// over the stream's delegate. The entire stream's contents will be + /// transmitted as the HTTP body of the request. Note that the body stream + /// and the body data (set by setHTTPBody:, above) are mutually exclusive + /// - setting one will clear the other. + set HTTPBodyStream(objc.NSInputStream? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setHTTPBodyStream_, value?.ref.pointer ?? ffi.nullptr); } - /// publish - void publish() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_publish); - } - - /// unpublish - void unpublish() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_unpublish); - } - - /// addSubscriberForFileURL:withPublishingHandler: - static objc.ObjCObjectBase addSubscriberForFileURL_withPublishingHandler_( - objc.NSURL url, DartNSProgressPublishingHandler publishingHandler) { - final _ret = _objc_msgSend_1kkhn3j( - _class_NSProgress, - _sel_addSubscriberForFileURL_withPublishingHandler_, - url.ref.pointer, - publishingHandler.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// removeSubscriber: - static void removeSubscriber_(objc.ObjCObjectBase subscriber) { - _objc_msgSend_ukcdfq( - _class_NSProgress, _sel_removeSubscriber_, subscriber.ref.pointer); - } - - /// isOld - bool get old { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isOld); - } - - /// init - NSProgress init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSProgress.castFromPointer(_ret, retain: false, release: true); + /// ! + /// @abstract Decide whether default cookie handling will happen for + /// this request (YES if cookies should be sent with and set for this request; + /// otherwise NO). + /// @discussion The default is YES - in other words, cookies are sent from and + /// stored to the cookie manager by default. + /// NOTE: In releases prior to 10.3, this value is ignored + bool get HTTPShouldHandleCookies { + return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldHandleCookies); } - /// new - static NSProgress new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_new); - return NSProgress.castFromPointer(_ret, retain: false, release: true); + /// ! + /// @abstract Decide whether default cookie handling will happen for + /// this request (YES if cookies should be sent with and set for this request; + /// otherwise NO). + /// @discussion The default is YES - in other words, cookies are sent from and + /// stored to the cookie manager by default. + /// NOTE: In releases prior to 10.3, this value is ignored + set HTTPShouldHandleCookies(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setHTTPShouldHandleCookies_, value); } - /// allocWithZone: - static NSProgress allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSProgress, _sel_allocWithZone_, zone); - return NSProgress.castFromPointer(_ret, retain: false, release: true); + /// ! + /// @abstract Sets whether the request should not wait for the previous response + /// before transmitting (YES if the receiver should transmit before the previous response is + /// received. NO to wait for the previous response before transmitting) + /// @discussion Calling this method with a YES value does not guarantee HTTP + /// pipelining behavior. This method may have no effect if an HTTP proxy is + /// configured, or if the HTTP request uses an unsafe request method (e.g., POST + /// requests will not pipeline). Pipelining behavior also may not begin until + /// the second request on a given TCP connection. There may be other situations + /// where pipelining does not occur even though YES was set. + /// HTTP 1.1 allows the client to send multiple requests to the server without + /// waiting for a response. Though HTTP 1.1 requires support for pipelining, + /// some servers report themselves as being HTTP 1.1 but do not support + /// pipelining (disconnecting, sending resources misordered, omitting part of + /// a resource, etc.). + bool get HTTPShouldUsePipelining { + return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); } - /// alloc - static NSProgress alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_alloc); - return NSProgress.castFromPointer(_ret, retain: false, release: true); + /// ! + /// @abstract Sets whether the request should not wait for the previous response + /// before transmitting (YES if the receiver should transmit before the previous response is + /// received. NO to wait for the previous response before transmitting) + /// @discussion Calling this method with a YES value does not guarantee HTTP + /// pipelining behavior. This method may have no effect if an HTTP proxy is + /// configured, or if the HTTP request uses an unsafe request method (e.g., POST + /// requests will not pipeline). Pipelining behavior also may not begin until + /// the second request on a given TCP connection. There may be other situations + /// where pipelining does not occur even though YES was set. + /// HTTP 1.1 allows the client to send multiple requests to the server without + /// waiting for a response. Though HTTP 1.1 requires support for pipelining, + /// some servers report themselves as being HTTP 1.1 but do not support + /// pipelining (disconnecting, sending resources misordered, omitting part of + /// a resource, etc.). + set HTTPShouldUsePipelining(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setHTTPShouldUsePipelining_, value); } } -late final _class_NSProgress = objc.getClass("NSProgress"); -late final _sel_currentProgress = objc.registerName("currentProgress"); -late final _sel_progressWithTotalUnitCount_ = - objc.registerName("progressWithTotalUnitCount:"); -final _objc_msgSend_n9eq1n = objc.msgSendPointer +late final _sel_setURL_ = objc.registerName("setURL:"); +late final _sel_setCachePolicy_ = objc.registerName("setCachePolicy:"); +final _objc_msgSend_1yjxuv2 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int64)>>() + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>() .asFunction< - ffi.Pointer Function(ffi.Pointer, + void Function(ffi.Pointer, ffi.Pointer, int)>(); -late final _sel_discreteProgressWithTotalUnitCount_ = - objc.registerName("discreteProgressWithTotalUnitCount:"); -late final _sel_progressWithTotalUnitCount_parent_pendingUnitCount_ = - objc.registerName("progressWithTotalUnitCount:parent:pendingUnitCount:"); -final _objc_msgSend_105mybv = objc.msgSendPointer +late final _sel_setTimeoutInterval_ = objc.registerName("setTimeoutInterval:"); +final _objc_msgSend_hwm8nu = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ffi.Int64)>>() + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>() .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - int)>(); -late final _sel_initWithParent_userInfo_ = - objc.registerName("initWithParent:userInfo:"); -late final _sel_becomeCurrentWithPendingUnitCount_ = - objc.registerName("becomeCurrentWithPendingUnitCount:"); -final _objc_msgSend_rrr3q = objc.msgSendPointer + void Function(ffi.Pointer, + ffi.Pointer, double)>(); +late final _sel_setMainDocumentURL_ = objc.registerName("setMainDocumentURL:"); +late final _sel_setNetworkServiceType_ = + objc.registerName("setNetworkServiceType:"); +final _objc_msgSend_1mse4s1 = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Int64)>>() + ffi.Pointer, NSUInteger)>>() .asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); -late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_ = - objc.registerName("performAsCurrentWithPendingUnitCount:usingBlock:"); -final _objc_msgSend_19q84do = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_resignCurrent = objc.registerName("resignCurrent"); -late final _sel_addChild_withPendingUnitCount_ = - objc.registerName("addChild:withPendingUnitCount:"); -final _objc_msgSend_2citz1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_totalUnitCount = objc.registerName("totalUnitCount"); -final _objc_msgSend_1voti03 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Int64 Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setTotalUnitCount_ = objc.registerName("setTotalUnitCount:"); -late final _sel_completedUnitCount = objc.registerName("completedUnitCount"); -late final _sel_setCompletedUnitCount_ = - objc.registerName("setCompletedUnitCount:"); -late final _sel_localizedDescription = - objc.registerName("localizedDescription"); -late final _sel_setLocalizedDescription_ = - objc.registerName("setLocalizedDescription:"); -late final _sel_localizedAdditionalDescription = - objc.registerName("localizedAdditionalDescription"); -late final _sel_setLocalizedAdditionalDescription_ = - objc.registerName("setLocalizedAdditionalDescription:"); -late final _sel_isCancellable = objc.registerName("isCancellable"); -late final _sel_setCancellable_ = objc.registerName("setCancellable:"); -final _objc_msgSend_117qins = objc.msgSendPointer +late final _sel_setAllowsCellularAccess_ = + objc.registerName("setAllowsCellularAccess:"); +late final _sel_setAllowsExpensiveNetworkAccess_ = + objc.registerName("setAllowsExpensiveNetworkAccess:"); +late final _sel_setAllowsConstrainedNetworkAccess_ = + objc.registerName("setAllowsConstrainedNetworkAccess:"); +late final _sel_setAssumesHTTP3Capable_ = + objc.registerName("setAssumesHTTP3Capable:"); +late final _sel_setAttribution_ = objc.registerName("setAttribution:"); +final _objc_msgSend_1nw1jep = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, bool)>(); -late final _sel_isPausable = objc.registerName("isPausable"); -late final _sel_setPausable_ = objc.registerName("setPausable:"); -late final _sel_isCancelled = objc.registerName("isCancelled"); -late final _sel_isPaused = objc.registerName("isPaused"); -late final _sel_cancellationHandler = objc.registerName("cancellationHandler"); -final _objc_msgSend_2osec1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setCancellationHandler_ = - objc.registerName("setCancellationHandler:"); -final _objc_msgSend_4daxhl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() + ffi.Pointer, NSUInteger)>>() .asFunction< void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_pausingHandler = objc.registerName("pausingHandler"); -late final _sel_setPausingHandler_ = objc.registerName("setPausingHandler:"); -late final _sel_resumingHandler = objc.registerName("resumingHandler"); -late final _sel_setResumingHandler_ = objc.registerName("setResumingHandler:"); -typedef NSProgressUserInfoKey = ffi.Pointer; -typedef DartNSProgressUserInfoKey = objc.NSString; -late final _sel_setUserInfoObject_forKey_ = - objc.registerName("setUserInfoObject:forKey:"); -late final _sel_isIndeterminate = objc.registerName("isIndeterminate"); -late final _sel_fractionCompleted = objc.registerName("fractionCompleted"); -late final _sel_isFinished = objc.registerName("isFinished"); -late final _sel_cancel = objc.registerName("cancel"); -late final _sel_pause = objc.registerName("pause"); -late final _sel_resume = objc.registerName("resume"); -typedef NSProgressKind = ffi.Pointer; -typedef DartNSProgressKind = objc.NSString; -late final _sel_kind = objc.registerName("kind"); -late final _sel_setKind_ = objc.registerName("setKind:"); -late final _sel_estimatedTimeRemaining = - objc.registerName("estimatedTimeRemaining"); -late final _sel_setEstimatedTimeRemaining_ = - objc.registerName("setEstimatedTimeRemaining:"); -late final _sel_throughput = objc.registerName("throughput"); -late final _sel_setThroughput_ = objc.registerName("setThroughput:"); -typedef NSProgressFileOperationKind = ffi.Pointer; -typedef DartNSProgressFileOperationKind = objc.NSString; -late final _sel_fileOperationKind = objc.registerName("fileOperationKind"); -late final _sel_setFileOperationKind_ = - objc.registerName("setFileOperationKind:"); -late final _sel_fileURL = objc.registerName("fileURL"); -late final _sel_setFileURL_ = objc.registerName("setFileURL:"); -late final _sel_fileTotalCount = objc.registerName("fileTotalCount"); -late final _sel_setFileTotalCount_ = objc.registerName("setFileTotalCount:"); -late final _sel_fileCompletedCount = objc.registerName("fileCompletedCount"); -late final _sel_setFileCompletedCount_ = - objc.registerName("setFileCompletedCount:"); -late final _sel_publish = objc.registerName("publish"); -late final _sel_unpublish = objc.registerName("unpublish"); -typedef NSProgressPublishingHandler = ffi.Pointer; -typedef DartNSProgressPublishingHandler - = objc.ObjCBlock Function(NSProgress)>; -NSProgressUnpublishingHandler - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer arg0)>>() - .asFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer)>()(arg0); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable = - ffi.Pointer.fromFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline) - .cast(); -NSProgressUnpublishingHandler - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as NSProgressUnpublishingHandler Function( - ffi.Pointer))(arg0); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable = - ffi.Pointer.fromFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock Function(NSProgress)>`. -abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - objc.ObjCBlock Function(NSProgress)> castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock Function(NSProgress)>( - pointer, - retain: retain, - release: release); + ffi.Pointer, int)>(); +late final _sel_setRequiresDNSSECValidation_ = + objc.registerName("setRequiresDNSSECValidation:"); - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(NSProgress)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock Function(NSProgress)>( - objc.newPointerBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +/// ! +/// @class NSMutableURLRequest +/// +/// @abstract An NSMutableURLRequest object represents a mutable URL load +/// request in a manner independent of protocol and URL scheme. +/// +/// @discussion This specialization of NSURLRequest is provided to aid +/// developers who may find it more convenient to mutate a single request +/// object for a series of URL loads instead of creating an immutable +/// NSURLRequest for each load. This programming model is supported by +/// the following contract stipulation between NSMutableURLRequest and +/// NSURLConnection: NSURLConnection makes a deep copy of each +/// NSMutableURLRequest object passed to one of its initializers. +///

NSMutableURLRequest is designed to be extended to support +/// protocol-specific data by adding categories to access a property +/// object provided in an interface targeted at protocol implementors. +///

    +///
  • Protocol implementors should direct their attention to the +/// NSMutableURLRequestExtensibility category on +/// NSMutableURLRequest for more information on how to provide +/// extensions on NSMutableURLRequest to support protocol-specific +/// request information. +///
  • Clients of this API who wish to create NSMutableURLRequest +/// objects to load URL content should consult the protocol-specific +/// NSMutableURLRequest categories that are available. The +/// NSMutableHTTPURLRequest category on NSMutableURLRequest is an +/// example. +///
+class NSMutableURLRequest extends NSURLRequest { + NSMutableURLRequest._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - objc.ObjCBlock Function(NSProgress)> fromFunction( - DartNSProgressUnpublishingHandler Function(NSProgress) fn) => - objc.ObjCBlock Function(NSProgress)>( - objc.newClosureBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable, - (ffi.Pointer arg0) => - fn(NSProgress.castFromPointer(arg0, retain: true, release: true)) - .ref - .retainAndAutorelease()), - retain: false, - release: true); -} + /// Constructs a [NSMutableURLRequest] that points to the same underlying object as [other]. + NSMutableURLRequest.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); -/// Call operator for `objc.ObjCBlock Function(NSProgress)>`. -extension ObjCBlock_NSProgressUnpublishingHandler_NSProgress_CallExtension - on objc - .ObjCBlock Function(NSProgress)> { - DartNSProgressUnpublishingHandler call(NSProgress arg0) => - ObjCBlock_ffiVoid.castFromPointer( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer), - retain: true, - release: true); -} + /// Constructs a [NSMutableURLRequest] that wraps the given raw object pointer. + NSMutableURLRequest.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); -typedef NSProgressUnpublishingHandler = ffi.Pointer; -typedef DartNSProgressUnpublishingHandler = objc.ObjCBlock; -late final _sel_addSubscriberForFileURL_withPublishingHandler_ = - objc.registerName("addSubscriberForFileURL:withPublishingHandler:"); -final _objc_msgSend_1kkhn3j = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSProgressPublishingHandler)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSProgressPublishingHandler)>(); -late final _sel_removeSubscriber_ = objc.registerName("removeSubscriber:"); -late final _sel_isOld = objc.registerName("isOld"); -late final _sel_progress = objc.registerName("progress"); -late final _sel_earliestBeginDate = objc.registerName("earliestBeginDate"); -late final _sel_setEarliestBeginDate_ = - objc.registerName("setEarliestBeginDate:"); -late final _sel_countOfBytesClientExpectsToSend = - objc.registerName("countOfBytesClientExpectsToSend"); -late final _sel_setCountOfBytesClientExpectsToSend_ = - objc.registerName("setCountOfBytesClientExpectsToSend:"); -late final _sel_countOfBytesClientExpectsToReceive = - objc.registerName("countOfBytesClientExpectsToReceive"); -late final _sel_setCountOfBytesClientExpectsToReceive_ = - objc.registerName("setCountOfBytesClientExpectsToReceive:"); -late final _sel_countOfBytesSent = objc.registerName("countOfBytesSent"); -late final _sel_countOfBytesReceived = - objc.registerName("countOfBytesReceived"); -late final _sel_countOfBytesExpectedToSend = - objc.registerName("countOfBytesExpectedToSend"); -late final _sel_countOfBytesExpectedToReceive = - objc.registerName("countOfBytesExpectedToReceive"); -late final _sel_taskDescription = objc.registerName("taskDescription"); -late final _sel_setTaskDescription_ = objc.registerName("setTaskDescription:"); + /// Returns whether [obj] is an instance of [NSMutableURLRequest]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSMutableURLRequest); + } -enum NSURLSessionTaskState { - /// The task is currently being serviced by the session - NSURLSessionTaskStateRunning(0), - NSURLSessionTaskStateSuspended(1), + /// ! + /// @abstract The URL of the receiver. + objc.NSURL? get URL { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_URL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } - /// The task has been told to cancel. The session will receive a URLSession:task:didCompleteWithError: message. - NSURLSessionTaskStateCanceling(2), + /// ! + /// @abstract The URL of the receiver. + set URL(objc.NSURL? value) { + return _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setURL_, value?.ref.pointer ?? ffi.nullptr); + } - /// The task has completed and the session will receive no more delegate notifications - NSURLSessionTaskStateCompleted(3); + /// ! + /// @abstract The cache policy of the receiver. + NSURLRequestCachePolicy get cachePolicy { + final _ret = _objc_msgSend_8jm3uo(this.ref.pointer, _sel_cachePolicy); + return NSURLRequestCachePolicy.fromValue(_ret); + } - final int value; - const NSURLSessionTaskState(this.value); + /// ! + /// @abstract The cache policy of the receiver. + set cachePolicy(NSURLRequestCachePolicy value) { + return _objc_msgSend_1yjxuv2( + this.ref.pointer, _sel_setCachePolicy_, value.value); + } - static NSURLSessionTaskState fromValue(int value) => switch (value) { - 0 => NSURLSessionTaskStateRunning, - 1 => NSURLSessionTaskStateSuspended, - 2 => NSURLSessionTaskStateCanceling, - 3 => NSURLSessionTaskStateCompleted, - _ => throw ArgumentError( - "Unknown value for NSURLSessionTaskState: $value"), - }; -} + /// ! + /// @abstract Sets the timeout interval of the receiver. + /// @discussion The timeout interval specifies the limit on the idle + /// interval allotted to a request in the process of loading. The "idle + /// interval" is defined as the period of time that has passed since the + /// last instance of load activity occurred for a request that is in the + /// process of loading. Hence, when an instance of load activity occurs + /// (e.g. bytes are received from the network for a request), the idle + /// interval for a request is reset to 0. If the idle interval ever + /// becomes greater than or equal to the timeout interval, the request + /// is considered to have timed out. This timeout interval is measured + /// in seconds. + DartNSTimeInterval get timeoutInterval { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_timeoutInterval) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeoutInterval); + } -late final _sel_state = objc.registerName("state"); -final _objc_msgSend_8b7yc1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_error = objc.registerName("error"); -late final _sel_suspend = objc.registerName("suspend"); -late final _sel_priority = objc.registerName("priority"); -final _objc_msgSend_fcilgx = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function( - ffi.Pointer, ffi.Pointer)>(); -final _objc_msgSend_fcilgxFpret = objc.msgSendFpretPointer - .cast< - ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setPriority_ = objc.registerName("setPriority:"); -final _objc_msgSend_s9gjzc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, double)>(); -late final _sel_prefersIncrementalDelivery = - objc.registerName("prefersIncrementalDelivery"); -late final _sel_setPrefersIncrementalDelivery_ = - objc.registerName("setPrefersIncrementalDelivery:"); + /// ! + /// @abstract Sets the timeout interval of the receiver. + /// @discussion The timeout interval specifies the limit on the idle + /// interval allotted to a request in the process of loading. The "idle + /// interval" is defined as the period of time that has passed since the + /// last instance of load activity occurred for a request that is in the + /// process of loading. Hence, when an instance of load activity occurs + /// (e.g. bytes are received from the network for a request), the idle + /// interval for a request is reset to 0. If the idle interval ever + /// becomes greater than or equal to the timeout interval, the request + /// is considered to have timed out. This timeout interval is measured + /// in seconds. + set timeoutInterval(DartNSTimeInterval value) { + return _objc_msgSend_hwm8nu( + this.ref.pointer, _sel_setTimeoutInterval_, value); + } -/// NSProgressReporting -abstract final class NSProgressReporting { - /// Builds an object that implements the NSProgressReporting protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required NSProgress Function() progress}) { - final builder = objc.ObjCProtocolBuilder(); - NSProgressReporting.progress.implement(builder, progress); - return builder.build(); + /// ! + /// @abstract Sets the main document URL + /// @discussion The caller should pass the URL for an appropriate main + /// document, if known. For example, when loading a web page, the URL + /// of the main html document for the top-level frame should be + /// passed. This main document is used to implement the cookie "only + /// from same domain as main document" policy, attributing this request + /// as a sub-resource of a user-specified URL, and possibly other things + /// in the future. + objc.NSURL? get mainDocumentURL { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_mainDocumentURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); } - /// Adds the implementation of the NSProgressReporting protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required NSProgress Function() progress}) { - NSProgressReporting.progress.implement(builder, progress); + /// ! + /// @abstract Sets the main document URL + /// @discussion The caller should pass the URL for an appropriate main + /// document, if known. For example, when loading a web page, the URL + /// of the main html document for the top-level frame should be + /// passed. This main document is used to implement the cookie "only + /// from same domain as main document" policy, attributing this request + /// as a sub-resource of a user-specified URL, and possibly other things + /// in the future. + set mainDocumentURL(objc.NSURL? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setMainDocumentURL_, + value?.ref.pointer ?? ffi.nullptr); } - /// progress - static final progress = objc.ObjCProtocolMethod( - _sel_progress, - objc.getProtocolMethodSignature( - _protocol_NSProgressReporting, - _sel_progress, - isRequired: true, - isInstanceMethod: true, - ), - (NSProgress Function() func) => ObjCBlock_NSProgress_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); -} + /// ! + /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request + /// @discussion This method is used to provide the network layers with a hint as to the purpose + /// of the request. Most clients should not need to use this method. + NSURLRequestNetworkServiceType get networkServiceType { + final _ret = + _objc_msgSend_t4uaw1(this.ref.pointer, _sel_networkServiceType); + return NSURLRequestNetworkServiceType.fromValue(_ret); + } -late final _protocol_NSProgressReporting = - objc.getProtocol("NSProgressReporting"); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSProgress_ffiVoid_closureTrampoline) - .cast(); + /// ! + /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request + /// @discussion This method is used to provide the network layers with a hint as to the purpose + /// of the request. Most clients should not need to use this method. + set networkServiceType(NSURLRequestNetworkServiceType value) { + return _objc_msgSend_1mse4s1( + this.ref.pointer, _sel_setNetworkServiceType_, value.value); + } -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_NSProgress_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock)>(pointer, - retain: retain, release: release); + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// the built in cellular radios (if present). + /// @discussion NO if the receiver should not be allowed to use the built in + /// cellular radios to satisfy the request, YES otherwise. The default is YES. + bool get allowsCellularAccess { + return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// the built in cellular radios (if present). + /// @discussion NO if the receiver should not be allowed to use the built in + /// cellular radios to satisfy the request, YES otherwise. The default is YES. + set allowsCellularAccess(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setAllowsCellularAccess_, value); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(NSProgress Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_NSProgress_ffiVoid_closureCallable, - (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_NSProgress_ffiVoid_CallExtension - on objc.ObjCBlock)> { - NSProgress call(ffi.Pointer arg0) => NSProgress.castFromPointer( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0), - retain: true, - release: true); -} - -late final _sel_storeCachedResponse_forDataTask_ = - objc.registerName("storeCachedResponse:forDataTask:"); -void _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable = ffi - .NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(NSCachedURLResponse?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable, - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSCachedURLResponse.castFromPointer(arg0, - retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(NSCachedURLResponse?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSCachedURLResponse.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_ukcdfq(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSCachedURLResponse_CallExtension - on objc.ObjCBlock { - void call(NSCachedURLResponse? arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_getCachedResponseForDataTask_completionHandler_ = - objc.registerName("getCachedResponseForDataTask:completionHandler:"); -final _objc_msgSend_cmbt6k = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_removeCachedResponseForDataTask_ = - objc.registerName("removeCachedResponseForDataTask:"); -typedef NSNotificationName = ffi.Pointer; -typedef DartNSNotificationName = objc.NSString; - -/// ! -/// @class NSMutableURLRequest -/// -/// @abstract An NSMutableURLRequest object represents a mutable URL load -/// request in a manner independent of protocol and URL scheme. -/// -/// @discussion This specialization of NSURLRequest is provided to aid -/// developers who may find it more convenient to mutate a single request -/// object for a series of URL loads instead of creating an immutable -/// NSURLRequest for each load. This programming model is supported by -/// the following contract stipulation between NSMutableURLRequest and -/// NSURLConnection: NSURLConnection makes a deep copy of each -/// NSMutableURLRequest object passed to one of its initializers. -///

NSMutableURLRequest is designed to be extended to support -/// protocol-specific data by adding categories to access a property -/// object provided in an interface targeted at protocol implementors. -///

    -///
  • Protocol implementors should direct their attention to the -/// NSMutableURLRequestExtensibility category on -/// NSMutableURLRequest for more information on how to provide -/// extensions on NSMutableURLRequest to support protocol-specific -/// request information. -///
  • Clients of this API who wish to create NSMutableURLRequest -/// objects to load URL content should consult the protocol-specific -/// NSMutableURLRequest categories that are available. The -/// NSMutableHTTPURLRequest category on NSMutableURLRequest is an -/// example. -///
-class NSMutableURLRequest extends NSURLRequest { - NSMutableURLRequest._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSMutableURLRequest] that points to the same underlying object as [other]. - NSMutableURLRequest.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSMutableURLRequest] that wraps the given raw object pointer. - NSMutableURLRequest.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSMutableURLRequest]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSMutableURLRequest); - } - - /// ! - /// @abstract The URL of the receiver. - objc.NSURL? get URL { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_URL); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract The URL of the receiver. - set URL(objc.NSURL? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setURL_, value?.ref.pointer ?? ffi.nullptr); - } - - /// ! - /// @abstract The cache policy of the receiver. - NSURLRequestCachePolicy get cachePolicy { - final _ret = _objc_msgSend_2xak1q(this.ref.pointer, _sel_cachePolicy); - return NSURLRequestCachePolicy.fromValue(_ret); - } - - /// ! - /// @abstract The cache policy of the receiver. - set cachePolicy(NSURLRequestCachePolicy value) { - return _objc_msgSend_12vaadl( - this.ref.pointer, _sel_setCachePolicy_, value.value); - } - - /// ! - /// @abstract Sets the timeout interval of the receiver. - /// @discussion The timeout interval specifies the limit on the idle - /// interval allotted to a request in the process of loading. The "idle - /// interval" is defined as the period of time that has passed since the - /// last instance of load activity occurred for a request that is in the - /// process of loading. Hence, when an instance of load activity occurs - /// (e.g. bytes are received from the network for a request), the idle - /// interval for a request is reset to 0. If the idle interval ever - /// becomes greater than or equal to the timeout interval, the request - /// is considered to have timed out. This timeout interval is measured - /// in seconds. - DartNSTimeInterval get timeoutInterval { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_timeoutInterval); - } - - /// ! - /// @abstract Sets the timeout interval of the receiver. - /// @discussion The timeout interval specifies the limit on the idle - /// interval allotted to a request in the process of loading. The "idle - /// interval" is defined as the period of time that has passed since the - /// last instance of load activity occurred for a request that is in the - /// process of loading. Hence, when an instance of load activity occurs - /// (e.g. bytes are received from the network for a request), the idle - /// interval for a request is reset to 0. If the idle interval ever - /// becomes greater than or equal to the timeout interval, the request - /// is considered to have timed out. This timeout interval is measured - /// in seconds. - set timeoutInterval(DartNSTimeInterval value) { - return _objc_msgSend_suh039( - this.ref.pointer, _sel_setTimeoutInterval_, value); - } - - /// ! - /// @abstract Sets the main document URL - /// @discussion The caller should pass the URL for an appropriate main - /// document, if known. For example, when loading a web page, the URL - /// of the main html document for the top-level frame should be - /// passed. This main document is used to implement the cookie "only - /// from same domain as main document" policy, attributing this request - /// as a sub-resource of a user-specified URL, and possibly other things - /// in the future. - objc.NSURL? get mainDocumentURL { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_mainDocumentURL); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Sets the main document URL - /// @discussion The caller should pass the URL for an appropriate main - /// document, if known. For example, when loading a web page, the URL - /// of the main html document for the top-level frame should be - /// passed. This main document is used to implement the cookie "only - /// from same domain as main document" policy, attributing this request - /// as a sub-resource of a user-specified URL, and possibly other things - /// in the future. - set mainDocumentURL(objc.NSURL? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setMainDocumentURL_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// ! - /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request - /// @discussion This method is used to provide the network layers with a hint as to the purpose - /// of the request. Most clients should not need to use this method. - NSURLRequestNetworkServiceType get networkServiceType { - final _ret = - _objc_msgSend_ttt73t(this.ref.pointer, _sel_networkServiceType); - return NSURLRequestNetworkServiceType.fromValue(_ret); - } - - /// ! - /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request - /// @discussion This method is used to provide the network layers with a hint as to the purpose - /// of the request. Most clients should not need to use this method. - set networkServiceType(NSURLRequestNetworkServiceType value) { - return _objc_msgSend_br89tg( - this.ref.pointer, _sel_setNetworkServiceType_, value.value); - } - - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// the built in cellular radios (if present). - /// @discussion NO if the receiver should not be allowed to use the built in - /// cellular radios to satisfy the request, YES otherwise. The default is YES. - bool get allowsCellularAccess { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_allowsCellularAccess); - } - - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// the built in cellular radios (if present). - /// @discussion NO if the receiver should not be allowed to use the built in - /// cellular radios to satisfy the request, YES otherwise. The default is YES. - set allowsCellularAccess(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setAllowsCellularAccess_, value); - } - - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as expensive. - /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to - /// satisfy the request, YES otherwise. - bool get allowsExpensiveNetworkAccess { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_allowsExpensiveNetworkAccess); - } + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// network interfaces which have been marked as expensive. + /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to + /// satisfy the request, YES otherwise. + bool get allowsExpensiveNetworkAccess { + return _objc_msgSend_91o635( + this.ref.pointer, _sel_allowsExpensiveNetworkAccess); + } /// ! /// @abstract sets whether a connection created with this request is allowed to use @@ -47931,7 +47726,7 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to /// satisfy the request, YES otherwise. set allowsExpensiveNetworkAccess(bool value) { - return _objc_msgSend_117qins( + return _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAllowsExpensiveNetworkAccess_, value); } @@ -47941,7 +47736,7 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to /// satisfy the request, YES otherwise. bool get allowsConstrainedNetworkAccess { - return _objc_msgSend_olxnu1( + return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsConstrainedNetworkAccess); } @@ -47951,7 +47746,7 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to /// satisfy the request, YES otherwise. set allowsConstrainedNetworkAccess(bool value) { - return _objc_msgSend_117qins( + return _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAllowsConstrainedNetworkAccess_, value); } @@ -47961,7 +47756,7 @@ class NSMutableURLRequest extends NSURLRequest { /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. /// The default may be YES in a future OS update. bool get assumesHTTP3Capable { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_assumesHTTP3Capable); + return _objc_msgSend_91o635(this.ref.pointer, _sel_assumesHTTP3Capable); } /// ! @@ -47970,7 +47765,7 @@ class NSMutableURLRequest extends NSURLRequest { /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. /// The default may be YES in a future OS update. set assumesHTTP3Capable(bool value) { - return _objc_msgSend_117qins( + return _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setAssumesHTTP3Capable_, value); } @@ -47979,7 +47774,7 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the /// user. Defaults to NSURLRequestAttributionDeveloper. NSURLRequestAttribution get attribution { - final _ret = _objc_msgSend_t5yka9(this.ref.pointer, _sel_attribution); + final _ret = _objc_msgSend_i3avs9(this.ref.pointer, _sel_attribution); return NSURLRequestAttribution.fromValue(_ret); } @@ -47988,7 +47783,7 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the /// user. Defaults to NSURLRequestAttributionDeveloper. set attribution(NSURLRequestAttribution value) { - return _objc_msgSend_1w8eyjo( + return _objc_msgSend_1nw1jep( this.ref.pointer, _sel_setAttribution_, value.value); } @@ -47997,7 +47792,7 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, /// No otherwise. Defaults to NO. bool get requiresDNSSECValidation { - return _objc_msgSend_olxnu1( + return _objc_msgSend_91o635( this.ref.pointer, _sel_requiresDNSSECValidation); } @@ -48006,99 +47801,10 @@ class NSMutableURLRequest extends NSURLRequest { /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, /// No otherwise. Defaults to NO. set requiresDNSSECValidation(bool value) { - return _objc_msgSend_117qins( + return _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setRequiresDNSSECValidation_, value); } - /// HTTPMethod - objc.NSString get HTTPMethod { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPMethod); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setHTTPMethod: - set HTTPMethod(objc.NSString value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setHTTPMethod_, value.ref.pointer); - } - - /// allHTTPHeaderFields - objc.NSDictionary? get allHTTPHeaderFields { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_allHTTPHeaderFields); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// setAllHTTPHeaderFields: - set allHTTPHeaderFields(objc.NSDictionary? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setAllHTTPHeaderFields_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// setValue:forHTTPHeaderField: - void setValue_forHTTPHeaderField_(objc.NSString? value, objc.NSString field) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_setValue_forHTTPHeaderField_, - value?.ref.pointer ?? ffi.nullptr, field.ref.pointer); - } - - /// addValue:forHTTPHeaderField: - void addValue_forHTTPHeaderField_(objc.NSString value, objc.NSString field) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_addValue_forHTTPHeaderField_, - value.ref.pointer, field.ref.pointer); - } - - /// HTTPBody - objc.NSData? get HTTPBody { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPBody); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// setHTTPBody: - set HTTPBody(objc.NSData? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setHTTPBody_, value?.ref.pointer ?? ffi.nullptr); - } - - /// HTTPBodyStream - objc.NSInputStream? get HTTPBodyStream { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPBodyStream); - return _ret.address == 0 - ? null - : objc.NSInputStream.castFromPointer(_ret, retain: true, release: true); - } - - /// setHTTPBodyStream: - set HTTPBodyStream(objc.NSInputStream? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setHTTPBodyStream_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// HTTPShouldHandleCookies - bool get HTTPShouldHandleCookies { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldHandleCookies); - } - - /// setHTTPShouldHandleCookies: - set HTTPShouldHandleCookies(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setHTTPShouldHandleCookies_, value); - } - - /// HTTPShouldUsePipelining - bool get HTTPShouldUsePipelining { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldUsePipelining); - } - - /// setHTTPShouldUsePipelining: - set HTTPShouldUsePipelining(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setHTTPShouldUsePipelining_, value); - } - /// ! /// @method requestWithURL: /// @abstract Allocates and initializes an NSURLRequest with the given @@ -48109,18 +47815,15 @@ class NSMutableURLRequest extends NSURLRequest { /// @param URL The URL for the request. /// @result A newly-created and autoreleased NSURLRequest instance. static NSMutableURLRequest requestWithURL_(objc.NSURL URL) { - final _ret = _objc_msgSend_juohf7( + final _ret = _objc_msgSend_62nh5j( _class_NSMutableURLRequest, _sel_requestWithURL_, URL.ref.pointer); return NSMutableURLRequest.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @property supportsSecureCoding - /// @abstract Indicates that NSURLRequest implements the NSSecureCoding protocol. - /// @result A BOOL value set to YES. + /// supportsSecureCoding static bool getSupportsSecureCoding() { - return _objc_msgSend_olxnu1( + return _objc_msgSend_91o635( _class_NSMutableURLRequest, _sel_supportsSecureCoding); } @@ -48138,7 +47841,7 @@ class NSMutableURLRequest extends NSURLRequest { objc.NSURL URL, NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { - final _ret = _objc_msgSend_191svj( + final _ret = _objc_msgSend_3phu9v( _class_NSMutableURLRequest, _sel_requestWithURL_cachePolicy_timeoutInterval_, URL.ref.pointer, @@ -48157,7 +47860,7 @@ class NSMutableURLRequest extends NSURLRequest { /// @param URL The URL for the request. /// @result An initialized NSURLRequest. NSMutableURLRequest initWithURL_(objc.NSURL URL) { - final _ret = _objc_msgSend_juohf7( + final _ret = _objc_msgSend_62nh5j( this.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer); return NSMutableURLRequest.castFromPointer(_ret, retain: false, release: true); @@ -48177,7 +47880,7 @@ class NSMutableURLRequest extends NSURLRequest { /// @result An initialized NSURLRequest. NSMutableURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { - final _ret = _objc_msgSend_191svj( + final _ret = _objc_msgSend_3phu9v( this.ref.retainAndReturnPointer(), _sel_initWithURL_cachePolicy_timeoutInterval_, URL.ref.pointer, @@ -48190,21 +47893,21 @@ class NSMutableURLRequest extends NSURLRequest { /// init NSMutableURLRequest init() { final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); return NSMutableURLRequest.castFromPointer(_ret, retain: false, release: true); } /// new static NSMutableURLRequest new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSMutableURLRequest, _sel_new); + final _ret = _objc_msgSend_1x359cv(_class_NSMutableURLRequest, _sel_new); return NSMutableURLRequest.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: static NSMutableURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( + final _ret = _objc_msgSend_hzlb60( _class_NSMutableURLRequest, _sel_allocWithZone_, zone); return NSMutableURLRequest.castFromPointer(_ret, retain: false, release: true); @@ -48212,14 +47915,35 @@ class NSMutableURLRequest extends NSURLRequest { /// alloc static NSMutableURLRequest alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSMutableURLRequest, _sel_alloc); + final _ret = _objc_msgSend_1x359cv(_class_NSMutableURLRequest, _sel_alloc); return NSMutableURLRequest.castFromPointer(_ret, retain: false, release: true); } + /// self + NSMutableURLRequest self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } + + /// retain + NSMutableURLRequest retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } + + /// autorelease + NSMutableURLRequest autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } + /// initWithCoder: NSMutableURLRequest? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), _sel_initWithCoder_, coder.ref.pointer); return _ret.address == 0 ? null @@ -48228,70 +47952,6 @@ class NSMutableURLRequest extends NSURLRequest { } } -late final _class_NSMutableURLRequest = objc.getClass("NSMutableURLRequest"); -late final _sel_setURL_ = objc.registerName("setURL:"); -late final _sel_setCachePolicy_ = objc.registerName("setCachePolicy:"); -final _objc_msgSend_12vaadl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_setTimeoutInterval_ = objc.registerName("setTimeoutInterval:"); -final _objc_msgSend_suh039 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSTimeInterval)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, double)>(); -late final _sel_setMainDocumentURL_ = objc.registerName("setMainDocumentURL:"); -late final _sel_setNetworkServiceType_ = - objc.registerName("setNetworkServiceType:"); -final _objc_msgSend_br89tg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_setAllowsCellularAccess_ = - objc.registerName("setAllowsCellularAccess:"); -late final _sel_setAllowsExpensiveNetworkAccess_ = - objc.registerName("setAllowsExpensiveNetworkAccess:"); -late final _sel_setAllowsConstrainedNetworkAccess_ = - objc.registerName("setAllowsConstrainedNetworkAccess:"); -late final _sel_setAssumesHTTP3Capable_ = - objc.registerName("setAssumesHTTP3Capable:"); -late final _sel_setAttribution_ = objc.registerName("setAttribution:"); -final _objc_msgSend_1w8eyjo = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_setRequiresDNSSECValidation_ = - objc.registerName("setRequiresDNSSECValidation:"); -late final _sel_setHTTPMethod_ = objc.registerName("setHTTPMethod:"); -late final _sel_setAllHTTPHeaderFields_ = - objc.registerName("setAllHTTPHeaderFields:"); -late final _sel_setValue_forHTTPHeaderField_ = - objc.registerName("setValue:forHTTPHeaderField:"); -late final _sel_addValue_forHTTPHeaderField_ = - objc.registerName("addValue:forHTTPHeaderField:"); -late final _sel_setHTTPBody_ = objc.registerName("setHTTPBody:"); -late final _sel_setHTTPBodyStream_ = objc.registerName("setHTTPBodyStream:"); -late final _sel_setHTTPShouldHandleCookies_ = - objc.registerName("setHTTPShouldHandleCookies:"); -late final _sel_setHTTPShouldUsePipelining_ = - objc.registerName("setHTTPShouldUsePipelining:"); - enum NSHTTPCookieAcceptPolicy { NSHTTPCookieAcceptPolicyAlways(0), NSHTTPCookieAcceptPolicyNever(1), @@ -48309,6 +47969,9 @@ enum NSHTTPCookieAcceptPolicy { }; } +/// WARNING: NSHTTPCookieStorage is a stub. To generate bindings for this class, include +/// NSHTTPCookieStorage in your config's objc-interfaces list. +/// /// NSHTTPCookieStorage class NSHTTPCookieStorage extends objc.NSObject { NSHTTPCookieStorage._(ffi.Pointer pointer, @@ -48323,285 +47986,83 @@ class NSHTTPCookieStorage extends objc.NSObject { NSHTTPCookieStorage.castFromPointer(ffi.Pointer other, {bool retain = false, bool release = false}) : this._(other, retain: retain, release: release); +} - /// Returns whether [obj] is an instance of [NSHTTPCookieStorage]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSHTTPCookieStorage); - } - - /// sharedHTTPCookieStorage - static NSHTTPCookieStorage getSharedHTTPCookieStorage() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSHTTPCookieStorage, _sel_sharedHTTPCookieStorage); - return NSHTTPCookieStorage.castFromPointer(_ret, - retain: true, release: true); - } - - /// sharedCookieStorageForGroupContainerIdentifier: - static NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier_( - objc.NSString identifier) { - final _ret = _objc_msgSend_juohf7( - _class_NSHTTPCookieStorage, - _sel_sharedCookieStorageForGroupContainerIdentifier_, - identifier.ref.pointer); - return NSHTTPCookieStorage.castFromPointer(_ret, - retain: true, release: true); - } +late final _class_NSHTTPCookieStorage = objc.getClass("NSHTTPCookieStorage"); +late final _class_NSURLSessionTask = objc.getClass("NSURLSessionTask"); +late final _protocol_NSProgressReporting = + objc.getProtocol("NSProgressReporting"); - /// cookies - objc.ObjCObjectBase? get cookies { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_cookies); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } +/// WARNING: NSProgress is a stub. To generate bindings for this class, include +/// NSProgress in your config's objc-interfaces list. +/// +/// NSProgress +class NSProgress extends objc.NSObject { + NSProgress._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// setCookie: - void setCookie_(NSHTTPCookie cookie) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setCookie_, cookie.ref.pointer); - } + /// Constructs a [NSProgress] that points to the same underlying object as [other]. + NSProgress.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// deleteCookie: - void deleteCookie_(NSHTTPCookie cookie) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_deleteCookie_, cookie.ref.pointer); - } + /// Constructs a [NSProgress] that wraps the given raw object pointer. + NSProgress.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} - /// removeCookiesSinceDate: - void removeCookiesSinceDate_(objc.NSDate date) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_removeCookiesSinceDate_, date.ref.pointer); - } - - /// cookiesForURL: - objc.ObjCObjectBase? cookiesForURL_(objc.NSURL URL) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_cookiesForURL_, URL.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setCookies:forURL:mainDocumentURL: - void setCookies_forURL_mainDocumentURL_(objc.ObjCObjectBase cookies, - objc.NSURL? URL, objc.NSURL? mainDocumentURL) { - _objc_msgSend_tenbla( - this.ref.pointer, - _sel_setCookies_forURL_mainDocumentURL_, - cookies.ref.pointer, - URL?.ref.pointer ?? ffi.nullptr, - mainDocumentURL?.ref.pointer ?? ffi.nullptr); - } - - /// cookieAcceptPolicy - NSHTTPCookieAcceptPolicy get cookieAcceptPolicy { - final _ret = - _objc_msgSend_1jpuqgg(this.ref.pointer, _sel_cookieAcceptPolicy); - return NSHTTPCookieAcceptPolicy.fromValue(_ret); - } - - /// setCookieAcceptPolicy: - set cookieAcceptPolicy(NSHTTPCookieAcceptPolicy value) { - return _objc_msgSend_199e8fv( - this.ref.pointer, _sel_setCookieAcceptPolicy_, value.value); - } - - /// sortedCookiesUsingDescriptors: - objc.ObjCObjectBase sortedCookiesUsingDescriptors_( - objc.ObjCObjectBase sortOrder) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_sortedCookiesUsingDescriptors_, sortOrder.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// storeCookies:forTask: - void storeCookies_forTask_(objc.NSArray cookies, NSURLSessionTask task) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_storeCookies_forTask_, - cookies.ref.pointer, task.ref.pointer); - } - - /// getCookiesForTask:completionHandler: - void getCookiesForTask_completionHandler_(NSURLSessionTask task, - objc.ObjCBlock completionHandler) { - _objc_msgSend_cmbt6k( - this.ref.pointer, - _sel_getCookiesForTask_completionHandler_, - task.ref.pointer, - completionHandler.ref.pointer); - } - - /// init - NSHTTPCookieStorage init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSHTTPCookieStorage.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSHTTPCookieStorage new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSHTTPCookieStorage, _sel_new); - return NSHTTPCookieStorage.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSHTTPCookieStorage allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSHTTPCookieStorage, _sel_allocWithZone_, zone); - return NSHTTPCookieStorage.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSHTTPCookieStorage alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSHTTPCookieStorage, _sel_alloc); - return NSHTTPCookieStorage.castFromPointer(_ret, - retain: false, release: true); - } -} - -late final _class_NSHTTPCookieStorage = objc.getClass("NSHTTPCookieStorage"); -late final _sel_sharedHTTPCookieStorage = - objc.registerName("sharedHTTPCookieStorage"); -late final _sel_sharedCookieStorageForGroupContainerIdentifier_ = - objc.registerName("sharedCookieStorageForGroupContainerIdentifier:"); -late final _sel_cookies = objc.registerName("cookies"); - -/// NSHTTPCookie -class NSHTTPCookie extends objc.ObjCObjectBase { - NSHTTPCookie._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super(pointer, retain: retain, release: release); - - /// Constructs a [NSHTTPCookie] that points to the same underlying object as [other]. - NSHTTPCookie.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSHTTPCookie] that wraps the given raw object pointer. - NSHTTPCookie.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSHTTPCookie]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSHTTPCookie); - } -} - -late final _class_NSHTTPCookie = objc.getClass("NSHTTPCookie"); -late final _sel_setCookie_ = objc.registerName("setCookie:"); -late final _sel_deleteCookie_ = objc.registerName("deleteCookie:"); -late final _sel_removeCookiesSinceDate_ = - objc.registerName("removeCookiesSinceDate:"); -late final _sel_cookiesForURL_ = objc.registerName("cookiesForURL:"); -late final _sel_setCookies_forURL_mainDocumentURL_ = - objc.registerName("setCookies:forURL:mainDocumentURL:"); -final _objc_msgSend_tenbla = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_cookieAcceptPolicy = objc.registerName("cookieAcceptPolicy"); -final _objc_msgSend_1jpuqgg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setCookieAcceptPolicy_ = - objc.registerName("setCookieAcceptPolicy:"); -final _objc_msgSend_199e8fv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_sortedCookiesUsingDescriptors_ = - objc.registerName("sortedCookiesUsingDescriptors:"); -late final _sel_storeCookies_forTask_ = - objc.registerName("storeCookies:forTask:"); -void _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => +late final _sel_progress = objc.registerName("progress"); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => block.ref.target .cast< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSArray_fnPtrCallable = + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline) + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSArray_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSArray_closureCallable = +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray_closureTrampoline) + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSArray_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSArray_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSArray_listenerTrampoline) - ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSArray { +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSProgress_ffiVoid { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( + static objc.ObjCBlock)> fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi.Pointer Function( + ffi.Pointer arg0)>> ptr) => - objc.ObjCBlock( + objc.ObjCBlock)>( objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSArray_fnPtrCallable, ptr.cast()), + _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -48610,1992 +48071,2818 @@ abstract final class ObjCBlock_ffiVoid_NSArray { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSArray?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray_closureCallable, - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : objc.NSArray.castFromPointer(arg0, - retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(objc.NSArray?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSArray_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : objc.NSArray.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_ukcdfq(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } + static objc.ObjCBlock)> + fromFunction(NSProgress Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSProgress_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSArray_CallExtension - on objc.ObjCBlock { - void call(objc.NSArray? arg0) => ref.pointer.ref.invoke +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_NSProgress_ffiVoid_CallExtension + on objc.ObjCBlock)> { + NSProgress call(ffi.Pointer arg0) => NSProgress.castFromPointer( + ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_getCookiesForTask_completionHandler_ = - objc.registerName("getCookiesForTask:completionHandler:"); - -final class CFArrayCallBacks extends ffi.Struct { - @CFIndex() - external int version; - - external CFArrayRetainCallBack retain; - - external CFArrayReleaseCallBack release; - - external CFArrayCopyDescriptionCallBack copyDescription; - - external CFArrayEqualCallBack equal; -} - -typedef CFArrayRetainCallBack - = ffi.Pointer>; -typedef CFArrayRetainCallBackFunction = ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFArrayReleaseCallBack - = ffi.Pointer>; -typedef CFArrayReleaseCallBackFunction = ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef DartCFArrayReleaseCallBackFunction = void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFArrayCopyDescriptionCallBack - = ffi.Pointer>; -typedef CFArrayCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer value); -typedef CFArrayEqualCallBack - = ffi.Pointer>; -typedef CFArrayEqualCallBackFunction = Boolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef DartCFArrayEqualCallBackFunction = DartBoolean Function( - ffi.Pointer value1, ffi.Pointer value2); - -final class __CFArray extends ffi.Opaque {} - -typedef CFArrayRef = ffi.Pointer<__CFArray>; -typedef CFMutableArrayRef = ffi.Pointer<__CFArray>; -typedef CFArrayApplierFunction - = ffi.Pointer>; -typedef CFArrayApplierFunctionFunction = ffi.Void Function( - ffi.Pointer value, ffi.Pointer context); -typedef DartCFArrayApplierFunctionFunction = void Function( - ffi.Pointer value, ffi.Pointer context); -typedef CFComparatorFunction - = ffi.Pointer>; -typedef CFComparatorFunctionFunction = CFIndex Function( - ffi.Pointer val1, - ffi.Pointer val2, - ffi.Pointer context); -typedef DartCFComparatorFunctionFunction = CFComparisonResult Function( - ffi.Pointer val1, - ffi.Pointer val2, - ffi.Pointer context); - -enum CFComparisonResult { - kCFCompareLessThan(-1), - kCFCompareEqualTo(0), - kCFCompareGreaterThan(1); - - final int value; - const CFComparisonResult(this.value); - - static CFComparisonResult fromValue(int value) => switch (value) { - -1 => kCFCompareLessThan, - 0 => kCFCompareEqualTo, - 1 => kCFCompareGreaterThan, - _ => - throw ArgumentError("Unknown value for CFComparisonResult: $value"), - }; + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); } -/// OS_sec_object -abstract final class OS_sec_object { - /// Builds an object that implements the OS_sec_object protocol. To implement +/// NSProgressReporting +abstract final class NSProgressReporting { + /// Builds an object that implements the NSProgressReporting protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { + static objc.ObjCObjectBase implement( + {required NSProgress Function() progress}) { final builder = objc.ObjCProtocolBuilder(); - + NSProgressReporting.progress.implement(builder, progress); return builder.build(); } - /// Adds the implementation of the OS_sec_object protocol to an existing + /// Adds the implementation of the NSProgressReporting protocol to an existing /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required NSProgress Function() progress}) { + NSProgressReporting.progress.implement(builder, progress); + } + + /// progress + static final progress = objc.ObjCProtocolMethod( + _protocol_NSProgressReporting, + _sel_progress, + objc.getProtocolMethodSignature( + _protocol_NSProgressReporting, + _sel_progress, + isRequired: true, + isInstanceMethod: true, + ), + (NSProgress Function() func) => ObjCBlock_NSProgress_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); } -late final _protocol_OS_sec_object = objc.getProtocol("OS_sec_object"); +late final _sel_taskIdentifier = objc.registerName("taskIdentifier"); +late final _sel_originalRequest = objc.registerName("originalRequest"); +late final _sel_currentRequest = objc.registerName("currentRequest"); +late final _class_NSURLResponse = objc.getClass("NSURLResponse"); +late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_ = + objc.registerName( + "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); +final _objc_msgSend_13tl325 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_MIMEType = objc.registerName("MIMEType"); +late final _sel_expectedContentLength = + objc.registerName("expectedContentLength"); +final _objc_msgSend_1k101e3 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.LongLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_textEncodingName = objc.registerName("textEncodingName"); +late final _sel_suggestedFilename = objc.registerName("suggestedFilename"); -final class __SecCertificate extends ffi.Opaque {} +/// NSURLResponse +class NSURLResponse extends objc.NSObject { + NSURLResponse._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); -final class __SecIdentity extends ffi.Opaque {} + /// Constructs a [NSURLResponse] that points to the same underlying object as [other]. + NSURLResponse.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); -final class __SecKey extends ffi.Opaque {} + /// Constructs a [NSURLResponse] that wraps the given raw object pointer. + NSURLResponse.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); -final class __SecPolicy extends ffi.Opaque {} + /// Returns whether [obj] is an instance of [NSURLResponse]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLResponse); + } -final class __SecAccessControl extends ffi.Opaque {} + /// ! + /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: + /// @abstract Initialize an NSURLResponse with the provided values. + /// @param URL the URL + /// @param MIMEType the MIME content type of the response + /// @param length the expected content length of the associated data + /// @param name the name of the text encoding for the associated data, if applicable, else nil + /// @result The initialized NSURLResponse. + /// @discussion This is the designated initializer for NSURLResponse. + NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( + objc.NSURL URL, + objc.NSString? MIMEType, + DartNSInteger length, + objc.NSString? name) { + final _ret = _objc_msgSend_13tl325( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, + URL.ref.pointer, + MIMEType?.ref.pointer ?? ffi.nullptr, + length, + name?.ref.pointer ?? ffi.nullptr); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + } -final class __SecKeychain extends ffi.Opaque {} + /// ! + /// @abstract Returns the URL of the receiver. + /// @result The URL of the receiver. + objc.NSURL? get URL { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_URL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } -final class __SecKeychainItem extends ffi.Opaque {} + /// ! + /// @abstract Returns the MIME type of the receiver. + /// @discussion The MIME type is based on the information provided + /// from an origin source. However, that value may be changed or + /// corrected by a protocol implementation if it can be determined + /// that the origin server or source reported the information + /// incorrectly or imprecisely. An attempt to guess the MIME type may + /// be made if the origin source did not report any such information. + /// @result The MIME type of the receiver. + objc.NSString? get MIMEType { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_MIMEType); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } -final class __SecKeychainSearch extends ffi.Opaque {} + /// ! + /// @abstract Returns the expected content length of the receiver. + /// @discussion Some protocol implementations report a content length + /// as part of delivering load metadata, but not all protocols + /// guarantee the amount of data that will be delivered in actuality. + /// Hence, this method returns an expected amount. Clients should use + /// this value as an advisory, and should be prepared to deal with + /// either more or less data. + /// @result The expected content length of the receiver, or -1 if + /// there is no expectation that can be arrived at regarding expected + /// content length. + int get expectedContentLength { + return _objc_msgSend_1k101e3(this.ref.pointer, _sel_expectedContentLength); + } -final class SecKeychainAttribute extends ffi.Struct { - @SecKeychainAttrType() - external int tag; + /// ! + /// @abstract Returns the name of the text encoding of the receiver. + /// @discussion This name will be the actual string reported by the + /// origin source during the course of performing a protocol-specific + /// URL load. Clients can inspect this string and convert it to an + /// NSStringEncoding or CFStringEncoding using the methods and + /// functions made available in the appropriate framework. + /// @result The name of the text encoding of the receiver, or nil if no + /// text encoding was specified. + objc.NSString? get textEncodingName { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_textEncodingName); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } - @UInt32() - external int length; + /// ! + /// @abstract Returns a suggested filename if the resource were saved to disk. + /// @discussion The method first checks if the server has specified a filename using the + /// content disposition header. If no valid filename is specified using that mechanism, + /// this method checks the last path component of the URL. If no valid filename can be + /// obtained using the last path component, this method uses the URL's host as the filename. + /// If the URL's host can't be converted to a valid filename, the filename "unknown" is used. + /// In most cases, this method appends the proper file extension based on the MIME type. + /// This method always returns a valid filename. + /// @result A suggested filename to use if saving the resource to disk. + objc.NSString? get suggestedFilename { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_suggestedFilename); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } - external ffi.Pointer data; -} + /// init + NSURLResponse init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + } -typedef SecKeychainAttrType = OSType; -typedef OSType = FourCharCode; -typedef FourCharCode = UInt32; + /// new + static NSURLResponse new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLResponse, _sel_new); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + } -final class SecKeychainAttributeList extends ffi.Struct { - @UInt32() - external int count; + /// allocWithZone: + static NSURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_hzlb60(_class_NSURLResponse, _sel_allocWithZone_, zone); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + } - external ffi.Pointer attr; -} + /// alloc + static NSURLResponse alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLResponse, _sel_alloc); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + } -final class __SecTrustedApplication extends ffi.Opaque {} + /// self + NSURLResponse self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLResponse.castFromPointer(_ret, retain: true, release: true); + } -final class __SecAccess extends ffi.Opaque {} + /// retain + NSURLResponse retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLResponse.castFromPointer(_ret, retain: true, release: true); + } -final class __SecACL extends ffi.Opaque {} + /// autorelease + NSURLResponse autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLResponse.castFromPointer(_ret, retain: true, release: true); + } -final class __SecPassword extends ffi.Opaque {} + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_91o635( + _class_NSURLResponse, _sel_supportsSecureCoding); + } -final class SecKeychainAttributeInfo extends ffi.Struct { - @UInt32() - external int count; - - external ffi.Pointer tag; + /// encodeWithCoder: + void encodeWithCoder_(objc.NSCoder coder) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); + } - external ffi.Pointer format; + /// initWithCoder: + NSURLResponse? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : NSURLResponse.castFromPointer(_ret, retain: false, release: true); + } } -typedef OSStatus = SInt32; - -final class _RuneEntry extends ffi.Struct { - @__darwin_rune_t() - external int __min; - - @__darwin_rune_t() - external int __max; - - @__darwin_rune_t() - external int __map; - - external ffi.Pointer<__uint32_t> __types; -} +late final _sel_response = objc.registerName("response"); +late final _sel_delegate = objc.registerName("delegate"); +late final _sel_setDelegate_ = objc.registerName("setDelegate:"); +late final _sel_earliestBeginDate = objc.registerName("earliestBeginDate"); +late final _sel_setEarliestBeginDate_ = + objc.registerName("setEarliestBeginDate:"); +late final _sel_countOfBytesClientExpectsToSend = + objc.registerName("countOfBytesClientExpectsToSend"); +final _objc_msgSend_pysgoz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Int64 Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setCountOfBytesClientExpectsToSend_ = + objc.registerName("setCountOfBytesClientExpectsToSend:"); +final _objc_msgSend_17gvxvj = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Int64)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_countOfBytesClientExpectsToReceive = + objc.registerName("countOfBytesClientExpectsToReceive"); +late final _sel_setCountOfBytesClientExpectsToReceive_ = + objc.registerName("setCountOfBytesClientExpectsToReceive:"); +late final _sel_countOfBytesSent = objc.registerName("countOfBytesSent"); +late final _sel_countOfBytesReceived = + objc.registerName("countOfBytesReceived"); +late final _sel_countOfBytesExpectedToSend = + objc.registerName("countOfBytesExpectedToSend"); +late final _sel_countOfBytesExpectedToReceive = + objc.registerName("countOfBytesExpectedToReceive"); +late final _sel_taskDescription = objc.registerName("taskDescription"); +late final _sel_setTaskDescription_ = objc.registerName("setTaskDescription:"); +late final _sel_cancel = objc.registerName("cancel"); -typedef __darwin_rune_t = __darwin_wchar_t; -typedef __darwin_wchar_t = ffi.Int; -typedef Dart__darwin_wchar_t = int; +enum NSURLSessionTaskState { + /// The task is currently being serviced by the session + NSURLSessionTaskStateRunning(0), + NSURLSessionTaskStateSuspended(1), -final class _RuneRange extends ffi.Struct { - @ffi.Int() - external int __nranges; + /// The task has been told to cancel. The session will receive a URLSession:task:didCompleteWithError: message. + NSURLSessionTaskStateCanceling(2), - external ffi.Pointer<_RuneEntry> __ranges; -} + /// The task has completed and the session will receive no more delegate notifications + NSURLSessionTaskStateCompleted(3); -final class _RuneCharClass extends ffi.Struct { - @ffi.Array.multi([14]) - external ffi.Array __name; + final int value; + const NSURLSessionTaskState(this.value); - @__uint32_t() - external int __mask; + static NSURLSessionTaskState fromValue(int value) => switch (value) { + 0 => NSURLSessionTaskStateRunning, + 1 => NSURLSessionTaskStateSuspended, + 2 => NSURLSessionTaskStateCanceling, + 3 => NSURLSessionTaskStateCompleted, + _ => throw ArgumentError( + "Unknown value for NSURLSessionTaskState: $value"), + }; } -final class _RuneLocale extends ffi.Struct { - @ffi.Array.multi([8]) - external ffi.Array __magic; - - @ffi.Array.multi([32]) - external ffi.Array __encoding; - - external ffi.Pointer< - ffi.NativeFunction< - __darwin_rune_t Function(ffi.Pointer, __darwin_size_t, - ffi.Pointer>)>> __sgetrune; +late final _sel_state = objc.registerName("state"); +final _objc_msgSend_1vze0g9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_error = objc.registerName("error"); +late final _sel_suspend = objc.registerName("suspend"); +late final _sel_resume = objc.registerName("resume"); +late final _sel_priority = objc.registerName("priority"); +final _objc_msgSend_2cgrxl = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_2cgrxlFpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setPriority_ = objc.registerName("setPriority:"); +final _objc_msgSend_v5hmet = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, double)>(); +late final _sel_prefersIncrementalDelivery = + objc.registerName("prefersIncrementalDelivery"); +late final _sel_setPrefersIncrementalDelivery_ = + objc.registerName("setPrefersIncrementalDelivery:"); - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(__darwin_rune_t, ffi.Pointer, - __darwin_size_t, ffi.Pointer>)>> __sputrune; +/// NSURLSessionTask - a cancelable object that refers to the lifetime +/// of processing a given request. +class NSURLSessionTask extends objc.NSObject { + NSURLSessionTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - @__darwin_rune_t() - external int __invalid_rune; + /// Constructs a [NSURLSessionTask] that points to the same underlying object as [other]. + NSURLSessionTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - @ffi.Array.multi([256]) - external ffi.Array<__uint32_t> __runetype; + /// Constructs a [NSURLSessionTask] that wraps the given raw object pointer. + NSURLSessionTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - @ffi.Array.multi([256]) - external ffi.Array<__darwin_rune_t> __maplower; + /// Returns whether [obj] is an instance of [NSURLSessionTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionTask); + } - @ffi.Array.multi([256]) - external ffi.Array<__darwin_rune_t> __mapupper; + /// an identifier for this task, assigned by and unique to the owning session + DartNSUInteger get taskIdentifier { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_taskIdentifier); + } - external _RuneRange __runetype_ext; + /// may be nil if this is a stream task + NSURLRequest? get originalRequest { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_originalRequest); + return _ret.address == 0 + ? null + : NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } - external _RuneRange __maplower_ext; + /// may differ from originalRequest due to http server redirection + NSURLRequest? get currentRequest { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_currentRequest); + return _ret.address == 0 + ? null + : NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } - external _RuneRange __mapupper_ext; + /// may be nil if no response has been received + NSURLResponse? get response { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_response); + return _ret.address == 0 + ? null + : NSURLResponse.castFromPointer(_ret, retain: true, release: true); + } - external ffi.Pointer __variable; + /// Sets a task-specific delegate. Methods not implemented on this delegate will + /// still be forwarded to the session delegate. + /// + /// Cannot be modified after task resumes. Not supported on background session. + /// + /// Delegate is strongly referenced until the task completes, after which it is + /// reset to `nil`. + objc.ObjCObjectBase? get delegate { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_delegate); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } - @ffi.Int() - external int __variable_len; + /// Sets a task-specific delegate. Methods not implemented on this delegate will + /// still be forwarded to the session delegate. + /// + /// Cannot be modified after task resumes. Not supported on background session. + /// + /// Delegate is strongly referenced until the task completes, after which it is + /// reset to `nil`. + set delegate(objc.ObjCObjectBase? value) { + return _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); + } - @ffi.Int() - external int __ncharclasses; + /// progress + NSProgress get progress { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_progress); + return NSProgress.castFromPointer(_ret, retain: true, release: true); + } - external ffi.Pointer<_RuneCharClass> __charclasses; -} + /// Start the network load for this task no earlier than the specified date. If + /// not specified, no start delay is used. + /// + /// Only applies to tasks created from background NSURLSession instances; has no + /// effect for tasks created from other session types. + objc.NSDate? get earliestBeginDate { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_earliestBeginDate); + return _ret.address == 0 + ? null + : objc.NSDate.castFromPointer(_ret, retain: true, release: true); + } -typedef __darwin_ct_rune_t = ffi.Int; -typedef Dart__darwin_ct_rune_t = int; + /// Start the network load for this task no earlier than the specified date. If + /// not specified, no start delay is used. + /// + /// Only applies to tasks created from background NSURLSession instances; has no + /// effect for tasks created from other session types. + set earliestBeginDate(objc.NSDate? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setEarliestBeginDate_, + value?.ref.pointer ?? ffi.nullptr); + } -final class lconv extends ffi.Struct { - external ffi.Pointer decimal_point; + /// The number of bytes that the client expects (a best-guess upper-bound) will + /// be sent and received by this task. These values are used by system scheduling + /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. + int get countOfBytesClientExpectsToSend { + return _objc_msgSend_pysgoz( + this.ref.pointer, _sel_countOfBytesClientExpectsToSend); + } - external ffi.Pointer thousands_sep; + /// The number of bytes that the client expects (a best-guess upper-bound) will + /// be sent and received by this task. These values are used by system scheduling + /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. + set countOfBytesClientExpectsToSend(int value) { + return _objc_msgSend_17gvxvj( + this.ref.pointer, _sel_setCountOfBytesClientExpectsToSend_, value); + } - external ffi.Pointer grouping; + /// countOfBytesClientExpectsToReceive + int get countOfBytesClientExpectsToReceive { + return _objc_msgSend_pysgoz( + this.ref.pointer, _sel_countOfBytesClientExpectsToReceive); + } - external ffi.Pointer int_curr_symbol; + /// setCountOfBytesClientExpectsToReceive: + set countOfBytesClientExpectsToReceive(int value) { + return _objc_msgSend_17gvxvj( + this.ref.pointer, _sel_setCountOfBytesClientExpectsToReceive_, value); + } - external ffi.Pointer currency_symbol; + /// number of body bytes already sent + int get countOfBytesSent { + return _objc_msgSend_pysgoz(this.ref.pointer, _sel_countOfBytesSent); + } - external ffi.Pointer mon_decimal_point; + /// number of body bytes already received + int get countOfBytesReceived { + return _objc_msgSend_pysgoz(this.ref.pointer, _sel_countOfBytesReceived); + } - external ffi.Pointer mon_thousands_sep; + /// number of body bytes we expect to send, derived from the Content-Length of the HTTP request + int get countOfBytesExpectedToSend { + return _objc_msgSend_pysgoz( + this.ref.pointer, _sel_countOfBytesExpectedToSend); + } - external ffi.Pointer mon_grouping; + /// number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response. + int get countOfBytesExpectedToReceive { + return _objc_msgSend_pysgoz( + this.ref.pointer, _sel_countOfBytesExpectedToReceive); + } - external ffi.Pointer positive_sign; + /// The taskDescription property is available for the developer to + /// provide a descriptive label for the task. + objc.NSString? get taskDescription { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_taskDescription); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } - external ffi.Pointer negative_sign; + /// The taskDescription property is available for the developer to + /// provide a descriptive label for the task. + set taskDescription(objc.NSString? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setTaskDescription_, + value?.ref.pointer ?? ffi.nullptr); + } - @ffi.Char() - external int int_frac_digits; + /// -cancel returns immediately, but marks a task as being canceled. + /// The task will signal -URLSession:task:didCompleteWithError: with an + /// error value of { NSURLErrorDomain, NSURLErrorCancelled }. In some + /// cases, the task may signal other work before it acknowledges the + /// cancelation. -cancel may be sent to a task that has been suspended. + void cancel() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_cancel); + } - @ffi.Char() - external int frac_digits; + /// The current state of the task within the session. + NSURLSessionTaskState get state { + final _ret = _objc_msgSend_1vze0g9(this.ref.pointer, _sel_state); + return NSURLSessionTaskState.fromValue(_ret); + } - @ffi.Char() - external int p_cs_precedes; + /// The error, if any, delivered via -URLSession:task:didCompleteWithError: + /// This property will be nil in the event that no error occurred. + objc.NSError? get error { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_error); + return _ret.address == 0 + ? null + : objc.NSError.castFromPointer(_ret, retain: true, release: true); + } - @ffi.Char() - external int p_sep_by_space; + /// Suspending a task will prevent the NSURLSession from continuing to + /// load data. There may still be delegate calls made on behalf of + /// this task (for instance, to report data received while suspending) + /// but no further transmissions will be made on behalf of the task + /// until -resume is sent. The timeout timer associated with the task + /// will be disabled while a task is suspended. -suspend and -resume are + /// nestable. + void suspend() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_suspend); + } - @ffi.Char() - external int n_cs_precedes; + /// resume + void resume() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_resume); + } - @ffi.Char() - external int n_sep_by_space; + /// Sets a scaling factor for the priority of the task. The scaling factor is a + /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest + /// priority and 1.0 is considered the highest. + /// + /// The priority is a hint and not a hard requirement of task performance. The + /// priority of a task may be changed using this API at any time, but not all + /// protocols support this; in these cases, the last priority that took effect + /// will be used. + /// + /// If no priority is specified, the task will operate with the default priority + /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional + /// priority levels are provided: NSURLSessionTaskPriorityLow and + /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. + double get priority { + return objc.useMsgSendVariants + ? _objc_msgSend_2cgrxlFpret(this.ref.pointer, _sel_priority) + : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_priority); + } - @ffi.Char() - external int p_sign_posn; + /// Sets a scaling factor for the priority of the task. The scaling factor is a + /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest + /// priority and 1.0 is considered the highest. + /// + /// The priority is a hint and not a hard requirement of task performance. The + /// priority of a task may be changed using this API at any time, but not all + /// protocols support this; in these cases, the last priority that took effect + /// will be used. + /// + /// If no priority is specified, the task will operate with the default priority + /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional + /// priority levels are provided: NSURLSessionTaskPriorityLow and + /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. + set priority(double value) { + return _objc_msgSend_v5hmet(this.ref.pointer, _sel_setPriority_, value); + } - @ffi.Char() - external int n_sign_posn; + /// Provides a hint indicating if incremental delivery of a partial response body + /// would be useful for the application, or if it cannot process the response + /// until it is complete. Indicating that incremental delivery is not desired may + /// improve task performance. For example, if a response cannot be decoded until + /// the entire content is received, set this property to false. + /// + /// Defaults to true unless this task is created with completion-handler based + /// convenience methods, or if it is a download task. + bool get prefersIncrementalDelivery { + return _objc_msgSend_91o635( + this.ref.pointer, _sel_prefersIncrementalDelivery); + } - @ffi.Char() - external int int_p_cs_precedes; + /// Provides a hint indicating if incremental delivery of a partial response body + /// would be useful for the application, or if it cannot process the response + /// until it is complete. Indicating that incremental delivery is not desired may + /// improve task performance. For example, if a response cannot be decoded until + /// the entire content is received, set this property to false. + /// + /// Defaults to true unless this task is created with completion-handler based + /// convenience methods, or if it is a download task. + set prefersIncrementalDelivery(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setPrefersIncrementalDelivery_, value); + } - @ffi.Char() - external int int_n_cs_precedes; + /// init + NSURLSessionTask init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + } - @ffi.Char() - external int int_p_sep_by_space; + /// new + static NSURLSessionTask new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLSessionTask, _sel_new); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + } - @ffi.Char() - external int int_n_sep_by_space; + /// allocWithZone: + static NSURLSessionTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_hzlb60( + _class_NSURLSessionTask, _sel_allocWithZone_, zone); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + } - @ffi.Char() - external int int_p_sign_posn; + /// alloc + static NSURLSessionTask alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLSessionTask, _sel_alloc); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + } - @ffi.Char() - external int int_n_sign_posn; -} + /// self + NSURLSessionTask self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); + } -final class __float2 extends ffi.Struct { - @ffi.Float() - external double __sinval; + /// retain + NSURLSessionTask retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); + } - @ffi.Float() - external double __cosval; + /// autorelease + NSURLSessionTask autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); + } } -final class __double2 extends ffi.Struct { - @ffi.Double() - external double __sinval; - - @ffi.Double() - external double __cosval; +late final _sel_storeCookies_forTask_ = + objc.registerName("storeCookies:forTask:"); +void _ObjCBlock_ffiVoid_objcObjCObject_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); } -final class exception extends ffi.Struct { - @ffi.Int() - external int type; - - external ffi.Pointer name; +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject_listenerTrampoline) + ..keepIsolateAlive = false; - @ffi.Double() - external double arg1; +/// Construction methods for `objc.ObjCBlock?)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObject { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock?)>( + pointer, + retain: retain, + release: release); - @ffi.Double() - external double arg2; - - @ffi.Double() - external double retval; -} - -typedef pthread_t = __darwin_pthread_t; -typedef __darwin_pthread_t = ffi.Pointer<_opaque_pthread_t>; -typedef stack_t = __darwin_sigaltstack; + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock?)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock?)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_objcObjCObject_fnPtrCallable, ptr.cast()), + retain: false, + release: true); -final class __sbuf extends ffi.Struct { - external ffi.Pointer _base; + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock?)> + fromFunction(void Function(objc.ObjCObjectBase?) fn) => + objc.ObjCBlock?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.ObjCObjectBase(arg0, + retain: true, release: true))), + retain: false, + release: true); - @ffi.Int() - external int _size; + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock?)> + listener(void Function(objc.ObjCObjectBase?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.ObjCObjectBase(arg0, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock?)>( + wrapper, + retain: false, + release: true); + } } -final class __sFILEX extends ffi.Opaque {} - -final class __sFILE extends ffi.Struct { - external ffi.Pointer _p; - - @ffi.Int() - external int _r; - - @ffi.Int() - external int _w; - - @ffi.Short() - external int _flags; - - @ffi.Short() - external int _file; - - external __sbuf _bf; - - @ffi.Int() - external int _lbfsize; - - external ffi.Pointer _cookie; - - external ffi - .Pointer)>> - _close; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>> _read; - - external ffi.Pointer< - ffi.NativeFunction< - fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>> _seek; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>> _write; - - external __sbuf _ub; - - external ffi.Pointer<__sFILEX> _extra; - - @ffi.Int() - external int _ur; - - @ffi.Array.multi([3]) - external ffi.Array _ubuf; - - @ffi.Array.multi([1]) - external ffi.Array _nbuf; - - external __sbuf _lb; - - @ffi.Int() - external int _blksize; - - @fpos_t() - external int _offset; +/// Call operator for `objc.ObjCBlock?)>`. +extension ObjCBlock_ffiVoid_objcObjCObject_CallExtension + on objc.ObjCBlock?)> { + void call(objc.ObjCObjectBase? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); } -typedef fpos_t = __darwin_off_t; -typedef __darwin_off_t = __int64_t; -typedef __int64_t = ffi.LongLong; -typedef Dart__int64_t = int; -typedef FILE = __sFILE; -typedef off_t = __darwin_off_t; -typedef ssize_t = __darwin_ssize_t; -typedef __darwin_ssize_t = ffi.Long; -typedef Dart__darwin_ssize_t = int; -typedef errno_t = ffi.Int; -typedef Darterrno_t = int; -typedef rsize_t = ffi.UnsignedLong; -typedef Dartrsize_t = int; +late final _sel_getCookiesForTask_completionHandler_ = + objc.registerName("getCookiesForTask:completionHandler:"); -final class timespec extends ffi.Struct { - @__darwin_time_t() - external int tv_sec; +/// NSURLSessionTaskAdditions +extension NSURLSessionTaskAdditions1 on NSHTTPCookieStorage { + /// storeCookies:forTask: + void storeCookies_forTask_( + objc.ObjCObjectBase cookies, NSURLSessionTask task) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_storeCookies_forTask_, + cookies.ref.pointer, task.ref.pointer); + } - @ffi.Long() - external int tv_nsec; + /// getCookiesForTask:completionHandler: + void getCookiesForTask_completionHandler_( + NSURLSessionTask task, + objc.ObjCBlock?)> + completionHandler) { + _objc_msgSend_14pxqbs( + this.ref.pointer, + _sel_getCookiesForTask_completionHandler_, + task.ref.pointer, + completionHandler.ref.pointer); + } } -final class tm extends ffi.Struct { - @ffi.Int() - external int tm_sec; - - @ffi.Int() - external int tm_min; - - @ffi.Int() - external int tm_hour; - - @ffi.Int() - external int tm_mday; - - @ffi.Int() - external int tm_mon; - - @ffi.Int() - external int tm_year; - - @ffi.Int() - external int tm_wday; - - @ffi.Int() - external int tm_yday; +late final _protocol_NSFastEnumeration = objc.getProtocol("NSFastEnumeration"); +late final _sel_countByEnumeratingWithState_objects_count_ = + objc.registerName("countByEnumeratingWithState:objects:count:"); +final _objc_msgSend_1b5ysjl = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.UnsignedLong)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + int)>(); +int _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + int arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + NSUInteger arg3)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + int)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_fnPtrCallable = + ffi.Pointer.fromFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>( + _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_fnPtrTrampoline, + 0) + .cast(); +int _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + int arg3) => + (objc.getBlockClosure(block) as int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + int))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_closureCallable = + ffi.Pointer.fromFunction< + NSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + NSUInteger)>( + _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_closureTrampoline, + 0) + .cast(); - @ffi.Int() - external int tm_isdst; +/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)>`. +abstract final class ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.UnsignedLong)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.UnsignedLong)>(pointer, retain: retain, release: release); - @ffi.Long() - external int tm_gmtoff; + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.UnsignedLong)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer> arg2, NSUInteger arg3)>> ptr) => + objc.ObjCBlock< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.UnsignedLong)>( + objc.newPointerBlock(_ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - external ffi.Pointer tm_zone; + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)> fromFunction( + DartNSUInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + DartNSUInteger) + fn) => + objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)>( + objc.newClosureBlock( + _ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer> arg2, int arg3) => + fn(arg0, arg1, arg2, arg3)), + retain: false, + release: true); } -typedef clock_t = __darwin_clock_t; -typedef __darwin_clock_t = ffi.UnsignedLong; -typedef Dart__darwin_clock_t = int; -typedef time_t = __darwin_time_t; +/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer>, ffi.UnsignedLong)>`. +extension ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger_CallExtension + on objc.ObjCBlock< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.UnsignedLong)> { + DartNSUInteger call( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + DartNSUInteger arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + NSUInteger Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, + NSUInteger arg3)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + int)>()(ref.pointer, arg0, arg1, arg2, arg3); +} -enum clockid_t { - _CLOCK_REALTIME(0), - _CLOCK_MONOTONIC(6), - _CLOCK_MONOTONIC_RAW(4), - _CLOCK_MONOTONIC_RAW_APPROX(5), - _CLOCK_UPTIME_RAW(8), - _CLOCK_UPTIME_RAW_APPROX(9), - _CLOCK_PROCESS_CPUTIME_ID(12), - _CLOCK_THREAD_CPUTIME_ID(16); +/// NSFastEnumeration +abstract final class NSFastEnumeration { + /// Builds an object that implements the NSFastEnumeration protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required DartNSUInteger Function( + ffi.Pointer, + ffi.Pointer>, + DartNSUInteger) + countByEnumeratingWithState_objects_count_}) { + final builder = objc.ObjCProtocolBuilder(); + NSFastEnumeration.countByEnumeratingWithState_objects_count_ + .implement(builder, countByEnumeratingWithState_objects_count_); + return builder.build(); + } - final int value; - const clockid_t(this.value); + /// Adds the implementation of the NSFastEnumeration protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required DartNSUInteger Function( + ffi.Pointer, + ffi.Pointer>, + DartNSUInteger) + countByEnumeratingWithState_objects_count_}) { + NSFastEnumeration.countByEnumeratingWithState_objects_count_ + .implement(builder, countByEnumeratingWithState_objects_count_); + } - static clockid_t fromValue(int value) => switch (value) { - 0 => _CLOCK_REALTIME, - 6 => _CLOCK_MONOTONIC, - 4 => _CLOCK_MONOTONIC_RAW, - 5 => _CLOCK_MONOTONIC_RAW_APPROX, - 8 => _CLOCK_UPTIME_RAW, - 9 => _CLOCK_UPTIME_RAW_APPROX, - 12 => _CLOCK_PROCESS_CPUTIME_ID, - 16 => _CLOCK_THREAD_CPUTIME_ID, - _ => throw ArgumentError("Unknown value for clockid_t: $value"), - }; + /// countByEnumeratingWithState:objects:count: + static final countByEnumeratingWithState_objects_count_ = + objc.ObjCProtocolMethod< + DartNSUInteger Function(ffi.Pointer, + ffi.Pointer>, DartNSUInteger)>( + _protocol_NSFastEnumeration, + _sel_countByEnumeratingWithState_objects_count_, + objc.getProtocolMethodSignature( + _protocol_NSFastEnumeration, + _sel_countByEnumeratingWithState_objects_count_, + isRequired: true, + isInstanceMethod: true, + ), + (DartNSUInteger Function(ffi.Pointer, + ffi.Pointer>, DartNSUInteger) + func) => + ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger + .fromFunction((ffi.Pointer _, + ffi.Pointer arg1, + ffi.Pointer> arg2, + DartNSUInteger arg3) => + func(arg1, arg2, arg3)), + ); } -typedef intmax_t = ffi.Long; -typedef Dartintmax_t = int; - -final class imaxdiv_t extends ffi.Struct { - @intmax_t() - external int quot; +late final _class_NSEnumerator = objc.getClass("NSEnumerator"); +late final _sel_allObjects = objc.registerName("allObjects"); - @intmax_t() - external int rem; +/// NSExtendedEnumerator +extension NSExtendedEnumerator on objc.NSEnumerator { + /// allObjects + objc.ObjCObjectBase get allObjects { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allObjects); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } } -typedef uintmax_t = ffi.UnsignedLong; -typedef Dartuintmax_t = int; - -final class CFBagCallBacks extends ffi.Struct { - @CFIndex() - external int version; +late final _class_NSDictionary = objc.getClass("NSDictionary"); +late final _sel_allKeys = objc.registerName("allKeys"); +late final _sel_allKeysForObject_ = objc.registerName("allKeysForObject:"); +late final _sel_allValues = objc.registerName("allValues"); +late final _sel_descriptionInStringsFileFormat = + objc.registerName("descriptionInStringsFileFormat"); +late final _sel_descriptionWithLocale_indent_ = + objc.registerName("descriptionWithLocale:indent:"); +final _objc_msgSend_dcd68g = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_isEqualToDictionary_ = + objc.registerName("isEqualToDictionary:"); +late final _sel_objectEnumerator = objc.registerName("objectEnumerator"); +late final _sel_objectsForKeys_notFoundMarker_ = + objc.registerName("objectsForKeys:notFoundMarker:"); +late final _sel_writeToURL_error_ = objc.registerName("writeToURL:error:"); +final _objc_msgSend_blqzg8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_keysSortedByValueUsingSelector_ = + objc.registerName("keysSortedByValueUsingSelector:"); +late final _sel_getObjects_andKeys_count_ = + objc.registerName("getObjects:andKeys:count:"); +final _objc_msgSend_n2svg2 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.UnsignedLong)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + int)>(); +late final _sel_objectForKeyedSubscript_ = + objc.registerName("objectForKeyedSubscript:"); +void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} - external CFBagRetainCallBack retain; +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerTrampoline) + ..keepIsolateAlive = false; - external CFBagReleaseCallBack release; +/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(pointer, + retain: retain, release: release); - external CFBagCopyDescriptionCallBack copyDescription; + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - external CFBagEqualCallBack equal; + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.Pointer, ffi.Pointer)> + fromFunction(void Function(objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) fn) => + objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true), + arg2)), + retain: false, + release: true); - external CFBagHashCallBack hash; + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> listener( + void Function( + objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn(objc.ObjCObjectBase(arg0, retain: false, release: true), + objc.ObjCObjectBase(arg1, retain: false, release: true), arg2)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1krhfwz(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(wrapper, retain: false, release: true); + } } -typedef CFBagRetainCallBack - = ffi.Pointer>; -typedef CFBagRetainCallBackFunction = ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFBagReleaseCallBack - = ffi.Pointer>; -typedef CFBagReleaseCallBackFunction = ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef DartCFBagReleaseCallBackFunction = void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFBagCopyDescriptionCallBack - = ffi.Pointer>; -typedef CFBagCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer value); -typedef CFBagEqualCallBack - = ffi.Pointer>; -typedef CFBagEqualCallBackFunction = Boolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef DartCFBagEqualCallBackFunction = DartBoolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef CFBagHashCallBack - = ffi.Pointer>; -typedef CFBagHashCallBackFunction = CFHashCode Function( - ffi.Pointer value); -typedef DartCFBagHashCallBackFunction = DartCFHashCode Function( - ffi.Pointer value); +/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +extension ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> { + void call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, + ffi.Pointer arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2); +} -final class __CFBag extends ffi.Opaque {} +late final _sel_enumerateKeysAndObjectsUsingBlock_ = + objc.registerName("enumerateKeysAndObjectsUsingBlock:"); +final _objc_msgSend_f167m6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_enumerateKeysAndObjectsWithOptions_usingBlock_ = + objc.registerName("enumerateKeysAndObjectsWithOptions:usingBlock:"); +final _objc_msgSend_yx8yc6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_keysSortedByValueUsingComparator_ = + objc.registerName("keysSortedByValueUsingComparator:"); +final _objc_msgSend_cy99le = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_keysSortedByValueWithOptions_usingComparator_ = + objc.registerName("keysSortedByValueWithOptions:usingComparator:"); +final _objc_msgSend_1u2b7ut = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline, + false) + .cast(); +bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureTrampoline, + false) + .cast(); -typedef CFBagRef = ffi.Pointer<__CFBag>; -typedef CFMutableBagRef = ffi.Pointer<__CFBag>; -typedef CFBagApplierFunction - = ffi.Pointer>; -typedef CFBagApplierFunctionFunction = ffi.Void Function( - ffi.Pointer value, ffi.Pointer context); -typedef DartCFBagApplierFunctionFunction = void Function( - ffi.Pointer value, ffi.Pointer context); +/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(pointer, + retain: retain, release: release); -final class CFBinaryHeapCompareContext extends ffi.Struct { - @CFIndex() - external int version; + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - external ffi.Pointer info; + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.Pointer, ffi.Pointer)> + fromFunction(bool Function(objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) fn) => + objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true), + arg2)), + retain: false, + release: true); +} - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; +/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +extension ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_CallExtension + on objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> { + bool call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, + ffi.Pointer arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2); +} - external ffi.Pointer< - ffi.NativeFunction info)>> - release; +late final _sel_keysOfEntriesPassingTest_ = + objc.registerName("keysOfEntriesPassingTest:"); +late final _sel_keysOfEntriesWithOptions_passingTest_ = + objc.registerName("keysOfEntriesWithOptions:passingTest:"); +final _objc_msgSend_hd4f96 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; -} +/// NSExtendedDictionary +extension NSExtendedDictionary on objc.NSDictionary { + /// allKeys + objc.ObjCObjectBase get allKeys { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allKeys); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } -final class CFBinaryHeapCallBacks extends ffi.Struct { - @CFIndex() - external int version; + /// allKeysForObject: + objc.ObjCObjectBase allKeysForObject_(objc.ObjCObjectBase anObject) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_allKeysForObject_, anObject.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer ptr)>> retain; + /// allValues + objc.ObjCObjectBase get allValues { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allValues); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } - external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer ptr)>> release; + /// description + objc.NSString get description { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_description); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } - external ffi.Pointer< - ffi.NativeFunction ptr)>> - copyDescription; + /// descriptionInStringsFileFormat + objc.NSString get descriptionInStringsFileFormat { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_descriptionInStringsFileFormat); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } - external ffi.Pointer< - ffi.NativeFunction< - CFIndex Function( - ffi.Pointer ptr1, - ffi.Pointer ptr2, - ffi.Pointer context)>> compare; -} + /// descriptionWithLocale: + objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } -final class __CFBinaryHeap extends ffi.Opaque {} + /// descriptionWithLocale:indent: + objc.NSString descriptionWithLocale_indent_( + objc.ObjCObjectBase? locale, DartNSUInteger level) { + final _ret = _objc_msgSend_dcd68g( + this.ref.pointer, + _sel_descriptionWithLocale_indent_, + locale?.ref.pointer ?? ffi.nullptr, + level); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } -typedef CFBinaryHeapRef = ffi.Pointer<__CFBinaryHeap>; -typedef CFBinaryHeapApplierFunction - = ffi.Pointer>; -typedef CFBinaryHeapApplierFunctionFunction = ffi.Void Function( - ffi.Pointer val, ffi.Pointer context); -typedef DartCFBinaryHeapApplierFunctionFunction = void Function( - ffi.Pointer val, ffi.Pointer context); + /// isEqualToDictionary: + bool isEqualToDictionary_(objc.NSDictionary otherDictionary) { + return _objc_msgSend_69e0x1(this.ref.pointer, _sel_isEqualToDictionary_, + otherDictionary.ref.pointer); + } -final class __CFBitVector extends ffi.Opaque {} + /// objectEnumerator + objc.NSEnumerator objectEnumerator() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_objectEnumerator); + return objc.NSEnumerator.castFromPointer(_ret, retain: true, release: true); + } -typedef CFBitVectorRef = ffi.Pointer<__CFBitVector>; -typedef CFMutableBitVectorRef = ffi.Pointer<__CFBitVector>; -typedef CFBit = UInt32; + /// objectsForKeys:notFoundMarker: + objc.ObjCObjectBase objectsForKeys_notFoundMarker_( + objc.ObjCObjectBase keys, objc.ObjCObjectBase marker) { + final _ret = _objc_msgSend_rsfdlh( + this.ref.pointer, + _sel_objectsForKeys_notFoundMarker_, + keys.ref.pointer, + marker.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } -final class CFSwappedFloat32 extends ffi.Struct { - @ffi.Uint32() - external int v; -} + /// writeToURL:error: + bool writeToURL_error_( + objc.NSURL url, ffi.Pointer> error) { + return _objc_msgSend_blqzg8( + this.ref.pointer, _sel_writeToURL_error_, url.ref.pointer, error); + } -final class CFSwappedFloat64 extends ffi.Struct { - @ffi.Uint64() - external int v; -} + /// keysSortedByValueUsingSelector: + objc.ObjCObjectBase keysSortedByValueUsingSelector_( + ffi.Pointer comparator) { + final _ret = _objc_msgSend_19hbqky( + this.ref.pointer, _sel_keysSortedByValueUsingSelector_, comparator); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } -final class CFDictionaryKeyCallBacks extends ffi.Struct { - @CFIndex() - external int version; + /// getObjects:andKeys:count: + void getObjects_andKeys_count_( + ffi.Pointer> objects, + ffi.Pointer> keys, + DartNSUInteger count) { + _objc_msgSend_n2svg2( + this.ref.pointer, _sel_getObjects_andKeys_count_, objects, keys, count); + } - external CFDictionaryRetainCallBack retain; + /// objectForKeyedSubscript: + objc.ObjCObjectBase? objectForKeyedSubscript_(objc.ObjCObjectBase key) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_objectForKeyedSubscript_, key.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } - external CFDictionaryReleaseCallBack release; + /// enumerateKeysAndObjectsUsingBlock: + void enumerateKeysAndObjectsUsingBlock_( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + block) { + _objc_msgSend_f167m6(this.ref.pointer, + _sel_enumerateKeysAndObjectsUsingBlock_, block.ref.pointer); + } - external CFDictionaryCopyDescriptionCallBack copyDescription; + /// enumerateKeysAndObjectsWithOptions:usingBlock: + void enumerateKeysAndObjectsWithOptions_usingBlock_( + objc.NSEnumerationOptions opts, + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + block) { + _objc_msgSend_yx8yc6( + this.ref.pointer, + _sel_enumerateKeysAndObjectsWithOptions_usingBlock_, + opts.value, + block.ref.pointer); + } - external CFDictionaryEqualCallBack equal; + /// keysSortedByValueUsingComparator: + objc.ObjCObjectBase keysSortedByValueUsingComparator_( + DartNSComparator cmptr) { + final _ret = _objc_msgSend_cy99le(this.ref.pointer, + _sel_keysSortedByValueUsingComparator_, cmptr.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } - external CFDictionaryHashCallBack hash; + /// keysSortedByValueWithOptions:usingComparator: + objc.ObjCObjectBase keysSortedByValueWithOptions_usingComparator_( + objc.NSSortOptions opts, DartNSComparator cmptr) { + final _ret = _objc_msgSend_1u2b7ut( + this.ref.pointer, + _sel_keysSortedByValueWithOptions_usingComparator_, + opts.value, + cmptr.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// keysOfEntriesPassingTest: + objc.ObjCObjectBase keysOfEntriesPassingTest_( + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + predicate) { + final _ret = _objc_msgSend_cy99le(this.ref.pointer, + _sel_keysOfEntriesPassingTest_, predicate.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// keysOfEntriesWithOptions:passingTest: + objc.ObjCObjectBase keysOfEntriesWithOptions_passingTest_( + objc.NSEnumerationOptions opts, + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + predicate) { + final _ret = _objc_msgSend_hd4f96( + this.ref.pointer, + _sel_keysOfEntriesWithOptions_passingTest_, + opts.value, + predicate.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } } -typedef CFDictionaryRetainCallBack - = ffi.Pointer>; -typedef CFDictionaryRetainCallBackFunction = ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFDictionaryReleaseCallBack - = ffi.Pointer>; -typedef CFDictionaryReleaseCallBackFunction = ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef DartCFDictionaryReleaseCallBackFunction = void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFDictionaryCopyDescriptionCallBack = ffi - .Pointer>; -typedef CFDictionaryCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer value); -typedef CFDictionaryEqualCallBack - = ffi.Pointer>; -typedef CFDictionaryEqualCallBackFunction = Boolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef DartCFDictionaryEqualCallBackFunction = DartBoolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef CFDictionaryHashCallBack - = ffi.Pointer>; -typedef CFDictionaryHashCallBackFunction = CFHashCode Function( - ffi.Pointer value); -typedef DartCFDictionaryHashCallBackFunction = DartCFHashCode Function( - ffi.Pointer value); +late final _sel_getObjects_andKeys_ = objc.registerName("getObjects:andKeys:"); +final _objc_msgSend_hefmm1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); +late final _sel_dictionaryWithContentsOfFile_ = + objc.registerName("dictionaryWithContentsOfFile:"); +late final _sel_dictionaryWithContentsOfURL_ = + objc.registerName("dictionaryWithContentsOfURL:"); +late final _sel_initWithContentsOfFile_ = + objc.registerName("initWithContentsOfFile:"); +late final _sel_initWithContentsOfURL_ = + objc.registerName("initWithContentsOfURL:"); +late final _sel_writeToFile_atomically_ = + objc.registerName("writeToFile:atomically:"); +final _objc_msgSend_w8pbfh = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_writeToURL_atomically_ = + objc.registerName("writeToURL:atomically:"); + +/// NSDeprecated +extension NSDeprecated on objc.NSDictionary { + /// getObjects:andKeys: + void getObjects_andKeys_(ffi.Pointer> objects, + ffi.Pointer> keys) { + _objc_msgSend_hefmm1( + this.ref.pointer, _sel_getObjects_andKeys_, objects, keys); + } + + /// dictionaryWithContentsOfFile: + static objc.NSDictionary? dictionaryWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(_class_NSDictionary, + _sel_dictionaryWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } -final class CFDictionaryValueCallBacks extends ffi.Struct { - @CFIndex() - external int version; + /// dictionaryWithContentsOfURL: + static objc.NSDictionary? dictionaryWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(_class_NSDictionary, + _sel_dictionaryWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } - external CFDictionaryRetainCallBack retain; + /// initWithContentsOfFile: + objc.NSDictionary? initWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); + } - external CFDictionaryReleaseCallBack release; + /// initWithContentsOfURL: + objc.NSDictionary? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); + } - external CFDictionaryCopyDescriptionCallBack copyDescription; + /// writeToFile:atomically: + bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { + return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToFile_atomically_, + path.ref.pointer, useAuxiliaryFile); + } - external CFDictionaryEqualCallBack equal; + /// writeToURL:atomically: + bool writeToURL_atomically_(objc.NSURL url, bool atomically) { + return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToURL_atomically_, + url.ref.pointer, atomically); + } } -final class __CFDictionary extends ffi.Opaque {} +late final _sel_dictionary = objc.registerName("dictionary"); +late final _sel_dictionaryWithObject_forKey_ = + objc.registerName("dictionaryWithObject:forKey:"); +late final _sel_dictionaryWithObjects_forKeys_count_ = + objc.registerName("dictionaryWithObjects:forKeys:count:"); +final _objc_msgSend_cfqbni = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + int)>(); +late final _sel_dictionaryWithObjectsAndKeys_ = + objc.registerName("dictionaryWithObjectsAndKeys:"); +late final _sel_dictionaryWithDictionary_ = + objc.registerName("dictionaryWithDictionary:"); +late final _sel_dictionaryWithObjects_forKeys_ = + objc.registerName("dictionaryWithObjects:forKeys:"); +late final _sel_initWithObjectsAndKeys_ = + objc.registerName("initWithObjectsAndKeys:"); +late final _sel_initWithDictionary_ = objc.registerName("initWithDictionary:"); +late final _sel_initWithDictionary_copyItems_ = + objc.registerName("initWithDictionary:copyItems:"); +final _objc_msgSend_1bdmr5f = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_initWithObjects_forKeys_ = + objc.registerName("initWithObjects:forKeys:"); +late final _sel_initWithContentsOfURL_error_ = + objc.registerName("initWithContentsOfURL:error:"); +final _objc_msgSend_1705co6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_dictionaryWithContentsOfURL_error_ = + objc.registerName("dictionaryWithContentsOfURL:error:"); + +/// NSDictionaryCreation +extension NSDictionaryCreation on objc.NSDictionary { + /// dictionary + static objc.NSDictionary dictionary() { + final _ret = _objc_msgSend_1x359cv(_class_NSDictionary, _sel_dictionary); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } -typedef CFDictionaryRef = ffi.Pointer<__CFDictionary>; -typedef CFMutableDictionaryRef = ffi.Pointer<__CFDictionary>; -typedef CFDictionaryApplierFunction - = ffi.Pointer>; -typedef CFDictionaryApplierFunctionFunction = ffi.Void Function( - ffi.Pointer key, - ffi.Pointer value, - ffi.Pointer context); -typedef DartCFDictionaryApplierFunctionFunction = void Function( - ffi.Pointer key, - ffi.Pointer value, - ffi.Pointer context); + /// dictionaryWithObject:forKey: + static objc.NSDictionary dictionaryWithObject_forKey_( + objc.ObjCObjectBase object, objc.ObjCObjectBase key) { + final _ret = _objc_msgSend_rsfdlh(_class_NSDictionary, + _sel_dictionaryWithObject_forKey_, object.ref.pointer, key.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } -final class __CFNotificationCenter extends ffi.Opaque {} + /// dictionaryWithObjects:forKeys:count: + static objc.NSDictionary dictionaryWithObjects_forKeys_count_( + ffi.Pointer> objects, + ffi.Pointer> keys, + DartNSUInteger cnt) { + final _ret = _objc_msgSend_cfqbni(_class_NSDictionary, + _sel_dictionaryWithObjects_forKeys_count_, objects, keys, cnt); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } -typedef CFNotificationCenterRef = ffi.Pointer<__CFNotificationCenter>; -typedef CFNotificationCallback - = ffi.Pointer>; -typedef CFNotificationCallbackFunction = ffi.Void Function( - CFNotificationCenterRef center, - ffi.Pointer observer, - CFNotificationName name, - ffi.Pointer object, - CFDictionaryRef userInfo); -typedef DartCFNotificationCallbackFunction = void Function( - CFNotificationCenterRef center, - ffi.Pointer observer, - CFNotificationName name, - ffi.Pointer object, - CFDictionaryRef userInfo); -typedef CFNotificationName = CFStringRef; + /// dictionaryWithObjectsAndKeys: + static objc.NSDictionary dictionaryWithObjectsAndKeys_( + objc.ObjCObjectBase firstObject) { + final _ret = _objc_msgSend_62nh5j(_class_NSDictionary, + _sel_dictionaryWithObjectsAndKeys_, firstObject.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } -enum CFNotificationSuspensionBehavior { - CFNotificationSuspensionBehaviorDrop(1), - CFNotificationSuspensionBehaviorCoalesce(2), - CFNotificationSuspensionBehaviorHold(3), - CFNotificationSuspensionBehaviorDeliverImmediately(4); + /// dictionaryWithDictionary: + static objc.NSDictionary dictionaryWithDictionary_(objc.NSDictionary dict) { + final _ret = _objc_msgSend_62nh5j( + _class_NSDictionary, _sel_dictionaryWithDictionary_, dict.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } - final int value; - const CFNotificationSuspensionBehavior(this.value); + /// dictionaryWithObjects:forKeys: + static objc.NSDictionary dictionaryWithObjects_forKeys_( + objc.ObjCObjectBase objects, objc.ObjCObjectBase keys) { + final _ret = _objc_msgSend_rsfdlh( + _class_NSDictionary, + _sel_dictionaryWithObjects_forKeys_, + objects.ref.pointer, + keys.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } - static CFNotificationSuspensionBehavior fromValue(int value) => - switch (value) { - 1 => CFNotificationSuspensionBehaviorDrop, - 2 => CFNotificationSuspensionBehaviorCoalesce, - 3 => CFNotificationSuspensionBehaviorHold, - 4 => CFNotificationSuspensionBehaviorDeliverImmediately, - _ => throw ArgumentError( - "Unknown value for CFNotificationSuspensionBehavior: $value"), - }; -} + /// initWithObjectsAndKeys: + objc.NSDictionary initWithObjectsAndKeys_(objc.ObjCObjectBase firstObject) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithObjectsAndKeys_, firstObject.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, + retain: false, release: true); + } -final class __CFLocale extends ffi.Opaque {} + /// initWithDictionary: + objc.NSDictionary initWithDictionary_(objc.NSDictionary otherDictionary) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithDictionary_, otherDictionary.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, + retain: false, release: true); + } -typedef CFLocaleRef = ffi.Pointer<__CFLocale>; -typedef CFLocaleIdentifier = CFStringRef; -typedef LangCode = SInt16; -typedef RegionCode = SInt16; + /// initWithDictionary:copyItems: + objc.NSDictionary initWithDictionary_copyItems_( + objc.NSDictionary otherDictionary, bool flag) { + final _ret = _objc_msgSend_1bdmr5f(this.ref.retainAndReturnPointer(), + _sel_initWithDictionary_copyItems_, otherDictionary.ref.pointer, flag); + return objc.NSDictionary.castFromPointer(_ret, + retain: false, release: true); + } -enum CFLocaleLanguageDirection { - kCFLocaleLanguageDirectionUnknown(0), - kCFLocaleLanguageDirectionLeftToRight(1), - kCFLocaleLanguageDirectionRightToLeft(2), - kCFLocaleLanguageDirectionTopToBottom(3), - kCFLocaleLanguageDirectionBottomToTop(4); + /// initWithObjects:forKeys: + objc.NSDictionary initWithObjects_forKeys_( + objc.ObjCObjectBase objects, objc.ObjCObjectBase keys) { + final _ret = _objc_msgSend_rsfdlh(this.ref.retainAndReturnPointer(), + _sel_initWithObjects_forKeys_, objects.ref.pointer, keys.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, + retain: false, release: true); + } - final int value; - const CFLocaleLanguageDirection(this.value); + /// initWithContentsOfURL:error: + objc.NSDictionary? initWithContentsOfURL_error_( + objc.NSURL url, ffi.Pointer> error) { + final _ret = _objc_msgSend_1705co6(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_error_, url.ref.pointer, error); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); + } - static CFLocaleLanguageDirection fromValue(int value) => switch (value) { - 0 => kCFLocaleLanguageDirectionUnknown, - 1 => kCFLocaleLanguageDirectionLeftToRight, - 2 => kCFLocaleLanguageDirectionRightToLeft, - 3 => kCFLocaleLanguageDirectionTopToBottom, - 4 => kCFLocaleLanguageDirectionBottomToTop, - _ => throw ArgumentError( - "Unknown value for CFLocaleLanguageDirection: $value"), - }; + /// dictionaryWithContentsOfURL:error: + static objc.NSDictionary? dictionaryWithContentsOfURL_error_( + objc.NSURL url, ffi.Pointer> error) { + final _ret = _objc_msgSend_1705co6(_class_NSDictionary, + _sel_dictionaryWithContentsOfURL_error_, url.ref.pointer, error); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } } -typedef CFLocaleKey = CFStringRef; -typedef CFCalendarIdentifier = CFStringRef; -typedef CFAbsoluteTime = CFTimeInterval; -typedef CFTimeInterval = ffi.Double; -typedef DartCFTimeInterval = double; +late final _class_NSMutableDictionary = objc.getClass("NSMutableDictionary"); +late final _sel_addEntriesFromDictionary_ = + objc.registerName("addEntriesFromDictionary:"); +late final _sel_removeAllObjects = objc.registerName("removeAllObjects"); +late final _sel_removeObjectsForKeys_ = + objc.registerName("removeObjectsForKeys:"); +late final _sel_setDictionary_ = objc.registerName("setDictionary:"); +late final _sel_setObject_forKeyedSubscript_ = + objc.registerName("setObject:forKeyedSubscript:"); -final class __CFDate extends ffi.Opaque {} +/// NSExtendedMutableDictionary +extension NSExtendedMutableDictionary on objc.NSMutableDictionary { + /// addEntriesFromDictionary: + void addEntriesFromDictionary_(objc.NSDictionary otherDictionary) { + _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_addEntriesFromDictionary_, + otherDictionary.ref.pointer); + } -typedef CFDateRef = ffi.Pointer<__CFDate>; + /// removeAllObjects + void removeAllObjects() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllObjects); + } -final class __CFTimeZone extends ffi.Opaque {} + /// removeObjectsForKeys: + void removeObjectsForKeys_(objc.ObjCObjectBase keyArray) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_removeObjectsForKeys_, keyArray.ref.pointer); + } -final class CFGregorianDate extends ffi.Struct { - @SInt32() - external int year; + /// setDictionary: + void setDictionary_(objc.NSDictionary otherDictionary) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setDictionary_, otherDictionary.ref.pointer); + } - @SInt8() - external int month; + /// setObject:forKeyedSubscript: + void setObject_forKeyedSubscript_( + objc.ObjCObjectBase? obj, objc.ObjCObjectBase key) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_setObject_forKeyedSubscript_, + obj?.ref.pointer ?? ffi.nullptr, key.ref.pointer); + } +} - @SInt8() - external int day; +late final _sel_dictionaryWithCapacity_ = + objc.registerName("dictionaryWithCapacity:"); +final _objc_msgSend_1qrcblu = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); - @SInt8() - external int hour; +/// NSMutableDictionaryCreation +extension NSMutableDictionaryCreation on objc.NSMutableDictionary { + /// dictionaryWithCapacity: + static objc.NSMutableDictionary dictionaryWithCapacity_( + DartNSUInteger numItems) { + final _ret = _objc_msgSend_1qrcblu( + _class_NSMutableDictionary, _sel_dictionaryWithCapacity_, numItems); + return objc.NSMutableDictionary.castFromPointer(_ret, + retain: true, release: true); + } - @SInt8() - external int minute; + /// dictionaryWithContentsOfFile: + static objc.NSMutableDictionary? dictionaryWithContentsOfFile_( + objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(_class_NSMutableDictionary, + _sel_dictionaryWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableDictionary.castFromPointer(_ret, + retain: true, release: true); + } - @ffi.Double() - external double second; + /// dictionaryWithContentsOfURL: + static objc.NSMutableDictionary? dictionaryWithContentsOfURL_( + objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(_class_NSMutableDictionary, + _sel_dictionaryWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableDictionary.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithContentsOfFile: + objc.NSMutableDictionary? initWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableDictionary.castFromPointer(_ret, + retain: false, release: true); + } + + /// initWithContentsOfURL: + objc.NSMutableDictionary? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableDictionary.castFromPointer(_ret, + retain: false, release: true); + } } -typedef SInt8 = ffi.SignedChar; -typedef DartSInt8 = int; +late final _sel_sharedKeySetForKeys_ = + objc.registerName("sharedKeySetForKeys:"); -final class CFGregorianUnits extends ffi.Struct { - @SInt32() - external int years; - - @SInt32() - external int months; - - @SInt32() - external int days; - - @SInt32() - external int hours; +/// NSSharedKeySetDictionary +extension NSSharedKeySetDictionary on objc.NSDictionary { + /// sharedKeySetForKeys: + static objc.ObjCObjectBase sharedKeySetForKeys_(objc.ObjCObjectBase keys) { + final _ret = _objc_msgSend_62nh5j( + _class_NSDictionary, _sel_sharedKeySetForKeys_, keys.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} - @SInt32() - external int minutes; +late final _sel_dictionaryWithSharedKeySet_ = + objc.registerName("dictionaryWithSharedKeySet:"); - @ffi.Double() - external double seconds; +/// NSSharedKeySetDictionary +extension NSSharedKeySetDictionary1 on objc.NSMutableDictionary { + /// dictionaryWithSharedKeySet: + static objc.NSMutableDictionary dictionaryWithSharedKeySet_( + objc.ObjCObjectBase keyset) { + final _ret = _objc_msgSend_62nh5j(_class_NSMutableDictionary, + _sel_dictionaryWithSharedKeySet_, keyset.ref.pointer); + return objc.NSMutableDictionary.castFromPointer(_ret, + retain: true, release: true); + } } -typedef CFTimeZoneRef = ffi.Pointer<__CFTimeZone>; +/// NSGenericFastEnumeration +extension NSGenericFastEnumeration on objc.NSDictionary { + /// countByEnumeratingWithState:objects:count: + DartNSUInteger countByEnumeratingWithState_objects_count_( + ffi.Pointer state, + ffi.Pointer> buffer, + DartNSUInteger len) { + return _objc_msgSend_1b5ysjl(this.ref.pointer, + _sel_countByEnumeratingWithState_objects_count_, state, buffer, len); + } +} -final class __CFData extends ffi.Opaque {} +typedef NSProgressKind = ffi.Pointer; +typedef DartNSProgressKind = objc.NSString; +typedef NSProgressUserInfoKey = ffi.Pointer; +typedef DartNSProgressUserInfoKey = objc.NSString; +typedef NSProgressFileOperationKind = ffi.Pointer; +typedef DartNSProgressFileOperationKind = objc.NSString; +typedef NSProgressUnpublishingHandler = ffi.Pointer; +typedef DartNSProgressUnpublishingHandler = objc.ObjCBlock; +NSProgressUnpublishingHandler + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer arg0)>>() + .asFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer)>()(arg0); +ffi.Pointer + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable = + ffi.Pointer.fromFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline) + .cast(); +NSProgressUnpublishingHandler + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as NSProgressUnpublishingHandler Function( + ffi.Pointer))(arg0); +ffi.Pointer + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable = + ffi.Pointer.fromFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline) + .cast(); -typedef CFDataRef = ffi.Pointer<__CFData>; -typedef CFMutableDataRef = ffi.Pointer<__CFData>; +/// Construction methods for `objc.ObjCBlock? Function(NSProgress)>`. +abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock? Function(NSProgress)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + objc.ObjCBlock? Function( + NSProgress)>(pointer, retain: retain, release: release); -enum CFDataSearchFlags { - kCFDataSearchBackwards(1), - kCFDataSearchAnchored(2); + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock? Function(NSProgress)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock? Function(NSProgress)>( + objc.newPointerBlock( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - final int value; - const CFDataSearchFlags(this.value); + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + objc.ObjCBlock? Function(NSProgress)> fromFunction( + DartNSProgressUnpublishingHandler? Function(NSProgress) fn) => + objc.ObjCBlock? Function(NSProgress)>( + objc.newClosureBlock( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable, + (ffi.Pointer arg0) => + fn(NSProgress.castFromPointer(arg0, retain: true, release: true)) + ?.ref + .retainAndAutorelease() ?? + ffi.nullptr), + retain: false, + release: true); +} - static CFDataSearchFlags fromValue(int value) => switch (value) { - 1 => kCFDataSearchBackwards, - 2 => kCFDataSearchAnchored, - _ => throw ArgumentError("Unknown value for CFDataSearchFlags: $value"), - }; +/// Call operator for `objc.ObjCBlock? Function(NSProgress)>`. +extension ObjCBlock_NSProgressUnpublishingHandler_NSProgress_CallExtension + on objc + .ObjCBlock? Function(NSProgress)> { + DartNSProgressUnpublishingHandler? call(NSProgress arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction, ffi.Pointer)>() + (ref.pointer, arg0.ref.pointer) + .address == + 0 + ? null + : ObjCBlock_ffiVoid.castFromPointer( + ref.pointer.ref.invoke.cast block, ffi.Pointer arg0)>>().asFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0.ref.pointer), + retain: true, + release: true); } -final class __CFCharacterSet extends ffi.Opaque {} +typedef NSProgressPublishingHandler = ffi.Pointer; +typedef DartNSProgressPublishingHandler + = objc.ObjCBlock? Function(NSProgress)>; +typedef CFArrayRetainCallBackFunction = ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFArrayRetainCallBack + = ffi.Pointer>; +typedef CFArrayReleaseCallBackFunction = ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef DartCFArrayReleaseCallBackFunction = void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFArrayReleaseCallBack + = ffi.Pointer>; +typedef CFArrayCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer value); +typedef CFArrayCopyDescriptionCallBack + = ffi.Pointer>; +typedef CFArrayEqualCallBackFunction = Boolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef DartCFArrayEqualCallBackFunction = DartBoolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef CFArrayEqualCallBack + = ffi.Pointer>; -typedef CFCharacterSetRef = ffi.Pointer<__CFCharacterSet>; +final class CFArrayCallBacks extends ffi.Struct { + @CFIndex() + external int version; -enum CFCharacterSetPredefinedSet { - kCFCharacterSetControl(1), - kCFCharacterSetWhitespace(2), - kCFCharacterSetWhitespaceAndNewline(3), - kCFCharacterSetDecimalDigit(4), - kCFCharacterSetLetter(5), - kCFCharacterSetLowercaseLetter(6), - kCFCharacterSetUppercaseLetter(7), - kCFCharacterSetNonBase(8), - kCFCharacterSetDecomposable(9), - kCFCharacterSetAlphaNumeric(10), - kCFCharacterSetPunctuation(11), - kCFCharacterSetCapitalizedLetter(13), - kCFCharacterSetSymbol(14), - kCFCharacterSetNewline(15), - kCFCharacterSetIllegal(12); + external CFArrayRetainCallBack retain; - final int value; - const CFCharacterSetPredefinedSet(this.value); + external CFArrayReleaseCallBack release; - static CFCharacterSetPredefinedSet fromValue(int value) => switch (value) { - 1 => kCFCharacterSetControl, - 2 => kCFCharacterSetWhitespace, - 3 => kCFCharacterSetWhitespaceAndNewline, - 4 => kCFCharacterSetDecimalDigit, - 5 => kCFCharacterSetLetter, - 6 => kCFCharacterSetLowercaseLetter, - 7 => kCFCharacterSetUppercaseLetter, - 8 => kCFCharacterSetNonBase, - 9 => kCFCharacterSetDecomposable, - 10 => kCFCharacterSetAlphaNumeric, - 11 => kCFCharacterSetPunctuation, - 13 => kCFCharacterSetCapitalizedLetter, - 14 => kCFCharacterSetSymbol, - 15 => kCFCharacterSetNewline, - 12 => kCFCharacterSetIllegal, - _ => throw ArgumentError( - "Unknown value for CFCharacterSetPredefinedSet: $value"), - }; -} + external CFArrayCopyDescriptionCallBack copyDescription; -typedef CFMutableCharacterSetRef = ffi.Pointer<__CFCharacterSet>; -typedef UniChar = UInt16; -typedef UTF32Char = UInt32; + external CFArrayEqualCallBack equal; +} -final class __CFError extends ffi.Opaque {} +typedef CFArrayApplierFunctionFunction = ffi.Void Function( + ffi.Pointer value, ffi.Pointer context); +typedef DartCFArrayApplierFunctionFunction = void Function( + ffi.Pointer value, ffi.Pointer context); +typedef CFArrayApplierFunction + = ffi.Pointer>; -typedef CFErrorDomain = CFStringRef; -typedef CFErrorRef = ffi.Pointer<__CFError>; -typedef CFStringEncoding = UInt32; -typedef CFMutableStringRef = ffi.Pointer<__CFString>; -typedef StringPtr = ffi.Pointer; -typedef ConstStringPtr = ffi.Pointer; +final class __CFArray extends ffi.Opaque {} -enum CFStringCompareFlags { - kCFCompareCaseInsensitive(1), - kCFCompareBackwards(4), - kCFCompareAnchored(8), - kCFCompareNonliteral(16), - kCFCompareLocalized(32), - kCFCompareNumerically(64), - kCFCompareDiacriticInsensitive(128), - kCFCompareWidthInsensitive(256), - kCFCompareForcedOrdering(512); +typedef CFArrayRef = ffi.Pointer<__CFArray>; +typedef CFMutableArrayRef = ffi.Pointer<__CFArray>; +typedef os_function_tFunction = ffi.Void Function(ffi.Pointer); +typedef Dartos_function_tFunction = void Function(ffi.Pointer); +typedef os_function_t = ffi.Pointer>; +typedef os_block_t = ffi.Pointer; +typedef Dartos_block_t = objc.ObjCBlock; + +/// WARNING: OS_object is a stub. To generate bindings for this class, include +/// OS_object in your config's objc-interfaces list. +/// +/// OS_object +class OS_object extends objc.NSObject { + OS_object._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - final int value; - const CFStringCompareFlags(this.value); + /// Constructs a [OS_object] that points to the same underlying object as [other]. + OS_object.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - static CFStringCompareFlags fromValue(int value) => switch (value) { - 1 => kCFCompareCaseInsensitive, - 4 => kCFCompareBackwards, - 8 => kCFCompareAnchored, - 16 => kCFCompareNonliteral, - 32 => kCFCompareLocalized, - 64 => kCFCompareNumerically, - 128 => kCFCompareDiacriticInsensitive, - 256 => kCFCompareWidthInsensitive, - 512 => kCFCompareForcedOrdering, - _ => - throw ArgumentError("Unknown value for CFStringCompareFlags: $value"), - }; + /// Constructs a [OS_object] that wraps the given raw object pointer. + OS_object.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); } -enum CFStringNormalizationForm { - kCFStringNormalizationFormD(0), - kCFStringNormalizationFormKD(1), - kCFStringNormalizationFormC(2), - kCFStringNormalizationFormKC(3); +late final _protocol_OS_sec_object = objc.getProtocol("OS_sec_object"); - final int value; - const CFStringNormalizationForm(this.value); +/// OS_sec_object +abstract final class OS_sec_object { + /// Builds an object that implements the OS_sec_object protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - static CFStringNormalizationForm fromValue(int value) => switch (value) { - 0 => kCFStringNormalizationFormD, - 1 => kCFStringNormalizationFormKD, - 2 => kCFStringNormalizationFormC, - 3 => kCFStringNormalizationFormKC, - _ => throw ArgumentError( - "Unknown value for CFStringNormalizationForm: $value"), - }; + return builder.build(); + } + + /// Adds the implementation of the OS_sec_object protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class CFStringInlineBuffer extends ffi.Struct { - @ffi.Array.multi([64]) - external ffi.Array buffer; +typedef sec_object_t = ffi.Pointer; +typedef Dartsec_object_t = objc.NSObject; - external CFStringRef theString; +final class __SecCertificate extends ffi.Opaque {} - external ffi.Pointer directUniCharBuffer; +typedef SecCertificateRef = ffi.Pointer<__SecCertificate>; +typedef OpaqueSecCertificateRef = __SecCertificate; - external ffi.Pointer directCStringBuffer; +final class __SecIdentity extends ffi.Opaque {} - external CFRange rangeToBuffer; +typedef SecIdentityRef = ffi.Pointer<__SecIdentity>; +typedef OpaqueSecIdentityRef = __SecIdentity; - @CFIndex() - external int bufferedRangeStart; +final class __SecKey extends ffi.Opaque {} - @CFIndex() - external int bufferedRangeEnd; -} +typedef SecKeyRef = ffi.Pointer<__SecKey>; +typedef OpaqueSecKeyRef = __SecKey; -enum CFTimeZoneNameStyle { - kCFTimeZoneNameStyleStandard(0), - kCFTimeZoneNameStyleShortStandard(1), - kCFTimeZoneNameStyleDaylightSaving(2), - kCFTimeZoneNameStyleShortDaylightSaving(3), - kCFTimeZoneNameStyleGeneric(4), - kCFTimeZoneNameStyleShortGeneric(5); +final class __SecPolicy extends ffi.Opaque {} - final int value; - const CFTimeZoneNameStyle(this.value); +typedef SecPolicyRef = ffi.Pointer<__SecPolicy>; - static CFTimeZoneNameStyle fromValue(int value) => switch (value) { - 0 => kCFTimeZoneNameStyleStandard, - 1 => kCFTimeZoneNameStyleShortStandard, - 2 => kCFTimeZoneNameStyleDaylightSaving, - 3 => kCFTimeZoneNameStyleShortDaylightSaving, - 4 => kCFTimeZoneNameStyleGeneric, - 5 => kCFTimeZoneNameStyleShortGeneric, - _ => - throw ArgumentError("Unknown value for CFTimeZoneNameStyle: $value"), - }; -} +final class __SecAccessControl extends ffi.Opaque {} -final class __CFCalendar extends ffi.Opaque {} +typedef SecAccessControlRef = ffi.Pointer<__SecAccessControl>; -typedef CFCalendarRef = ffi.Pointer<__CFCalendar>; +final class __SecKeychain extends ffi.Opaque {} -enum CFCalendarUnit { - kCFCalendarUnitEra(2), - kCFCalendarUnitYear(4), - kCFCalendarUnitMonth(8), - kCFCalendarUnitDay(16), - kCFCalendarUnitHour(32), - kCFCalendarUnitMinute(64), - kCFCalendarUnitSecond(128), - kCFCalendarUnitWeek(256), - kCFCalendarUnitWeekday(512), - kCFCalendarUnitWeekdayOrdinal(1024), - kCFCalendarUnitQuarter(2048), - kCFCalendarUnitWeekOfMonth(4096), - kCFCalendarUnitWeekOfYear(8192), - kCFCalendarUnitYearForWeekOfYear(16384); +typedef SecKeychainRef = ffi.Pointer<__SecKeychain>; - final int value; - const CFCalendarUnit(this.value); +final class __SecKeychainItem extends ffi.Opaque {} - static CFCalendarUnit fromValue(int value) => switch (value) { - 2 => kCFCalendarUnitEra, - 4 => kCFCalendarUnitYear, - 8 => kCFCalendarUnitMonth, - 16 => kCFCalendarUnitDay, - 32 => kCFCalendarUnitHour, - 64 => kCFCalendarUnitMinute, - 128 => kCFCalendarUnitSecond, - 256 => kCFCalendarUnitWeek, - 512 => kCFCalendarUnitWeekday, - 1024 => kCFCalendarUnitWeekdayOrdinal, - 2048 => kCFCalendarUnitQuarter, - 4096 => kCFCalendarUnitWeekOfMonth, - 8192 => kCFCalendarUnitWeekOfYear, - 16384 => kCFCalendarUnitYearForWeekOfYear, - _ => throw ArgumentError("Unknown value for CFCalendarUnit: $value"), - }; -} +typedef SecKeychainItemRef = ffi.Pointer<__SecKeychainItem>; -final class CGPoint extends ffi.Struct { - @CGFloat() - external double x; +final class __SecKeychainSearch extends ffi.Opaque {} - @CGFloat() - external double y; -} +typedef SecKeychainSearchRef = ffi.Pointer<__SecKeychainSearch>; +typedef SecKeychainAttrType = OSType; -typedef CGFloat = ffi.Double; -typedef DartCGFloat = double; +final class SecKeychainAttribute extends ffi.Struct { + @SecKeychainAttrType() + external int tag; -final class CGSize extends ffi.Struct { - @CGFloat() - external double width; + @UInt32() + external int length; - @CGFloat() - external double height; + external ffi.Pointer data; } -final class CGVector extends ffi.Struct { - @CGFloat() - external double dx; +typedef SecKeychainAttributePtr = ffi.Pointer; - @CGFloat() - external double dy; +final class SecKeychainAttributeList extends ffi.Struct { + @UInt32() + external int count; + + external ffi.Pointer attr; } -final class CGRect extends ffi.Struct { - external CGPoint origin; +typedef SecKeychainStatus = UInt32; - external CGSize size; -} +final class __SecTrustedApplication extends ffi.Opaque {} -final class CGAffineTransform extends ffi.Struct { - @CGFloat() - external double a; +typedef SecTrustedApplicationRef = ffi.Pointer<__SecTrustedApplication>; - @CGFloat() - external double b; +final class __SecAccess extends ffi.Opaque {} - @CGFloat() - external double c; +typedef SecAccessRef = ffi.Pointer<__SecAccess>; +typedef OpaqueSecAccessRef = __SecAccess; - @CGFloat() - external double d; +final class __SecACL extends ffi.Opaque {} - @CGFloat() - external double tx; +typedef SecACLRef = ffi.Pointer<__SecACL>; - @CGFloat() - external double ty; -} +final class __SecPassword extends ffi.Opaque {} -final class CGAffineTransformComponents extends ffi.Struct { - external CGSize scale; +typedef SecPasswordRef = ffi.Pointer<__SecPassword>; - @CGFloat() - external double horizontalShear; +final class SecKeychainAttributeInfo extends ffi.Struct { + @UInt32() + external int count; - @CGFloat() - external double rotation; + external ffi.Pointer tag; - external CGVector translation; + external ffi.Pointer format; } -final class __CFDateFormatter extends ffi.Opaque {} +typedef wint_t = __darwin_wint_t; -typedef CFDateFormatterRef = ffi.Pointer<__CFDateFormatter>; +final class _RuneEntry extends ffi.Struct { + @__darwin_rune_t() + external int __min; -enum CFISO8601DateFormatOptions { - kCFISO8601DateFormatWithYear(1), - kCFISO8601DateFormatWithMonth(2), - kCFISO8601DateFormatWithWeekOfYear(4), - kCFISO8601DateFormatWithDay(16), - kCFISO8601DateFormatWithTime(32), - kCFISO8601DateFormatWithTimeZone(64), - kCFISO8601DateFormatWithSpaceBetweenDateAndTime(128), - kCFISO8601DateFormatWithDashSeparatorInDate(256), - kCFISO8601DateFormatWithColonSeparatorInTime(512), - kCFISO8601DateFormatWithColonSeparatorInTimeZone(1024), - kCFISO8601DateFormatWithFractionalSeconds(2048), - kCFISO8601DateFormatWithFullDate(275), - kCFISO8601DateFormatWithFullTime(1632), - kCFISO8601DateFormatWithInternetDateTime(1907); + @__darwin_rune_t() + external int __max; - final int value; - const CFISO8601DateFormatOptions(this.value); + @__darwin_rune_t() + external int __map; - static CFISO8601DateFormatOptions fromValue(int value) => switch (value) { - 1 => kCFISO8601DateFormatWithYear, - 2 => kCFISO8601DateFormatWithMonth, - 4 => kCFISO8601DateFormatWithWeekOfYear, - 16 => kCFISO8601DateFormatWithDay, - 32 => kCFISO8601DateFormatWithTime, - 64 => kCFISO8601DateFormatWithTimeZone, - 128 => kCFISO8601DateFormatWithSpaceBetweenDateAndTime, - 256 => kCFISO8601DateFormatWithDashSeparatorInDate, - 512 => kCFISO8601DateFormatWithColonSeparatorInTime, - 1024 => kCFISO8601DateFormatWithColonSeparatorInTimeZone, - 2048 => kCFISO8601DateFormatWithFractionalSeconds, - 275 => kCFISO8601DateFormatWithFullDate, - 1632 => kCFISO8601DateFormatWithFullTime, - 1907 => kCFISO8601DateFormatWithInternetDateTime, - _ => throw ArgumentError( - "Unknown value for CFISO8601DateFormatOptions: $value"), - }; + external ffi.Pointer<__uint32_t> __types; } -enum CFDateFormatterStyle { - kCFDateFormatterNoStyle(0), - kCFDateFormatterShortStyle(1), - kCFDateFormatterMediumStyle(2), - kCFDateFormatterLongStyle(3), - kCFDateFormatterFullStyle(4); - - final int value; - const CFDateFormatterStyle(this.value); +final class _RuneRange extends ffi.Struct { + @ffi.Int() + external int __nranges; - static CFDateFormatterStyle fromValue(int value) => switch (value) { - 0 => kCFDateFormatterNoStyle, - 1 => kCFDateFormatterShortStyle, - 2 => kCFDateFormatterMediumStyle, - 3 => kCFDateFormatterLongStyle, - 4 => kCFDateFormatterFullStyle, - _ => - throw ArgumentError("Unknown value for CFDateFormatterStyle: $value"), - }; + external ffi.Pointer<_RuneEntry> __ranges; } -typedef CFDateFormatterKey = CFStringRef; - -final class __CFBoolean extends ffi.Opaque {} +final class _RuneCharClass extends ffi.Struct { + @ffi.Array.multi([14]) + external ffi.Array __name; -typedef CFBooleanRef = ffi.Pointer<__CFBoolean>; + @__uint32_t() + external int __mask; +} -final class __CFNumber extends ffi.Opaque {} +final class _RuneLocale extends ffi.Struct { + @ffi.Array.multi([8]) + external ffi.Array __magic; -typedef CFNumberRef = ffi.Pointer<__CFNumber>; + @ffi.Array.multi([32]) + external ffi.Array __encoding; -enum CFNumberType { - kCFNumberSInt8Type(1), - kCFNumberSInt16Type(2), - kCFNumberSInt32Type(3), - kCFNumberSInt64Type(4), - kCFNumberFloat32Type(5), - kCFNumberFloat64Type(6), - kCFNumberCharType(7), - kCFNumberShortType(8), - kCFNumberIntType(9), - kCFNumberLongType(10), - kCFNumberLongLongType(11), - kCFNumberFloatType(12), - kCFNumberDoubleType(13), - kCFNumberCFIndexType(14), - kCFNumberNSIntegerType(15), - kCFNumberCGFloatType(16); - - static const kCFNumberMaxType = kCFNumberCGFloatType; - - final int value; - const CFNumberType(this.value); - - static CFNumberType fromValue(int value) => switch (value) { - 1 => kCFNumberSInt8Type, - 2 => kCFNumberSInt16Type, - 3 => kCFNumberSInt32Type, - 4 => kCFNumberSInt64Type, - 5 => kCFNumberFloat32Type, - 6 => kCFNumberFloat64Type, - 7 => kCFNumberCharType, - 8 => kCFNumberShortType, - 9 => kCFNumberIntType, - 10 => kCFNumberLongType, - 11 => kCFNumberLongLongType, - 12 => kCFNumberFloatType, - 13 => kCFNumberDoubleType, - 14 => kCFNumberCFIndexType, - 15 => kCFNumberNSIntegerType, - 16 => kCFNumberCGFloatType, - _ => throw ArgumentError("Unknown value for CFNumberType: $value"), - }; + external ffi.Pointer< + ffi.NativeFunction< + __darwin_rune_t Function(ffi.Pointer, __darwin_size_t, + ffi.Pointer>)>> __sgetrune; - @override - String toString() { - if (this == kCFNumberCGFloatType) - return "CFNumberType.kCFNumberCGFloatType, CFNumberType.kCFNumberMaxType"; - return super.toString(); - } -} + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(__darwin_rune_t, ffi.Pointer, + __darwin_size_t, ffi.Pointer>)>> __sputrune; -final class __CFNumberFormatter extends ffi.Opaque {} + @__darwin_rune_t() + external int __invalid_rune; -typedef CFNumberFormatterRef = ffi.Pointer<__CFNumberFormatter>; + @ffi.Array.multi([256]) + external ffi.Array<__uint32_t> __runetype; -enum CFNumberFormatterStyle { - kCFNumberFormatterNoStyle(0), - kCFNumberFormatterDecimalStyle(1), - kCFNumberFormatterCurrencyStyle(2), - kCFNumberFormatterPercentStyle(3), - kCFNumberFormatterScientificStyle(4), - kCFNumberFormatterSpellOutStyle(5), - kCFNumberFormatterOrdinalStyle(6), - kCFNumberFormatterCurrencyISOCodeStyle(8), - kCFNumberFormatterCurrencyPluralStyle(9), - kCFNumberFormatterCurrencyAccountingStyle(10); + @ffi.Array.multi([256]) + external ffi.Array<__darwin_rune_t> __maplower; - final int value; - const CFNumberFormatterStyle(this.value); + @ffi.Array.multi([256]) + external ffi.Array<__darwin_rune_t> __mapupper; - static CFNumberFormatterStyle fromValue(int value) => switch (value) { - 0 => kCFNumberFormatterNoStyle, - 1 => kCFNumberFormatterDecimalStyle, - 2 => kCFNumberFormatterCurrencyStyle, - 3 => kCFNumberFormatterPercentStyle, - 4 => kCFNumberFormatterScientificStyle, - 5 => kCFNumberFormatterSpellOutStyle, - 6 => kCFNumberFormatterOrdinalStyle, - 8 => kCFNumberFormatterCurrencyISOCodeStyle, - 9 => kCFNumberFormatterCurrencyPluralStyle, - 10 => kCFNumberFormatterCurrencyAccountingStyle, - _ => throw ArgumentError( - "Unknown value for CFNumberFormatterStyle: $value"), - }; -} + external _RuneRange __runetype_ext; -typedef CFNumberFormatterKey = CFStringRef; -typedef CFPropertyListRef = CFTypeRef; + external _RuneRange __maplower_ext; -final class __CFURL extends ffi.Opaque {} + external _RuneRange __mapupper_ext; -typedef CFURLRef = ffi.Pointer<__CFURL>; + external ffi.Pointer __variable; -enum CFURLPathStyle { - kCFURLPOSIXPathStyle(0), - kCFURLHFSPathStyle(1), - kCFURLWindowsPathStyle(2); + @ffi.Int() + external int __variable_len; - final int value; - const CFURLPathStyle(this.value); + @ffi.Int() + external int __ncharclasses; - static CFURLPathStyle fromValue(int value) => switch (value) { - 0 => kCFURLPOSIXPathStyle, - 1 => kCFURLHFSPathStyle, - 2 => kCFURLWindowsPathStyle, - _ => throw ArgumentError("Unknown value for CFURLPathStyle: $value"), - }; + external ffi.Pointer<_RuneCharClass> __charclasses; } -enum CFURLComponentType { - kCFURLComponentScheme(1), - kCFURLComponentNetLocation(2), - kCFURLComponentPath(3), - kCFURLComponentResourceSpecifier(4), - kCFURLComponentUser(5), - kCFURLComponentPassword(6), - kCFURLComponentUserInfo(7), - kCFURLComponentHost(8), - kCFURLComponentPort(9), - kCFURLComponentParameterString(10), - kCFURLComponentQuery(11), - kCFURLComponentFragment(12); - - final int value; - const CFURLComponentType(this.value); +final class lconv extends ffi.Struct { + external ffi.Pointer decimal_point; - static CFURLComponentType fromValue(int value) => switch (value) { - 1 => kCFURLComponentScheme, - 2 => kCFURLComponentNetLocation, - 3 => kCFURLComponentPath, - 4 => kCFURLComponentResourceSpecifier, - 5 => kCFURLComponentUser, - 6 => kCFURLComponentPassword, - 7 => kCFURLComponentUserInfo, - 8 => kCFURLComponentHost, - 9 => kCFURLComponentPort, - 10 => kCFURLComponentParameterString, - 11 => kCFURLComponentQuery, - 12 => kCFURLComponentFragment, - _ => - throw ArgumentError("Unknown value for CFURLComponentType: $value"), - }; -} + external ffi.Pointer thousands_sep; -final class FSRef extends ffi.Opaque {} + external ffi.Pointer grouping; -enum CFURLBookmarkCreationOptions { - kCFURLBookmarkCreationMinimalBookmarkMask(512), - kCFURLBookmarkCreationSuitableForBookmarkFile(1024), - kCFURLBookmarkCreationWithSecurityScope(2048), - kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess(4096), - kCFURLBookmarkCreationWithoutImplicitSecurityScope(536870912), - kCFURLBookmarkCreationPreferFileIDResolutionMask(256); + external ffi.Pointer int_curr_symbol; - final int value; - const CFURLBookmarkCreationOptions(this.value); + external ffi.Pointer currency_symbol; - static CFURLBookmarkCreationOptions fromValue(int value) => switch (value) { - 512 => kCFURLBookmarkCreationMinimalBookmarkMask, - 1024 => kCFURLBookmarkCreationSuitableForBookmarkFile, - 2048 => kCFURLBookmarkCreationWithSecurityScope, - 4096 => kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess, - 536870912 => kCFURLBookmarkCreationWithoutImplicitSecurityScope, - 256 => kCFURLBookmarkCreationPreferFileIDResolutionMask, - _ => throw ArgumentError( - "Unknown value for CFURLBookmarkCreationOptions: $value"), - }; -} + external ffi.Pointer mon_decimal_point; -enum CFURLBookmarkResolutionOptions { - kCFURLBookmarkResolutionWithoutUIMask(256), - kCFURLBookmarkResolutionWithoutMountingMask(512), - kCFURLBookmarkResolutionWithSecurityScope(1024), - kCFURLBookmarkResolutionWithoutImplicitStartAccessing(32768); + external ffi.Pointer mon_thousands_sep; - static const kCFBookmarkResolutionWithoutUIMask = - kCFURLBookmarkResolutionWithoutUIMask; - static const kCFBookmarkResolutionWithoutMountingMask = - kCFURLBookmarkResolutionWithoutMountingMask; + external ffi.Pointer mon_grouping; - final int value; - const CFURLBookmarkResolutionOptions(this.value); + external ffi.Pointer positive_sign; - static CFURLBookmarkResolutionOptions fromValue(int value) => switch (value) { - 256 => kCFURLBookmarkResolutionWithoutUIMask, - 512 => kCFURLBookmarkResolutionWithoutMountingMask, - 1024 => kCFURLBookmarkResolutionWithSecurityScope, - 32768 => kCFURLBookmarkResolutionWithoutImplicitStartAccessing, - _ => throw ArgumentError( - "Unknown value for CFURLBookmarkResolutionOptions: $value"), - }; + external ffi.Pointer negative_sign; - @override - String toString() { - if (this == kCFURLBookmarkResolutionWithoutUIMask) - return "CFURLBookmarkResolutionOptions.kCFURLBookmarkResolutionWithoutUIMask, CFURLBookmarkResolutionOptions.kCFBookmarkResolutionWithoutUIMask"; - if (this == kCFURLBookmarkResolutionWithoutMountingMask) - return "CFURLBookmarkResolutionOptions.kCFURLBookmarkResolutionWithoutMountingMask, CFURLBookmarkResolutionOptions.kCFBookmarkResolutionWithoutMountingMask"; - return super.toString(); - } -} + @ffi.Char() + external int int_frac_digits; -typedef CFURLBookmarkFileCreationOptions = CFOptionFlags; + @ffi.Char() + external int frac_digits; -final class mach_port_status extends ffi.Struct { - @mach_port_rights_t() - external int mps_pset; + @ffi.Char() + external int p_cs_precedes; - @mach_port_seqno_t() - external int mps_seqno; + @ffi.Char() + external int p_sep_by_space; - @mach_port_mscount_t() - external int mps_mscount; + @ffi.Char() + external int n_cs_precedes; - @mach_port_msgcount_t() - external int mps_qlimit; + @ffi.Char() + external int n_sep_by_space; - @mach_port_msgcount_t() - external int mps_msgcount; + @ffi.Char() + external int p_sign_posn; - @mach_port_rights_t() - external int mps_sorights; + @ffi.Char() + external int n_sign_posn; - @boolean_t() - external int mps_srights; + @ffi.Char() + external int int_p_cs_precedes; - @boolean_t() - external int mps_pdrequest; + @ffi.Char() + external int int_n_cs_precedes; - @boolean_t() - external int mps_nsrequest; + @ffi.Char() + external int int_p_sep_by_space; - @natural_t() - external int mps_flags; -} + @ffi.Char() + external int int_n_sep_by_space; -typedef mach_port_rights_t = natural_t; -typedef natural_t = __darwin_natural_t; -typedef __darwin_natural_t = ffi.UnsignedInt; -typedef Dart__darwin_natural_t = int; -typedef mach_port_seqno_t = natural_t; -typedef mach_port_mscount_t = natural_t; -typedef mach_port_msgcount_t = natural_t; -typedef boolean_t = ffi.Int; -typedef Dartboolean_t = int; + @ffi.Char() + external int int_p_sign_posn; -final class mach_port_limits extends ffi.Struct { - @mach_port_msgcount_t() - external int mpl_qlimit; + @ffi.Char() + external int int_n_sign_posn; } -final class mach_port_info_ext extends ffi.Struct { - external mach_port_status_t mpie_status; +typedef float_t = ffi.Float; +typedef Dartfloat_t = double; +typedef double_t = ffi.Double; +typedef Dartdouble_t = double; - @mach_port_msgcount_t() - external int mpie_boost_cnt; +final class __float2 extends ffi.Struct { + @ffi.Float() + external double __sinval; - @ffi.Array.multi([6]) - external ffi.Array reserved; + @ffi.Float() + external double __cosval; } -typedef mach_port_status_t = mach_port_status; +final class __double2 extends ffi.Struct { + @ffi.Double() + external double __sinval; -final class mach_port_guard_info extends ffi.Struct { - @ffi.Uint64() - external int mpgi_guard; + @ffi.Double() + external double __cosval; } -final class mach_port_qos extends ffi.Opaque {} - -final class mach_service_port_info extends ffi.Struct { - @ffi.Array.multi([255]) - external ffi.Array mspi_string_name; +final class exception extends ffi.Struct { + @ffi.Int() + external int type; - @ffi.Uint8() - external int mspi_domain_type; -} + external ffi.Pointer name; -final class mach_port_options extends ffi.Struct { - @ffi.Uint32() - external int flags; + @ffi.Double() + external double arg1; - external mach_port_limits_t mpl; + @ffi.Double() + external double arg2; - external UnnamedUnion1 unnamed; + @ffi.Double() + external double retval; } -typedef mach_port_limits_t = mach_port_limits; - -final class UnnamedUnion1 extends ffi.Union { - @ffi.Array.multi([2]) - external ffi.Array reserved; - - @mach_port_name_t() - external int work_interval_port; +typedef fpos_t = __darwin_off_t; - external mach_service_port_info_t service_port_info; +final class __sbuf extends ffi.Struct { + external ffi.Pointer _base; - @mach_port_name_t() - external int service_port_name; + @ffi.Int() + external int _size; } -typedef mach_port_name_t = natural_t; -typedef mach_service_port_info_t = ffi.Pointer; - -final class __CFRunLoop extends ffi.Opaque {} - -final class __CFRunLoopSource extends ffi.Opaque {} +final class __sFILEX extends ffi.Opaque {} -final class __CFRunLoopObserver extends ffi.Opaque {} +final class __sFILE extends ffi.Struct { + external ffi.Pointer _p; -final class __CFRunLoopTimer extends ffi.Opaque {} + @ffi.Int() + external int _r; -typedef CFRunLoopMode = CFStringRef; -typedef CFRunLoopRef = ffi.Pointer<__CFRunLoop>; + @ffi.Int() + external int _w; -enum CFRunLoopRunResult { - kCFRunLoopRunFinished(1), - kCFRunLoopRunStopped(2), - kCFRunLoopRunTimedOut(3), - kCFRunLoopRunHandledSource(4); + @ffi.Short() + external int _flags; - final int value; - const CFRunLoopRunResult(this.value); + @ffi.Short() + external int _file; - static CFRunLoopRunResult fromValue(int value) => switch (value) { - 1 => kCFRunLoopRunFinished, - 2 => kCFRunLoopRunStopped, - 3 => kCFRunLoopRunTimedOut, - 4 => kCFRunLoopRunHandledSource, - _ => - throw ArgumentError("Unknown value for CFRunLoopRunResult: $value"), - }; -} + external __sbuf _bf; -typedef CFRunLoopSourceRef = ffi.Pointer<__CFRunLoopSource>; -typedef CFRunLoopObserverRef = ffi.Pointer<__CFRunLoopObserver>; -typedef CFRunLoopTimerRef = ffi.Pointer<__CFRunLoopTimer>; + @ffi.Int() + external int _lbfsize; -final class CFRunLoopSourceContext extends ffi.Struct { - @CFIndex() - external int version; + external ffi.Pointer _cookie; - external ffi.Pointer info; + external ffi + .Pointer)>> + _close; external ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; - - external ffi.Pointer< - ffi.NativeFunction info)>> - release; - - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; + ffi.Int Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>> _read; external ffi.Pointer< ffi.NativeFunction< - Boolean Function( - ffi.Pointer info1, ffi.Pointer info2)>> equal; - - external ffi.Pointer< - ffi.NativeFunction info)>> hash; + fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>> _seek; external ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer info, CFRunLoopRef rl, - CFRunLoopMode mode)>> schedule; + ffi.Int Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>> _write; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer info, CFRunLoopRef rl, - CFRunLoopMode mode)>> cancel; + external __sbuf _ub; - external ffi.Pointer< - ffi.NativeFunction info)>> - perform; -} + external ffi.Pointer<__sFILEX> _extra; -final class CFRunLoopSourceContext1 extends ffi.Struct { - @CFIndex() - external int version; + @ffi.Int() + external int _ur; - external ffi.Pointer info; + @ffi.Array.multi([3]) + external ffi.Array _ubuf; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; + @ffi.Array.multi([1]) + external ffi.Array _nbuf; - external ffi.Pointer< - ffi.NativeFunction info)>> - release; + external __sbuf _lb; - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; + @ffi.Int() + external int _blksize; - external ffi.Pointer< - ffi.NativeFunction< - Boolean Function( - ffi.Pointer info1, ffi.Pointer info2)>> equal; + @fpos_t() + external int _offset; +} - external ffi.Pointer< - ffi.NativeFunction info)>> hash; +typedef FILE = __sFILE; - external ffi.Pointer< - ffi.NativeFunction info)>> - getPort; +final class timespec extends ffi.Struct { + @__darwin_time_t() + external int tv_sec; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer msg, - CFIndex size, - CFAllocatorRef allocator, - ffi.Pointer info)>> perform; + @ffi.Long() + external int tv_nsec; } -typedef mach_port_t = __darwin_mach_port_t; -typedef __darwin_mach_port_t = __darwin_mach_port_name_t; -typedef __darwin_mach_port_name_t = __darwin_natural_t; +final class tm extends ffi.Struct { + @ffi.Int() + external int tm_sec; -final class CFRunLoopObserverContext extends ffi.Struct { - @CFIndex() - external int version; + @ffi.Int() + external int tm_min; - external ffi.Pointer info; + @ffi.Int() + external int tm_hour; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; + @ffi.Int() + external int tm_mday; - external ffi.Pointer< - ffi.NativeFunction info)>> - release; + @ffi.Int() + external int tm_mon; - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; -} + @ffi.Int() + external int tm_year; -typedef CFRunLoopObserverCallBack - = ffi.Pointer>; -typedef CFRunLoopObserverCallBackFunction = ffi.Void Function( - CFRunLoopObserverRef observer, - CFOptionFlags activity, - ffi.Pointer info); -typedef DartCFRunLoopObserverCallBackFunction = void Function( - CFRunLoopObserverRef observer, - CFRunLoopActivity activity, - ffi.Pointer info); + @ffi.Int() + external int tm_wday; -enum CFRunLoopActivity { - kCFRunLoopEntry(1), - kCFRunLoopBeforeTimers(2), - kCFRunLoopBeforeSources(4), - kCFRunLoopBeforeWaiting(32), - kCFRunLoopAfterWaiting(64), - kCFRunLoopExit(128), - kCFRunLoopAllActivities(268435455); + @ffi.Int() + external int tm_yday; - final int value; - const CFRunLoopActivity(this.value); + @ffi.Int() + external int tm_isdst; - static CFRunLoopActivity fromValue(int value) => switch (value) { - 1 => kCFRunLoopEntry, - 2 => kCFRunLoopBeforeTimers, - 4 => kCFRunLoopBeforeSources, - 32 => kCFRunLoopBeforeWaiting, - 64 => kCFRunLoopAfterWaiting, - 128 => kCFRunLoopExit, - 268435455 => kCFRunLoopAllActivities, - _ => throw ArgumentError("Unknown value for CFRunLoopActivity: $value"), - }; -} + @ffi.Long() + external int tm_gmtoff; -void _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrTrampoline( - ffi.Pointer block, - CFRunLoopObserverRef arg0, - int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - CFRunLoopObserverRef arg0, CFOptionFlags arg1)>>() - .asFunction()(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - CFRunLoopObserverRef, CFOptionFlags)>( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline( - ffi.Pointer block, - CFRunLoopObserverRef arg0, - int arg1) => - (objc.getBlockClosure(block) as void Function( - CFRunLoopObserverRef, int))(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - CFRunLoopObserverRef, CFOptionFlags)>( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerTrampoline( - ffi.Pointer block, - CFRunLoopObserverRef arg0, - int arg1) { - (objc.getBlockClosure(block) as void Function(CFRunLoopObserverRef, int))( - arg0, arg1); - objc.objectRelease(block.cast()); + external ffi.Pointer tm_zone; } -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, CFRunLoopObserverRef, - CFOptionFlags)> - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - CFRunLoopObserverRef, CFOptionFlags)>.listener( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerTrampoline) - ..keepIsolateAlive = false; +enum clockid_t { + _CLOCK_REALTIME(0), + _CLOCK_MONOTONIC(6), + _CLOCK_MONOTONIC_RAW(4), + _CLOCK_MONOTONIC_RAW_APPROX(5), + _CLOCK_UPTIME_RAW(8), + _CLOCK_UPTIME_RAW_APPROX(9), + _CLOCK_PROCESS_CPUTIME_ID(12), + _CLOCK_THREAD_CPUTIME_ID(16); -/// Construction methods for `objc.ObjCBlock, CFOptionFlags)>`. -abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, - CFOptionFlags)>(pointer, retain: retain, release: release); + final int value; + const clockid_t(this.value); - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> - fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock, CFOptionFlags)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + static clockid_t fromValue(int value) => switch (value) { + 0 => _CLOCK_REALTIME, + 6 => _CLOCK_MONOTONIC, + 4 => _CLOCK_MONOTONIC_RAW, + 5 => _CLOCK_MONOTONIC_RAW_APPROX, + 8 => _CLOCK_UPTIME_RAW, + 9 => _CLOCK_UPTIME_RAW_APPROX, + 12 => _CLOCK_PROCESS_CPUTIME_ID, + 16 => _CLOCK_THREAD_CPUTIME_ID, + _ => throw ArgumentError("Unknown value for clockid_t: $value"), + }; +} - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, CFOptionFlags)> - fromFunction(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureCallable, - (CFRunLoopObserverRef arg0, int arg1) => - fn(arg0, CFRunLoopActivity.fromValue(arg1))), - retain: false, - release: true); +final class imaxdiv_t extends ffi.Struct { + @intmax_t() + external int quot; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> - listener(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerCallable - .nativeFunction - .cast(), - (CFRunLoopObserverRef arg0, int arg1) => - fn(arg0, CFRunLoopActivity.fromValue(arg1))); - final wrapper = _wrapListenerBlock_ttt6u1(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, - CFOptionFlags)>(wrapper, retain: false, release: true); - } + @intmax_t() + external int rem; } -/// Call operator for `objc.ObjCBlock, CFOptionFlags)>`. -extension ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> { - void call(CFRunLoopObserverRef arg0, CFRunLoopActivity arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - CFRunLoopObserverRef arg0, CFOptionFlags arg1)>>() - .asFunction< - void Function(ffi.Pointer, CFRunLoopObserverRef, - int)>()(ref.pointer, arg0, arg1.value); -} +typedef CFBagRetainCallBackFunction = ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFBagRetainCallBack + = ffi.Pointer>; +typedef CFBagReleaseCallBackFunction = ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef DartCFBagReleaseCallBackFunction = void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFBagReleaseCallBack + = ffi.Pointer>; +typedef CFBagCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer value); +typedef CFBagCopyDescriptionCallBack + = ffi.Pointer>; +typedef CFBagEqualCallBackFunction = Boolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef DartCFBagEqualCallBackFunction = DartBoolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef CFBagEqualCallBack + = ffi.Pointer>; +typedef CFBagHashCallBackFunction = CFHashCode Function( + ffi.Pointer value); +typedef DartCFBagHashCallBackFunction = DartCFHashCode Function( + ffi.Pointer value); +typedef CFBagHashCallBack + = ffi.Pointer>; -final class CFRunLoopTimerContext extends ffi.Struct { +final class CFBagCallBacks extends ffi.Struct { @CFIndex() external int version; - external ffi.Pointer info; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; - - external ffi.Pointer< - ffi.NativeFunction info)>> - release; - - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; -} - -typedef CFRunLoopTimerCallBack - = ffi.Pointer>; -typedef CFRunLoopTimerCallBackFunction = ffi.Void Function( - CFRunLoopTimerRef timer, ffi.Pointer info); -typedef DartCFRunLoopTimerCallBackFunction = void Function( - CFRunLoopTimerRef timer, ffi.Pointer info); -void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrTrampoline( - ffi.Pointer block, CFRunLoopTimerRef arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, CFRunLoopTimerRef)>( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline( - ffi.Pointer block, CFRunLoopTimerRef arg0) => - (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, CFRunLoopTimerRef)>( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerTrampoline( - ffi.Pointer block, CFRunLoopTimerRef arg0) { - (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, CFRunLoopTimerRef)> - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerCallable = ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, CFRunLoopTimerRef)>.listener( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock)>( - pointer, - retain: retain, - release: release); + external CFBagRetainCallBack retain; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__CFRunLoopTimer>)> fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + external CFBagReleaseCallBack release; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(void Function(CFRunLoopTimerRef) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureCallable, - (CFRunLoopTimerRef arg0) => fn(arg0)), - retain: false, - release: true); + external CFBagCopyDescriptionCallBack copyDescription; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock)> - listener(void Function(CFRunLoopTimerRef) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerCallable.nativeFunction - .cast(), - (CFRunLoopTimerRef arg0) => fn(arg0)); - final wrapper = _wrapListenerBlock_1txhfzs(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock)>( - wrapper, - retain: false, - release: true); - } -} + external CFBagEqualCallBack equal; -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_CFRunLoopTimerRef_CallExtension - on objc.ObjCBlock)> { - void call(CFRunLoopTimerRef arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - CFRunLoopTimerRef arg0)>>() - .asFunction< - void Function(ffi.Pointer, - CFRunLoopTimerRef)>()(ref.pointer, arg0); + external CFBagHashCallBack hash; } -final class __CFSocket extends ffi.Opaque {} - -final class CFSocketSignature extends ffi.Struct { - @SInt32() - external int protocolFamily; - - @SInt32() - external int socketType; +typedef CFBagApplierFunctionFunction = ffi.Void Function( + ffi.Pointer value, ffi.Pointer context); +typedef DartCFBagApplierFunctionFunction = void Function( + ffi.Pointer value, ffi.Pointer context); +typedef CFBagApplierFunction + = ffi.Pointer>; - @SInt32() - external int protocol; +final class __CFBag extends ffi.Opaque {} - external CFDataRef address; -} +typedef CFBagRef = ffi.Pointer<__CFBag>; +typedef CFMutableBagRef = ffi.Pointer<__CFBag>; -final class CFSocketContext extends ffi.Struct { +final class CFBinaryHeapCompareContext extends ffi.Struct { @CFIndex() external int version; @@ -50614,1301 +50901,1172 @@ final class CFSocketContext extends ffi.Struct { copyDescription; } -typedef CFSocketRef = ffi.Pointer<__CFSocket>; -typedef CFSocketCallBack - = ffi.Pointer>; -typedef CFSocketCallBackFunction = ffi.Void Function( - CFSocketRef s, - CFOptionFlags type, - CFDataRef address, - ffi.Pointer data, - ffi.Pointer info); -typedef DartCFSocketCallBackFunction = void Function( - CFSocketRef s, - CFSocketCallBackType type, - CFDataRef address, - ffi.Pointer data, - ffi.Pointer info); +final class CFBinaryHeapCallBacks extends ffi.Struct { + @CFIndex() + external int version; -enum CFSocketCallBackType { - kCFSocketNoCallBack(0), - kCFSocketReadCallBack(1), - kCFSocketAcceptCallBack(2), - kCFSocketDataCallBack(3), - kCFSocketConnectCallBack(4), - kCFSocketWriteCallBack(8); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer ptr)>> retain; - final int value; - const CFSocketCallBackType(this.value); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer ptr)>> release; - static CFSocketCallBackType fromValue(int value) => switch (value) { - 0 => kCFSocketNoCallBack, - 1 => kCFSocketReadCallBack, - 2 => kCFSocketAcceptCallBack, - 3 => kCFSocketDataCallBack, - 4 => kCFSocketConnectCallBack, - 8 => kCFSocketWriteCallBack, - _ => - throw ArgumentError("Unknown value for CFSocketCallBackType: $value"), - }; -} + external ffi.Pointer< + ffi.NativeFunction ptr)>> + copyDescription; -typedef CFSocketNativeHandle = ffi.Int; -typedef DartCFSocketNativeHandle = int; + external ffi.Pointer< + ffi.NativeFunction< + CFIndex Function( + ffi.Pointer ptr1, + ffi.Pointer ptr2, + ffi.Pointer context)>> compare; +} -enum CFSocketError { - kCFSocketSuccess(0), - kCFSocketError(-1), - kCFSocketTimeout(-2); +typedef CFBinaryHeapApplierFunctionFunction = ffi.Void Function( + ffi.Pointer val, ffi.Pointer context); +typedef DartCFBinaryHeapApplierFunctionFunction = void Function( + ffi.Pointer val, ffi.Pointer context); +typedef CFBinaryHeapApplierFunction + = ffi.Pointer>; - final int value; - const CFSocketError(this.value); +final class __CFBinaryHeap extends ffi.Opaque {} - static CFSocketError fromValue(int value) => switch (value) { - 0 => kCFSocketSuccess, - -1 => kCFSocketError, - -2 => kCFSocketTimeout, - _ => throw ArgumentError("Unknown value for CFSocketError: $value"), - }; -} +typedef CFBinaryHeapRef = ffi.Pointer<__CFBinaryHeap>; +typedef CFBit = UInt32; -final class accessx_descriptor extends ffi.Struct { - @ffi.UnsignedInt() - external int ad_name_offset; +final class __CFBitVector extends ffi.Opaque {} - @ffi.Int() - external int ad_flags; +typedef CFBitVectorRef = ffi.Pointer<__CFBitVector>; +typedef CFMutableBitVectorRef = ffi.Pointer<__CFBitVector>; +typedef CFByteOrder = CFIndex; - @ffi.Array.multi([2]) - external ffi.Array ad_pad; +final class CFSwappedFloat32 extends ffi.Struct { + @ffi.Uint32() + external int v; } -typedef gid_t = __darwin_gid_t; -typedef __darwin_gid_t = __uint32_t; -typedef useconds_t = __darwin_useconds_t; -typedef __darwin_useconds_t = __uint32_t; +final class CFSwappedFloat64 extends ffi.Struct { + @ffi.Uint64() + external int v; +} -final class fssearchblock extends ffi.Opaque {} +typedef CFDictionaryRetainCallBackFunction = ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFDictionaryRetainCallBack + = ffi.Pointer>; +typedef CFDictionaryReleaseCallBackFunction = ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef DartCFDictionaryReleaseCallBackFunction = void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFDictionaryReleaseCallBack + = ffi.Pointer>; +typedef CFDictionaryCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer value); +typedef CFDictionaryCopyDescriptionCallBack = ffi + .Pointer>; +typedef CFDictionaryEqualCallBackFunction = Boolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef DartCFDictionaryEqualCallBackFunction = DartBoolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef CFDictionaryEqualCallBack + = ffi.Pointer>; +typedef CFDictionaryHashCallBackFunction = CFHashCode Function( + ffi.Pointer value); +typedef DartCFDictionaryHashCallBackFunction = DartCFHashCode Function( + ffi.Pointer value); +typedef CFDictionaryHashCallBack + = ffi.Pointer>; -final class searchstate extends ffi.Opaque {} +final class CFDictionaryKeyCallBacks extends ffi.Struct { + @CFIndex() + external int version; -final class flock extends ffi.Struct { - @off_t() - external int l_start; + external CFDictionaryRetainCallBack retain; - @off_t() - external int l_len; + external CFDictionaryReleaseCallBack release; - @pid_t() - external int l_pid; + external CFDictionaryCopyDescriptionCallBack copyDescription; - @ffi.Short() - external int l_type; + external CFDictionaryEqualCallBack equal; - @ffi.Short() - external int l_whence; + external CFDictionaryHashCallBack hash; } -final class flocktimeout extends ffi.Struct { - external flock fl; +final class CFDictionaryValueCallBacks extends ffi.Struct { + @CFIndex() + external int version; - external timespec timeout; -} + external CFDictionaryRetainCallBack retain; -final class radvisory extends ffi.Struct { - @off_t() - external int ra_offset; + external CFDictionaryReleaseCallBack release; - @ffi.Int() - external int ra_count; + external CFDictionaryCopyDescriptionCallBack copyDescription; + + external CFDictionaryEqualCallBack equal; } -final class fsignatures extends ffi.Struct { - @off_t() - external int fs_file_start; +typedef CFDictionaryApplierFunctionFunction = ffi.Void Function( + ffi.Pointer key, + ffi.Pointer value, + ffi.Pointer context); +typedef DartCFDictionaryApplierFunctionFunction = void Function( + ffi.Pointer key, + ffi.Pointer value, + ffi.Pointer context); +typedef CFDictionaryApplierFunction + = ffi.Pointer>; - external ffi.Pointer fs_blob_start; +final class __CFDictionary extends ffi.Opaque {} - @ffi.Size() - external int fs_blob_size; +typedef CFDictionaryRef = ffi.Pointer<__CFDictionary>; +typedef CFMutableDictionaryRef = ffi.Pointer<__CFDictionary>; +typedef CFNotificationName = CFStringRef; - @ffi.Size() - external int fs_fsignatures_size; +final class __CFNotificationCenter extends ffi.Opaque {} - @ffi.Array.multi([20]) - external ffi.Array fs_cdhash; +typedef CFNotificationCenterRef = ffi.Pointer<__CFNotificationCenter>; +typedef CFNotificationCallbackFunction = ffi.Void Function( + CFNotificationCenterRef center, + ffi.Pointer observer, + CFNotificationName name, + ffi.Pointer object, + CFDictionaryRef userInfo); +typedef DartCFNotificationCallbackFunction = void Function( + CFNotificationCenterRef center, + ffi.Pointer observer, + CFNotificationName name, + ffi.Pointer object, + CFDictionaryRef userInfo); +typedef CFNotificationCallback + = ffi.Pointer>; - @ffi.Int() - external int fs_hash_type; +enum CFNotificationSuspensionBehavior { + CFNotificationSuspensionBehaviorDrop(1), + CFNotificationSuspensionBehaviorCoalesce(2), + CFNotificationSuspensionBehaviorHold(3), + CFNotificationSuspensionBehaviorDeliverImmediately(4); + + final int value; + const CFNotificationSuspensionBehavior(this.value); + + static CFNotificationSuspensionBehavior fromValue(int value) => + switch (value) { + 1 => CFNotificationSuspensionBehaviorDrop, + 2 => CFNotificationSuspensionBehaviorCoalesce, + 3 => CFNotificationSuspensionBehaviorHold, + 4 => CFNotificationSuspensionBehaviorDeliverImmediately, + _ => throw ArgumentError( + "Unknown value for CFNotificationSuspensionBehavior: $value"), + }; } -final class fsupplement extends ffi.Struct { - @off_t() - external int fs_file_start; +typedef CFLocaleIdentifier = CFStringRef; +typedef CFLocaleKey = CFStringRef; - @off_t() - external int fs_blob_start; +final class __CFLocale extends ffi.Opaque {} - @ffi.Size() - external int fs_blob_size; +typedef CFLocaleRef = ffi.Pointer<__CFLocale>; - @ffi.Int() - external int fs_orig_fd; +enum CFLocaleLanguageDirection { + kCFLocaleLanguageDirectionUnknown(0), + kCFLocaleLanguageDirectionLeftToRight(1), + kCFLocaleLanguageDirectionRightToLeft(2), + kCFLocaleLanguageDirectionTopToBottom(3), + kCFLocaleLanguageDirectionBottomToTop(4); + + final int value; + const CFLocaleLanguageDirection(this.value); + + static CFLocaleLanguageDirection fromValue(int value) => switch (value) { + 0 => kCFLocaleLanguageDirectionUnknown, + 1 => kCFLocaleLanguageDirectionLeftToRight, + 2 => kCFLocaleLanguageDirectionRightToLeft, + 3 => kCFLocaleLanguageDirectionTopToBottom, + 4 => kCFLocaleLanguageDirectionBottomToTop, + _ => throw ArgumentError( + "Unknown value for CFLocaleLanguageDirection: $value"), + }; } -final class fchecklv extends ffi.Struct { - @off_t() - external int lv_file_start; +typedef CFCalendarIdentifier = CFStringRef; +typedef CFTimeInterval = ffi.Double; +typedef DartCFTimeInterval = double; +typedef CFAbsoluteTime = CFTimeInterval; - @ffi.Size() - external int lv_error_message_size; +final class __CFDate extends ffi.Opaque {} - external ffi.Pointer lv_error_message; -} +typedef CFDateRef = ffi.Pointer<__CFDate>; -final class fgetsigsinfo extends ffi.Struct { - @off_t() - external int fg_file_start; +final class __CFTimeZone extends ffi.Opaque {} - @ffi.Int() - external int fg_info_request; +typedef CFTimeZoneRef = ffi.Pointer<__CFTimeZone>; - @ffi.Int() - external int fg_sig_is_platform; -} +final class CFGregorianDate extends ffi.Struct { + @SInt32() + external int year; -final class fstore extends ffi.Struct { - @ffi.UnsignedInt() - external int fst_flags; + @SInt8() + external int month; - @ffi.Int() - external int fst_posmode; + @SInt8() + external int day; - @off_t() - external int fst_offset; + @SInt8() + external int hour; - @off_t() - external int fst_length; + @SInt8() + external int minute; - @off_t() - external int fst_bytesalloc; + @ffi.Double() + external double second; } -final class fpunchhole extends ffi.Struct { - @ffi.UnsignedInt() - external int fp_flags; +final class CFGregorianUnits extends ffi.Struct { + @SInt32() + external int years; - @ffi.UnsignedInt() - external int reserved; + @SInt32() + external int months; - @off_t() - external int fp_offset; + @SInt32() + external int days; - @off_t() - external int fp_length; -} + @SInt32() + external int hours; -final class ftrimactivefile extends ffi.Struct { - @off_t() - external int fta_offset; + @SInt32() + external int minutes; - @off_t() - external int fta_length; + @ffi.Double() + external double seconds; } -final class fspecread extends ffi.Struct { - @ffi.UnsignedInt() - external int fsr_flags; +final class __CFData extends ffi.Opaque {} - @ffi.UnsignedInt() - external int reserved; +typedef CFDataRef = ffi.Pointer<__CFData>; +typedef CFMutableDataRef = ffi.Pointer<__CFData>; - @off_t() - external int fsr_offset; +enum CFDataSearchFlags { + kCFDataSearchBackwards(1), + kCFDataSearchAnchored(2); - @off_t() - external int fsr_length; -} + final int value; + const CFDataSearchFlags(this.value); -final class fattributiontag extends ffi.Struct { - @ffi.UnsignedInt() - external int ft_flags; + static CFDataSearchFlags fromValue(int value) => switch (value) { + 1 => kCFDataSearchBackwards, + 2 => kCFDataSearchAnchored, + _ => throw ArgumentError("Unknown value for CFDataSearchFlags: $value"), + }; +} - @ffi.UnsignedLongLong() - external int ft_hash; +final class __CFCharacterSet extends ffi.Opaque {} - @ffi.Array.multi([255]) - external ffi.Array ft_attribution_name; -} +typedef CFCharacterSetRef = ffi.Pointer<__CFCharacterSet>; +typedef CFMutableCharacterSetRef = ffi.Pointer<__CFCharacterSet>; -@ffi.Packed(4) -final class log2phys extends ffi.Struct { - @ffi.UnsignedInt() - external int l2p_flags; +enum CFCharacterSetPredefinedSet { + kCFCharacterSetControl(1), + kCFCharacterSetWhitespace(2), + kCFCharacterSetWhitespaceAndNewline(3), + kCFCharacterSetDecimalDigit(4), + kCFCharacterSetLetter(5), + kCFCharacterSetLowercaseLetter(6), + kCFCharacterSetUppercaseLetter(7), + kCFCharacterSetNonBase(8), + kCFCharacterSetDecomposable(9), + kCFCharacterSetAlphaNumeric(10), + kCFCharacterSetPunctuation(11), + kCFCharacterSetCapitalizedLetter(13), + kCFCharacterSetSymbol(14), + kCFCharacterSetNewline(15), + kCFCharacterSetIllegal(12); - @off_t() - external int l2p_contigbytes; + final int value; + const CFCharacterSetPredefinedSet(this.value); - @off_t() - external int l2p_devoffset; + static CFCharacterSetPredefinedSet fromValue(int value) => switch (value) { + 1 => kCFCharacterSetControl, + 2 => kCFCharacterSetWhitespace, + 3 => kCFCharacterSetWhitespaceAndNewline, + 4 => kCFCharacterSetDecimalDigit, + 5 => kCFCharacterSetLetter, + 6 => kCFCharacterSetLowercaseLetter, + 7 => kCFCharacterSetUppercaseLetter, + 8 => kCFCharacterSetNonBase, + 9 => kCFCharacterSetDecomposable, + 10 => kCFCharacterSetAlphaNumeric, + 11 => kCFCharacterSetPunctuation, + 13 => kCFCharacterSetCapitalizedLetter, + 14 => kCFCharacterSetSymbol, + 15 => kCFCharacterSetNewline, + 12 => kCFCharacterSetIllegal, + _ => throw ArgumentError( + "Unknown value for CFCharacterSetPredefinedSet: $value"), + }; } -final class _filesec extends ffi.Opaque {} +typedef CFErrorDomain = CFStringRef; -typedef filesec_t = ffi.Pointer<_filesec>; +final class __CFError extends ffi.Opaque {} -enum filesec_property_t { - FILESEC_OWNER(1), - FILESEC_GROUP(2), - FILESEC_UUID(3), - FILESEC_MODE(4), - FILESEC_ACL(5), - FILESEC_GRPUUID(6), - FILESEC_ACL_RAW(100), - FILESEC_ACL_ALLOCSIZE(101); +typedef CFErrorRef = ffi.Pointer<__CFError>; +typedef CFStringEncoding = UInt32; + +enum CFStringCompareFlags { + kCFCompareCaseInsensitive(1), + kCFCompareBackwards(4), + kCFCompareAnchored(8), + kCFCompareNonliteral(16), + kCFCompareLocalized(32), + kCFCompareNumerically(64), + kCFCompareDiacriticInsensitive(128), + kCFCompareWidthInsensitive(256), + kCFCompareForcedOrdering(512); final int value; - const filesec_property_t(this.value); + const CFStringCompareFlags(this.value); - static filesec_property_t fromValue(int value) => switch (value) { - 1 => FILESEC_OWNER, - 2 => FILESEC_GROUP, - 3 => FILESEC_UUID, - 4 => FILESEC_MODE, - 5 => FILESEC_ACL, - 6 => FILESEC_GRPUUID, - 100 => FILESEC_ACL_RAW, - 101 => FILESEC_ACL_ALLOCSIZE, + static CFStringCompareFlags fromValue(int value) => switch (value) { + 1 => kCFCompareCaseInsensitive, + 4 => kCFCompareBackwards, + 8 => kCFCompareAnchored, + 16 => kCFCompareNonliteral, + 32 => kCFCompareLocalized, + 64 => kCFCompareNumerically, + 128 => kCFCompareDiacriticInsensitive, + 256 => kCFCompareWidthInsensitive, + 512 => kCFCompareForcedOrdering, _ => - throw ArgumentError("Unknown value for filesec_property_t: $value"), + throw ArgumentError("Unknown value for CFStringCompareFlags: $value"), }; } -final class os_workgroup_attr_opaque_s extends ffi.Struct { - @ffi.Uint32() - external int sig; - - @ffi.Array.multi([60]) - external ffi.Array opaque; -} +enum CFStringNormalizationForm { + kCFStringNormalizationFormD(0), + kCFStringNormalizationFormKD(1), + kCFStringNormalizationFormC(2), + kCFStringNormalizationFormKC(3); -final class os_workgroup_interval_data_opaque_s extends ffi.Struct { - @ffi.Uint32() - external int sig; + final int value; + const CFStringNormalizationForm(this.value); - @ffi.Array.multi([56]) - external ffi.Array opaque; + static CFStringNormalizationForm fromValue(int value) => switch (value) { + 0 => kCFStringNormalizationFormD, + 1 => kCFStringNormalizationFormKD, + 2 => kCFStringNormalizationFormC, + 3 => kCFStringNormalizationFormKC, + _ => throw ArgumentError( + "Unknown value for CFStringNormalizationForm: $value"), + }; } -final class os_workgroup_join_token_opaque_s extends ffi.Struct { - @ffi.Uint32() - external int sig; - - @ffi.Array.multi([36]) - external ffi.Array opaque; -} +final class CFStringInlineBuffer extends ffi.Struct { + @ffi.Array.multi([64]) + external ffi.Array buffer; -typedef os_workgroup_t = ffi.Pointer; -typedef Dartos_workgroup_t = OS_os_workgroup; + external CFStringRef theString; -/// OS_os_workgroup -class OS_os_workgroup extends OS_object { - OS_os_workgroup._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + external ffi.Pointer directUniCharBuffer; - /// Constructs a [OS_os_workgroup] that points to the same underlying object as [other]. - OS_os_workgroup.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + external ffi.Pointer directCStringBuffer; - /// Constructs a [OS_os_workgroup] that wraps the given raw object pointer. - OS_os_workgroup.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); + external CFRange rangeToBuffer; - /// Returns whether [obj] is an instance of [OS_os_workgroup]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_OS_os_workgroup); - } + @CFIndex() + external int bufferedRangeStart; - /// init - OS_os_workgroup init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return OS_os_workgroup.castFromPointer(_ret, retain: false, release: true); - } + @CFIndex() + external int bufferedRangeEnd; +} - /// new - static OS_os_workgroup new1() { - final _ret = _objc_msgSend_1unuoxw(_class_OS_os_workgroup, _sel_new); - return OS_os_workgroup.castFromPointer(_ret, retain: false, release: true); - } +enum CFTimeZoneNameStyle { + kCFTimeZoneNameStyleStandard(0), + kCFTimeZoneNameStyleShortStandard(1), + kCFTimeZoneNameStyleDaylightSaving(2), + kCFTimeZoneNameStyleShortDaylightSaving(3), + kCFTimeZoneNameStyleGeneric(4), + kCFTimeZoneNameStyleShortGeneric(5); - /// allocWithZone: - static OS_os_workgroup allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_OS_os_workgroup, _sel_allocWithZone_, zone); - return OS_os_workgroup.castFromPointer(_ret, retain: false, release: true); - } + final int value; + const CFTimeZoneNameStyle(this.value); - /// alloc - static OS_os_workgroup alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_OS_os_workgroup, _sel_alloc); - return OS_os_workgroup.castFromPointer(_ret, retain: false, release: true); - } + static CFTimeZoneNameStyle fromValue(int value) => switch (value) { + 0 => kCFTimeZoneNameStyleStandard, + 1 => kCFTimeZoneNameStyleShortStandard, + 2 => kCFTimeZoneNameStyleDaylightSaving, + 3 => kCFTimeZoneNameStyleShortDaylightSaving, + 4 => kCFTimeZoneNameStyleGeneric, + 5 => kCFTimeZoneNameStyleShortGeneric, + _ => + throw ArgumentError("Unknown value for CFTimeZoneNameStyle: $value"), + }; } -late final _class_OS_os_workgroup = objc.getClass("OS_os_workgroup"); - -/// OS_object -class OS_object extends objc.NSObject { - OS_object._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); +final class __CFCalendar extends ffi.Opaque {} - /// Constructs a [OS_object] that points to the same underlying object as [other]. - OS_object.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); +typedef CFCalendarRef = ffi.Pointer<__CFCalendar>; - /// Constructs a [OS_object] that wraps the given raw object pointer. - OS_object.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); +enum CFCalendarUnit { + kCFCalendarUnitEra(2), + kCFCalendarUnitYear(4), + kCFCalendarUnitMonth(8), + kCFCalendarUnitDay(16), + kCFCalendarUnitHour(32), + kCFCalendarUnitMinute(64), + kCFCalendarUnitSecond(128), + kCFCalendarUnitWeek(256), + kCFCalendarUnitWeekday(512), + kCFCalendarUnitWeekdayOrdinal(1024), + kCFCalendarUnitQuarter(2048), + kCFCalendarUnitWeekOfMonth(4096), + kCFCalendarUnitWeekOfYear(8192), + kCFCalendarUnitYearForWeekOfYear(16384); - /// Returns whether [obj] is an instance of [OS_object]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_OS_object); - } + final int value; + const CFCalendarUnit(this.value); - /// init - OS_object init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return OS_object.castFromPointer(_ret, retain: false, release: true); - } + static CFCalendarUnit fromValue(int value) => switch (value) { + 2 => kCFCalendarUnitEra, + 4 => kCFCalendarUnitYear, + 8 => kCFCalendarUnitMonth, + 16 => kCFCalendarUnitDay, + 32 => kCFCalendarUnitHour, + 64 => kCFCalendarUnitMinute, + 128 => kCFCalendarUnitSecond, + 256 => kCFCalendarUnitWeek, + 512 => kCFCalendarUnitWeekday, + 1024 => kCFCalendarUnitWeekdayOrdinal, + 2048 => kCFCalendarUnitQuarter, + 4096 => kCFCalendarUnitWeekOfMonth, + 8192 => kCFCalendarUnitWeekOfYear, + 16384 => kCFCalendarUnitYearForWeekOfYear, + _ => throw ArgumentError("Unknown value for CFCalendarUnit: $value"), + }; +} - /// new - static OS_object new1() { - final _ret = _objc_msgSend_1unuoxw(_class_OS_object, _sel_new); - return OS_object.castFromPointer(_ret, retain: false, release: true); - } +typedef CGFloat = ffi.Double; +typedef DartCGFloat = double; - /// allocWithZone: - static OS_object allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_OS_object, _sel_allocWithZone_, zone); - return OS_object.castFromPointer(_ret, retain: false, release: true); - } +final class CGPoint extends ffi.Struct { + @CGFloat() + external double x; - /// alloc - static OS_object alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_OS_object, _sel_alloc); - return OS_object.castFromPointer(_ret, retain: false, release: true); - } + @CGFloat() + external double y; } -late final _class_OS_object = objc.getClass("OS_object"); -typedef os_workgroup_join_token_t - = ffi.Pointer; -typedef os_workgroup_working_arena_destructor_t = ffi.Pointer< - ffi.NativeFunction>; -typedef os_workgroup_working_arena_destructor_tFunction = ffi.Void Function( - ffi.Pointer); -typedef Dartos_workgroup_working_arena_destructor_tFunction = void Function( - ffi.Pointer); -typedef os_workgroup_index = ffi.Uint32; -typedef Dartos_workgroup_index = int; +final class CGSize extends ffi.Struct { + @CGFloat() + external double width; -final class os_workgroup_max_parallel_threads_attr_s extends ffi.Opaque {} + @CGFloat() + external double height; +} -typedef os_workgroup_mpt_attr_t - = ffi.Pointer; +final class CGVector extends ffi.Struct { + @CGFloat() + external double dx; -/// OS_os_workgroup_interval -abstract final class OS_os_workgroup_interval { - /// Builds an object that implements the OS_os_workgroup_interval protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); + @CGFloat() + external double dy; +} - return builder.build(); - } +final class CGRect extends ffi.Struct { + external CGPoint origin; - /// Adds the implementation of the OS_os_workgroup_interval protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + external CGSize size; } -late final _protocol_OS_os_workgroup_interval = - objc.getProtocol("OS_os_workgroup_interval"); -typedef os_workgroup_interval_t = ffi.Pointer; -typedef Dartos_workgroup_interval_t = OS_os_workgroup; -typedef os_workgroup_interval_data_t - = ffi.Pointer; - -/// OS_os_workgroup_parallel -abstract final class OS_os_workgroup_parallel { - /// Builds an object that implements the OS_os_workgroup_parallel protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +final class CGAffineTransform extends ffi.Struct { + @CGFloat() + external double a; - return builder.build(); - } + @CGFloat() + external double b; - /// Adds the implementation of the OS_os_workgroup_parallel protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} + @CGFloat() + external double c; -late final _protocol_OS_os_workgroup_parallel = - objc.getProtocol("OS_os_workgroup_parallel"); -typedef os_workgroup_parallel_t = ffi.Pointer; -typedef Dartos_workgroup_parallel_t = OS_os_workgroup; -typedef os_workgroup_attr_t = ffi.Pointer; + @CGFloat() + external double d; -final class time_value extends ffi.Struct { - @integer_t() - external int seconds; + @CGFloat() + external double tx; - @integer_t() - external int microseconds; + @CGFloat() + external double ty; } -typedef integer_t = ffi.Int; -typedef Dartinteger_t = int; +final class CGAffineTransformComponents extends ffi.Struct { + external CGSize scale; -final class mach_timespec extends ffi.Struct { - @ffi.UnsignedInt() - external int tv_sec; + @CGFloat() + external double horizontalShear; - @clock_res_t() - external int tv_nsec; + @CGFloat() + external double rotation; + + external CGVector translation; } -typedef clock_res_t = ffi.Int; -typedef Dartclock_res_t = int; -typedef dispatch_time_t = ffi.Uint64; -typedef Dartdispatch_time_t = int; +typedef CFDateFormatterKey = CFStringRef; -enum qos_class_t { - QOS_CLASS_USER_INTERACTIVE(33), - QOS_CLASS_USER_INITIATED(25), - QOS_CLASS_DEFAULT(21), - QOS_CLASS_UTILITY(17), - QOS_CLASS_BACKGROUND(9), - QOS_CLASS_UNSPECIFIED(0); +final class __CFDateFormatter extends ffi.Opaque {} + +typedef CFDateFormatterRef = ffi.Pointer<__CFDateFormatter>; + +enum CFDateFormatterStyle { + kCFDateFormatterNoStyle(0), + kCFDateFormatterShortStyle(1), + kCFDateFormatterMediumStyle(2), + kCFDateFormatterLongStyle(3), + kCFDateFormatterFullStyle(4); final int value; - const qos_class_t(this.value); + const CFDateFormatterStyle(this.value); - static qos_class_t fromValue(int value) => switch (value) { - 33 => QOS_CLASS_USER_INTERACTIVE, - 25 => QOS_CLASS_USER_INITIATED, - 21 => QOS_CLASS_DEFAULT, - 17 => QOS_CLASS_UTILITY, - 9 => QOS_CLASS_BACKGROUND, - 0 => QOS_CLASS_UNSPECIFIED, - _ => throw ArgumentError("Unknown value for qos_class_t: $value"), + static CFDateFormatterStyle fromValue(int value) => switch (value) { + 0 => kCFDateFormatterNoStyle, + 1 => kCFDateFormatterShortStyle, + 2 => kCFDateFormatterMediumStyle, + 3 => kCFDateFormatterLongStyle, + 4 => kCFDateFormatterFullStyle, + _ => + throw ArgumentError("Unknown value for CFDateFormatterStyle: $value"), }; } -/// OS_dispatch_object -abstract final class OS_dispatch_object { - /// Builds an object that implements the OS_dispatch_object protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +enum CFISO8601DateFormatOptions { + kCFISO8601DateFormatWithYear(1), + kCFISO8601DateFormatWithMonth(2), + kCFISO8601DateFormatWithWeekOfYear(4), + kCFISO8601DateFormatWithDay(16), + kCFISO8601DateFormatWithTime(32), + kCFISO8601DateFormatWithTimeZone(64), + kCFISO8601DateFormatWithSpaceBetweenDateAndTime(128), + kCFISO8601DateFormatWithDashSeparatorInDate(256), + kCFISO8601DateFormatWithColonSeparatorInTime(512), + kCFISO8601DateFormatWithColonSeparatorInTimeZone(1024), + kCFISO8601DateFormatWithFractionalSeconds(2048), + kCFISO8601DateFormatWithFullDate(275), + kCFISO8601DateFormatWithFullTime(1632), + kCFISO8601DateFormatWithInternetDateTime(1907); - return builder.build(); - } + final int value; + const CFISO8601DateFormatOptions(this.value); - /// Adds the implementation of the OS_dispatch_object protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + static CFISO8601DateFormatOptions fromValue(int value) => switch (value) { + 1 => kCFISO8601DateFormatWithYear, + 2 => kCFISO8601DateFormatWithMonth, + 4 => kCFISO8601DateFormatWithWeekOfYear, + 16 => kCFISO8601DateFormatWithDay, + 32 => kCFISO8601DateFormatWithTime, + 64 => kCFISO8601DateFormatWithTimeZone, + 128 => kCFISO8601DateFormatWithSpaceBetweenDateAndTime, + 256 => kCFISO8601DateFormatWithDashSeparatorInDate, + 512 => kCFISO8601DateFormatWithColonSeparatorInTime, + 1024 => kCFISO8601DateFormatWithColonSeparatorInTimeZone, + 2048 => kCFISO8601DateFormatWithFractionalSeconds, + 275 => kCFISO8601DateFormatWithFullDate, + 1632 => kCFISO8601DateFormatWithFullTime, + 1907 => kCFISO8601DateFormatWithInternetDateTime, + _ => throw ArgumentError( + "Unknown value for CFISO8601DateFormatOptions: $value"), + }; } -late final _protocol_OS_dispatch_object = - objc.getProtocol("OS_dispatch_object"); -typedef dispatch_object_t = ffi.Pointer; -typedef Dartdispatch_object_t = objc.NSObject; -typedef dispatch_function_t - = ffi.Pointer>; -typedef dispatch_function_tFunction = ffi.Void Function(ffi.Pointer); -typedef Dartdispatch_function_tFunction = void Function(ffi.Pointer); -typedef dispatch_block_t = ffi.Pointer; -typedef Dartdispatch_block_t = objc.ObjCBlock; +final class __CFBoolean extends ffi.Opaque {} -/// OS_dispatch_queue -abstract final class OS_dispatch_queue { - /// Builds an object that implements the OS_dispatch_queue protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +typedef CFBooleanRef = ffi.Pointer<__CFBoolean>; - return builder.build(); - } +enum CFNumberType { + kCFNumberSInt8Type(1), + kCFNumberSInt16Type(2), + kCFNumberSInt32Type(3), + kCFNumberSInt64Type(4), + kCFNumberFloat32Type(5), + kCFNumberFloat64Type(6), + kCFNumberCharType(7), + kCFNumberShortType(8), + kCFNumberIntType(9), + kCFNumberLongType(10), + kCFNumberLongLongType(11), + kCFNumberFloatType(12), + kCFNumberDoubleType(13), + kCFNumberCFIndexType(14), + kCFNumberNSIntegerType(15), + kCFNumberCGFloatType(16); - /// Adds the implementation of the OS_dispatch_queue protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} + static const kCFNumberMaxType = kCFNumberCGFloatType; -late final _protocol_OS_dispatch_queue = objc.getProtocol("OS_dispatch_queue"); + final int value; + const CFNumberType(this.value); -/// OS_dispatch_queue_global -abstract final class OS_dispatch_queue_global { - /// Builds an object that implements the OS_dispatch_queue_global protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); + static CFNumberType fromValue(int value) => switch (value) { + 1 => kCFNumberSInt8Type, + 2 => kCFNumberSInt16Type, + 3 => kCFNumberSInt32Type, + 4 => kCFNumberSInt64Type, + 5 => kCFNumberFloat32Type, + 6 => kCFNumberFloat64Type, + 7 => kCFNumberCharType, + 8 => kCFNumberShortType, + 9 => kCFNumberIntType, + 10 => kCFNumberLongType, + 11 => kCFNumberLongLongType, + 12 => kCFNumberFloatType, + 13 => kCFNumberDoubleType, + 14 => kCFNumberCFIndexType, + 15 => kCFNumberNSIntegerType, + 16 => kCFNumberCGFloatType, + _ => throw ArgumentError("Unknown value for CFNumberType: $value"), + }; - return builder.build(); + @override + String toString() { + if (this == kCFNumberCGFloatType) + return "CFNumberType.kCFNumberCGFloatType, CFNumberType.kCFNumberMaxType"; + return super.toString(); } - - /// Adds the implementation of the OS_dispatch_queue_global protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} } -late final _protocol_OS_dispatch_queue_global = - objc.getProtocol("OS_dispatch_queue_global"); - -/// OS_dispatch_queue_serial_executor -abstract final class OS_dispatch_queue_serial_executor { - /// Builds an object that implements the OS_dispatch_queue_serial_executor protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +final class __CFNumber extends ffi.Opaque {} - return builder.build(); - } +typedef CFNumberRef = ffi.Pointer<__CFNumber>; +typedef CFNumberFormatterKey = CFStringRef; - /// Adds the implementation of the OS_dispatch_queue_serial_executor protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} +final class __CFNumberFormatter extends ffi.Opaque {} -late final _protocol_OS_dispatch_queue_serial_executor = - objc.getProtocol("OS_dispatch_queue_serial_executor"); +typedef CFNumberFormatterRef = ffi.Pointer<__CFNumberFormatter>; -/// OS_dispatch_queue_serial -abstract final class OS_dispatch_queue_serial { - /// Builds an object that implements the OS_dispatch_queue_serial protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +enum CFNumberFormatterStyle { + kCFNumberFormatterNoStyle(0), + kCFNumberFormatterDecimalStyle(1), + kCFNumberFormatterCurrencyStyle(2), + kCFNumberFormatterPercentStyle(3), + kCFNumberFormatterScientificStyle(4), + kCFNumberFormatterSpellOutStyle(5), + kCFNumberFormatterOrdinalStyle(6), + kCFNumberFormatterCurrencyISOCodeStyle(8), + kCFNumberFormatterCurrencyPluralStyle(9), + kCFNumberFormatterCurrencyAccountingStyle(10); - return builder.build(); - } + final int value; + const CFNumberFormatterStyle(this.value); - /// Adds the implementation of the OS_dispatch_queue_serial protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + static CFNumberFormatterStyle fromValue(int value) => switch (value) { + 0 => kCFNumberFormatterNoStyle, + 1 => kCFNumberFormatterDecimalStyle, + 2 => kCFNumberFormatterCurrencyStyle, + 3 => kCFNumberFormatterPercentStyle, + 4 => kCFNumberFormatterScientificStyle, + 5 => kCFNumberFormatterSpellOutStyle, + 6 => kCFNumberFormatterOrdinalStyle, + 8 => kCFNumberFormatterCurrencyISOCodeStyle, + 9 => kCFNumberFormatterCurrencyPluralStyle, + 10 => kCFNumberFormatterCurrencyAccountingStyle, + _ => throw ArgumentError( + "Unknown value for CFNumberFormatterStyle: $value"), + }; } -late final _protocol_OS_dispatch_queue_serial = - objc.getProtocol("OS_dispatch_queue_serial"); - -/// OS_dispatch_queue_main -abstract final class OS_dispatch_queue_main { - /// Builds an object that implements the OS_dispatch_queue_main protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +enum CFURLPathStyle { + kCFURLPOSIXPathStyle(0), + kCFURLHFSPathStyle(1), + kCFURLWindowsPathStyle(2); - return builder.build(); - } + final int value; + const CFURLPathStyle(this.value); - /// Adds the implementation of the OS_dispatch_queue_main protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + static CFURLPathStyle fromValue(int value) => switch (value) { + 0 => kCFURLPOSIXPathStyle, + 1 => kCFURLHFSPathStyle, + 2 => kCFURLWindowsPathStyle, + _ => throw ArgumentError("Unknown value for CFURLPathStyle: $value"), + }; } -late final _protocol_OS_dispatch_queue_main = - objc.getProtocol("OS_dispatch_queue_main"); +final class __CFURL extends ffi.Opaque {} -/// OS_dispatch_queue_concurrent -abstract final class OS_dispatch_queue_concurrent { - /// Builds an object that implements the OS_dispatch_queue_concurrent protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +typedef CFURLRef = ffi.Pointer<__CFURL>; - return builder.build(); - } +enum CFURLComponentType { + kCFURLComponentScheme(1), + kCFURLComponentNetLocation(2), + kCFURLComponentPath(3), + kCFURLComponentResourceSpecifier(4), + kCFURLComponentUser(5), + kCFURLComponentPassword(6), + kCFURLComponentUserInfo(7), + kCFURLComponentHost(8), + kCFURLComponentPort(9), + kCFURLComponentParameterString(10), + kCFURLComponentQuery(11), + kCFURLComponentFragment(12); - /// Adds the implementation of the OS_dispatch_queue_concurrent protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} + final int value; + const CFURLComponentType(this.value); -late final _protocol_OS_dispatch_queue_concurrent = - objc.getProtocol("OS_dispatch_queue_concurrent"); -typedef dispatch_queue_t = ffi.Pointer; -typedef Dartdispatch_queue_t = objc.NSObject; -void _ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline( - ffi.Pointer block, int arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiSize_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Size)>(_ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiSize_closureTrampoline( - ffi.Pointer block, int arg0) => - (objc.getBlockClosure(block) as void Function(int))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiSize_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Size)>(_ObjCBlock_ffiVoid_ffiSize_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiSize_listenerTrampoline( - ffi.Pointer block, int arg0) { - (objc.getBlockClosure(block) as void Function(int))(arg0); - objc.objectRelease(block.cast()); + static CFURLComponentType fromValue(int value) => switch (value) { + 1 => kCFURLComponentScheme, + 2 => kCFURLComponentNetLocation, + 3 => kCFURLComponentPath, + 4 => kCFURLComponentResourceSpecifier, + 5 => kCFURLComponentUser, + 6 => kCFURLComponentPassword, + 7 => kCFURLComponentUserInfo, + 8 => kCFURLComponentHost, + 9 => kCFURLComponentPort, + 10 => kCFURLComponentParameterString, + 11 => kCFURLComponentQuery, + 12 => kCFURLComponentFragment, + _ => + throw ArgumentError("Unknown value for CFURLComponentType: $value"), + }; } -ffi.NativeCallable, ffi.Size)> - _ObjCBlock_ffiVoid_ffiSize_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Size)>.listener(_ObjCBlock_ffiVoid_ffiSize_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_ffiSize { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); +final class FSRef extends ffi.Opaque {} - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiSize_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +enum CFURLBookmarkCreationOptions { + kCFURLBookmarkCreationMinimalBookmarkMask(512), + kCFURLBookmarkCreationSuitableForBookmarkFile(1024), + kCFURLBookmarkCreationWithSecurityScope(2048), + kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess(4096), + kCFURLBookmarkCreationWithoutImplicitSecurityScope(536870912), + kCFURLBookmarkCreationPreferFileIDResolutionMask(256); - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(int) fn) => - objc.ObjCBlock( - objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiSize_closureCallable, - (int arg0) => fn(arg0)), - retain: false, - release: true); + final int value; + const CFURLBookmarkCreationOptions(this.value); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(int) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiSize_listenerCallable.nativeFunction.cast(), - (int arg0) => fn(arg0)); - final wrapper = _wrapListenerBlock_1hmngv6(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } + static CFURLBookmarkCreationOptions fromValue(int value) => switch (value) { + 512 => kCFURLBookmarkCreationMinimalBookmarkMask, + 1024 => kCFURLBookmarkCreationSuitableForBookmarkFile, + 2048 => kCFURLBookmarkCreationWithSecurityScope, + 4096 => kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess, + 536870912 => kCFURLBookmarkCreationWithoutImplicitSecurityScope, + 256 => kCFURLBookmarkCreationPreferFileIDResolutionMask, + _ => throw ArgumentError( + "Unknown value for CFURLBookmarkCreationOptions: $value"), + }; } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_ffiSize_CallExtension - on objc.ObjCBlock { - void call(int arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, ffi.Size arg0)>>() - .asFunction, int)>()( - ref.pointer, arg0); -} +enum CFURLBookmarkResolutionOptions { + kCFURLBookmarkResolutionWithoutUIMask(256), + kCFURLBookmarkResolutionWithoutMountingMask(512), + kCFURLBookmarkResolutionWithSecurityScope(1024), + kCFURLBookmarkResolutionWithoutImplicitStartAccessing(32768); -final class dispatch_queue_s extends ffi.Opaque {} + static const kCFBookmarkResolutionWithoutUIMask = + kCFURLBookmarkResolutionWithoutUIMask; + static const kCFBookmarkResolutionWithoutMountingMask = + kCFURLBookmarkResolutionWithoutMountingMask; -typedef dispatch_queue_global_t = ffi.Pointer; -typedef Dartdispatch_queue_global_t = objc.NSObject; + final int value; + const CFURLBookmarkResolutionOptions(this.value); -/// OS_dispatch_queue_attr -abstract final class OS_dispatch_queue_attr { - /// Builds an object that implements the OS_dispatch_queue_attr protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); + static CFURLBookmarkResolutionOptions fromValue(int value) => switch (value) { + 256 => kCFURLBookmarkResolutionWithoutUIMask, + 512 => kCFURLBookmarkResolutionWithoutMountingMask, + 1024 => kCFURLBookmarkResolutionWithSecurityScope, + 32768 => kCFURLBookmarkResolutionWithoutImplicitStartAccessing, + _ => throw ArgumentError( + "Unknown value for CFURLBookmarkResolutionOptions: $value"), + }; - return builder.build(); + @override + String toString() { + if (this == kCFURLBookmarkResolutionWithoutUIMask) + return "CFURLBookmarkResolutionOptions.kCFURLBookmarkResolutionWithoutUIMask, CFURLBookmarkResolutionOptions.kCFBookmarkResolutionWithoutUIMask"; + if (this == kCFURLBookmarkResolutionWithoutMountingMask) + return "CFURLBookmarkResolutionOptions.kCFURLBookmarkResolutionWithoutMountingMask, CFURLBookmarkResolutionOptions.kCFBookmarkResolutionWithoutMountingMask"; + return super.toString(); } - - /// Adds the implementation of the OS_dispatch_queue_attr protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - -late final _protocol_OS_dispatch_queue_attr = - objc.getProtocol("OS_dispatch_queue_attr"); - -final class dispatch_queue_attr_s extends ffi.Opaque {} - -typedef dispatch_queue_attr_t = ffi.Pointer; -typedef Dartdispatch_queue_attr_t = objc.NSObject; - -enum dispatch_autorelease_frequency_t { - DISPATCH_AUTORELEASE_FREQUENCY_INHERIT(0), - DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM(1), - DISPATCH_AUTORELEASE_FREQUENCY_NEVER(2); - - final int value; - const dispatch_autorelease_frequency_t(this.value); - - static dispatch_autorelease_frequency_t fromValue(int value) => - switch (value) { - 0 => DISPATCH_AUTORELEASE_FREQUENCY_INHERIT, - 1 => DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM, - 2 => DISPATCH_AUTORELEASE_FREQUENCY_NEVER, - _ => throw ArgumentError( - "Unknown value for dispatch_autorelease_frequency_t: $value"), - }; -} - -enum dispatch_block_flags_t { - DISPATCH_BLOCK_BARRIER(1), - DISPATCH_BLOCK_DETACHED(2), - DISPATCH_BLOCK_ASSIGN_CURRENT(4), - DISPATCH_BLOCK_NO_QOS_CLASS(8), - DISPATCH_BLOCK_INHERIT_QOS_CLASS(16), - DISPATCH_BLOCK_ENFORCE_QOS_CLASS(32); - - final int value; - const dispatch_block_flags_t(this.value); - - static dispatch_block_flags_t fromValue(int value) => switch (value) { - 1 => DISPATCH_BLOCK_BARRIER, - 2 => DISPATCH_BLOCK_DETACHED, - 4 => DISPATCH_BLOCK_ASSIGN_CURRENT, - 8 => DISPATCH_BLOCK_NO_QOS_CLASS, - 16 => DISPATCH_BLOCK_INHERIT_QOS_CLASS, - 32 => DISPATCH_BLOCK_ENFORCE_QOS_CLASS, - _ => throw ArgumentError( - "Unknown value for dispatch_block_flags_t: $value"), - }; } -final class mach_msg_type_descriptor_t extends ffi.Opaque {} - -final class mach_msg_port_descriptor_t extends ffi.Opaque {} - -final class mach_msg_ool_descriptor32_t extends ffi.Opaque {} +typedef CFURLBookmarkFileCreationOptions = CFOptionFlags; +typedef boolean_t = ffi.Int; +typedef Dartboolean_t = int; +typedef natural_t = __darwin_natural_t; +typedef integer_t = ffi.Int; +typedef Dartinteger_t = int; +typedef vm_offset_t = ffi.UintPtr; +typedef Dartvm_offset_t = int; +typedef vm_size_t = ffi.UintPtr; +typedef Dartvm_size_t = int; +typedef mach_vm_address_t = ffi.Uint64; +typedef Dartmach_vm_address_t = int; +typedef mach_vm_offset_t = ffi.Uint64; +typedef Dartmach_vm_offset_t = int; +typedef mach_vm_size_t = ffi.Uint64; +typedef Dartmach_vm_size_t = int; +typedef vm_map_offset_t = ffi.Uint64; +typedef Dartvm_map_offset_t = int; +typedef vm_map_address_t = ffi.Uint64; +typedef Dartvm_map_address_t = int; +typedef vm_map_size_t = ffi.Uint64; +typedef Dartvm_map_size_t = int; +typedef vm32_offset_t = ffi.Uint32; +typedef Dartvm32_offset_t = int; +typedef vm32_address_t = ffi.Uint32; +typedef Dartvm32_address_t = int; +typedef vm32_size_t = ffi.Uint32; +typedef Dartvm32_size_t = int; +typedef mach_port_context_t = vm_offset_t; +typedef mach_port_name_t = natural_t; +typedef mach_port_name_array_t = ffi.Pointer; +typedef mach_port_t = __darwin_mach_port_t; +typedef mach_port_array_t = ffi.Pointer; +typedef mach_port_right_t = natural_t; +typedef mach_port_type_t = natural_t; +typedef mach_port_type_array_t = ffi.Pointer; +typedef mach_port_urefs_t = natural_t; +typedef mach_port_delta_t = integer_t; +typedef mach_port_seqno_t = natural_t; +typedef mach_port_mscount_t = natural_t; +typedef mach_port_msgcount_t = natural_t; +typedef mach_port_rights_t = natural_t; +typedef mach_port_srights_t = ffi.UnsignedInt; +typedef Dartmach_port_srights_t = int; -final class mach_msg_ool_descriptor64_t extends ffi.Opaque {} +final class mach_port_status extends ffi.Struct { + @mach_port_rights_t() + external int mps_pset; -final class mach_msg_ool_descriptor_t extends ffi.Opaque {} + @mach_port_seqno_t() + external int mps_seqno; -final class mach_msg_ool_ports_descriptor32_t extends ffi.Opaque {} + @mach_port_mscount_t() + external int mps_mscount; -final class mach_msg_ool_ports_descriptor64_t extends ffi.Opaque {} + @mach_port_msgcount_t() + external int mps_qlimit; -final class mach_msg_ool_ports_descriptor_t extends ffi.Opaque {} + @mach_port_msgcount_t() + external int mps_msgcount; -final class mach_msg_guarded_port_descriptor32_t extends ffi.Opaque {} + @mach_port_rights_t() + external int mps_sorights; -final class mach_msg_guarded_port_descriptor64_t extends ffi.Opaque {} + @boolean_t() + external int mps_srights; -final class mach_msg_guarded_port_descriptor_t extends ffi.Opaque {} + @boolean_t() + external int mps_pdrequest; -final class mach_msg_descriptor_t extends ffi.Opaque {} + @boolean_t() + external int mps_nsrequest; -final class mach_msg_body_t extends ffi.Struct { - @mach_msg_size_t() - external int msgh_descriptor_count; + @natural_t() + external int mps_flags; } -typedef mach_msg_size_t = natural_t; - -final class mach_msg_header_t extends ffi.Struct { - @mach_msg_bits_t() - external int msgh_bits; - - @mach_msg_size_t() - external int msgh_size; - - @mach_port_t() - external int msgh_remote_port; - - @mach_port_t() - external int msgh_local_port; - - @mach_port_name_t() - external int msgh_voucher_port; +typedef mach_port_status_t = mach_port_status; - @mach_msg_id_t() - external int msgh_id; +final class mach_port_limits extends ffi.Struct { + @mach_port_msgcount_t() + external int mpl_qlimit; } -typedef mach_msg_bits_t = ffi.UnsignedInt; -typedef Dartmach_msg_bits_t = int; -typedef mach_msg_id_t = integer_t; +typedef mach_port_limits_t = mach_port_limits; -final class mach_msg_base_t extends ffi.Struct { - external mach_msg_header_t header; +final class mach_port_info_ext extends ffi.Struct { + external mach_port_status_t mpie_status; - external mach_msg_body_t body; + @mach_port_msgcount_t() + external int mpie_boost_cnt; + + @ffi.Array.multi([6]) + external ffi.Array reserved; } -final class mach_msg_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; +typedef mach_port_info_ext_t = mach_port_info_ext; - @mach_msg_trailer_size_t() - external int msgh_trailer_size; +final class mach_port_guard_info extends ffi.Struct { + @ffi.Uint64() + external int mpgi_guard; } -typedef mach_msg_trailer_type_t = ffi.UnsignedInt; -typedef Dartmach_msg_trailer_type_t = int; -typedef mach_msg_trailer_size_t = ffi.UnsignedInt; -typedef Dartmach_msg_trailer_size_t = int; +typedef mach_port_guard_info_t = mach_port_guard_info; +typedef mach_port_info_t = ffi.Pointer; +typedef mach_port_flavor_t = ffi.Int; +typedef Dartmach_port_flavor_t = int; -final class mach_msg_seqno_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; +final class mach_port_qos extends ffi.Opaque {} - @mach_msg_trailer_size_t() - external int msgh_trailer_size; +typedef mach_port_qos_t = mach_port_qos; - @mach_port_seqno_t() - external int msgh_seqno; -} +final class mach_service_port_info extends ffi.Struct { + @ffi.Array.multi([255]) + external ffi.Array mspi_string_name; -final class security_token_t extends ffi.Struct { - @ffi.Array.multi([2]) - external ffi.Array val; + @ffi.Uint8() + external int mspi_domain_type; } -final class mach_msg_security_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; +typedef mach_service_port_info_data_t = mach_service_port_info; +typedef mach_service_port_info_t = ffi.Pointer; - @mach_msg_trailer_size_t() - external int msgh_trailer_size; +final class UnnamedUnion1 extends ffi.Union { + @ffi.Array.multi([2]) + external ffi.Array reserved; - @mach_port_seqno_t() - external int msgh_seqno; + @mach_port_name_t() + external int work_interval_port; - external security_token_t msgh_sender; -} + external mach_service_port_info_t service_port_info; -final class audit_token_t extends ffi.Struct { - @ffi.Array.multi([8]) - external ffi.Array val; + @mach_port_name_t() + external int service_port_name; } -final class mach_msg_audit_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; - - @mach_msg_trailer_size_t() - external int msgh_trailer_size; - - @mach_port_seqno_t() - external int msgh_seqno; +final class mach_port_options extends ffi.Struct { + @ffi.Uint32() + external int flags; - external security_token_t msgh_sender; + external mach_port_limits_t mpl; - external audit_token_t msgh_audit; + external UnnamedUnion1 unnamed; } -@ffi.Packed(4) -final class mach_msg_context_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; - - @mach_msg_trailer_size_t() - external int msgh_trailer_size; +typedef mach_port_options_t = mach_port_options; +typedef mach_port_options_ptr_t = ffi.Pointer; +typedef CFRunLoopMode = CFStringRef; - @mach_port_seqno_t() - external int msgh_seqno; +final class __CFRunLoop extends ffi.Opaque {} - external security_token_t msgh_sender; +typedef CFRunLoopRef = ffi.Pointer<__CFRunLoop>; - external audit_token_t msgh_audit; +final class __CFRunLoopSource extends ffi.Opaque {} - @mach_port_context_t() - external int msgh_context; -} +typedef CFRunLoopSourceRef = ffi.Pointer<__CFRunLoopSource>; -typedef mach_port_context_t = vm_offset_t; -typedef vm_offset_t = ffi.UintPtr; -typedef Dartvm_offset_t = int; +final class __CFRunLoopObserver extends ffi.Opaque {} -final class msg_labels_t extends ffi.Struct { - @mach_port_name_t() - external int sender; -} +typedef CFRunLoopObserverRef = ffi.Pointer<__CFRunLoopObserver>; -@ffi.Packed(4) -final class mach_msg_mac_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; +final class __CFRunLoopTimer extends ffi.Opaque {} - @mach_msg_trailer_size_t() - external int msgh_trailer_size; +typedef CFRunLoopTimerRef = ffi.Pointer<__CFRunLoopTimer>; - @mach_port_seqno_t() - external int msgh_seqno; +enum CFRunLoopRunResult { + kCFRunLoopRunFinished(1), + kCFRunLoopRunStopped(2), + kCFRunLoopRunTimedOut(3), + kCFRunLoopRunHandledSource(4); - external security_token_t msgh_sender; + final int value; + const CFRunLoopRunResult(this.value); - external audit_token_t msgh_audit; + static CFRunLoopRunResult fromValue(int value) => switch (value) { + 1 => kCFRunLoopRunFinished, + 2 => kCFRunLoopRunStopped, + 3 => kCFRunLoopRunTimedOut, + 4 => kCFRunLoopRunHandledSource, + _ => + throw ArgumentError("Unknown value for CFRunLoopRunResult: $value"), + }; +} - @mach_port_context_t() - external int msgh_context; +enum CFRunLoopActivity { + kCFRunLoopEntry(1), + kCFRunLoopBeforeTimers(2), + kCFRunLoopBeforeSources(4), + kCFRunLoopBeforeWaiting(32), + kCFRunLoopAfterWaiting(64), + kCFRunLoopExit(128), + kCFRunLoopAllActivities(268435455); - @mach_msg_filter_id() - external int msgh_ad; + final int value; + const CFRunLoopActivity(this.value); - external msg_labels_t msgh_labels; + static CFRunLoopActivity fromValue(int value) => switch (value) { + 1 => kCFRunLoopEntry, + 2 => kCFRunLoopBeforeTimers, + 4 => kCFRunLoopBeforeSources, + 32 => kCFRunLoopBeforeWaiting, + 64 => kCFRunLoopAfterWaiting, + 128 => kCFRunLoopExit, + 268435455 => kCFRunLoopAllActivities, + _ => throw ArgumentError("Unknown value for CFRunLoopActivity: $value"), + }; } -typedef mach_msg_filter_id = ffi.Int; -typedef Dartmach_msg_filter_id = int; +final class CFRunLoopSourceContext extends ffi.Struct { + @CFIndex() + external int version; -final class mach_msg_empty_send_t extends ffi.Struct { - external mach_msg_header_t header; -} + external ffi.Pointer info; -final class mach_msg_empty_rcv_t extends ffi.Struct { - external mach_msg_header_t header; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; - external mach_msg_trailer_t trailer; -} + external ffi.Pointer< + ffi.NativeFunction info)>> + release; -final class mach_msg_empty_t extends ffi.Union { - external mach_msg_empty_send_t send; + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; - external mach_msg_empty_rcv_t rcv; -} + external ffi.Pointer< + ffi.NativeFunction< + Boolean Function( + ffi.Pointer info1, ffi.Pointer info2)>> equal; -typedef mach_msg_return_t = kern_return_t; -typedef kern_return_t = ffi.Int; -typedef Dartkern_return_t = int; -typedef mach_msg_option_t = integer_t; -typedef mach_msg_timeout_t = natural_t; + external ffi.Pointer< + ffi.NativeFunction info)>> hash; -/// OS_dispatch_source -abstract final class OS_dispatch_source { - /// Builds an object that implements the OS_dispatch_source protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer info, CFRunLoopRef rl, + CFRunLoopMode mode)>> schedule; - return builder.build(); - } + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer info, CFRunLoopRef rl, + CFRunLoopMode mode)>> cancel; - /// Adds the implementation of the OS_dispatch_source protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + external ffi.Pointer< + ffi.NativeFunction info)>> + perform; } -late final _protocol_OS_dispatch_source = - objc.getProtocol("OS_dispatch_source"); - -final class dispatch_source_type_s extends ffi.Opaque {} +final class CFRunLoopSourceContext1 extends ffi.Struct { + @CFIndex() + external int version; -typedef dispatch_source_t = ffi.Pointer; -typedef Dartdispatch_source_t = objc.NSObject; -typedef dispatch_source_type_t = ffi.Pointer; + external ffi.Pointer info; -/// OS_dispatch_group -abstract final class OS_dispatch_group { - /// Builds an object that implements the OS_dispatch_group protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; - return builder.build(); - } + external ffi.Pointer< + ffi.NativeFunction info)>> + release; - /// Adds the implementation of the OS_dispatch_group protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; -late final _protocol_OS_dispatch_group = objc.getProtocol("OS_dispatch_group"); -typedef dispatch_group_t = ffi.Pointer; -typedef Dartdispatch_group_t = objc.NSObject; + external ffi.Pointer< + ffi.NativeFunction< + Boolean Function( + ffi.Pointer info1, ffi.Pointer info2)>> equal; -/// OS_dispatch_semaphore -abstract final class OS_dispatch_semaphore { - /// Builds an object that implements the OS_dispatch_semaphore protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); + external ffi.Pointer< + ffi.NativeFunction info)>> hash; - return builder.build(); - } + external ffi.Pointer< + ffi.NativeFunction info)>> + getPort; - /// Adds the implementation of the OS_dispatch_semaphore protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer msg, + CFIndex size, + CFAllocatorRef allocator, + ffi.Pointer info)>> perform; } -late final _protocol_OS_dispatch_semaphore = - objc.getProtocol("OS_dispatch_semaphore"); -typedef dispatch_semaphore_t = ffi.Pointer; -typedef Dartdispatch_semaphore_t = objc.NSObject; -typedef dispatch_once_t = ffi.IntPtr; -typedef Dartdispatch_once_t = int; - -/// OS_dispatch_data -abstract final class OS_dispatch_data { - /// Builds an object that implements the OS_dispatch_data protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +final class CFRunLoopObserverContext extends ffi.Struct { + @CFIndex() + external int version; - return builder.build(); - } + external ffi.Pointer info; - /// Adds the implementation of the OS_dispatch_data protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; -late final _protocol_OS_dispatch_data = objc.getProtocol("OS_dispatch_data"); + external ffi.Pointer< + ffi.NativeFunction info)>> + release; -final class dispatch_data_s extends ffi.Opaque {} + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; +} -typedef dispatch_data_t = ffi.Pointer; -typedef Dartdispatch_data_t = objc.NSObject; -typedef dispatch_data_applier_t = ffi.Pointer; -typedef Dartdispatch_data_applier_t = objc.ObjCBlock< - ffi.Bool Function( - objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)>; -bool _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrTrampoline( +typedef CFRunLoopObserverCallBackFunction = ffi.Void Function( + CFRunLoopObserverRef observer, + CFOptionFlags activity, + ffi.Pointer info); +typedef DartCFRunLoopObserverCallBackFunction = void Function( + CFRunLoopObserverRef observer, + CFRunLoopActivity activity, + ffi.Pointer info); +typedef CFRunLoopObserverCallBack + = ffi.Pointer>; +void _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrTrampoline( ffi.Pointer block, - dispatch_data_t arg0, - int arg1, - ffi.Pointer arg2, - int arg3) => + CFRunLoopObserverRef arg0, + int arg1) => block.ref.target .cast< ffi.NativeFunction< - ffi.Bool Function(dispatch_data_t arg0, ffi.Size arg1, - ffi.Pointer arg2, ffi.Size arg3)>>() - .asFunction< - bool Function(dispatch_data_t, int, ffi.Pointer, - int)>()(arg0, arg1, arg2, arg3); + ffi.Void Function( + CFRunLoopObserverRef arg0, CFOptionFlags arg1)>>() + .asFunction()(arg0, arg1); ffi.Pointer - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrCallable = + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - dispatch_data_t, - ffi.Size, - ffi.Pointer, - ffi.Size)>( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrTrampoline, - false) + ffi.Void Function(ffi.Pointer, + CFRunLoopObserverRef, CFOptionFlags)>( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrTrampoline) .cast(); -bool _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - int arg1, - ffi.Pointer arg2, - int arg3) => - (objc.getBlockClosure(block) as bool Function(dispatch_data_t, int, - ffi.Pointer, int))(arg0, arg1, arg2, arg3); +void + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline( + ffi.Pointer block, + CFRunLoopObserverRef arg0, + int arg1) => + (objc.getBlockClosure(block) as void Function( + CFRunLoopObserverRef, int))(arg0, arg1); ffi.Pointer - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - dispatch_data_t, - ffi.Size, - ffi.Pointer, - ffi.Size)>( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureTrampoline, - false) - .cast(); - -/// Construction methods for `objc.ObjCBlock, ffi.Size)>`. -abstract final class ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Bool Function( - objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function(objc.NSObject, ffi.Size, ffi.Pointer, - ffi.Size)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.Size)> - fromFunctionPointer(ffi.Pointer arg2, ffi.Size arg3)>> ptr) => - objc.ObjCBlock< - ffi.Bool Function( - objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)>( - objc.newPointerBlock( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, ffi.Size)> fromFunction( - bool Function(Dartdispatch_data_t, int, ffi.Pointer, int) - fn) => - objc.ObjCBlock, ffi.Size)>( - objc.newClosureBlock( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureCallable, - (dispatch_data_t arg0, int arg1, ffi.Pointer arg2, - int arg3) => - fn(objc.NSObject.castFromPointer(arg0, retain: true, release: true), arg1, arg2, arg3)), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock, ffi.Size)>`. -extension ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_CallExtension - on objc.ObjCBlock< - ffi.Bool Function( - objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)> { - bool call(Dartdispatch_data_t arg0, int arg1, ffi.Pointer arg2, - int arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - dispatch_data_t arg0, - ffi.Size arg1, - ffi.Pointer arg2, - ffi.Size arg3)>>() - .asFunction< - bool Function( - ffi.Pointer, - dispatch_data_t, - int, - ffi.Pointer, - int)>()(ref.pointer, arg0.ref.pointer, arg1, arg2, arg3); -} - -typedef dispatch_fd_t = ffi.Int; -typedef Dartdispatch_fd_t = int; -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(dispatch_data_t arg0, ffi.Int arg1)>>() - .asFunction()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrCallable = + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, dispatch_data_t, ffi.Int)>( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrTrampoline) + ffi.Void Function(ffi.Pointer, + CFRunLoopObserverRef, CFOptionFlags)>( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline( +void + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerTrampoline( ffi.Pointer block, - dispatch_data_t arg0, - int arg1) => - (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( - arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, dispatch_data_t, ffi.Int)>( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerTrampoline( - ffi.Pointer block, dispatch_data_t arg0, int arg1) { - (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + CFRunLoopObserverRef arg0, + int arg1) { + (objc.getBlockClosure(block) as void Function(CFRunLoopObserverRef, int))( arg0, arg1); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, dispatch_data_t, ffi.Int)> - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerCallable = ffi - .NativeCallable< - ffi.Void Function(ffi.Pointer, dispatch_data_t, - ffi.Int)>.listener( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerTrampoline) + ffi.Void Function(ffi.Pointer, CFRunLoopObserverRef, + CFOptionFlags)> + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + CFRunLoopObserverRef, CFOptionFlags)>.listener( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { +/// Construction methods for `objc.ObjCBlock, CFOptionFlags)>`. +abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, + CFOptionFlags)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -51916,32 +52074,34 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function(objc.NSObject, ffi.Int)> fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> + fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock, CFOptionFlags)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(Dartdispatch_data_t, int) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureCallable, - (dispatch_data_t arg0, int arg1) => fn( - objc.NSObject.castFromPointer(arg0, - retain: true, release: true), - arg1)), - retain: false, - release: true); + static objc + .ObjCBlock, CFOptionFlags)> + fromFunction(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureCallable, + (CFRunLoopObserverRef arg0, int arg1) => + fn(arg0, CFRunLoopActivity.fromValue(arg1))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -51952,219 +52112,104 @@ abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(Dartdispatch_data_t, int) fn) { + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> + listener(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerCallable.nativeFunction + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerCallable + .nativeFunction .cast(), - (dispatch_data_t arg0, int arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - arg1)); - final wrapper = _wrapListenerBlock_108ugvk(raw); + (CFRunLoopObserverRef arg0, int arg1) => + fn(arg0, CFRunLoopActivity.fromValue(arg1))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_tg5tbv(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, + CFOptionFlags)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt_CallExtension - on objc.ObjCBlock { - void call(Dartdispatch_data_t arg0, int arg1) => ref.pointer.ref.invoke +/// Call operator for `objc.ObjCBlock, CFOptionFlags)>`. +extension ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> { + void call(CFRunLoopObserverRef arg0, CFRunLoopActivity arg1) => ref + .pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer block, - dispatch_data_t arg0, ffi.Int arg1)>>() + CFRunLoopObserverRef arg0, CFOptionFlags arg1)>>() .asFunction< - void Function(ffi.Pointer, dispatch_data_t, - int)>()(ref.pointer, arg0.ref.pointer, arg1); -} - -/// OS_dispatch_io -abstract final class OS_dispatch_io { - /// Builds an object that implements the OS_dispatch_io protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_io protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - -late final _protocol_OS_dispatch_io = objc.getProtocol("OS_dispatch_io"); -typedef dispatch_io_t = ffi.Pointer; -typedef Dartdispatch_io_t = objc.NSObject; -typedef dispatch_io_type_t = ffi.UnsignedLong; -typedef Dartdispatch_io_type_t = int; -void _ObjCBlock_ffiVoid_ffiInt_fnPtrTrampoline( - ffi.Pointer block, int arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiInt_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Int)>(_ObjCBlock_ffiVoid_ffiInt_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiInt_closureTrampoline( - ffi.Pointer block, int arg0) => - (objc.getBlockClosure(block) as void Function(int))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiInt_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Int)>(_ObjCBlock_ffiVoid_ffiInt_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiInt_listenerTrampoline( - ffi.Pointer block, int arg0) { - (objc.getBlockClosure(block) as void Function(int))(arg0); - objc.objectRelease(block.cast()); + void Function(ffi.Pointer, CFRunLoopObserverRef, + int)>()(ref.pointer, arg0, arg1.value); } -ffi.NativeCallable, ffi.Int)> - _ObjCBlock_ffiVoid_ffiInt_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Int)>.listener(_ObjCBlock_ffiVoid_ffiInt_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_ffiInt { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); +final class CFRunLoopTimerContext extends ffi.Struct { + @CFIndex() + external int version; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiInt_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + external ffi.Pointer info; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(int) fn) => - objc.ObjCBlock( - objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiInt_closureCallable, - (int arg0) => fn(arg0)), - retain: false, - release: true); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(int) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiInt_listenerCallable.nativeFunction.cast(), - (int arg0) => fn(arg0)); - final wrapper = _wrapListenerBlock_1afulej(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} + external ffi.Pointer< + ffi.NativeFunction info)>> + release; -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_ffiInt_CallExtension - on objc.ObjCBlock { - void call(int arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, ffi.Int arg0)>>() - .asFunction, int)>()( - ref.pointer, arg0); + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; } -typedef dispatch_io_handler_t = ffi.Pointer; -typedef Dartdispatch_io_handler_t - = objc.ObjCBlock; -void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrTrampoline( - ffi.Pointer block, - bool arg0, - dispatch_data_t arg1, - int arg2) => +typedef CFRunLoopTimerCallBackFunction = ffi.Void Function( + CFRunLoopTimerRef timer, ffi.Pointer info); +typedef DartCFRunLoopTimerCallBackFunction = void Function( + CFRunLoopTimerRef timer, ffi.Pointer info); +typedef CFRunLoopTimerCallBack + = ffi.Pointer>; +void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrTrampoline( + ffi.Pointer block, CFRunLoopTimerRef arg0) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Bool arg0, dispatch_data_t arg1, ffi.Int arg2)>>() - .asFunction()( - arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrCallable = + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, ffi.Bool, - dispatch_data_t, ffi.Int)>( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrTrampoline) + ffi.Void Function( + ffi.Pointer, CFRunLoopTimerRef)>( + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline( - ffi.Pointer block, - bool arg0, - dispatch_data_t arg1, - int arg2) => - (objc.getBlockClosure(block) as void Function(bool, dispatch_data_t, int))( - arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureCallable = +void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline( + ffi.Pointer block, CFRunLoopTimerRef arg0) => + (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, ffi.Bool, - dispatch_data_t, ffi.Int)>( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline) + ffi.Void Function( + ffi.Pointer, CFRunLoopTimerRef)>( + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerTrampoline( - ffi.Pointer block, - bool arg0, - dispatch_data_t arg1, - int arg2) { - (objc.getBlockClosure(block) as void Function(bool, dispatch_data_t, int))( - arg0, arg1, arg2); +void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerTrampoline( + ffi.Pointer block, CFRunLoopTimerRef arg0) { + (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Bool, - dispatch_data_t, ffi.Int)> - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerCallable = ffi - .NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Bool, - dispatch_data_t, ffi.Int)>.listener( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerTrampoline) + ffi.Void Function(ffi.Pointer, CFRunLoopTimerRef)> + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerCallable = ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, CFRunLoopTimerRef)>.listener( + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock + static objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock( + objc.ObjCBlock)>( pointer, retain: retain, release: release); @@ -52175,13 +52220,12 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function(ffi.Bool, objc.NSObject, ffi.Int)> fromFunctionPointer( - ffi.Pointer> + ffi.Void Function(ffi.Pointer<__CFRunLoopTimer>)> fromFunctionPointer( + ffi.Pointer> ptr) => - objc.ObjCBlock( + objc.ObjCBlock)>( objc.newPointerBlock( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrCallable, - ptr.cast()), + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -52190,16 +52234,12 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock - fromFunction(void Function(bool, Dartdispatch_data_t, int) fn) => - objc.ObjCBlock( + static objc.ObjCBlock)> + fromFunction(void Function(CFRunLoopTimerRef) fn) => + objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureCallable, - (bool arg0, dispatch_data_t arg1, int arg2) => fn( - arg0, - objc.NSObject.castFromPointer(arg1, - retain: true, release: true), - arg2)), + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureCallable, + (CFRunLoopTimerRef arg0) => fn(arg0)), retain: false, release: true); @@ -52212,75 +52252,106 @@ abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock - listener(void Function(bool, Dartdispatch_data_t, int) fn) { + static objc.ObjCBlock)> + listener(void Function(CFRunLoopTimerRef) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerCallable - .nativeFunction + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerCallable.nativeFunction .cast(), - (bool arg0, dispatch_data_t arg1, int arg2) => fn( - arg0, - objc.NSObject.castFromPointer(arg1, retain: false, release: true), - arg2)); - final wrapper = _wrapListenerBlock_elldw5(raw); + (CFRunLoopTimerRef arg0) => fn(arg0)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1dqvvol(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock( + return objc.ObjCBlock)>( wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_CallExtension - on objc.ObjCBlock { - void call(bool arg0, Dartdispatch_data_t arg1, int arg2) => ref - .pointer.ref.invoke +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_CFRunLoopTimerRef_CallExtension + on objc.ObjCBlock)> { + void call(CFRunLoopTimerRef arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer block, - ffi.Bool arg0, dispatch_data_t arg1, ffi.Int arg2)>>() + CFRunLoopTimerRef arg0)>>() .asFunction< - void Function(ffi.Pointer, bool, dispatch_data_t, - int)>()(ref.pointer, arg0, arg1.ref.pointer, arg2); + void Function(ffi.Pointer, + CFRunLoopTimerRef)>()(ref.pointer, arg0); } -typedef dispatch_io_close_flags_t = ffi.UnsignedLong; -typedef Dartdispatch_io_close_flags_t = int; -typedef dispatch_io_interval_flags_t = ffi.UnsignedLong; -typedef Dartdispatch_io_interval_flags_t = int; +final class __CFSocket extends ffi.Opaque {} -/// OS_dispatch_workloop -abstract final class OS_dispatch_workloop { - /// Builds an object that implements the OS_dispatch_workloop protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +typedef CFSocketRef = ffi.Pointer<__CFSocket>; - return builder.build(); - } +enum CFSocketError { + kCFSocketSuccess(0), + kCFSocketError(-1), + kCFSocketTimeout(-2); - /// Adds the implementation of the OS_dispatch_workloop protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + final int value; + const CFSocketError(this.value); + + static CFSocketError fromValue(int value) => switch (value) { + 0 => kCFSocketSuccess, + -1 => kCFSocketError, + -2 => kCFSocketTimeout, + _ => throw ArgumentError("Unknown value for CFSocketError: $value"), + }; } -late final _protocol_OS_dispatch_workloop = - objc.getProtocol("OS_dispatch_workloop"); -typedef dispatch_workloop_t = ffi.Pointer; -typedef Dartdispatch_workloop_t = objc.NSObject; +final class CFSocketSignature extends ffi.Struct { + @SInt32() + external int protocolFamily; -final class CFStreamError extends ffi.Struct { - @CFIndex() - external int domain; + @SInt32() + external int socketType; @SInt32() - external int error; + external int protocol; + + external CFDataRef address; } -final class CFStreamClientContext extends ffi.Struct { +enum CFSocketCallBackType { + kCFSocketNoCallBack(0), + kCFSocketReadCallBack(1), + kCFSocketAcceptCallBack(2), + kCFSocketDataCallBack(3), + kCFSocketConnectCallBack(4), + kCFSocketWriteCallBack(8); + + final int value; + const CFSocketCallBackType(this.value); + + static CFSocketCallBackType fromValue(int value) => switch (value) { + 0 => kCFSocketNoCallBack, + 1 => kCFSocketReadCallBack, + 2 => kCFSocketAcceptCallBack, + 3 => kCFSocketDataCallBack, + 4 => kCFSocketConnectCallBack, + 8 => kCFSocketWriteCallBack, + _ => + throw ArgumentError("Unknown value for CFSocketCallBackType: $value"), + }; +} + +typedef CFSocketCallBackFunction = ffi.Void Function( + CFSocketRef s, + CFOptionFlags type, + CFDataRef address, + ffi.Pointer data, + ffi.Pointer info); +typedef DartCFSocketCallBackFunction = void Function( + CFSocketRef s, + CFSocketCallBackType type, + CFDataRef address, + ffi.Pointer data, + ffi.Pointer info); +typedef CFSocketCallBack + = ffi.Pointer>; + +final class CFSocketContext extends ffi.Struct { @CFIndex() external int version; @@ -52299,7031 +52370,5367 @@ final class CFStreamClientContext extends ffi.Struct { copyDescription; } -final class __CFReadStream extends ffi.Opaque {} +typedef CFSocketNativeHandle = ffi.Int; +typedef DartCFSocketNativeHandle = int; -final class __CFWriteStream extends ffi.Opaque {} +final class accessx_descriptor extends ffi.Struct { + @ffi.UnsignedInt() + external int ad_name_offset; -typedef CFStreamPropertyKey = CFStringRef; -typedef CFReadStreamRef = ffi.Pointer<__CFReadStream>; -typedef CFWriteStreamRef = ffi.Pointer<__CFWriteStream>; + @ffi.Int() + external int ad_flags; -enum CFStreamStatus { - kCFStreamStatusNotOpen(0), - kCFStreamStatusOpening(1), - kCFStreamStatusOpen(2), - kCFStreamStatusReading(3), - kCFStreamStatusWriting(4), - kCFStreamStatusAtEnd(5), - kCFStreamStatusClosed(6), - kCFStreamStatusError(7); + @ffi.Array.multi([2]) + external ffi.Array ad_pad; +} - final int value; - const CFStreamStatus(this.value); +final class fssearchblock extends ffi.Opaque {} - static CFStreamStatus fromValue(int value) => switch (value) { - 0 => kCFStreamStatusNotOpen, - 1 => kCFStreamStatusOpening, - 2 => kCFStreamStatusOpen, - 3 => kCFStreamStatusReading, - 4 => kCFStreamStatusWriting, - 5 => kCFStreamStatusAtEnd, - 6 => kCFStreamStatusClosed, - 7 => kCFStreamStatusError, - _ => throw ArgumentError("Unknown value for CFStreamStatus: $value"), - }; -} +final class searchstate extends ffi.Opaque {} -typedef CFReadStreamClientCallBack - = ffi.Pointer>; -typedef CFReadStreamClientCallBackFunction = ffi.Void Function( - CFReadStreamRef stream, - CFOptionFlags type, - ffi.Pointer clientCallBackInfo); -typedef DartCFReadStreamClientCallBackFunction = void Function( - CFReadStreamRef stream, - CFStreamEventType type, - ffi.Pointer clientCallBackInfo); +final class flock extends ffi.Struct { + @off_t() + external int l_start; -enum CFStreamEventType { - kCFStreamEventNone(0), - kCFStreamEventOpenCompleted(1), - kCFStreamEventHasBytesAvailable(2), - kCFStreamEventCanAcceptBytes(4), - kCFStreamEventErrorOccurred(8), - kCFStreamEventEndEncountered(16); + @off_t() + external int l_len; - final int value; - const CFStreamEventType(this.value); + @pid_t() + external int l_pid; - static CFStreamEventType fromValue(int value) => switch (value) { - 0 => kCFStreamEventNone, - 1 => kCFStreamEventOpenCompleted, - 2 => kCFStreamEventHasBytesAvailable, - 4 => kCFStreamEventCanAcceptBytes, - 8 => kCFStreamEventErrorOccurred, - 16 => kCFStreamEventEndEncountered, - _ => throw ArgumentError("Unknown value for CFStreamEventType: $value"), - }; + @ffi.Short() + external int l_type; + + @ffi.Short() + external int l_whence; } -typedef CFWriteStreamClientCallBack - = ffi.Pointer>; -typedef CFWriteStreamClientCallBackFunction = ffi.Void Function( - CFWriteStreamRef stream, - CFOptionFlags type, - ffi.Pointer clientCallBackInfo); -typedef DartCFWriteStreamClientCallBackFunction = void Function( - CFWriteStreamRef stream, - CFStreamEventType type, - ffi.Pointer clientCallBackInfo); +final class flocktimeout extends ffi.Struct { + external flock fl; -enum CFPropertyListFormat { - kCFPropertyListOpenStepFormat(1), - kCFPropertyListXMLFormat_v1_0(100), - kCFPropertyListBinaryFormat_v1_0(200); + external timespec timeout; +} - final int value; - const CFPropertyListFormat(this.value); +final class radvisory extends ffi.Struct { + @off_t() + external int ra_offset; - static CFPropertyListFormat fromValue(int value) => switch (value) { - 1 => kCFPropertyListOpenStepFormat, - 100 => kCFPropertyListXMLFormat_v1_0, - 200 => kCFPropertyListBinaryFormat_v1_0, - _ => - throw ArgumentError("Unknown value for CFPropertyListFormat: $value"), - }; + @ffi.Int() + external int ra_count; } -final class CFSetCallBacks extends ffi.Struct { - @CFIndex() - external int version; +final class fsignatures extends ffi.Struct { + @off_t() + external int fs_file_start; - external CFSetRetainCallBack retain; + external ffi.Pointer fs_blob_start; - external CFSetReleaseCallBack release; + @ffi.Size() + external int fs_blob_size; - external CFSetCopyDescriptionCallBack copyDescription; + @ffi.Size() + external int fs_fsignatures_size; - external CFSetEqualCallBack equal; + @ffi.Array.multi([20]) + external ffi.Array fs_cdhash; - external CFSetHashCallBack hash; + @ffi.Int() + external int fs_hash_type; } -typedef CFSetRetainCallBack - = ffi.Pointer>; -typedef CFSetRetainCallBackFunction = ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFSetReleaseCallBack - = ffi.Pointer>; -typedef CFSetReleaseCallBackFunction = ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef DartCFSetReleaseCallBackFunction = void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFSetCopyDescriptionCallBack - = ffi.Pointer>; -typedef CFSetCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer value); -typedef CFSetEqualCallBack - = ffi.Pointer>; -typedef CFSetEqualCallBackFunction = Boolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef DartCFSetEqualCallBackFunction = DartBoolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef CFSetHashCallBack - = ffi.Pointer>; -typedef CFSetHashCallBackFunction = CFHashCode Function( - ffi.Pointer value); -typedef DartCFSetHashCallBackFunction = DartCFHashCode Function( - ffi.Pointer value); - -final class __CFSet extends ffi.Opaque {} +typedef fsignatures_t = fsignatures; -typedef CFSetRef = ffi.Pointer<__CFSet>; -typedef CFMutableSetRef = ffi.Pointer<__CFSet>; -typedef CFSetApplierFunction - = ffi.Pointer>; -typedef CFSetApplierFunctionFunction = ffi.Void Function( - ffi.Pointer value, ffi.Pointer context); -typedef DartCFSetApplierFunctionFunction = void Function( - ffi.Pointer value, ffi.Pointer context); +final class fsupplement extends ffi.Struct { + @off_t() + external int fs_file_start; -final class CFTreeContext extends ffi.Struct { - @CFIndex() - external int version; + @off_t() + external int fs_blob_start; - external ffi.Pointer info; + @ffi.Size() + external int fs_blob_size; - external CFTreeRetainCallBack retain; + @ffi.Int() + external int fs_orig_fd; +} - external CFTreeReleaseCallBack release; +typedef fsupplement_t = fsupplement; - external CFTreeCopyDescriptionCallBack copyDescription; -} +final class fchecklv extends ffi.Struct { + @off_t() + external int lv_file_start; -typedef CFTreeRetainCallBack - = ffi.Pointer>; -typedef CFTreeRetainCallBackFunction = ffi.Pointer Function( - ffi.Pointer info); -typedef CFTreeReleaseCallBack - = ffi.Pointer>; -typedef CFTreeReleaseCallBackFunction = ffi.Void Function( - ffi.Pointer info); -typedef DartCFTreeReleaseCallBackFunction = void Function( - ffi.Pointer info); -typedef CFTreeCopyDescriptionCallBack - = ffi.Pointer>; -typedef CFTreeCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer info); + @ffi.Size() + external int lv_error_message_size; -final class __CFTree extends ffi.Opaque {} + external ffi.Pointer lv_error_message; +} -typedef CFTreeRef = ffi.Pointer<__CFTree>; -typedef CFTreeApplierFunction - = ffi.Pointer>; -typedef CFTreeApplierFunctionFunction = ffi.Void Function( - ffi.Pointer value, ffi.Pointer context); -typedef DartCFTreeApplierFunctionFunction = void Function( - ffi.Pointer value, ffi.Pointer context); +typedef fchecklv_t = fchecklv; -final class __CFUUID extends ffi.Opaque {} +final class fgetsigsinfo extends ffi.Struct { + @off_t() + external int fg_file_start; -final class CFUUIDBytes extends ffi.Struct { - @UInt8() - external int byte0; + @ffi.Int() + external int fg_info_request; - @UInt8() - external int byte1; + @ffi.Int() + external int fg_sig_is_platform; +} - @UInt8() - external int byte2; +typedef fgetsigsinfo_t = fgetsigsinfo; - @UInt8() - external int byte3; +final class fstore extends ffi.Struct { + @ffi.UnsignedInt() + external int fst_flags; - @UInt8() - external int byte4; + @ffi.Int() + external int fst_posmode; - @UInt8() - external int byte5; + @off_t() + external int fst_offset; - @UInt8() - external int byte6; + @off_t() + external int fst_length; - @UInt8() - external int byte7; + @off_t() + external int fst_bytesalloc; +} - @UInt8() - external int byte8; +typedef fstore_t = fstore; - @UInt8() - external int byte9; +final class fpunchhole extends ffi.Struct { + @ffi.UnsignedInt() + external int fp_flags; - @UInt8() - external int byte10; + @ffi.UnsignedInt() + external int reserved; - @UInt8() - external int byte11; + @off_t() + external int fp_offset; - @UInt8() - external int byte12; + @off_t() + external int fp_length; +} - @UInt8() - external int byte13; +typedef fpunchhole_t = fpunchhole; - @UInt8() - external int byte14; +final class ftrimactivefile extends ffi.Struct { + @off_t() + external int fta_offset; - @UInt8() - external int byte15; + @off_t() + external int fta_length; } -typedef CFUUIDRef = ffi.Pointer<__CFUUID>; +typedef ftrimactivefile_t = ftrimactivefile; -final class __CFBundle extends ffi.Opaque {} +final class fspecread extends ffi.Struct { + @ffi.UnsignedInt() + external int fsr_flags; -typedef CFBundleRef = ffi.Pointer<__CFBundle>; -typedef cpu_type_t = integer_t; -typedef CFPlugInRef = ffi.Pointer<__CFBundle>; -typedef CFBundleRefNum = ffi.Int; -typedef DartCFBundleRefNum = int; + @ffi.UnsignedInt() + external int reserved; -final class __CFMessagePort extends ffi.Opaque {} + @off_t() + external int fsr_offset; -final class CFMessagePortContext extends ffi.Struct { - @CFIndex() - external int version; + @off_t() + external int fsr_length; +} - external ffi.Pointer info; +typedef fspecread_t = fspecread; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; +final class fattributiontag extends ffi.Struct { + @ffi.UnsignedInt() + external int ft_flags; - external ffi.Pointer< - ffi.NativeFunction info)>> - release; + @ffi.UnsignedLongLong() + external int ft_hash; - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; + @ffi.Array.multi([255]) + external ffi.Array ft_attribution_name; } -typedef CFMessagePortRef = ffi.Pointer<__CFMessagePort>; -typedef CFMessagePortCallBack - = ffi.Pointer>; -typedef CFMessagePortCallBackFunction = CFDataRef Function( - CFMessagePortRef local, - SInt32 msgid, - CFDataRef data, - ffi.Pointer info); -typedef DartCFMessagePortCallBackFunction = CFDataRef Function( - CFMessagePortRef local, - DartSInt32 msgid, - CFDataRef data, - ffi.Pointer info); -typedef CFMessagePortInvalidationCallBack = ffi - .Pointer>; -typedef CFMessagePortInvalidationCallBackFunction = ffi.Void Function( - CFMessagePortRef ms, ffi.Pointer info); -typedef DartCFMessagePortInvalidationCallBackFunction = void Function( - CFMessagePortRef ms, ffi.Pointer info); -typedef CFPlugInFactoryFunction - = ffi.Pointer>; -typedef CFPlugInFactoryFunctionFunction = ffi.Pointer Function( - CFAllocatorRef allocator, CFUUIDRef typeUUID); +typedef fattributiontag_t = fattributiontag; -final class __CFPlugInInstance extends ffi.Opaque {} +@ffi.Packed(4) +final class log2phys extends ffi.Struct { + @ffi.UnsignedInt() + external int l2p_flags; -typedef CFPlugInInstanceRef = ffi.Pointer<__CFPlugInInstance>; -typedef CFPlugInInstanceDeallocateInstanceDataFunction = ffi.Pointer< - ffi.NativeFunction>; -typedef CFPlugInInstanceDeallocateInstanceDataFunctionFunction = ffi.Void - Function(ffi.Pointer instanceData); -typedef DartCFPlugInInstanceDeallocateInstanceDataFunctionFunction = void - Function(ffi.Pointer instanceData); -typedef CFPlugInInstanceGetInterfaceFunction = ffi - .Pointer>; -typedef CFPlugInInstanceGetInterfaceFunctionFunction = Boolean Function( - CFPlugInInstanceRef instance, - CFStringRef interfaceName, - ffi.Pointer> ftbl); -typedef DartCFPlugInInstanceGetInterfaceFunctionFunction = DartBoolean Function( - CFPlugInInstanceRef instance, - CFStringRef interfaceName, - ffi.Pointer> ftbl); + @off_t() + external int l2p_contigbytes; -final class __CFMachPort extends ffi.Opaque {} + @off_t() + external int l2p_devoffset; +} -final class CFMachPortContext extends ffi.Struct { - @CFIndex() - external int version; +final class _filesec extends ffi.Opaque {} - external ffi.Pointer info; +typedef filesec_t = ffi.Pointer<_filesec>; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; +enum filesec_property_t { + FILESEC_OWNER(1), + FILESEC_GROUP(2), + FILESEC_UUID(3), + FILESEC_MODE(4), + FILESEC_ACL(5), + FILESEC_GRPUUID(6), + FILESEC_ACL_RAW(100), + FILESEC_ACL_ALLOCSIZE(101); - external ffi.Pointer< - ffi.NativeFunction info)>> - release; + final int value; + const filesec_property_t(this.value); - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; + static filesec_property_t fromValue(int value) => switch (value) { + 1 => FILESEC_OWNER, + 2 => FILESEC_GROUP, + 3 => FILESEC_UUID, + 4 => FILESEC_MODE, + 5 => FILESEC_ACL, + 6 => FILESEC_GRPUUID, + 100 => FILESEC_ACL_RAW, + 101 => FILESEC_ACL_ALLOCSIZE, + _ => + throw ArgumentError("Unknown value for filesec_property_t: $value"), + }; } -typedef CFMachPortRef = ffi.Pointer<__CFMachPort>; -typedef CFMachPortCallBack - = ffi.Pointer>; -typedef CFMachPortCallBackFunction = ffi.Void Function(CFMachPortRef port, - ffi.Pointer msg, CFIndex size, ffi.Pointer info); -typedef DartCFMachPortCallBackFunction = void Function(CFMachPortRef port, - ffi.Pointer msg, DartCFIndex size, ffi.Pointer info); -typedef CFMachPortInvalidationCallBack - = ffi.Pointer>; -typedef CFMachPortInvalidationCallBackFunction = ffi.Void Function( - CFMachPortRef port, ffi.Pointer info); -typedef DartCFMachPortInvalidationCallBackFunction = void Function( - CFMachPortRef port, ffi.Pointer info); - -final class __CFAttributedString extends ffi.Opaque {} +final class os_workgroup_attr_opaque_s extends ffi.Struct { + @ffi.Uint32() + external int sig; -typedef CFAttributedStringRef = ffi.Pointer<__CFAttributedString>; -typedef CFMutableAttributedStringRef = ffi.Pointer<__CFAttributedString>; + @ffi.Array.multi([60]) + external ffi.Array opaque; +} -final class __CFURLEnumerator extends ffi.Opaque {} +final class os_workgroup_interval_data_opaque_s extends ffi.Struct { + @ffi.Uint32() + external int sig; -typedef CFURLEnumeratorRef = ffi.Pointer<__CFURLEnumerator>; + @ffi.Array.multi([56]) + external ffi.Array opaque; +} -enum CFURLEnumeratorOptions { - kCFURLEnumeratorDefaultBehavior(0), - kCFURLEnumeratorDescendRecursively(1), - kCFURLEnumeratorSkipInvisibles(2), - kCFURLEnumeratorGenerateFileReferenceURLs(4), - kCFURLEnumeratorSkipPackageContents(8), - kCFURLEnumeratorIncludeDirectoriesPreOrder(16), - kCFURLEnumeratorIncludeDirectoriesPostOrder(32), - kCFURLEnumeratorGenerateRelativePathURLs(64); +final class os_workgroup_join_token_opaque_s extends ffi.Struct { + @ffi.Uint32() + external int sig; - final int value; - const CFURLEnumeratorOptions(this.value); + @ffi.Array.multi([36]) + external ffi.Array opaque; +} - static CFURLEnumeratorOptions fromValue(int value) => switch (value) { - 0 => kCFURLEnumeratorDefaultBehavior, - 1 => kCFURLEnumeratorDescendRecursively, - 2 => kCFURLEnumeratorSkipInvisibles, - 4 => kCFURLEnumeratorGenerateFileReferenceURLs, - 8 => kCFURLEnumeratorSkipPackageContents, - 16 => kCFURLEnumeratorIncludeDirectoriesPreOrder, - 32 => kCFURLEnumeratorIncludeDirectoriesPostOrder, - 64 => kCFURLEnumeratorGenerateRelativePathURLs, - _ => throw ArgumentError( - "Unknown value for CFURLEnumeratorOptions: $value"), - }; -} - -enum CFURLEnumeratorResult { - kCFURLEnumeratorSuccess(1), - kCFURLEnumeratorEnd(2), - kCFURLEnumeratorError(3), - kCFURLEnumeratorDirectoryPostOrderSuccess(4); +/// WARNING: OS_os_workgroup is a stub. To generate bindings for this class, include +/// OS_os_workgroup in your config's objc-interfaces list. +/// +/// OS_os_workgroup +class OS_os_workgroup extends OS_object { + OS_os_workgroup._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - final int value; - const CFURLEnumeratorResult(this.value); + /// Constructs a [OS_os_workgroup] that points to the same underlying object as [other]. + OS_os_workgroup.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - static CFURLEnumeratorResult fromValue(int value) => switch (value) { - 1 => kCFURLEnumeratorSuccess, - 2 => kCFURLEnumeratorEnd, - 3 => kCFURLEnumeratorError, - 4 => kCFURLEnumeratorDirectoryPostOrderSuccess, - _ => throw ArgumentError( - "Unknown value for CFURLEnumeratorResult: $value"), - }; + /// Constructs a [OS_os_workgroup] that wraps the given raw object pointer. + OS_os_workgroup.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); } -final class guid_t extends ffi.Union { - @ffi.Array.multi([16]) - external ffi.Array g_guid; +typedef os_workgroup_t = ffi.Pointer; +typedef Dartos_workgroup_t = OS_os_workgroup; +typedef os_workgroup_attr_s = os_workgroup_attr_opaque_s; +typedef os_workgroup_attr_t = ffi.Pointer; +typedef os_workgroup_join_token_s = os_workgroup_join_token_opaque_s; +typedef os_workgroup_join_token_t + = ffi.Pointer; +typedef os_workgroup_index = ffi.Uint32; +typedef Dartos_workgroup_index = int; +typedef os_workgroup_working_arena_destructor_tFunction = ffi.Void Function( + ffi.Pointer); +typedef Dartos_workgroup_working_arena_destructor_tFunction = void Function( + ffi.Pointer); +typedef os_workgroup_working_arena_destructor_t = ffi.Pointer< + ffi.NativeFunction>; - @ffi.Array.multi([4]) - external ffi.Array g_guid_asint; -} +final class os_workgroup_max_parallel_threads_attr_s extends ffi.Opaque {} -@ffi.Packed(1) -final class ntsid_t extends ffi.Struct { - @u_int8_t() - external int sid_kind; +typedef os_workgroup_mpt_attr_s = os_workgroup_max_parallel_threads_attr_s; +typedef os_workgroup_mpt_attr_t + = ffi.Pointer; +late final _protocol_OS_os_workgroup_interval = + objc.getProtocol("OS_os_workgroup_interval"); - @u_int8_t() - external int sid_authcount; +/// OS_os_workgroup_interval +abstract final class OS_os_workgroup_interval { + /// Builds an object that implements the OS_os_workgroup_interval protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @ffi.Array.multi([6]) - external ffi.Array sid_authority; + return builder.build(); + } - @ffi.Array.multi([16]) - external ffi.Array sid_authorities; + /// Adds the implementation of the OS_os_workgroup_interval protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef u_int8_t = ffi.UnsignedChar; -typedef Dartu_int8_t = int; -typedef u_int32_t = ffi.UnsignedInt; -typedef Dartu_int32_t = int; - -final class kauth_identity_extlookup extends ffi.Struct { - @u_int32_t() - external int el_seqno; - - @u_int32_t() - external int el_result; +typedef os_workgroup_interval_t = ffi.Pointer; +typedef Dartos_workgroup_interval_t = OS_os_workgroup; +typedef os_workgroup_interval_data_s = os_workgroup_interval_data_opaque_s; +typedef os_workgroup_interval_data_t + = ffi.Pointer; +late final _protocol_OS_os_workgroup_parallel = + objc.getProtocol("OS_os_workgroup_parallel"); - @u_int32_t() - external int el_flags; +/// OS_os_workgroup_parallel +abstract final class OS_os_workgroup_parallel { + /// Builds an object that implements the OS_os_workgroup_parallel protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @__darwin_pid_t() - external int el_info_pid; + return builder.build(); + } - @u_int64_t() - external int el_extend; + /// Adds the implementation of the OS_os_workgroup_parallel protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} - @u_int32_t() - external int el_info_reserved_1; +typedef os_workgroup_parallel_t = ffi.Pointer; +typedef Dartos_workgroup_parallel_t = OS_os_workgroup; +typedef dispatch_function_tFunction = ffi.Void Function(ffi.Pointer); +typedef Dartdispatch_function_tFunction = void Function(ffi.Pointer); +typedef dispatch_function_t + = ffi.Pointer>; - @uid_t() - external int el_uid; +final class time_value extends ffi.Struct { + @integer_t() + external int seconds; - external guid_t el_uguid; + @integer_t() + external int microseconds; +} - @u_int32_t() - external int el_uguid_valid; +typedef time_value_t = time_value; +typedef alarm_type_t = ffi.Int; +typedef Dartalarm_type_t = int; +typedef sleep_type_t = ffi.Int; +typedef Dartsleep_type_t = int; +typedef clock_id_t = ffi.Int; +typedef Dartclock_id_t = int; +typedef clock_flavor_t = ffi.Int; +typedef Dartclock_flavor_t = int; +typedef clock_attr_t = ffi.Pointer; +typedef clock_res_t = ffi.Int; +typedef Dartclock_res_t = int; - external ntsid_t el_usid; +final class mach_timespec extends ffi.Struct { + @ffi.UnsignedInt() + external int tv_sec; - @u_int32_t() - external int el_usid_valid; + @clock_res_t() + external int tv_nsec; +} - @gid_t() - external int el_gid; +typedef mach_timespec_t = mach_timespec; +typedef dispatch_time_t = ffi.Uint64; +typedef Dartdispatch_time_t = int; - external guid_t el_gguid; +enum qos_class_t { + QOS_CLASS_USER_INTERACTIVE(33), + QOS_CLASS_USER_INITIATED(25), + QOS_CLASS_DEFAULT(21), + QOS_CLASS_UTILITY(17), + QOS_CLASS_BACKGROUND(9), + QOS_CLASS_UNSPECIFIED(0); - @u_int32_t() - external int el_gguid_valid; + final int value; + const qos_class_t(this.value); - external ntsid_t el_gsid; + static qos_class_t fromValue(int value) => switch (value) { + 33 => QOS_CLASS_USER_INTERACTIVE, + 25 => QOS_CLASS_USER_INITIATED, + 21 => QOS_CLASS_DEFAULT, + 17 => QOS_CLASS_UTILITY, + 9 => QOS_CLASS_BACKGROUND, + 0 => QOS_CLASS_UNSPECIFIED, + _ => throw ArgumentError("Unknown value for qos_class_t: $value"), + }; +} - @u_int32_t() - external int el_gsid_valid; +late final _protocol_OS_dispatch_object = + objc.getProtocol("OS_dispatch_object"); - @u_int32_t() - external int el_member_valid; +/// OS_dispatch_object +abstract final class OS_dispatch_object { + /// Builds an object that implements the OS_dispatch_object protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @u_int32_t() - external int el_sup_grp_cnt; + return builder.build(); + } - @ffi.Array.multi([16]) - external ffi.Array el_sup_groups; + /// Adds the implementation of the OS_dispatch_object protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef u_int64_t = ffi.UnsignedLongLong; -typedef Dartu_int64_t = int; +typedef dispatch_object_t = ffi.Pointer; +typedef Dartdispatch_object_t = objc.NSObject; +typedef dispatch_block_t = ffi.Pointer; +typedef Dartdispatch_block_t = objc.ObjCBlock; +late final _protocol_OS_dispatch_queue = objc.getProtocol("OS_dispatch_queue"); -final class kauth_cache_sizes extends ffi.Struct { - @u_int32_t() - external int kcs_group_size; +/// OS_dispatch_queue +abstract final class OS_dispatch_queue { + /// Builds an object that implements the OS_dispatch_queue protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @u_int32_t() - external int kcs_id_size; + return builder.build(); + } + + /// Adds the implementation of the OS_dispatch_queue protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class kauth_ace extends ffi.Struct { - external guid_t ace_applicable; +typedef dispatch_queue_t = ffi.Pointer; +typedef Dartdispatch_queue_t = objc.NSObject; +late final _protocol_OS_dispatch_queue_global = + objc.getProtocol("OS_dispatch_queue_global"); - @u_int32_t() - external int ace_flags; +/// OS_dispatch_queue_global +abstract final class OS_dispatch_queue_global { + /// Builds an object that implements the OS_dispatch_queue_global protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @kauth_ace_rights_t() - external int ace_rights; + return builder.build(); + } + + /// Adds the implementation of the OS_dispatch_queue_global protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef kauth_ace_rights_t = u_int32_t; +typedef dispatch_queue_global_t = ffi.Pointer; +typedef Dartdispatch_queue_global_t = objc.NSObject; +late final _protocol_OS_dispatch_queue_serial_executor = + objc.getProtocol("OS_dispatch_queue_serial_executor"); -final class kauth_acl extends ffi.Struct { - @u_int32_t() - external int acl_entrycount; +/// OS_dispatch_queue_serial_executor +abstract final class OS_dispatch_queue_serial_executor { + /// Builds an object that implements the OS_dispatch_queue_serial_executor protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @u_int32_t() - external int acl_flags; + return builder.build(); + } - @ffi.Array.multi([1]) - external ffi.Array acl_ace; + /// Adds the implementation of the OS_dispatch_queue_serial_executor protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class kauth_filesec extends ffi.Struct { - @u_int32_t() - external int fsec_magic; +typedef dispatch_queue_serial_executor_t = ffi.Pointer; +typedef Dartdispatch_queue_serial_executor_t = objc.NSObject; +late final _protocol_OS_dispatch_queue_serial = + objc.getProtocol("OS_dispatch_queue_serial"); - external guid_t fsec_owner; +/// OS_dispatch_queue_serial +abstract final class OS_dispatch_queue_serial { + /// Builds an object that implements the OS_dispatch_queue_serial protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - external guid_t fsec_group; + return builder.build(); + } - external kauth_acl fsec_acl; + /// Adds the implementation of the OS_dispatch_queue_serial protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class _acl extends ffi.Opaque {} +typedef dispatch_queue_serial_t = ffi.Pointer; +typedef Dartdispatch_queue_serial_t = objc.NSObject; +late final _protocol_OS_dispatch_queue_main = + objc.getProtocol("OS_dispatch_queue_main"); -final class _acl_entry extends ffi.Opaque {} +/// OS_dispatch_queue_main +abstract final class OS_dispatch_queue_main { + /// Builds an object that implements the OS_dispatch_queue_main protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); -final class _acl_permset extends ffi.Opaque {} + return builder.build(); + } -final class _acl_flagset extends ffi.Opaque {} + /// Adds the implementation of the OS_dispatch_queue_main protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} -typedef acl_t = ffi.Pointer<_acl>; -typedef acl_entry_t = ffi.Pointer<_acl_entry>; +typedef dispatch_queue_main_t = ffi.Pointer; +typedef Dartdispatch_queue_main_t = objc.NSObject; +late final _protocol_OS_dispatch_queue_concurrent = + objc.getProtocol("OS_dispatch_queue_concurrent"); -enum acl_type_t { - ACL_TYPE_EXTENDED(256), - ACL_TYPE_ACCESS(0), - ACL_TYPE_DEFAULT(1), - ACL_TYPE_AFS(2), - ACL_TYPE_CODA(3), - ACL_TYPE_NTFS(4), - ACL_TYPE_NWFS(5); +/// OS_dispatch_queue_concurrent +abstract final class OS_dispatch_queue_concurrent { + /// Builds an object that implements the OS_dispatch_queue_concurrent protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - final int value; - const acl_type_t(this.value); + return builder.build(); + } - static acl_type_t fromValue(int value) => switch (value) { - 256 => ACL_TYPE_EXTENDED, - 0 => ACL_TYPE_ACCESS, - 1 => ACL_TYPE_DEFAULT, - 2 => ACL_TYPE_AFS, - 3 => ACL_TYPE_CODA, - 4 => ACL_TYPE_NTFS, - 5 => ACL_TYPE_NWFS, - _ => throw ArgumentError("Unknown value for acl_type_t: $value"), - }; + /// Adds the implementation of the OS_dispatch_queue_concurrent protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef acl_permset_t = ffi.Pointer<_acl_permset>; +typedef dispatch_queue_concurrent_t = ffi.Pointer; +typedef Dartdispatch_queue_concurrent_t = objc.NSObject; +void _ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline( + ffi.Pointer block, int arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiSize_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Size)>(_ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiSize_closureTrampoline( + ffi.Pointer block, int arg0) => + (objc.getBlockClosure(block) as void Function(int))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiSize_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Size)>(_ObjCBlock_ffiVoid_ffiSize_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiSize_listenerTrampoline( + ffi.Pointer block, int arg0) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); +} -enum acl_perm_t { - ACL_READ_DATA(2), - ACL_WRITE_DATA(4), - ACL_EXECUTE(8), - ACL_DELETE(16), - ACL_APPEND_DATA(32), - ACL_DELETE_CHILD(64), - ACL_READ_ATTRIBUTES(128), - ACL_WRITE_ATTRIBUTES(256), - ACL_READ_EXTATTRIBUTES(512), - ACL_WRITE_EXTATTRIBUTES(1024), - ACL_READ_SECURITY(2048), - ACL_WRITE_SECURITY(4096), - ACL_CHANGE_OWNER(8192), - ACL_SYNCHRONIZE(1048576); +ffi.NativeCallable, ffi.Size)> + _ObjCBlock_ffiVoid_ffiSize_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Size)>.listener(_ObjCBlock_ffiVoid_ffiSize_listenerTrampoline) + ..keepIsolateAlive = false; - static const ACL_LIST_DIRECTORY = ACL_READ_DATA; - static const ACL_ADD_FILE = ACL_WRITE_DATA; - static const ACL_SEARCH = ACL_EXECUTE; - static const ACL_ADD_SUBDIRECTORY = ACL_APPEND_DATA; +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_ffiSize { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - final int value; - const acl_perm_t(this.value); + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiSize_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static acl_perm_t fromValue(int value) => switch (value) { - 2 => ACL_READ_DATA, - 4 => ACL_WRITE_DATA, - 8 => ACL_EXECUTE, - 16 => ACL_DELETE, - 32 => ACL_APPEND_DATA, - 64 => ACL_DELETE_CHILD, - 128 => ACL_READ_ATTRIBUTES, - 256 => ACL_WRITE_ATTRIBUTES, - 512 => ACL_READ_EXTATTRIBUTES, - 1024 => ACL_WRITE_EXTATTRIBUTES, - 2048 => ACL_READ_SECURITY, - 4096 => ACL_WRITE_SECURITY, - 8192 => ACL_CHANGE_OWNER, - 1048576 => ACL_SYNCHRONIZE, - _ => throw ArgumentError("Unknown value for acl_perm_t: $value"), - }; + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(int) fn) => + objc.ObjCBlock( + objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiSize_closureCallable, + (int arg0) => fn(arg0)), + retain: false, + release: true); - @override - String toString() { - if (this == ACL_READ_DATA) - return "acl_perm_t.ACL_READ_DATA, acl_perm_t.ACL_LIST_DIRECTORY"; - if (this == ACL_WRITE_DATA) - return "acl_perm_t.ACL_WRITE_DATA, acl_perm_t.ACL_ADD_FILE"; - if (this == ACL_EXECUTE) - return "acl_perm_t.ACL_EXECUTE, acl_perm_t.ACL_SEARCH"; - if (this == ACL_APPEND_DATA) - return "acl_perm_t.ACL_APPEND_DATA, acl_perm_t.ACL_ADD_SUBDIRECTORY"; - return super.toString(); + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiSize_listenerCallable.nativeFunction.cast(), + (int arg0) => fn(arg0)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_6enxqz(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } } -typedef acl_permset_mask_t = u_int64_t; -typedef acl_flagset_t = ffi.Pointer<_acl_flagset>; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_ffiSize_CallExtension + on objc.ObjCBlock { + void call(int arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, ffi.Size arg0)>>() + .asFunction, int)>()( + ref.pointer, arg0); +} -enum acl_flag_t { - ACL_FLAG_DEFER_INHERIT(1), - ACL_FLAG_NO_INHERIT(131072), - ACL_ENTRY_INHERITED(16), - ACL_ENTRY_FILE_INHERIT(32), - ACL_ENTRY_DIRECTORY_INHERIT(64), - ACL_ENTRY_LIMIT_INHERIT(128), - ACL_ENTRY_ONLY_INHERIT(256); +final class dispatch_queue_s extends ffi.Opaque {} - final int value; - const acl_flag_t(this.value); - - static acl_flag_t fromValue(int value) => switch (value) { - 1 => ACL_FLAG_DEFER_INHERIT, - 131072 => ACL_FLAG_NO_INHERIT, - 16 => ACL_ENTRY_INHERITED, - 32 => ACL_ENTRY_FILE_INHERIT, - 64 => ACL_ENTRY_DIRECTORY_INHERIT, - 128 => ACL_ENTRY_LIMIT_INHERIT, - 256 => ACL_ENTRY_ONLY_INHERIT, - _ => throw ArgumentError("Unknown value for acl_flag_t: $value"), - }; -} +typedef dispatch_queue_priority_t = ffi.Long; +typedef Dartdispatch_queue_priority_t = int; +late final _protocol_OS_dispatch_queue_attr = + objc.getProtocol("OS_dispatch_queue_attr"); -enum acl_tag_t { - ACL_UNDEFINED_TAG(0), - ACL_EXTENDED_ALLOW(1), - ACL_EXTENDED_DENY(2); +/// OS_dispatch_queue_attr +abstract final class OS_dispatch_queue_attr { + /// Builds an object that implements the OS_dispatch_queue_attr protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - final int value; - const acl_tag_t(this.value); + return builder.build(); + } - static acl_tag_t fromValue(int value) => switch (value) { - 0 => ACL_UNDEFINED_TAG, - 1 => ACL_EXTENDED_ALLOW, - 2 => ACL_EXTENDED_DENY, - _ => throw ArgumentError("Unknown value for acl_tag_t: $value"), - }; + /// Adds the implementation of the OS_dispatch_queue_attr protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class __CFFileSecurity extends ffi.Opaque {} +typedef dispatch_queue_attr_t = ffi.Pointer; +typedef Dartdispatch_queue_attr_t = objc.NSObject; -typedef CFFileSecurityRef = ffi.Pointer<__CFFileSecurity>; +final class dispatch_queue_attr_s extends ffi.Opaque {} -enum CFFileSecurityClearOptions { - kCFFileSecurityClearOwner(1), - kCFFileSecurityClearGroup(2), - kCFFileSecurityClearMode(4), - kCFFileSecurityClearOwnerUUID(8), - kCFFileSecurityClearGroupUUID(16), - kCFFileSecurityClearAccessControlList(32); +enum dispatch_autorelease_frequency_t { + DISPATCH_AUTORELEASE_FREQUENCY_INHERIT(0), + DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM(1), + DISPATCH_AUTORELEASE_FREQUENCY_NEVER(2); final int value; - const CFFileSecurityClearOptions(this.value); + const dispatch_autorelease_frequency_t(this.value); - static CFFileSecurityClearOptions fromValue(int value) => switch (value) { - 1 => kCFFileSecurityClearOwner, - 2 => kCFFileSecurityClearGroup, - 4 => kCFFileSecurityClearMode, - 8 => kCFFileSecurityClearOwnerUUID, - 16 => kCFFileSecurityClearGroupUUID, - 32 => kCFFileSecurityClearAccessControlList, + static dispatch_autorelease_frequency_t fromValue(int value) => + switch (value) { + 0 => DISPATCH_AUTORELEASE_FREQUENCY_INHERIT, + 1 => DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM, + 2 => DISPATCH_AUTORELEASE_FREQUENCY_NEVER, _ => throw ArgumentError( - "Unknown value for CFFileSecurityClearOptions: $value"), + "Unknown value for dispatch_autorelease_frequency_t: $value"), }; } -final class __CFStringTokenizer extends ffi.Opaque {} - -typedef CFStringTokenizerRef = ffi.Pointer<__CFStringTokenizer>; - -enum CFStringTokenizerTokenType { - kCFStringTokenizerTokenNone(0), - kCFStringTokenizerTokenNormal(1), - kCFStringTokenizerTokenHasSubTokensMask(2), - kCFStringTokenizerTokenHasDerivedSubTokensMask(4), - kCFStringTokenizerTokenHasHasNumbersMask(8), - kCFStringTokenizerTokenHasNonLettersMask(16), - kCFStringTokenizerTokenIsCJWordMask(32); +enum dispatch_block_flags_t { + DISPATCH_BLOCK_BARRIER(1), + DISPATCH_BLOCK_DETACHED(2), + DISPATCH_BLOCK_ASSIGN_CURRENT(4), + DISPATCH_BLOCK_NO_QOS_CLASS(8), + DISPATCH_BLOCK_INHERIT_QOS_CLASS(16), + DISPATCH_BLOCK_ENFORCE_QOS_CLASS(32); final int value; - const CFStringTokenizerTokenType(this.value); + const dispatch_block_flags_t(this.value); - static CFStringTokenizerTokenType fromValue(int value) => switch (value) { - 0 => kCFStringTokenizerTokenNone, - 1 => kCFStringTokenizerTokenNormal, - 2 => kCFStringTokenizerTokenHasSubTokensMask, - 4 => kCFStringTokenizerTokenHasDerivedSubTokensMask, - 8 => kCFStringTokenizerTokenHasHasNumbersMask, - 16 => kCFStringTokenizerTokenHasNonLettersMask, - 32 => kCFStringTokenizerTokenIsCJWordMask, + static dispatch_block_flags_t fromValue(int value) => switch (value) { + 1 => DISPATCH_BLOCK_BARRIER, + 2 => DISPATCH_BLOCK_DETACHED, + 4 => DISPATCH_BLOCK_ASSIGN_CURRENT, + 8 => DISPATCH_BLOCK_NO_QOS_CLASS, + 16 => DISPATCH_BLOCK_INHERIT_QOS_CLASS, + 32 => DISPATCH_BLOCK_ENFORCE_QOS_CLASS, _ => throw ArgumentError( - "Unknown value for CFStringTokenizerTokenType: $value"), + "Unknown value for dispatch_block_flags_t: $value"), }; } -final class __CFFileDescriptor extends ffi.Opaque {} +typedef kern_return_t = ffi.Int; +typedef Dartkern_return_t = int; +typedef mach_msg_timeout_t = natural_t; +typedef mach_msg_bits_t = ffi.UnsignedInt; +typedef Dartmach_msg_bits_t = int; +typedef mach_msg_size_t = natural_t; +typedef mach_msg_id_t = integer_t; +typedef mach_msg_priority_t = ffi.UnsignedInt; +typedef Dartmach_msg_priority_t = int; +typedef mach_msg_type_name_t = ffi.UnsignedInt; +typedef Dartmach_msg_type_name_t = int; +typedef mach_msg_copy_options_t = ffi.UnsignedInt; +typedef Dartmach_msg_copy_options_t = int; +typedef mach_msg_guard_flags_t = ffi.UnsignedInt; +typedef Dartmach_msg_guard_flags_t = int; +typedef mach_msg_descriptor_type_t = ffi.UnsignedInt; +typedef Dartmach_msg_descriptor_type_t = int; -final class CFFileDescriptorContext extends ffi.Struct { - @CFIndex() - external int version; +final class mach_msg_type_descriptor_t extends ffi.Opaque {} - external ffi.Pointer info; +final class mach_msg_port_descriptor_t extends ffi.Opaque {} - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; +final class mach_msg_ool_descriptor32_t extends ffi.Opaque {} - external ffi.Pointer< - ffi.NativeFunction info)>> - release; +final class mach_msg_ool_descriptor64_t extends ffi.Opaque {} - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; -} +final class mach_msg_ool_descriptor_t extends ffi.Opaque {} -typedef CFFileDescriptorRef = ffi.Pointer<__CFFileDescriptor>; -typedef CFFileDescriptorNativeDescriptor = ffi.Int; -typedef DartCFFileDescriptorNativeDescriptor = int; -typedef CFFileDescriptorCallBack - = ffi.Pointer>; -typedef CFFileDescriptorCallBackFunction = ffi.Void Function( - CFFileDescriptorRef f, - CFOptionFlags callBackTypes, - ffi.Pointer info); -typedef DartCFFileDescriptorCallBackFunction = void Function( - CFFileDescriptorRef f, - DartCFOptionFlags callBackTypes, - ffi.Pointer info); +final class mach_msg_ool_ports_descriptor32_t extends ffi.Opaque {} -final class __CFUserNotification extends ffi.Opaque {} +final class mach_msg_ool_ports_descriptor64_t extends ffi.Opaque {} -typedef CFUserNotificationRef = ffi.Pointer<__CFUserNotification>; -typedef CFUserNotificationCallBack - = ffi.Pointer>; -typedef CFUserNotificationCallBackFunction = ffi.Void Function( - CFUserNotificationRef userNotification, CFOptionFlags responseFlags); -typedef DartCFUserNotificationCallBackFunction = void Function( - CFUserNotificationRef userNotification, DartCFOptionFlags responseFlags); +final class mach_msg_ool_ports_descriptor_t extends ffi.Opaque {} -final class __CFXMLNode extends ffi.Opaque {} +final class mach_msg_guarded_port_descriptor32_t extends ffi.Opaque {} -final class CFXMLElementInfo extends ffi.Struct { - external CFDictionaryRef attributes; +final class mach_msg_guarded_port_descriptor64_t extends ffi.Opaque {} - external CFArrayRef attributeOrder; +final class mach_msg_guarded_port_descriptor_t extends ffi.Opaque {} - @Boolean() - external int isEmpty; +final class mach_msg_descriptor_t extends ffi.Opaque {} - @ffi.Array.multi([3]) - external ffi.Array _reserved; +final class mach_msg_body_t extends ffi.Struct { + @mach_msg_size_t() + external int msgh_descriptor_count; } -final class CFXMLProcessingInstructionInfo extends ffi.Struct { - external CFStringRef dataString; -} +final class mach_msg_header_t extends ffi.Struct { + @mach_msg_bits_t() + external int msgh_bits; -final class CFXMLDocumentInfo extends ffi.Struct { - external CFURLRef sourceURL; + @mach_msg_size_t() + external int msgh_size; - @CFStringEncoding() - external int encoding; -} + @mach_port_t() + external int msgh_remote_port; -final class CFXMLExternalID extends ffi.Struct { - external CFURLRef systemID; + @mach_port_t() + external int msgh_local_port; - external CFStringRef publicID; -} + @mach_port_name_t() + external int msgh_voucher_port; -final class CFXMLDocumentTypeInfo extends ffi.Struct { - external CFXMLExternalID externalID; + @mach_msg_id_t() + external int msgh_id; } -final class CFXMLNotationInfo extends ffi.Struct { - external CFXMLExternalID externalID; -} +final class mach_msg_base_t extends ffi.Struct { + external mach_msg_header_t header; -final class CFXMLElementTypeDeclarationInfo extends ffi.Struct { - external CFStringRef contentDescription; + external mach_msg_body_t body; } -final class CFXMLAttributeDeclarationInfo extends ffi.Struct { - external CFStringRef attributeName; +typedef mach_msg_trailer_type_t = ffi.UnsignedInt; +typedef Dartmach_msg_trailer_type_t = int; +typedef mach_msg_trailer_size_t = ffi.UnsignedInt; +typedef Dartmach_msg_trailer_size_t = int; +typedef mach_msg_trailer_info_t = ffi.Pointer; - external CFStringRef typeString; +final class mach_msg_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; - external CFStringRef defaultString; + @mach_msg_trailer_size_t() + external int msgh_trailer_size; } -final class CFXMLAttributeListDeclarationInfo extends ffi.Struct { - @CFIndex() - external int numberOfAttributes; +final class mach_msg_seqno_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; - external ffi.Pointer attributes; + @mach_msg_trailer_size_t() + external int msgh_trailer_size; + + @mach_port_seqno_t() + external int msgh_seqno; } -final class CFXMLEntityInfo extends ffi.Struct { - @CFIndex() - external int entityTypeAsInt; +final class security_token_t extends ffi.Struct { + @ffi.Array.multi([2]) + external ffi.Array val; +} - CFXMLEntityTypeCode get entityType => - CFXMLEntityTypeCode.fromValue(entityTypeAsInt); +final class mach_msg_security_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; - external CFStringRef replacementText; + @mach_msg_trailer_size_t() + external int msgh_trailer_size; - external CFXMLExternalID entityID; + @mach_port_seqno_t() + external int msgh_seqno; - external CFStringRef notationName; + external security_token_t msgh_sender; } -enum CFXMLEntityTypeCode { - kCFXMLEntityTypeParameter(0), - kCFXMLEntityTypeParsedInternal(1), - kCFXMLEntityTypeParsedExternal(2), - kCFXMLEntityTypeUnparsed(3), - kCFXMLEntityTypeCharacter(4); - - final int value; - const CFXMLEntityTypeCode(this.value); - - static CFXMLEntityTypeCode fromValue(int value) => switch (value) { - 0 => kCFXMLEntityTypeParameter, - 1 => kCFXMLEntityTypeParsedInternal, - 2 => kCFXMLEntityTypeParsedExternal, - 3 => kCFXMLEntityTypeUnparsed, - 4 => kCFXMLEntityTypeCharacter, - _ => - throw ArgumentError("Unknown value for CFXMLEntityTypeCode: $value"), - }; +final class audit_token_t extends ffi.Struct { + @ffi.Array.multi([8]) + external ffi.Array val; } -final class CFXMLEntityReferenceInfo extends ffi.Struct { - @CFIndex() - external int entityTypeAsInt; - - CFXMLEntityTypeCode get entityType => - CFXMLEntityTypeCode.fromValue(entityTypeAsInt); -} +final class mach_msg_audit_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; -typedef CFXMLNodeRef = ffi.Pointer<__CFXMLNode>; + @mach_msg_trailer_size_t() + external int msgh_trailer_size; -enum CFXMLNodeTypeCode { - kCFXMLNodeTypeDocument(1), - kCFXMLNodeTypeElement(2), - kCFXMLNodeTypeAttribute(3), - kCFXMLNodeTypeProcessingInstruction(4), - kCFXMLNodeTypeComment(5), - kCFXMLNodeTypeText(6), - kCFXMLNodeTypeCDATASection(7), - kCFXMLNodeTypeDocumentFragment(8), - kCFXMLNodeTypeEntity(9), - kCFXMLNodeTypeEntityReference(10), - kCFXMLNodeTypeDocumentType(11), - kCFXMLNodeTypeWhitespace(12), - kCFXMLNodeTypeNotation(13), - kCFXMLNodeTypeElementTypeDeclaration(14), - kCFXMLNodeTypeAttributeListDeclaration(15); + @mach_port_seqno_t() + external int msgh_seqno; - final int value; - const CFXMLNodeTypeCode(this.value); + external security_token_t msgh_sender; - static CFXMLNodeTypeCode fromValue(int value) => switch (value) { - 1 => kCFXMLNodeTypeDocument, - 2 => kCFXMLNodeTypeElement, - 3 => kCFXMLNodeTypeAttribute, - 4 => kCFXMLNodeTypeProcessingInstruction, - 5 => kCFXMLNodeTypeComment, - 6 => kCFXMLNodeTypeText, - 7 => kCFXMLNodeTypeCDATASection, - 8 => kCFXMLNodeTypeDocumentFragment, - 9 => kCFXMLNodeTypeEntity, - 10 => kCFXMLNodeTypeEntityReference, - 11 => kCFXMLNodeTypeDocumentType, - 12 => kCFXMLNodeTypeWhitespace, - 13 => kCFXMLNodeTypeNotation, - 14 => kCFXMLNodeTypeElementTypeDeclaration, - 15 => kCFXMLNodeTypeAttributeListDeclaration, - _ => throw ArgumentError("Unknown value for CFXMLNodeTypeCode: $value"), - }; + external audit_token_t msgh_audit; } -typedef CFXMLTreeRef = CFTreeRef; - -final class __CFXMLParser extends ffi.Opaque {} +@ffi.Packed(4) +final class mach_msg_context_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; -final class CFXMLParserCallBacks extends ffi.Struct { - @CFIndex() - external int version; + @mach_msg_trailer_size_t() + external int msgh_trailer_size; - external CFXMLParserCreateXMLStructureCallBack createXMLStructure; + @mach_port_seqno_t() + external int msgh_seqno; - external CFXMLParserAddChildCallBack addChild; + external security_token_t msgh_sender; - external CFXMLParserEndXMLStructureCallBack endXMLStructure; + external audit_token_t msgh_audit; - external CFXMLParserResolveExternalEntityCallBack resolveExternalEntity; + @mach_port_context_t() + external int msgh_context; +} - external CFXMLParserHandleErrorCallBack handleError; +final class msg_labels_t extends ffi.Struct { + @mach_port_name_t() + external int sender; } -typedef CFXMLParserCreateXMLStructureCallBack = ffi - .Pointer>; -typedef CFXMLParserCreateXMLStructureCallBackFunction - = ffi.Pointer Function(CFXMLParserRef parser, - CFXMLNodeRef nodeDesc, ffi.Pointer info); -typedef CFXMLParserRef = ffi.Pointer<__CFXMLParser>; -typedef CFXMLParserAddChildCallBack - = ffi.Pointer>; -typedef CFXMLParserAddChildCallBackFunction = ffi.Void Function( - CFXMLParserRef parser, - ffi.Pointer parent, - ffi.Pointer child, - ffi.Pointer info); -typedef DartCFXMLParserAddChildCallBackFunction = void Function( - CFXMLParserRef parser, - ffi.Pointer parent, - ffi.Pointer child, - ffi.Pointer info); -typedef CFXMLParserEndXMLStructureCallBack = ffi - .Pointer>; -typedef CFXMLParserEndXMLStructureCallBackFunction = ffi.Void Function( - CFXMLParserRef parser, - ffi.Pointer xmlType, - ffi.Pointer info); -typedef DartCFXMLParserEndXMLStructureCallBackFunction = void Function( - CFXMLParserRef parser, - ffi.Pointer xmlType, - ffi.Pointer info); -typedef CFXMLParserResolveExternalEntityCallBack = ffi.Pointer< - ffi.NativeFunction>; -typedef CFXMLParserResolveExternalEntityCallBackFunction = CFDataRef Function( - CFXMLParserRef parser, - ffi.Pointer extID, - ffi.Pointer info); -typedef CFXMLParserHandleErrorCallBack - = ffi.Pointer>; -typedef CFXMLParserHandleErrorCallBackFunction = Boolean Function( - CFXMLParserRef parser, CFIndex error, ffi.Pointer info); -typedef DartCFXMLParserHandleErrorCallBackFunction = DartBoolean Function( - CFXMLParserRef parser, - CFXMLParserStatusCode error, - ffi.Pointer info); +typedef mach_msg_filter_id = ffi.Int; +typedef Dartmach_msg_filter_id = int; -enum CFXMLParserStatusCode { - kCFXMLStatusParseNotBegun(-2), - kCFXMLStatusParseInProgress(-1), - kCFXMLStatusParseSuccessful(0), - kCFXMLErrorUnexpectedEOF(1), - kCFXMLErrorUnknownEncoding(2), - kCFXMLErrorEncodingConversionFailure(3), - kCFXMLErrorMalformedProcessingInstruction(4), - kCFXMLErrorMalformedDTD(5), - kCFXMLErrorMalformedName(6), - kCFXMLErrorMalformedCDSect(7), - kCFXMLErrorMalformedCloseTag(8), - kCFXMLErrorMalformedStartTag(9), - kCFXMLErrorMalformedDocument(10), - kCFXMLErrorElementlessDocument(11), - kCFXMLErrorMalformedComment(12), - kCFXMLErrorMalformedCharacterReference(13), - kCFXMLErrorMalformedParsedCharacterData(14), - kCFXMLErrorNoData(15); +@ffi.Packed(4) +final class mach_msg_mac_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; - final int value; - const CFXMLParserStatusCode(this.value); + @mach_msg_trailer_size_t() + external int msgh_trailer_size; - static CFXMLParserStatusCode fromValue(int value) => switch (value) { - -2 => kCFXMLStatusParseNotBegun, - -1 => kCFXMLStatusParseInProgress, - 0 => kCFXMLStatusParseSuccessful, - 1 => kCFXMLErrorUnexpectedEOF, - 2 => kCFXMLErrorUnknownEncoding, - 3 => kCFXMLErrorEncodingConversionFailure, - 4 => kCFXMLErrorMalformedProcessingInstruction, - 5 => kCFXMLErrorMalformedDTD, - 6 => kCFXMLErrorMalformedName, - 7 => kCFXMLErrorMalformedCDSect, - 8 => kCFXMLErrorMalformedCloseTag, - 9 => kCFXMLErrorMalformedStartTag, - 10 => kCFXMLErrorMalformedDocument, - 11 => kCFXMLErrorElementlessDocument, - 12 => kCFXMLErrorMalformedComment, - 13 => kCFXMLErrorMalformedCharacterReference, - 14 => kCFXMLErrorMalformedParsedCharacterData, - 15 => kCFXMLErrorNoData, - _ => throw ArgumentError( - "Unknown value for CFXMLParserStatusCode: $value"), - }; -} + @mach_port_seqno_t() + external int msgh_seqno; -final class CFXMLParserContext extends ffi.Struct { - @CFIndex() - external int version; + external security_token_t msgh_sender; - external ffi.Pointer info; + external audit_token_t msgh_audit; - external CFXMLParserRetainCallBack retain; + @mach_port_context_t() + external int msgh_context; - external CFXMLParserReleaseCallBack release; + @mach_msg_filter_id() + external int msgh_ad; - external CFXMLParserCopyDescriptionCallBack copyDescription; + external msg_labels_t msgh_labels; } -typedef CFXMLParserRetainCallBack - = ffi.Pointer>; -typedef CFXMLParserRetainCallBackFunction = ffi.Pointer Function( - ffi.Pointer info); -typedef CFXMLParserReleaseCallBack - = ffi.Pointer>; -typedef CFXMLParserReleaseCallBackFunction = ffi.Void Function( - ffi.Pointer info); -typedef DartCFXMLParserReleaseCallBackFunction = void Function( - ffi.Pointer info); -typedef CFXMLParserCopyDescriptionCallBack = ffi - .Pointer>; -typedef CFXMLParserCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer info); - -final class cssm_data extends ffi.Struct { - @ffi.Size() - external int Length; +typedef mach_msg_max_trailer_t = mach_msg_mac_trailer_t; +typedef mach_msg_format_0_trailer_t = mach_msg_security_trailer_t; +typedef mach_msg_options_t = integer_t; - external ffi.Pointer Data; +final class mach_msg_empty_send_t extends ffi.Struct { + external mach_msg_header_t header; } -final class SecAsn1AlgId extends ffi.Struct { - external SecAsn1Oid algorithm; +final class mach_msg_empty_rcv_t extends ffi.Struct { + external mach_msg_header_t header; - external SecAsn1Item parameters; + external mach_msg_trailer_t trailer; } -typedef SecAsn1Oid = cssm_data; -typedef SecAsn1Item = cssm_data; - -final class SecAsn1PubKeyInfo extends ffi.Struct { - external SecAsn1AlgId algorithm; +final class mach_msg_empty_t extends ffi.Union { + external mach_msg_empty_send_t send; - external SecAsn1Item subjectPublicKey; + external mach_msg_empty_rcv_t rcv; } -final class SecAsn1Template_struct extends ffi.Struct { - @ffi.Uint32() - external int kind; +typedef mach_msg_type_size_t = natural_t; +typedef mach_msg_type_number_t = natural_t; +typedef mach_msg_option_t = integer_t; +typedef mach_msg_return_t = kern_return_t; +late final _protocol_OS_dispatch_source = + objc.getProtocol("OS_dispatch_source"); - @ffi.Uint32() - external int offset; +/// OS_dispatch_source +abstract final class OS_dispatch_source { + /// Builds an object that implements the OS_dispatch_source protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - external ffi.Pointer sub; + return builder.build(); + } - @ffi.Uint32() - external int size; + /// Adds the implementation of the OS_dispatch_source protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class cssm_guid extends ffi.Struct { - @uint32() - external int Data1; - - @uint16() - external int Data2; +typedef dispatch_source_t = ffi.Pointer; +typedef Dartdispatch_source_t = objc.NSObject; - @uint16() - external int Data3; +final class dispatch_source_type_s extends ffi.Opaque {} - @ffi.Array.multi([8]) - external ffi.Array Data4; -} +typedef dispatch_source_type_t = ffi.Pointer; +typedef dispatch_source_mach_send_flags_t = ffi.UnsignedLong; +typedef Dartdispatch_source_mach_send_flags_t = int; +typedef dispatch_source_mach_recv_flags_t = ffi.UnsignedLong; +typedef Dartdispatch_source_mach_recv_flags_t = int; +typedef dispatch_source_memorypressure_flags_t = ffi.UnsignedLong; +typedef Dartdispatch_source_memorypressure_flags_t = int; +typedef dispatch_source_proc_flags_t = ffi.UnsignedLong; +typedef Dartdispatch_source_proc_flags_t = int; +typedef dispatch_source_vnode_flags_t = ffi.UnsignedLong; +typedef Dartdispatch_source_vnode_flags_t = int; +typedef dispatch_source_timer_flags_t = ffi.UnsignedLong; +typedef Dartdispatch_source_timer_flags_t = int; +late final _protocol_OS_dispatch_group = objc.getProtocol("OS_dispatch_group"); -typedef uint32 = ffi.Uint32; -typedef Dartuint32 = int; -typedef uint16 = ffi.Uint16; -typedef Dartuint16 = int; -typedef uint8 = ffi.Uint8; -typedef Dartuint8 = int; +/// OS_dispatch_group +abstract final class OS_dispatch_group { + /// Builds an object that implements the OS_dispatch_group protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); -final class cssm_version extends ffi.Struct { - @uint32() - external int Major; + return builder.build(); + } - @uint32() - external int Minor; + /// Adds the implementation of the OS_dispatch_group protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class cssm_subservice_uid extends ffi.Struct { - external CSSM_GUID Guid; - - external CSSM_VERSION Version; - - @uint32() - external int SubserviceId; - - @CSSM_SERVICE_TYPE() - external int SubserviceType; -} +typedef dispatch_group_t = ffi.Pointer; +typedef Dartdispatch_group_t = objc.NSObject; +late final _protocol_OS_dispatch_semaphore = + objc.getProtocol("OS_dispatch_semaphore"); -typedef CSSM_GUID = cssm_guid; -typedef CSSM_VERSION = cssm_version; -typedef CSSM_SERVICE_TYPE = CSSM_SERVICE_MASK; -typedef CSSM_SERVICE_MASK = uint32; +/// OS_dispatch_semaphore +abstract final class OS_dispatch_semaphore { + /// Builds an object that implements the OS_dispatch_semaphore protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); -final class cssm_net_address extends ffi.Struct { - @CSSM_NET_ADDRESS_TYPE() - external int AddressType; + return builder.build(); + } - external SecAsn1Item Address; + /// Adds the implementation of the OS_dispatch_semaphore protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef CSSM_NET_ADDRESS_TYPE = uint32; +typedef dispatch_semaphore_t = ffi.Pointer; +typedef Dartdispatch_semaphore_t = objc.NSObject; +typedef dispatch_once_t = ffi.IntPtr; +typedef Dartdispatch_once_t = int; +late final _protocol_OS_dispatch_data = objc.getProtocol("OS_dispatch_data"); -final class cssm_crypto_data extends ffi.Struct { - external SecAsn1Item Param; +/// OS_dispatch_data +abstract final class OS_dispatch_data { + /// Builds an object that implements the OS_dispatch_data protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - external CSSM_CALLBACK Callback; + return builder.build(); + } - external ffi.Pointer CallerCtx; + /// Adds the implementation of the OS_dispatch_data protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef CSSM_CALLBACK = ffi.Pointer>; -typedef CSSM_CALLBACKFunction = CSSM_RETURN Function( - CSSM_DATA_PTR OutData, ffi.Pointer CallerCtx); -typedef DartCSSM_CALLBACKFunction = Dartsint32 Function( - CSSM_DATA_PTR OutData, ffi.Pointer CallerCtx); -typedef CSSM_RETURN = sint32; -typedef sint32 = ffi.Int32; -typedef Dartsint32 = int; -typedef CSSM_DATA_PTR = ffi.Pointer; - -final class cssm_list_element extends ffi.Struct { - external ffi.Pointer NextElement; - - @CSSM_WORDID_TYPE() - external int WordID; +typedef dispatch_data_t = ffi.Pointer; +typedef Dartdispatch_data_t = objc.NSObject; - @CSSM_LIST_ELEMENT_TYPE() - external int ElementType; +final class dispatch_data_s extends ffi.Opaque {} - external UnnamedUnion2 Element; -} +bool _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ffi.Pointer arg2, + int arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(dispatch_data_t arg0, ffi.Size arg1, + ffi.Pointer arg2, ffi.Size arg3)>>() + .asFunction< + bool Function(dispatch_data_t, int, ffi.Pointer, + int)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + dispatch_data_t, + ffi.Size, + ffi.Pointer, + ffi.Size)>( + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrTrampoline, + false) + .cast(); +bool _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ffi.Pointer arg2, + int arg3) => + (objc.getBlockClosure(block) as bool Function(dispatch_data_t, int, + ffi.Pointer, int))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + dispatch_data_t, + ffi.Size, + ffi.Pointer, + ffi.Size)>( + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureTrampoline, + false) + .cast(); -typedef CSSM_WORDID_TYPE = sint32; -typedef CSSM_LIST_ELEMENT_TYPE = uint32; +/// Construction methods for `objc.ObjCBlock, ffi.Size)>`. +abstract final class ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Bool Function( + objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Bool Function(objc.NSObject, ffi.Size, ffi.Pointer, + ffi.Size)>(pointer, retain: retain, release: release); -final class UnnamedUnion2 extends ffi.Union { - external CSSM_LIST Sublist; + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.Size)> + fromFunctionPointer(ffi.Pointer arg2, ffi.Size arg3)>> ptr) => + objc.ObjCBlock< + ffi.Bool Function( + objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)>( + objc.newPointerBlock( + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - external SecAsn1Item Word; + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, ffi.Size)> fromFunction( + bool Function(Dartdispatch_data_t, int, ffi.Pointer, int) + fn) => + objc.ObjCBlock, ffi.Size)>( + objc.newClosureBlock( + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureCallable, + (dispatch_data_t arg0, int arg1, ffi.Pointer arg2, + int arg3) => + fn(objc.NSObject.castFromPointer(arg0, retain: true, release: true), arg1, arg2, arg3)), + retain: false, + release: true); } -typedef CSSM_LIST = cssm_list; - -final class cssm_list extends ffi.Struct { - @CSSM_LIST_TYPE() - external int ListType; - - external CSSM_LIST_ELEMENT_PTR Head; - - external CSSM_LIST_ELEMENT_PTR Tail; +/// Call operator for `objc.ObjCBlock, ffi.Size)>`. +extension ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_CallExtension + on objc.ObjCBlock< + ffi.Bool Function( + objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)> { + bool call(Dartdispatch_data_t arg0, int arg1, ffi.Pointer arg2, + int arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + dispatch_data_t arg0, + ffi.Size arg1, + ffi.Pointer arg2, + ffi.Size arg3)>>() + .asFunction< + bool Function( + ffi.Pointer, + dispatch_data_t, + int, + ffi.Pointer, + int)>()(ref.pointer, arg0.ref.pointer, arg1, arg2, arg3); } -typedef CSSM_LIST_TYPE = uint32; -typedef CSSM_LIST_ELEMENT_PTR = ffi.Pointer; +typedef dispatch_data_applier_t = ffi.Pointer; +typedef Dartdispatch_data_applier_t = objc.ObjCBlock< + ffi.Bool Function( + objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)>; +typedef dispatch_fd_t = ffi.Int; +typedef Dartdispatch_fd_t = int; +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(dispatch_data_t arg0, ffi.Int arg1)>>() + .asFunction()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, dispatch_data_t, ffi.Int)>( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1) => + (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, dispatch_data_t, ffi.Int)>( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerTrampoline( + ffi.Pointer block, dispatch_data_t arg0, int arg1) { + (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, arg1); + objc.objectRelease(block.cast()); +} -final class CSSM_TUPLE extends ffi.Struct { - external CSSM_LIST Issuer; +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, dispatch_data_t, ffi.Int)> + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, dispatch_data_t, + ffi.Int)>.listener( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerTrampoline) + ..keepIsolateAlive = false; - external CSSM_LIST Subject; +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - @CSSM_BOOL() - external int Delegate; + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, ffi.Int)> fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - external CSSM_LIST AuthorizationTag; + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(Dartdispatch_data_t, int) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureCallable, + (dispatch_data_t arg0, int arg1) => fn( + objc.NSObject.castFromPointer(arg0, + retain: true, release: true), + arg1)), + retain: false, + release: true); - external CSSM_LIST ValidityPeriod; + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(Dartdispatch_data_t, int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerCallable.nativeFunction + .cast(), + (dispatch_data_t arg0, int arg1) => fn( + objc.NSObject.castFromPointer(arg0, retain: false, release: true), + arg1)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_qxvyq2(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } } -typedef CSSM_BOOL = sint32; - -final class cssm_tuplegroup extends ffi.Struct { - @uint32() - external int NumberOfTuples; - - external CSSM_TUPLE_PTR Tuples; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt_CallExtension + on objc.ObjCBlock { + void call(Dartdispatch_data_t arg0, int arg1) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + dispatch_data_t arg0, ffi.Int arg1)>>() + .asFunction< + void Function(ffi.Pointer, dispatch_data_t, + int)>()(ref.pointer, arg0.ref.pointer, arg1); } -typedef CSSM_TUPLE_PTR = ffi.Pointer; +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(dispatch_data_t arg0, ffi.Int arg1)>>() + .asFunction()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, dispatch_data_t, ffi.Int)>( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1) => + (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, dispatch_data_t, ffi.Int)>( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_listenerTrampoline( + ffi.Pointer block, dispatch_data_t arg0, int arg1) { + (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, arg1); + objc.objectRelease(block.cast()); +} -final class cssm_sample extends ffi.Struct { - external CSSM_LIST TypedSample; +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, dispatch_data_t, ffi.Int)> + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, dispatch_data_t, + ffi.Int)>.listener( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_listenerTrampoline) + ..keepIsolateAlive = false; - external ffi.Pointer Verifier; -} +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt1 { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); -typedef CSSM_SUBSERVICE_UID = cssm_subservice_uid; + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject?, ffi.Int)> fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); -final class cssm_samplegroup extends ffi.Struct { - @uint32() - external int NumberOfSamples; + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(Dartdispatch_data_t?, int) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_closureCallable, + (dispatch_data_t arg0, int arg1) => fn( + arg0.address == 0 + ? null + : objc.NSObject.castFromPointer(arg0, + retain: true, release: true), + arg1)), + retain: false, + release: true); - external ffi.Pointer Samples; + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(Dartdispatch_data_t?, int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_listenerCallable.nativeFunction + .cast(), + (dispatch_data_t arg0, int arg1) => fn( + arg0.address == 0 + ? null + : objc.NSObject.castFromPointer(arg0, + retain: false, release: true), + arg1)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_qxvyq2(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } } -typedef CSSM_SAMPLE = cssm_sample; - -final class cssm_memory_funcs extends ffi.Struct { - external CSSM_MALLOC malloc_func; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_CallExtension + on objc.ObjCBlock { + void call(Dartdispatch_data_t? arg0, int arg1) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + dispatch_data_t arg0, ffi.Int arg1)>>() + .asFunction< + void Function(ffi.Pointer, dispatch_data_t, + int)>()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr, arg1); +} - external CSSM_FREE free_func; +late final _protocol_OS_dispatch_io = objc.getProtocol("OS_dispatch_io"); - external CSSM_REALLOC realloc_func; +/// OS_dispatch_io +abstract final class OS_dispatch_io { + /// Builds an object that implements the OS_dispatch_io protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - external CSSM_CALLOC calloc_func; + return builder.build(); + } - external ffi.Pointer AllocRef; + /// Adds the implementation of the OS_dispatch_io protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef CSSM_MALLOC = ffi.Pointer>; -typedef CSSM_MALLOCFunction = ffi.Pointer Function( - CSSM_SIZE size, ffi.Pointer allocref); -typedef DartCSSM_MALLOCFunction = ffi.Pointer Function( - DartCSSM_SIZE size, ffi.Pointer allocref); -typedef CSSM_SIZE = ffi.Size; -typedef DartCSSM_SIZE = int; -typedef CSSM_FREE = ffi.Pointer>; -typedef CSSM_FREEFunction = ffi.Void Function( - ffi.Pointer memblock, ffi.Pointer allocref); -typedef DartCSSM_FREEFunction = void Function( - ffi.Pointer memblock, ffi.Pointer allocref); -typedef CSSM_REALLOC = ffi.Pointer>; -typedef CSSM_REALLOCFunction = ffi.Pointer Function( - ffi.Pointer memblock, - CSSM_SIZE size, - ffi.Pointer allocref); -typedef DartCSSM_REALLOCFunction = ffi.Pointer Function( - ffi.Pointer memblock, - DartCSSM_SIZE size, - ffi.Pointer allocref); -typedef CSSM_CALLOC = ffi.Pointer>; -typedef CSSM_CALLOCFunction = ffi.Pointer Function( - uint32 num, CSSM_SIZE size, ffi.Pointer allocref); -typedef DartCSSM_CALLOCFunction = ffi.Pointer Function( - Dartuint32 num, DartCSSM_SIZE size, ffi.Pointer allocref); +typedef dispatch_io_t = ffi.Pointer; +typedef Dartdispatch_io_t = objc.NSObject; +typedef dispatch_io_type_t = ffi.UnsignedLong; +typedef Dartdispatch_io_type_t = int; +void _ObjCBlock_ffiVoid_ffiInt_fnPtrTrampoline( + ffi.Pointer block, int arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiInt_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Int)>(_ObjCBlock_ffiVoid_ffiInt_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiInt_closureTrampoline( + ffi.Pointer block, int arg0) => + (objc.getBlockClosure(block) as void Function(int))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiInt_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Int)>(_ObjCBlock_ffiVoid_ffiInt_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiInt_listenerTrampoline( + ffi.Pointer block, int arg0) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); +} -final class cssm_encoded_cert extends ffi.Struct { - @CSSM_CERT_TYPE() - external int CertType; +ffi.NativeCallable, ffi.Int)> + _ObjCBlock_ffiVoid_ffiInt_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Int)>.listener(_ObjCBlock_ffiVoid_ffiInt_listenerTrampoline) + ..keepIsolateAlive = false; - @CSSM_CERT_ENCODING() - external int CertEncoding; +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_ffiInt { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - external SecAsn1Item CertBlob; -} + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiInt_fnPtrCallable, ptr.cast()), + retain: false, + release: true); -typedef CSSM_CERT_TYPE = uint32; -typedef CSSM_CERT_ENCODING = uint32; + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(int) fn) => + objc.ObjCBlock( + objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiInt_closureCallable, + (int arg0) => fn(arg0)), + retain: false, + release: true); -final class cssm_parsed_cert extends ffi.Struct { - @CSSM_CERT_TYPE() - external int CertType; + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiInt_listenerCallable.nativeFunction.cast(), + (int arg0) => fn(arg0)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_9o8504(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } +} - @CSSM_CERT_PARSE_FORMAT() - external int ParsedCertFormat; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_ffiInt_CallExtension + on objc.ObjCBlock { + void call(int arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, ffi.Int arg0)>>() + .asFunction, int)>()( + ref.pointer, arg0); +} - external ffi.Pointer ParsedCert; +void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrTrampoline( + ffi.Pointer block, + bool arg0, + dispatch_data_t arg1, + int arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Bool arg0, dispatch_data_t arg1, ffi.Int arg2)>>() + .asFunction()( + arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Bool, + dispatch_data_t, ffi.Int)>( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline( + ffi.Pointer block, + bool arg0, + dispatch_data_t arg1, + int arg2) => + (objc.getBlockClosure(block) as void Function(bool, dispatch_data_t, int))( + arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Bool, + dispatch_data_t, ffi.Int)>( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerTrampoline( + ffi.Pointer block, + bool arg0, + dispatch_data_t arg1, + int arg2) { + (objc.getBlockClosure(block) as void Function(bool, dispatch_data_t, int))( + arg0, arg1, arg2); + objc.objectRelease(block.cast()); } -typedef CSSM_CERT_PARSE_FORMAT = uint32; +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Bool, + dispatch_data_t, ffi.Int)> + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Bool, + dispatch_data_t, ffi.Int)>.listener( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerTrampoline) + ..keepIsolateAlive = false; -final class cssm_cert_pair extends ffi.Struct { - external CSSM_ENCODED_CERT EncodedCert; +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock( + pointer, + retain: retain, + release: release); - external CSSM_PARSED_CERT ParsedCert; -} + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Bool, objc.NSObject?, ffi.Int)> fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); -typedef CSSM_ENCODED_CERT = cssm_encoded_cert; -typedef CSSM_PARSED_CERT = cssm_parsed_cert; + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock + fromFunction(void Function(bool, Dartdispatch_data_t?, int) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureCallable, + (bool arg0, dispatch_data_t arg1, int arg2) => fn( + arg0, + arg1.address == 0 + ? null + : objc.NSObject.castFromPointer(arg1, retain: true, release: true), + arg2)), + retain: false, + release: true); -final class cssm_certgroup extends ffi.Struct { - @CSSM_CERT_TYPE() - external int CertType; + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock + listener(void Function(bool, Dartdispatch_data_t?, int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerCallable + .nativeFunction + .cast(), + (bool arg0, dispatch_data_t arg1, int arg2) => fn( + arg0, + arg1.address == 0 + ? null + : objc.NSObject.castFromPointer(arg1, + retain: false, release: true), + arg2)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_12a4qua(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true); + } +} - @CSSM_CERT_ENCODING() - external int CertEncoding; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_CallExtension + on objc.ObjCBlock { + void call(bool arg0, Dartdispatch_data_t? arg1, int arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Bool arg0, dispatch_data_t arg1, ffi.Int arg2)>>() + .asFunction< + void Function(ffi.Pointer, bool, + dispatch_data_t, int)>()( + ref.pointer, arg0, arg1?.ref.pointer ?? ffi.nullptr, arg2); +} - @uint32() - external int NumCerts; +typedef dispatch_io_handler_t = ffi.Pointer; +typedef Dartdispatch_io_handler_t + = objc.ObjCBlock; +typedef dispatch_io_close_flags_t = ffi.UnsignedLong; +typedef Dartdispatch_io_close_flags_t = int; +typedef dispatch_io_interval_flags_t = ffi.UnsignedLong; +typedef Dartdispatch_io_interval_flags_t = int; +late final _protocol_OS_dispatch_workloop = + objc.getProtocol("OS_dispatch_workloop"); - external UnnamedUnion3 GroupList; +/// OS_dispatch_workloop +abstract final class OS_dispatch_workloop { + /// Builds an object that implements the OS_dispatch_workloop protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @CSSM_CERTGROUP_TYPE() - external int CertGroupType; + return builder.build(); + } - external ffi.Pointer Reserved; + /// Adds the implementation of the OS_dispatch_workloop protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class UnnamedUnion3 extends ffi.Union { - external CSSM_DATA_PTR CertList; - - external CSSM_ENCODED_CERT_PTR EncodedCertList; +typedef dispatch_workloop_t = ffi.Pointer; +typedef Dartdispatch_workloop_t = objc.NSObject; - external CSSM_PARSED_CERT_PTR ParsedCertList; +final class CFStreamError extends ffi.Struct { + @CFIndex() + external int domain; - external CSSM_CERT_PAIR_PTR PairCertList; + @SInt32() + external int error; } -typedef CSSM_ENCODED_CERT_PTR = ffi.Pointer; -typedef CSSM_PARSED_CERT_PTR = ffi.Pointer; -typedef CSSM_CERT_PAIR_PTR = ffi.Pointer; -typedef CSSM_CERTGROUP_TYPE = uint32; +typedef CFStreamPropertyKey = CFStringRef; -final class cssm_base_certs extends ffi.Struct { - @CSSM_TP_HANDLE() - external int TPHandle; +enum CFStreamStatus { + kCFStreamStatusNotOpen(0), + kCFStreamStatusOpening(1), + kCFStreamStatusOpen(2), + kCFStreamStatusReading(3), + kCFStreamStatusWriting(4), + kCFStreamStatusAtEnd(5), + kCFStreamStatusClosed(6), + kCFStreamStatusError(7); - @CSSM_CL_HANDLE() - external int CLHandle; + final int value; + const CFStreamStatus(this.value); - external CSSM_CERTGROUP Certs; + static CFStreamStatus fromValue(int value) => switch (value) { + 0 => kCFStreamStatusNotOpen, + 1 => kCFStreamStatusOpening, + 2 => kCFStreamStatusOpen, + 3 => kCFStreamStatusReading, + 4 => kCFStreamStatusWriting, + 5 => kCFStreamStatusAtEnd, + 6 => kCFStreamStatusClosed, + 7 => kCFStreamStatusError, + _ => throw ArgumentError("Unknown value for CFStreamStatus: $value"), + }; } -typedef CSSM_TP_HANDLE = CSSM_MODULE_HANDLE; -typedef CSSM_MODULE_HANDLE = CSSM_HANDLE; -typedef CSSM_HANDLE = CSSM_INTPTR; -typedef CSSM_INTPTR = ffi.IntPtr; -typedef DartCSSM_INTPTR = int; -typedef CSSM_CL_HANDLE = CSSM_MODULE_HANDLE; -typedef CSSM_CERTGROUP = cssm_certgroup; - -final class cssm_access_credentials extends ffi.Struct { - @ffi.Array.multi([68]) - external ffi.Array EntryTag; +enum CFStreamEventType { + kCFStreamEventNone(0), + kCFStreamEventOpenCompleted(1), + kCFStreamEventHasBytesAvailable(2), + kCFStreamEventCanAcceptBytes(4), + kCFStreamEventErrorOccurred(8), + kCFStreamEventEndEncountered(16); - external CSSM_BASE_CERTS BaseCerts; + final int value; + const CFStreamEventType(this.value); - external CSSM_SAMPLEGROUP Samples; + static CFStreamEventType fromValue(int value) => switch (value) { + 0 => kCFStreamEventNone, + 1 => kCFStreamEventOpenCompleted, + 2 => kCFStreamEventHasBytesAvailable, + 4 => kCFStreamEventCanAcceptBytes, + 8 => kCFStreamEventErrorOccurred, + 16 => kCFStreamEventEndEncountered, + _ => throw ArgumentError("Unknown value for CFStreamEventType: $value"), + }; +} - external CSSM_CHALLENGE_CALLBACK Callback; +final class CFStreamClientContext extends ffi.Struct { + @CFIndex() + external int version; - external ffi.Pointer CallerCtx; -} + external ffi.Pointer info; -typedef CSSM_BASE_CERTS = cssm_base_certs; -typedef CSSM_SAMPLEGROUP = cssm_samplegroup; -typedef CSSM_CHALLENGE_CALLBACK - = ffi.Pointer>; -typedef CSSM_CHALLENGE_CALLBACKFunction = CSSM_RETURN Function( - ffi.Pointer Challenge, - CSSM_SAMPLEGROUP_PTR Response, - ffi.Pointer CallerCtx, - ffi.Pointer MemFuncs); -typedef DartCSSM_CHALLENGE_CALLBACKFunction = Dartsint32 Function( - ffi.Pointer Challenge, - CSSM_SAMPLEGROUP_PTR Response, - ffi.Pointer CallerCtx, - ffi.Pointer MemFuncs); -typedef CSSM_SAMPLEGROUP_PTR = ffi.Pointer; -typedef CSSM_MEMORY_FUNCS = cssm_memory_funcs; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; -final class cssm_authorizationgroup extends ffi.Struct { - @uint32() - external int NumberOfAuthTags; + external ffi.Pointer< + ffi.NativeFunction info)>> + release; - external ffi.Pointer AuthTags; + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; } -typedef CSSM_ACL_AUTHORIZATION_TAG = sint32; - -final class cssm_acl_validity_period extends ffi.Struct { - external SecAsn1Item StartDate; +final class __CFReadStream extends ffi.Opaque {} - external SecAsn1Item EndDate; -} +typedef CFReadStreamRef = ffi.Pointer<__CFReadStream>; -final class cssm_acl_entry_prototype extends ffi.Struct { - external CSSM_LIST TypedSubject; +final class __CFWriteStream extends ffi.Opaque {} - @CSSM_BOOL() - external int Delegate; +typedef CFWriteStreamRef = ffi.Pointer<__CFWriteStream>; +typedef CFReadStreamClientCallBackFunction = ffi.Void Function( + CFReadStreamRef stream, + CFOptionFlags type, + ffi.Pointer clientCallBackInfo); +typedef DartCFReadStreamClientCallBackFunction = void Function( + CFReadStreamRef stream, + CFStreamEventType type, + ffi.Pointer clientCallBackInfo); +typedef CFReadStreamClientCallBack + = ffi.Pointer>; +typedef CFWriteStreamClientCallBackFunction = ffi.Void Function( + CFWriteStreamRef stream, + CFOptionFlags type, + ffi.Pointer clientCallBackInfo); +typedef DartCFWriteStreamClientCallBackFunction = void Function( + CFWriteStreamRef stream, + CFStreamEventType type, + ffi.Pointer clientCallBackInfo); +typedef CFWriteStreamClientCallBack + = ffi.Pointer>; - external CSSM_AUTHORIZATIONGROUP Authorization; +enum CFPropertyListFormat { + kCFPropertyListOpenStepFormat(1), + kCFPropertyListXMLFormat_v1_0(100), + kCFPropertyListBinaryFormat_v1_0(200); - external CSSM_ACL_VALIDITY_PERIOD TimeRange; + final int value; + const CFPropertyListFormat(this.value); - @ffi.Array.multi([68]) - external ffi.Array EntryTag; + static CFPropertyListFormat fromValue(int value) => switch (value) { + 1 => kCFPropertyListOpenStepFormat, + 100 => kCFPropertyListXMLFormat_v1_0, + 200 => kCFPropertyListBinaryFormat_v1_0, + _ => + throw ArgumentError("Unknown value for CFPropertyListFormat: $value"), + }; } -typedef CSSM_AUTHORIZATIONGROUP = cssm_authorizationgroup; -typedef CSSM_ACL_VALIDITY_PERIOD = cssm_acl_validity_period; +typedef CFSetRetainCallBackFunction = ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFSetRetainCallBack + = ffi.Pointer>; +typedef CFSetReleaseCallBackFunction = ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef DartCFSetReleaseCallBackFunction = void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFSetReleaseCallBack + = ffi.Pointer>; +typedef CFSetCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer value); +typedef CFSetCopyDescriptionCallBack + = ffi.Pointer>; +typedef CFSetEqualCallBackFunction = Boolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef DartCFSetEqualCallBackFunction = DartBoolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef CFSetEqualCallBack + = ffi.Pointer>; +typedef CFSetHashCallBackFunction = CFHashCode Function( + ffi.Pointer value); +typedef DartCFSetHashCallBackFunction = DartCFHashCode Function( + ffi.Pointer value); +typedef CFSetHashCallBack + = ffi.Pointer>; -final class cssm_acl_owner_prototype extends ffi.Struct { - external CSSM_LIST TypedSubject; +final class CFSetCallBacks extends ffi.Struct { + @CFIndex() + external int version; - @CSSM_BOOL() - external int Delegate; -} + external CFSetRetainCallBack retain; -final class cssm_acl_entry_input extends ffi.Struct { - external CSSM_ACL_ENTRY_PROTOTYPE Prototype; + external CFSetReleaseCallBack release; - external CSSM_ACL_SUBJECT_CALLBACK Callback; + external CFSetCopyDescriptionCallBack copyDescription; - external ffi.Pointer CallerContext; + external CFSetEqualCallBack equal; + + external CFSetHashCallBack hash; } -typedef CSSM_ACL_ENTRY_PROTOTYPE = cssm_acl_entry_prototype; -typedef CSSM_ACL_SUBJECT_CALLBACK - = ffi.Pointer>; -typedef CSSM_ACL_SUBJECT_CALLBACKFunction = CSSM_RETURN Function( - ffi.Pointer SubjectRequest, - CSSM_LIST_PTR SubjectResponse, - ffi.Pointer CallerContext, - ffi.Pointer MemFuncs); -typedef DartCSSM_ACL_SUBJECT_CALLBACKFunction = Dartsint32 Function( - ffi.Pointer SubjectRequest, - CSSM_LIST_PTR SubjectResponse, - ffi.Pointer CallerContext, - ffi.Pointer MemFuncs); -typedef CSSM_LIST_PTR = ffi.Pointer; +typedef CFSetApplierFunctionFunction = ffi.Void Function( + ffi.Pointer value, ffi.Pointer context); +typedef DartCFSetApplierFunctionFunction = void Function( + ffi.Pointer value, ffi.Pointer context); +typedef CFSetApplierFunction + = ffi.Pointer>; -final class cssm_resource_control_context extends ffi.Struct { - external CSSM_ACCESS_CREDENTIALS_PTR AccessCred; +final class __CFSet extends ffi.Opaque {} - external CSSM_ACL_ENTRY_INPUT InitialAclEntry; -} +typedef CFSetRef = ffi.Pointer<__CFSet>; +typedef CFMutableSetRef = ffi.Pointer<__CFSet>; +typedef CFTreeRetainCallBackFunction = ffi.Pointer Function( + ffi.Pointer info); +typedef CFTreeRetainCallBack + = ffi.Pointer>; +typedef CFTreeReleaseCallBackFunction = ffi.Void Function( + ffi.Pointer info); +typedef DartCFTreeReleaseCallBackFunction = void Function( + ffi.Pointer info); +typedef CFTreeReleaseCallBack + = ffi.Pointer>; +typedef CFTreeCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer info); +typedef CFTreeCopyDescriptionCallBack + = ffi.Pointer>; -typedef CSSM_ACCESS_CREDENTIALS_PTR = ffi.Pointer; -typedef CSSM_ACL_ENTRY_INPUT = cssm_acl_entry_input; +final class CFTreeContext extends ffi.Struct { + @CFIndex() + external int version; -final class cssm_acl_entry_info extends ffi.Struct { - external CSSM_ACL_ENTRY_PROTOTYPE EntryPublicInfo; + external ffi.Pointer info; - @CSSM_ACL_HANDLE() - external int EntryHandle; + external CFTreeRetainCallBack retain; + + external CFTreeReleaseCallBack release; + + external CFTreeCopyDescriptionCallBack copyDescription; } -typedef CSSM_ACL_HANDLE = CSSM_HANDLE; +typedef CFTreeApplierFunctionFunction = ffi.Void Function( + ffi.Pointer value, ffi.Pointer context); +typedef DartCFTreeApplierFunctionFunction = void Function( + ffi.Pointer value, ffi.Pointer context); +typedef CFTreeApplierFunction + = ffi.Pointer>; -final class cssm_acl_edit extends ffi.Struct { - @CSSM_ACL_EDIT_MODE() - external int EditMode; +final class __CFTree extends ffi.Opaque {} - @CSSM_ACL_HANDLE() - external int OldEntryHandle; +typedef CFTreeRef = ffi.Pointer<__CFTree>; - external ffi.Pointer NewEntry; -} +final class __CFUUID extends ffi.Opaque {} -typedef CSSM_ACL_EDIT_MODE = uint32; +typedef CFUUIDRef = ffi.Pointer<__CFUUID>; -final class cssm_func_name_addr extends ffi.Struct { - @ffi.Array.multi([68]) - external ffi.Array Name; +final class CFUUIDBytes extends ffi.Struct { + @UInt8() + external int byte0; - external CSSM_PROC_ADDR Address; -} + @UInt8() + external int byte1; -typedef CSSM_PROC_ADDR - = ffi.Pointer>; -typedef CSSM_PROC_ADDRFunction = ffi.Void Function(); -typedef DartCSSM_PROC_ADDRFunction = void Function(); + @UInt8() + external int byte2; -final class cssm_date extends ffi.Struct { - @ffi.Array.multi([4]) - external ffi.Array Year; + @UInt8() + external int byte3; - @ffi.Array.multi([2]) - external ffi.Array Month; + @UInt8() + external int byte4; - @ffi.Array.multi([2]) - external ffi.Array Day; -} + @UInt8() + external int byte5; -final class cssm_range extends ffi.Struct { - @uint32() - external int Min; + @UInt8() + external int byte6; - @uint32() - external int Max; -} + @UInt8() + external int byte7; -final class cssm_query_size_data extends ffi.Struct { - @uint32() - external int SizeInputBlock; + @UInt8() + external int byte8; - @uint32() - external int SizeOutputBlock; -} + @UInt8() + external int byte9; -final class cssm_key_size extends ffi.Struct { - @uint32() - external int LogicalKeySizeInBits; + @UInt8() + external int byte10; - @uint32() - external int EffectiveKeySizeInBits; -} + @UInt8() + external int byte11; -final class cssm_keyheader extends ffi.Struct { - @CSSM_HEADERVERSION() - external int HeaderVersion; + @UInt8() + external int byte12; - external CSSM_GUID CspId; + @UInt8() + external int byte13; - @CSSM_KEYBLOB_TYPE() - external int BlobType; + @UInt8() + external int byte14; - @CSSM_KEYBLOB_FORMAT() - external int Format; + @UInt8() + external int byte15; +} - @CSSM_ALGORITHMS() - external int AlgorithmId; +typedef cpu_type_t = integer_t; +typedef cpu_subtype_t = integer_t; +typedef cpu_threadtype_t = integer_t; - @CSSM_KEYCLASS() - external int KeyClass; +final class __CFBundle extends ffi.Opaque {} - @uint32() - external int LogicalKeySizeInBits; +typedef CFBundleRef = ffi.Pointer<__CFBundle>; +typedef CFPlugInRef = ffi.Pointer<__CFBundle>; +typedef CFBundleRefNum = ffi.Int; +typedef DartCFBundleRefNum = int; - @CSSM_KEYATTR_FLAGS() - external int KeyAttr; +final class __CFMessagePort extends ffi.Opaque {} - @CSSM_KEYUSE() - external int KeyUsage; +typedef CFMessagePortRef = ffi.Pointer<__CFMessagePort>; - external CSSM_DATE StartDate; +final class CFMessagePortContext extends ffi.Struct { + @CFIndex() + external int version; - external CSSM_DATE EndDate; + external ffi.Pointer info; - @CSSM_ALGORITHMS() - external int WrapAlgorithmId; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; - @CSSM_ENCRYPT_MODE() - external int WrapMode; + external ffi.Pointer< + ffi.NativeFunction info)>> + release; - @uint32() - external int Reserved; + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; } -typedef CSSM_HEADERVERSION = uint32; -typedef CSSM_KEYBLOB_TYPE = uint32; -typedef CSSM_KEYBLOB_FORMAT = uint32; -typedef CSSM_ALGORITHMS = uint32; -typedef CSSM_KEYCLASS = uint32; -typedef CSSM_KEYATTR_FLAGS = uint32; -typedef CSSM_KEYUSE = uint32; -typedef CSSM_DATE = cssm_date; -typedef CSSM_ENCRYPT_MODE = uint32; +typedef CFMessagePortCallBackFunction = CFDataRef Function( + CFMessagePortRef local, + SInt32 msgid, + CFDataRef data, + ffi.Pointer info); +typedef DartCFMessagePortCallBackFunction = CFDataRef Function( + CFMessagePortRef local, + DartSInt32 msgid, + CFDataRef data, + ffi.Pointer info); +typedef CFMessagePortCallBack + = ffi.Pointer>; +typedef CFMessagePortInvalidationCallBackFunction = ffi.Void Function( + CFMessagePortRef ms, ffi.Pointer info); +typedef DartCFMessagePortInvalidationCallBackFunction = void Function( + CFMessagePortRef ms, ffi.Pointer info); +typedef CFMessagePortInvalidationCallBack = ffi + .Pointer>; +typedef CFPlugInDynamicRegisterFunctionFunction = ffi.Void Function( + CFPlugInRef plugIn); +typedef DartCFPlugInDynamicRegisterFunctionFunction = void Function( + CFPlugInRef plugIn); +typedef CFPlugInDynamicRegisterFunction + = ffi.Pointer>; +typedef CFPlugInUnloadFunctionFunction = ffi.Void Function(CFPlugInRef plugIn); +typedef DartCFPlugInUnloadFunctionFunction = void Function(CFPlugInRef plugIn); +typedef CFPlugInUnloadFunction + = ffi.Pointer>; +typedef CFPlugInFactoryFunctionFunction = ffi.Pointer Function( + CFAllocatorRef allocator, CFUUIDRef typeUUID); +typedef CFPlugInFactoryFunction + = ffi.Pointer>; -final class cssm_key extends ffi.Struct { - external CSSM_KEYHEADER KeyHeader; +final class __CFPlugInInstance extends ffi.Opaque {} - external SecAsn1Item KeyData; -} +typedef CFPlugInInstanceRef = ffi.Pointer<__CFPlugInInstance>; +typedef CFPlugInInstanceGetInterfaceFunctionFunction = Boolean Function( + CFPlugInInstanceRef instance, + CFStringRef interfaceName, + ffi.Pointer> ftbl); +typedef DartCFPlugInInstanceGetInterfaceFunctionFunction = DartBoolean Function( + CFPlugInInstanceRef instance, + CFStringRef interfaceName, + ffi.Pointer> ftbl); +typedef CFPlugInInstanceGetInterfaceFunction = ffi + .Pointer>; +typedef CFPlugInInstanceDeallocateInstanceDataFunctionFunction = ffi.Void + Function(ffi.Pointer instanceData); +typedef DartCFPlugInInstanceDeallocateInstanceDataFunctionFunction = void + Function(ffi.Pointer instanceData); +typedef CFPlugInInstanceDeallocateInstanceDataFunction = ffi.Pointer< + ffi.NativeFunction>; -typedef CSSM_KEYHEADER = cssm_keyheader; +final class __CFMachPort extends ffi.Opaque {} -final class cssm_dl_db_handle extends ffi.Struct { - @CSSM_DL_HANDLE() - external int DLHandle; +typedef CFMachPortRef = ffi.Pointer<__CFMachPort>; - @CSSM_DB_HANDLE() - external int DBHandle; -} +final class CFMachPortContext extends ffi.Struct { + @CFIndex() + external int version; -typedef CSSM_DL_HANDLE = CSSM_MODULE_HANDLE; -typedef CSSM_DB_HANDLE = CSSM_MODULE_HANDLE; + external ffi.Pointer info; -final class cssm_context_attribute extends ffi.Struct { - @CSSM_ATTRIBUTE_TYPE() - external int AttributeType; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; - @uint32() - external int AttributeLength; + external ffi.Pointer< + ffi.NativeFunction info)>> + release; - external cssm_context_attribute_value Attribute; + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; } -typedef CSSM_ATTRIBUTE_TYPE = uint32; +typedef CFMachPortCallBackFunction = ffi.Void Function(CFMachPortRef port, + ffi.Pointer msg, CFIndex size, ffi.Pointer info); +typedef DartCFMachPortCallBackFunction = void Function(CFMachPortRef port, + ffi.Pointer msg, DartCFIndex size, ffi.Pointer info); +typedef CFMachPortCallBack + = ffi.Pointer>; +typedef CFMachPortInvalidationCallBackFunction = ffi.Void Function( + CFMachPortRef port, ffi.Pointer info); +typedef DartCFMachPortInvalidationCallBackFunction = void Function( + CFMachPortRef port, ffi.Pointer info); +typedef CFMachPortInvalidationCallBack + = ffi.Pointer>; -final class cssm_context_attribute_value extends ffi.Union { - external ffi.Pointer String; +final class __CFAttributedString extends ffi.Opaque {} - @uint32() - external int Uint32; +typedef CFAttributedStringRef = ffi.Pointer<__CFAttributedString>; +typedef CFMutableAttributedStringRef = ffi.Pointer<__CFAttributedString>; - external CSSM_ACCESS_CREDENTIALS_PTR AccessCredentials; +final class __CFURLEnumerator extends ffi.Opaque {} - external CSSM_KEY_PTR Key; +typedef CFURLEnumeratorRef = ffi.Pointer<__CFURLEnumerator>; - external CSSM_DATA_PTR Data; +enum CFURLEnumeratorOptions { + kCFURLEnumeratorDefaultBehavior(0), + kCFURLEnumeratorDescendRecursively(1), + kCFURLEnumeratorSkipInvisibles(2), + kCFURLEnumeratorGenerateFileReferenceURLs(4), + kCFURLEnumeratorSkipPackageContents(8), + kCFURLEnumeratorIncludeDirectoriesPreOrder(16), + kCFURLEnumeratorIncludeDirectoriesPostOrder(32), + kCFURLEnumeratorGenerateRelativePathURLs(64); - @CSSM_PADDING() - external int Padding; + final int value; + const CFURLEnumeratorOptions(this.value); - external CSSM_DATE_PTR Date; + static CFURLEnumeratorOptions fromValue(int value) => switch (value) { + 0 => kCFURLEnumeratorDefaultBehavior, + 1 => kCFURLEnumeratorDescendRecursively, + 2 => kCFURLEnumeratorSkipInvisibles, + 4 => kCFURLEnumeratorGenerateFileReferenceURLs, + 8 => kCFURLEnumeratorSkipPackageContents, + 16 => kCFURLEnumeratorIncludeDirectoriesPreOrder, + 32 => kCFURLEnumeratorIncludeDirectoriesPostOrder, + 64 => kCFURLEnumeratorGenerateRelativePathURLs, + _ => throw ArgumentError( + "Unknown value for CFURLEnumeratorOptions: $value"), + }; +} - external CSSM_RANGE_PTR Range; +enum CFURLEnumeratorResult { + kCFURLEnumeratorSuccess(1), + kCFURLEnumeratorEnd(2), + kCFURLEnumeratorError(3), + kCFURLEnumeratorDirectoryPostOrderSuccess(4); - external CSSM_CRYPTO_DATA_PTR CryptoData; + final int value; + const CFURLEnumeratorResult(this.value); - external CSSM_VERSION_PTR Version; + static CFURLEnumeratorResult fromValue(int value) => switch (value) { + 1 => kCFURLEnumeratorSuccess, + 2 => kCFURLEnumeratorEnd, + 3 => kCFURLEnumeratorError, + 4 => kCFURLEnumeratorDirectoryPostOrderSuccess, + _ => throw ArgumentError( + "Unknown value for CFURLEnumeratorResult: $value"), + }; +} - external CSSM_DL_DB_HANDLE_PTR DLDBHandle; +final class guid_t extends ffi.Union { + @ffi.Array.multi([16]) + external ffi.Array g_guid; - external ffi.Pointer KRProfile; + @ffi.Array.multi([4]) + external ffi.Array g_guid_asint; } -typedef CSSM_KEY_PTR = ffi.Pointer; -typedef CSSM_PADDING = uint32; -typedef CSSM_DATE_PTR = ffi.Pointer; -typedef CSSM_RANGE_PTR = ffi.Pointer; -typedef CSSM_CRYPTO_DATA_PTR = ffi.Pointer; -typedef CSSM_VERSION_PTR = ffi.Pointer; -typedef CSSM_DL_DB_HANDLE_PTR = ffi.Pointer; +@ffi.Packed(1) +final class ntsid_t extends ffi.Struct { + @u_int8_t() + external int sid_kind; -final class cssm_kr_profile extends ffi.Opaque {} + @u_int8_t() + external int sid_authcount; -final class cssm_context extends ffi.Struct { - @CSSM_CONTEXT_TYPE() - external int ContextType; + @ffi.Array.multi([6]) + external ffi.Array sid_authority; - @CSSM_ALGORITHMS() - external int AlgorithmType; + @ffi.Array.multi([16]) + external ffi.Array sid_authorities; +} - @uint32() - external int NumberOfAttributes; +final class kauth_identity_extlookup extends ffi.Struct { + @u_int32_t() + external int el_seqno; - external CSSM_CONTEXT_ATTRIBUTE_PTR ContextAttributes; + @u_int32_t() + external int el_result; - @CSSM_CSP_HANDLE() - external int CSPHandle; + @u_int32_t() + external int el_flags; - @CSSM_BOOL() - external int Privileged; + @__darwin_pid_t() + external int el_info_pid; - @uint32() - external int EncryptionProhibited; + @u_int64_t() + external int el_extend; - @uint32() - external int WorkFactor; + @u_int32_t() + external int el_info_reserved_1; - @uint32() - external int Reserved; -} + @uid_t() + external int el_uid; -typedef CSSM_CONTEXT_TYPE = uint32; -typedef CSSM_CONTEXT_ATTRIBUTE_PTR = ffi.Pointer; -typedef CSSM_CSP_HANDLE = CSSM_MODULE_HANDLE; + external guid_t el_uguid; -final class cssm_pkcs1_oaep_params extends ffi.Struct { - @uint32() - external int HashAlgorithm; + @u_int32_t() + external int el_uguid_valid; - external SecAsn1Item HashParams; + external ntsid_t el_usid; - @CSSM_PKCS_OAEP_MGF() - external int MGF; + @u_int32_t() + external int el_usid_valid; - external SecAsn1Item MGFParams; + @gid_t() + external int el_gid; - @CSSM_PKCS_OAEP_PSOURCE() - external int PSource; + external guid_t el_gguid; - external SecAsn1Item PSourceParams; -} + @u_int32_t() + external int el_gguid_valid; -typedef CSSM_PKCS_OAEP_MGF = uint32; -typedef CSSM_PKCS_OAEP_PSOURCE = uint32; + external ntsid_t el_gsid; -final class cssm_csp_operational_statistics extends ffi.Struct { - @CSSM_BOOL() - external int UserAuthenticated; + @u_int32_t() + external int el_gsid_valid; - @CSSM_CSP_FLAGS() - external int DeviceFlags; + @u_int32_t() + external int el_member_valid; - @uint32() - external int TokenMaxSessionCount; + @u_int32_t() + external int el_sup_grp_cnt; - @uint32() - external int TokenOpenedSessionCount; + @ffi.Array.multi([16]) + external ffi.Array el_sup_groups; +} - @uint32() - external int TokenMaxRWSessionCount; +final class kauth_cache_sizes extends ffi.Struct { + @u_int32_t() + external int kcs_group_size; - @uint32() - external int TokenOpenedRWSessionCount; + @u_int32_t() + external int kcs_id_size; +} - @uint32() - external int TokenTotalPublicMem; +typedef kauth_ace_rights_t = u_int32_t; - @uint32() - external int TokenFreePublicMem; +final class kauth_ace extends ffi.Struct { + external guid_t ace_applicable; - @uint32() - external int TokenTotalPrivateMem; + @u_int32_t() + external int ace_flags; - @uint32() - external int TokenFreePrivateMem; + @kauth_ace_rights_t() + external int ace_rights; } -typedef CSSM_CSP_FLAGS = uint32; - -final class cssm_pkcs5_pbkdf1_params extends ffi.Struct { - external SecAsn1Item Passphrase; +typedef kauth_ace_t = ffi.Pointer; - external SecAsn1Item InitVector; -} +final class kauth_acl extends ffi.Struct { + @u_int32_t() + external int acl_entrycount; -final class cssm_pkcs5_pbkdf2_params extends ffi.Struct { - external SecAsn1Item Passphrase; + @u_int32_t() + external int acl_flags; - @CSSM_PKCS5_PBKDF2_PRF() - external int PseudoRandomFunction; + @ffi.Array.multi([1]) + external ffi.Array acl_ace; } -typedef CSSM_PKCS5_PBKDF2_PRF = uint32; +typedef kauth_acl_t = ffi.Pointer; -final class cssm_kea_derive_params extends ffi.Struct { - external SecAsn1Item Rb; +final class kauth_filesec extends ffi.Struct { + @u_int32_t() + external int fsec_magic; - external SecAsn1Item Yb; -} + external guid_t fsec_owner; -final class cssm_tp_authority_id extends ffi.Struct { - external ffi.Pointer AuthorityCert; + external guid_t fsec_group; - external CSSM_NET_ADDRESS_PTR AuthorityLocation; + external kauth_acl fsec_acl; } -typedef CSSM_NET_ADDRESS_PTR = ffi.Pointer; - -final class cssm_field extends ffi.Struct { - external SecAsn1Oid FieldOid; - - external SecAsn1Item FieldValue; -} +typedef kauth_filesec_t = ffi.Pointer; -final class cssm_tp_policyinfo extends ffi.Struct { - @uint32() - external int NumberOfPolicyIds; - - external CSSM_FIELD_PTR PolicyIds; - - external ffi.Pointer PolicyControl; -} - -typedef CSSM_FIELD_PTR = ffi.Pointer; - -final class cssm_dl_db_list extends ffi.Struct { - @uint32() - external int NumHandles; - - external CSSM_DL_DB_HANDLE_PTR DLDBHandle; -} - -final class cssm_tp_callerauth_context extends ffi.Struct { - external CSSM_TP_POLICYINFO Policy; - - external CSSM_TIMESTRING VerifyTime; - - @CSSM_TP_STOP_ON() - external int VerificationAbortOn; - - external CSSM_TP_VERIFICATION_RESULTS_CALLBACK CallbackWithVerifiedCert; +enum acl_perm_t { + ACL_READ_DATA(2), + ACL_WRITE_DATA(4), + ACL_EXECUTE(8), + ACL_DELETE(16), + ACL_APPEND_DATA(32), + ACL_DELETE_CHILD(64), + ACL_READ_ATTRIBUTES(128), + ACL_WRITE_ATTRIBUTES(256), + ACL_READ_EXTATTRIBUTES(512), + ACL_WRITE_EXTATTRIBUTES(1024), + ACL_READ_SECURITY(2048), + ACL_WRITE_SECURITY(4096), + ACL_CHANGE_OWNER(8192), + ACL_SYNCHRONIZE(1048576); - @uint32() - external int NumberOfAnchorCerts; + static const ACL_LIST_DIRECTORY = ACL_READ_DATA; + static const ACL_ADD_FILE = ACL_WRITE_DATA; + static const ACL_SEARCH = ACL_EXECUTE; + static const ACL_ADD_SUBDIRECTORY = ACL_APPEND_DATA; - external CSSM_DATA_PTR AnchorCerts; + final int value; + const acl_perm_t(this.value); - external CSSM_DL_DB_LIST_PTR DBList; + static acl_perm_t fromValue(int value) => switch (value) { + 2 => ACL_READ_DATA, + 4 => ACL_WRITE_DATA, + 8 => ACL_EXECUTE, + 16 => ACL_DELETE, + 32 => ACL_APPEND_DATA, + 64 => ACL_DELETE_CHILD, + 128 => ACL_READ_ATTRIBUTES, + 256 => ACL_WRITE_ATTRIBUTES, + 512 => ACL_READ_EXTATTRIBUTES, + 1024 => ACL_WRITE_EXTATTRIBUTES, + 2048 => ACL_READ_SECURITY, + 4096 => ACL_WRITE_SECURITY, + 8192 => ACL_CHANGE_OWNER, + 1048576 => ACL_SYNCHRONIZE, + _ => throw ArgumentError("Unknown value for acl_perm_t: $value"), + }; - external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; + @override + String toString() { + if (this == ACL_READ_DATA) + return "acl_perm_t.ACL_READ_DATA, acl_perm_t.ACL_LIST_DIRECTORY"; + if (this == ACL_WRITE_DATA) + return "acl_perm_t.ACL_WRITE_DATA, acl_perm_t.ACL_ADD_FILE"; + if (this == ACL_EXECUTE) + return "acl_perm_t.ACL_EXECUTE, acl_perm_t.ACL_SEARCH"; + if (this == ACL_APPEND_DATA) + return "acl_perm_t.ACL_APPEND_DATA, acl_perm_t.ACL_ADD_SUBDIRECTORY"; + return super.toString(); + } } -typedef CSSM_TP_POLICYINFO = cssm_tp_policyinfo; -typedef CSSM_TIMESTRING = ffi.Pointer; -typedef CSSM_TP_STOP_ON = uint32; -typedef CSSM_TP_VERIFICATION_RESULTS_CALLBACK = ffi - .Pointer>; -typedef CSSM_TP_VERIFICATION_RESULTS_CALLBACKFunction = CSSM_RETURN Function( - CSSM_MODULE_HANDLE ModuleHandle, - ffi.Pointer CallerCtx, - CSSM_DATA_PTR VerifiedCert); -typedef DartCSSM_TP_VERIFICATION_RESULTS_CALLBACKFunction = Dartsint32 Function( - DartCSSM_INTPTR ModuleHandle, - ffi.Pointer CallerCtx, - CSSM_DATA_PTR VerifiedCert); -typedef CSSM_DL_DB_LIST_PTR = ffi.Pointer; - -final class cssm_encoded_crl extends ffi.Struct { - @CSSM_CRL_TYPE() - external int CrlType; +enum acl_tag_t { + ACL_UNDEFINED_TAG(0), + ACL_EXTENDED_ALLOW(1), + ACL_EXTENDED_DENY(2); - @CSSM_CRL_ENCODING() - external int CrlEncoding; + final int value; + const acl_tag_t(this.value); - external SecAsn1Item CrlBlob; + static acl_tag_t fromValue(int value) => switch (value) { + 0 => ACL_UNDEFINED_TAG, + 1 => ACL_EXTENDED_ALLOW, + 2 => ACL_EXTENDED_DENY, + _ => throw ArgumentError("Unknown value for acl_tag_t: $value"), + }; } -typedef CSSM_CRL_TYPE = uint32; -typedef CSSM_CRL_ENCODING = uint32; - -final class cssm_parsed_crl extends ffi.Struct { - @CSSM_CRL_TYPE() - external int CrlType; +enum acl_type_t { + ACL_TYPE_EXTENDED(256), + ACL_TYPE_ACCESS(0), + ACL_TYPE_DEFAULT(1), + ACL_TYPE_AFS(2), + ACL_TYPE_CODA(3), + ACL_TYPE_NTFS(4), + ACL_TYPE_NWFS(5); - @CSSM_CRL_PARSE_FORMAT() - external int ParsedCrlFormat; + final int value; + const acl_type_t(this.value); - external ffi.Pointer ParsedCrl; + static acl_type_t fromValue(int value) => switch (value) { + 256 => ACL_TYPE_EXTENDED, + 0 => ACL_TYPE_ACCESS, + 1 => ACL_TYPE_DEFAULT, + 2 => ACL_TYPE_AFS, + 3 => ACL_TYPE_CODA, + 4 => ACL_TYPE_NTFS, + 5 => ACL_TYPE_NWFS, + _ => throw ArgumentError("Unknown value for acl_type_t: $value"), + }; } -typedef CSSM_CRL_PARSE_FORMAT = uint32; +enum acl_flag_t { + ACL_FLAG_DEFER_INHERIT(1), + ACL_FLAG_NO_INHERIT(131072), + ACL_ENTRY_INHERITED(16), + ACL_ENTRY_FILE_INHERIT(32), + ACL_ENTRY_DIRECTORY_INHERIT(64), + ACL_ENTRY_LIMIT_INHERIT(128), + ACL_ENTRY_ONLY_INHERIT(256); -final class cssm_crl_pair extends ffi.Struct { - external CSSM_ENCODED_CRL EncodedCrl; + final int value; + const acl_flag_t(this.value); - external CSSM_PARSED_CRL ParsedCrl; + static acl_flag_t fromValue(int value) => switch (value) { + 1 => ACL_FLAG_DEFER_INHERIT, + 131072 => ACL_FLAG_NO_INHERIT, + 16 => ACL_ENTRY_INHERITED, + 32 => ACL_ENTRY_FILE_INHERIT, + 64 => ACL_ENTRY_DIRECTORY_INHERIT, + 128 => ACL_ENTRY_LIMIT_INHERIT, + 256 => ACL_ENTRY_ONLY_INHERIT, + _ => throw ArgumentError("Unknown value for acl_flag_t: $value"), + }; } -typedef CSSM_ENCODED_CRL = cssm_encoded_crl; -typedef CSSM_PARSED_CRL = cssm_parsed_crl; +final class _acl extends ffi.Opaque {} -final class cssm_crlgroup extends ffi.Struct { - @CSSM_CRL_TYPE() - external int CrlType; +final class _acl_entry extends ffi.Opaque {} - @CSSM_CRL_ENCODING() - external int CrlEncoding; +final class _acl_permset extends ffi.Opaque {} - @uint32() - external int NumberOfCrls; +final class _acl_flagset extends ffi.Opaque {} - external UnnamedUnion4 GroupCrlList; +typedef acl_t = ffi.Pointer<_acl>; +typedef acl_entry_t = ffi.Pointer<_acl_entry>; +typedef acl_permset_t = ffi.Pointer<_acl_permset>; +typedef acl_flagset_t = ffi.Pointer<_acl_flagset>; +typedef acl_permset_mask_t = u_int64_t; - @CSSM_CRLGROUP_TYPE() - external int CrlGroupType; -} +final class __CFFileSecurity extends ffi.Opaque {} -final class UnnamedUnion4 extends ffi.Union { - external CSSM_DATA_PTR CrlList; +typedef CFFileSecurityRef = ffi.Pointer<__CFFileSecurity>; - external CSSM_ENCODED_CRL_PTR EncodedCrlList; +enum CFFileSecurityClearOptions { + kCFFileSecurityClearOwner(1), + kCFFileSecurityClearGroup(2), + kCFFileSecurityClearMode(4), + kCFFileSecurityClearOwnerUUID(8), + kCFFileSecurityClearGroupUUID(16), + kCFFileSecurityClearAccessControlList(32); - external CSSM_PARSED_CRL_PTR ParsedCrlList; + final int value; + const CFFileSecurityClearOptions(this.value); - external CSSM_CRL_PAIR_PTR PairCrlList; + static CFFileSecurityClearOptions fromValue(int value) => switch (value) { + 1 => kCFFileSecurityClearOwner, + 2 => kCFFileSecurityClearGroup, + 4 => kCFFileSecurityClearMode, + 8 => kCFFileSecurityClearOwnerUUID, + 16 => kCFFileSecurityClearGroupUUID, + 32 => kCFFileSecurityClearAccessControlList, + _ => throw ArgumentError( + "Unknown value for CFFileSecurityClearOptions: $value"), + }; } -typedef CSSM_ENCODED_CRL_PTR = ffi.Pointer; -typedef CSSM_PARSED_CRL_PTR = ffi.Pointer; -typedef CSSM_CRL_PAIR_PTR = ffi.Pointer; -typedef CSSM_CRLGROUP_TYPE = uint32; +final class __CFStringTokenizer extends ffi.Opaque {} -final class cssm_fieldgroup extends ffi.Struct { - @ffi.Int() - external int NumberOfFields; +typedef CFStringTokenizerRef = ffi.Pointer<__CFStringTokenizer>; - external CSSM_FIELD_PTR Fields; -} +enum CFStringTokenizerTokenType { + kCFStringTokenizerTokenNone(0), + kCFStringTokenizerTokenNormal(1), + kCFStringTokenizerTokenHasSubTokensMask(2), + kCFStringTokenizerTokenHasDerivedSubTokensMask(4), + kCFStringTokenizerTokenHasHasNumbersMask(8), + kCFStringTokenizerTokenHasNonLettersMask(16), + kCFStringTokenizerTokenIsCJWordMask(32); -final class cssm_evidence extends ffi.Struct { - @CSSM_EVIDENCE_FORM() - external int EvidenceForm; + final int value; + const CFStringTokenizerTokenType(this.value); - external ffi.Pointer Evidence; + static CFStringTokenizerTokenType fromValue(int value) => switch (value) { + 0 => kCFStringTokenizerTokenNone, + 1 => kCFStringTokenizerTokenNormal, + 2 => kCFStringTokenizerTokenHasSubTokensMask, + 4 => kCFStringTokenizerTokenHasDerivedSubTokensMask, + 8 => kCFStringTokenizerTokenHasHasNumbersMask, + 16 => kCFStringTokenizerTokenHasNonLettersMask, + 32 => kCFStringTokenizerTokenIsCJWordMask, + _ => throw ArgumentError( + "Unknown value for CFStringTokenizerTokenType: $value"), + }; } -typedef CSSM_EVIDENCE_FORM = uint32; +typedef CFFileDescriptorNativeDescriptor = ffi.Int; +typedef DartCFFileDescriptorNativeDescriptor = int; -final class cssm_tp_verify_context extends ffi.Struct { - @CSSM_TP_ACTION() - external int Action; +final class __CFFileDescriptor extends ffi.Opaque {} - external SecAsn1Item ActionData; +typedef CFFileDescriptorRef = ffi.Pointer<__CFFileDescriptor>; +typedef CFFileDescriptorCallBackFunction = ffi.Void Function( + CFFileDescriptorRef f, + CFOptionFlags callBackTypes, + ffi.Pointer info); +typedef DartCFFileDescriptorCallBackFunction = void Function( + CFFileDescriptorRef f, + DartCFOptionFlags callBackTypes, + ffi.Pointer info); +typedef CFFileDescriptorCallBack + = ffi.Pointer>; - external CSSM_CRLGROUP Crls; +final class CFFileDescriptorContext extends ffi.Struct { + @CFIndex() + external int version; - external CSSM_TP_CALLERAUTH_CONTEXT_PTR Cred; -} + external ffi.Pointer info; -typedef CSSM_TP_ACTION = uint32; -typedef CSSM_CRLGROUP = cssm_crlgroup; -typedef CSSM_TP_CALLERAUTH_CONTEXT_PTR - = ffi.Pointer; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; -final class cssm_tp_verify_context_result extends ffi.Struct { - @uint32() - external int NumberOfEvidences; + external ffi.Pointer< + ffi.NativeFunction info)>> + release; - external CSSM_EVIDENCE_PTR Evidence; + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; } -typedef CSSM_EVIDENCE_PTR = ffi.Pointer; +final class __CFUserNotification extends ffi.Opaque {} -final class cssm_tp_request_set extends ffi.Struct { - @uint32() - external int NumberOfRequests; +typedef CFUserNotificationRef = ffi.Pointer<__CFUserNotification>; +typedef CFUserNotificationCallBackFunction = ffi.Void Function( + CFUserNotificationRef userNotification, CFOptionFlags responseFlags); +typedef DartCFUserNotificationCallBackFunction = void Function( + CFUserNotificationRef userNotification, DartCFOptionFlags responseFlags); +typedef CFUserNotificationCallBack + = ffi.Pointer>; - external ffi.Pointer Requests; -} +final class __CFXMLNode extends ffi.Opaque {} -final class cssm_tp_result_set extends ffi.Struct { - @uint32() - external int NumberOfResults; +typedef CFXMLNodeRef = ffi.Pointer<__CFXMLNode>; +typedef CFXMLTreeRef = CFTreeRef; - external ffi.Pointer Results; -} +enum CFXMLNodeTypeCode { + kCFXMLNodeTypeDocument(1), + kCFXMLNodeTypeElement(2), + kCFXMLNodeTypeAttribute(3), + kCFXMLNodeTypeProcessingInstruction(4), + kCFXMLNodeTypeComment(5), + kCFXMLNodeTypeText(6), + kCFXMLNodeTypeCDATASection(7), + kCFXMLNodeTypeDocumentFragment(8), + kCFXMLNodeTypeEntity(9), + kCFXMLNodeTypeEntityReference(10), + kCFXMLNodeTypeDocumentType(11), + kCFXMLNodeTypeWhitespace(12), + kCFXMLNodeTypeNotation(13), + kCFXMLNodeTypeElementTypeDeclaration(14), + kCFXMLNodeTypeAttributeListDeclaration(15); -final class cssm_tp_confirm_response extends ffi.Struct { - @uint32() - external int NumberOfResponses; + final int value; + const CFXMLNodeTypeCode(this.value); - external CSSM_TP_CONFIRM_STATUS_PTR Responses; + static CFXMLNodeTypeCode fromValue(int value) => switch (value) { + 1 => kCFXMLNodeTypeDocument, + 2 => kCFXMLNodeTypeElement, + 3 => kCFXMLNodeTypeAttribute, + 4 => kCFXMLNodeTypeProcessingInstruction, + 5 => kCFXMLNodeTypeComment, + 6 => kCFXMLNodeTypeText, + 7 => kCFXMLNodeTypeCDATASection, + 8 => kCFXMLNodeTypeDocumentFragment, + 9 => kCFXMLNodeTypeEntity, + 10 => kCFXMLNodeTypeEntityReference, + 11 => kCFXMLNodeTypeDocumentType, + 12 => kCFXMLNodeTypeWhitespace, + 13 => kCFXMLNodeTypeNotation, + 14 => kCFXMLNodeTypeElementTypeDeclaration, + 15 => kCFXMLNodeTypeAttributeListDeclaration, + _ => throw ArgumentError("Unknown value for CFXMLNodeTypeCode: $value"), + }; } -typedef CSSM_TP_CONFIRM_STATUS_PTR = ffi.Pointer; - -final class cssm_tp_certissue_input extends ffi.Struct { - external CSSM_SUBSERVICE_UID CSPSubserviceUid; - - @CSSM_CL_HANDLE() - external int CLHandle; - - @uint32() - external int NumberOfTemplateFields; - - external CSSM_FIELD_PTR SubjectCertFields; - - @CSSM_TP_SERVICES() - external int MoreServiceRequests; +final class CFXMLElementInfo extends ffi.Struct { + external CFDictionaryRef attributes; - @uint32() - external int NumberOfServiceControls; + external CFArrayRef attributeOrder; - external CSSM_FIELD_PTR ServiceControls; + @Boolean() + external int isEmpty; - external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; + @ffi.Array.multi([3]) + external ffi.Array _reserved; } -typedef CSSM_TP_SERVICES = uint32; - -final class cssm_tp_certissue_output extends ffi.Struct { - @CSSM_TP_CERTISSUE_STATUS() - external int IssueStatus; - - external CSSM_CERTGROUP_PTR CertGroup; - - @CSSM_TP_SERVICES() - external int PerformedServiceRequests; +final class CFXMLProcessingInstructionInfo extends ffi.Struct { + external CFStringRef dataString; } -typedef CSSM_TP_CERTISSUE_STATUS = uint32; -typedef CSSM_CERTGROUP_PTR = ffi.Pointer; - -final class cssm_tp_certchange_input extends ffi.Struct { - @CSSM_TP_CERTCHANGE_ACTION() - external int Action; - - @CSSM_TP_CERTCHANGE_REASON() - external int Reason; - - @CSSM_CL_HANDLE() - external int CLHandle; - - external CSSM_DATA_PTR Cert; +final class CFXMLDocumentInfo extends ffi.Struct { + external CFURLRef sourceURL; - external CSSM_FIELD_PTR ChangeInfo; + @CFStringEncoding() + external int encoding; +} - external CSSM_TIMESTRING StartTime; +final class CFXMLExternalID extends ffi.Struct { + external CFURLRef systemID; - external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; + external CFStringRef publicID; } -typedef CSSM_TP_CERTCHANGE_ACTION = uint32; -typedef CSSM_TP_CERTCHANGE_REASON = uint32; - -final class cssm_tp_certchange_output extends ffi.Struct { - @CSSM_TP_CERTCHANGE_STATUS() - external int ActionStatus; +final class CFXMLDocumentTypeInfo extends ffi.Struct { + external CFXMLExternalID externalID; +} - external CSSM_FIELD RevokeInfo; +final class CFXMLNotationInfo extends ffi.Struct { + external CFXMLExternalID externalID; } -typedef CSSM_TP_CERTCHANGE_STATUS = uint32; -typedef CSSM_FIELD = cssm_field; +final class CFXMLElementTypeDeclarationInfo extends ffi.Struct { + external CFStringRef contentDescription; +} -final class cssm_tp_certverify_input extends ffi.Struct { - @CSSM_CL_HANDLE() - external int CLHandle; +final class CFXMLAttributeDeclarationInfo extends ffi.Struct { + external CFStringRef attributeName; - external CSSM_DATA_PTR Cert; + external CFStringRef typeString; - external CSSM_TP_VERIFY_CONTEXT_PTR VerifyContext; + external CFStringRef defaultString; } -typedef CSSM_TP_VERIFY_CONTEXT_PTR = ffi.Pointer; - -final class cssm_tp_certverify_output extends ffi.Struct { - @CSSM_TP_CERTVERIFY_STATUS() - external int VerifyStatus; - - @uint32() - external int NumberOfEvidence; +final class CFXMLAttributeListDeclarationInfo extends ffi.Struct { + @CFIndex() + external int numberOfAttributes; - external CSSM_EVIDENCE_PTR Evidence; + external ffi.Pointer attributes; } -typedef CSSM_TP_CERTVERIFY_STATUS = uint32; +enum CFXMLEntityTypeCode { + kCFXMLEntityTypeParameter(0), + kCFXMLEntityTypeParsedInternal(1), + kCFXMLEntityTypeParsedExternal(2), + kCFXMLEntityTypeUnparsed(3), + kCFXMLEntityTypeCharacter(4); -final class cssm_tp_certnotarize_input extends ffi.Struct { - @CSSM_CL_HANDLE() - external int CLHandle; + final int value; + const CFXMLEntityTypeCode(this.value); - @uint32() - external int NumberOfFields; + static CFXMLEntityTypeCode fromValue(int value) => switch (value) { + 0 => kCFXMLEntityTypeParameter, + 1 => kCFXMLEntityTypeParsedInternal, + 2 => kCFXMLEntityTypeParsedExternal, + 3 => kCFXMLEntityTypeUnparsed, + 4 => kCFXMLEntityTypeCharacter, + _ => + throw ArgumentError("Unknown value for CFXMLEntityTypeCode: $value"), + }; +} - external CSSM_FIELD_PTR MoreFields; +final class CFXMLEntityInfo extends ffi.Struct { + @CFIndex() + external int entityTypeAsInt; - external CSSM_FIELD_PTR SignScope; + CFXMLEntityTypeCode get entityType => + CFXMLEntityTypeCode.fromValue(entityTypeAsInt); - @uint32() - external int ScopeSize; + external CFStringRef replacementText; - @CSSM_TP_SERVICES() - external int MoreServiceRequests; + external CFXMLExternalID entityID; - @uint32() - external int NumberOfServiceControls; + external CFStringRef notationName; +} - external CSSM_FIELD_PTR ServiceControls; +final class CFXMLEntityReferenceInfo extends ffi.Struct { + @CFIndex() + external int entityTypeAsInt; - external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; + CFXMLEntityTypeCode get entityType => + CFXMLEntityTypeCode.fromValue(entityTypeAsInt); } -final class cssm_tp_certnotarize_output extends ffi.Struct { - @CSSM_TP_CERTNOTARIZE_STATUS() - external int NotarizeStatus; +final class __CFXMLParser extends ffi.Opaque {} - external CSSM_CERTGROUP_PTR NotarizedCertGroup; +typedef CFXMLParserRef = ffi.Pointer<__CFXMLParser>; - @CSSM_TP_SERVICES() - external int PerformedServiceRequests; -} +enum CFXMLParserStatusCode { + kCFXMLStatusParseNotBegun(-2), + kCFXMLStatusParseInProgress(-1), + kCFXMLStatusParseSuccessful(0), + kCFXMLErrorUnexpectedEOF(1), + kCFXMLErrorUnknownEncoding(2), + kCFXMLErrorEncodingConversionFailure(3), + kCFXMLErrorMalformedProcessingInstruction(4), + kCFXMLErrorMalformedDTD(5), + kCFXMLErrorMalformedName(6), + kCFXMLErrorMalformedCDSect(7), + kCFXMLErrorMalformedCloseTag(8), + kCFXMLErrorMalformedStartTag(9), + kCFXMLErrorMalformedDocument(10), + kCFXMLErrorElementlessDocument(11), + kCFXMLErrorMalformedComment(12), + kCFXMLErrorMalformedCharacterReference(13), + kCFXMLErrorMalformedParsedCharacterData(14), + kCFXMLErrorNoData(15); -typedef CSSM_TP_CERTNOTARIZE_STATUS = uint32; + final int value; + const CFXMLParserStatusCode(this.value); -final class cssm_tp_certreclaim_input extends ffi.Struct { - @CSSM_CL_HANDLE() - external int CLHandle; + static CFXMLParserStatusCode fromValue(int value) => switch (value) { + -2 => kCFXMLStatusParseNotBegun, + -1 => kCFXMLStatusParseInProgress, + 0 => kCFXMLStatusParseSuccessful, + 1 => kCFXMLErrorUnexpectedEOF, + 2 => kCFXMLErrorUnknownEncoding, + 3 => kCFXMLErrorEncodingConversionFailure, + 4 => kCFXMLErrorMalformedProcessingInstruction, + 5 => kCFXMLErrorMalformedDTD, + 6 => kCFXMLErrorMalformedName, + 7 => kCFXMLErrorMalformedCDSect, + 8 => kCFXMLErrorMalformedCloseTag, + 9 => kCFXMLErrorMalformedStartTag, + 10 => kCFXMLErrorMalformedDocument, + 11 => kCFXMLErrorElementlessDocument, + 12 => kCFXMLErrorMalformedComment, + 13 => kCFXMLErrorMalformedCharacterReference, + 14 => kCFXMLErrorMalformedParsedCharacterData, + 15 => kCFXMLErrorNoData, + _ => throw ArgumentError( + "Unknown value for CFXMLParserStatusCode: $value"), + }; +} - @uint32() - external int NumberOfSelectionFields; +typedef CFXMLParserCreateXMLStructureCallBackFunction + = ffi.Pointer Function(CFXMLParserRef parser, + CFXMLNodeRef nodeDesc, ffi.Pointer info); +typedef CFXMLParserCreateXMLStructureCallBack = ffi + .Pointer>; +typedef CFXMLParserAddChildCallBackFunction = ffi.Void Function( + CFXMLParserRef parser, + ffi.Pointer parent, + ffi.Pointer child, + ffi.Pointer info); +typedef DartCFXMLParserAddChildCallBackFunction = void Function( + CFXMLParserRef parser, + ffi.Pointer parent, + ffi.Pointer child, + ffi.Pointer info); +typedef CFXMLParserAddChildCallBack + = ffi.Pointer>; +typedef CFXMLParserEndXMLStructureCallBackFunction = ffi.Void Function( + CFXMLParserRef parser, + ffi.Pointer xmlType, + ffi.Pointer info); +typedef DartCFXMLParserEndXMLStructureCallBackFunction = void Function( + CFXMLParserRef parser, + ffi.Pointer xmlType, + ffi.Pointer info); +typedef CFXMLParserEndXMLStructureCallBack = ffi + .Pointer>; +typedef CFXMLParserResolveExternalEntityCallBackFunction = CFDataRef Function( + CFXMLParserRef parser, + ffi.Pointer extID, + ffi.Pointer info); +typedef CFXMLParserResolveExternalEntityCallBack = ffi.Pointer< + ffi.NativeFunction>; +typedef CFXMLParserHandleErrorCallBackFunction = Boolean Function( + CFXMLParserRef parser, CFIndex error, ffi.Pointer info); +typedef DartCFXMLParserHandleErrorCallBackFunction = DartBoolean Function( + CFXMLParserRef parser, + CFXMLParserStatusCode error, + ffi.Pointer info); +typedef CFXMLParserHandleErrorCallBack + = ffi.Pointer>; - external CSSM_FIELD_PTR SelectionFields; +final class CFXMLParserCallBacks extends ffi.Struct { + @CFIndex() + external int version; - external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; -} + external CFXMLParserCreateXMLStructureCallBack createXMLStructure; -final class cssm_tp_certreclaim_output extends ffi.Struct { - @CSSM_TP_CERTRECLAIM_STATUS() - external int ReclaimStatus; + external CFXMLParserAddChildCallBack addChild; - external CSSM_CERTGROUP_PTR ReclaimedCertGroup; + external CFXMLParserEndXMLStructureCallBack endXMLStructure; - @CSSM_LONG_HANDLE() - external int KeyCacheHandle; + external CFXMLParserResolveExternalEntityCallBack resolveExternalEntity; + + external CFXMLParserHandleErrorCallBack handleError; } -typedef CSSM_TP_CERTRECLAIM_STATUS = uint32; -typedef CSSM_LONG_HANDLE = uint64; -typedef uint64 = ffi.Uint64; -typedef Dartuint64 = int; +typedef CFXMLParserRetainCallBackFunction = ffi.Pointer Function( + ffi.Pointer info); +typedef CFXMLParserRetainCallBack + = ffi.Pointer>; +typedef CFXMLParserReleaseCallBackFunction = ffi.Void Function( + ffi.Pointer info); +typedef DartCFXMLParserReleaseCallBackFunction = void Function( + ffi.Pointer info); +typedef CFXMLParserReleaseCallBack + = ffi.Pointer>; +typedef CFXMLParserCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer info); +typedef CFXMLParserCopyDescriptionCallBack = ffi + .Pointer>; -final class cssm_tp_crlissue_input extends ffi.Struct { - @CSSM_CL_HANDLE() - external int CLHandle; +final class CFXMLParserContext extends ffi.Struct { + @CFIndex() + external int version; - @uint32() - external int CrlIdentifier; + external ffi.Pointer info; - external CSSM_TIMESTRING CrlThisTime; + external CFXMLParserRetainCallBack retain; - external CSSM_FIELD_PTR PolicyIdentifier; + external CFXMLParserReleaseCallBack release; - external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; + external CFXMLParserCopyDescriptionCallBack copyDescription; } -final class cssm_tp_crlissue_output extends ffi.Struct { - @CSSM_TP_CRLISSUE_STATUS() - external int IssueStatus; +typedef sint64 = ffi.Int64; +typedef Dartsint64 = int; +typedef uint64 = ffi.Uint64; +typedef Dartuint64 = int; +typedef sint32 = ffi.Int32; +typedef Dartsint32 = int; +typedef sint16 = ffi.Int16; +typedef Dartsint16 = int; +typedef sint8 = ffi.Int8; +typedef Dartsint8 = int; +typedef uint32 = ffi.Uint32; +typedef Dartuint32 = int; +typedef uint16 = ffi.Uint16; +typedef Dartuint16 = int; +typedef uint8 = ffi.Uint8; +typedef Dartuint8 = int; +typedef CSSM_INTPTR = ffi.IntPtr; +typedef DartCSSM_INTPTR = int; +typedef CSSM_SIZE = ffi.Size; +typedef DartCSSM_SIZE = int; - external CSSM_ENCODED_CRL_PTR Crl; +final class cssm_data extends ffi.Struct { + @ffi.Size() + external int Length; - external CSSM_TIMESTRING CrlNextTime; + external ffi.Pointer Data; } -typedef CSSM_TP_CRLISSUE_STATUS = uint32; +typedef SecAsn1Item = cssm_data; +typedef SecAsn1Oid = cssm_data; -final class cssm_cert_bundle_header extends ffi.Struct { - @CSSM_CERT_BUNDLE_TYPE() - external int BundleType; +final class SecAsn1AlgId extends ffi.Struct { + external SecAsn1Oid algorithm; - @CSSM_CERT_BUNDLE_ENCODING() - external int BundleEncoding; + external SecAsn1Item parameters; } -typedef CSSM_CERT_BUNDLE_TYPE = uint32; -typedef CSSM_CERT_BUNDLE_ENCODING = uint32; - -final class cssm_cert_bundle extends ffi.Struct { - external CSSM_CERT_BUNDLE_HEADER BundleHeader; +final class SecAsn1PubKeyInfo extends ffi.Struct { + external SecAsn1AlgId algorithm; - external SecAsn1Item Bundle; + external SecAsn1Item subjectPublicKey; } -typedef CSSM_CERT_BUNDLE_HEADER = cssm_cert_bundle_header; +final class SecAsn1Template_struct extends ffi.Struct { + @ffi.Uint32() + external int kind; -final class cssm_db_attribute_info extends ffi.Struct { - @CSSM_DB_ATTRIBUTE_NAME_FORMAT() - external int AttributeNameFormat; + @ffi.Uint32() + external int offset; - external cssm_db_attribute_label Label; + external ffi.Pointer sub; - @CSSM_DB_ATTRIBUTE_FORMAT() - external int AttributeFormat; + @ffi.Uint32() + external int size; } -typedef CSSM_DB_ATTRIBUTE_NAME_FORMAT = uint32; - -final class cssm_db_attribute_label extends ffi.Union { - external ffi.Pointer AttributeName; - - external SecAsn1Oid AttributeOID; +typedef SecAsn1Template = SecAsn1Template_struct; +typedef SecAsn1TemplateChooser = ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg, + Boolean enc, + ffi.Pointer buf, + ffi.Size len, + ffi.Pointer dest)>; +typedef SecAsn1TemplateChooserPtr = ffi.Pointer; +typedef CSSM_HANDLE = CSSM_INTPTR; +typedef CSSM_HANDLE_PTR = ffi.Pointer; +typedef CSSM_LONG_HANDLE = uint64; +typedef CSSM_LONG_HANDLE_PTR = ffi.Pointer; +typedef CSSM_MODULE_HANDLE = CSSM_HANDLE; +typedef CSSM_MODULE_HANDLE_PTR = ffi.Pointer; +typedef CSSM_CC_HANDLE = CSSM_LONG_HANDLE; +typedef CSSM_CSP_HANDLE = CSSM_MODULE_HANDLE; +typedef CSSM_TP_HANDLE = CSSM_MODULE_HANDLE; +typedef CSSM_AC_HANDLE = CSSM_MODULE_HANDLE; +typedef CSSM_CL_HANDLE = CSSM_MODULE_HANDLE; +typedef CSSM_DL_HANDLE = CSSM_MODULE_HANDLE; +typedef CSSM_DB_HANDLE = CSSM_MODULE_HANDLE; +typedef CSSM_BOOL = sint32; +typedef CSSM_RETURN = sint32; +typedef CSSM_DATA_PTR = ffi.Pointer; +final class cssm_guid extends ffi.Struct { @uint32() - external int AttributeID; -} - -typedef CSSM_DB_ATTRIBUTE_FORMAT = uint32; + external int Data1; -final class cssm_db_attribute_data extends ffi.Struct { - external CSSM_DB_ATTRIBUTE_INFO Info; + @uint16() + external int Data2; - @uint32() - external int NumberOfValues; + @uint16() + external int Data3; - external CSSM_DATA_PTR Value; + @ffi.Array.multi([8]) + external ffi.Array Data4; } -typedef CSSM_DB_ATTRIBUTE_INFO = cssm_db_attribute_info; - -final class cssm_db_record_attribute_info extends ffi.Struct { - @CSSM_DB_RECORDTYPE() - external int DataRecordType; +typedef CSSM_GUID = cssm_guid; +typedef CSSM_GUID_PTR = ffi.Pointer; +typedef CSSM_BITMASK = uint32; +typedef CSSM_KEY_HIERARCHY = CSSM_BITMASK; +typedef CSSM_PVC_MODE = CSSM_BITMASK; +typedef CSSM_PRIVILEGE_SCOPE = uint32; +final class cssm_version extends ffi.Struct { @uint32() - external int NumberOfAttributes; + external int Major; - external CSSM_DB_ATTRIBUTE_INFO_PTR AttributeInfo; + @uint32() + external int Minor; } -typedef CSSM_DB_RECORDTYPE = uint32; -typedef CSSM_DB_ATTRIBUTE_INFO_PTR = ffi.Pointer; +typedef CSSM_VERSION = cssm_version; +typedef CSSM_VERSION_PTR = ffi.Pointer; +typedef CSSM_SERVICE_MASK = uint32; +typedef CSSM_SERVICE_TYPE = CSSM_SERVICE_MASK; -final class cssm_db_record_attribute_data extends ffi.Struct { - @CSSM_DB_RECORDTYPE() - external int DataRecordType; +final class cssm_subservice_uid extends ffi.Struct { + external CSSM_GUID Guid; - @uint32() - external int SemanticInformation; + external CSSM_VERSION Version; @uint32() - external int NumberOfAttributes; + external int SubserviceId; - external CSSM_DB_ATTRIBUTE_DATA_PTR AttributeData; + @CSSM_SERVICE_TYPE() + external int SubserviceType; } -typedef CSSM_DB_ATTRIBUTE_DATA_PTR = ffi.Pointer; +typedef CSSM_SUBSERVICE_UID = cssm_subservice_uid; +typedef CSSM_SUBSERVICE_UID_PTR = ffi.Pointer; +typedef CSSM_MODULE_EVENT = uint32; +typedef CSSM_MODULE_EVENT_PTR = ffi.Pointer; +typedef CSSM_API_ModuleEventHandlerFunction = CSSM_RETURN Function( + ffi.Pointer ModuleGuid, + ffi.Pointer AppNotifyCallbackCtx, + uint32 SubserviceId, + CSSM_SERVICE_TYPE ServiceType, + CSSM_MODULE_EVENT EventType); +typedef DartCSSM_API_ModuleEventHandlerFunction = Dartsint32 Function( + ffi.Pointer ModuleGuid, + ffi.Pointer AppNotifyCallbackCtx, + Dartuint32 SubserviceId, + Dartuint32 ServiceType, + Dartuint32 EventType); +typedef CSSM_API_ModuleEventHandler + = ffi.Pointer>; +typedef CSSM_ATTACH_FLAGS = uint32; +typedef CSSM_PRIVILEGE = uint64; +typedef CSSM_USEE_TAG = CSSM_PRIVILEGE; +typedef CSSM_NET_ADDRESS_TYPE = uint32; -final class cssm_db_parsing_module_info extends ffi.Struct { - @CSSM_DB_RECORDTYPE() - external int RecordType; +final class cssm_net_address extends ffi.Struct { + @CSSM_NET_ADDRESS_TYPE() + external int AddressType; - external CSSM_SUBSERVICE_UID ModuleSubserviceUid; + external SecAsn1Item Address; } -final class cssm_db_index_info extends ffi.Struct { - @CSSM_DB_INDEX_TYPE() - external int IndexType; +typedef CSSM_NET_ADDRESS = cssm_net_address; +typedef CSSM_NET_ADDRESS_PTR = ffi.Pointer; +typedef CSSM_NET_PROTOCOL = uint32; +typedef CSSM_CALLBACKFunction = CSSM_RETURN Function( + CSSM_DATA_PTR OutData, ffi.Pointer CallerCtx); +typedef DartCSSM_CALLBACKFunction = Dartsint32 Function( + CSSM_DATA_PTR OutData, ffi.Pointer CallerCtx); +typedef CSSM_CALLBACK = ffi.Pointer>; - @CSSM_DB_INDEXED_DATA_LOCATION() - external int IndexedDataLocation; +final class cssm_crypto_data extends ffi.Struct { + external SecAsn1Item Param; - external CSSM_DB_ATTRIBUTE_INFO Info; + external CSSM_CALLBACK Callback; + + external ffi.Pointer CallerCtx; } -typedef CSSM_DB_INDEX_TYPE = uint32; -typedef CSSM_DB_INDEXED_DATA_LOCATION = uint32; +typedef CSSM_CRYPTO_DATA = cssm_crypto_data; +typedef CSSM_CRYPTO_DATA_PTR = ffi.Pointer; +typedef CSSM_WORDID_TYPE = sint32; +typedef CSSM_LIST_ELEMENT_TYPE = uint32; +typedef CSSM_LIST_ELEMENT_TYPE_PTR = ffi.Pointer; +typedef CSSM_LIST_TYPE = uint32; +typedef CSSM_LIST_TYPE_PTR = ffi.Pointer; +typedef CSSM_LIST_ELEMENT_PTR = ffi.Pointer; -final class cssm_db_unique_record extends ffi.Struct { - external CSSM_DB_INDEX_INFO RecordLocator; +final class cssm_list extends ffi.Struct { + @CSSM_LIST_TYPE() + external int ListType; - external SecAsn1Item RecordIdentifier; -} + external CSSM_LIST_ELEMENT_PTR Head; -typedef CSSM_DB_INDEX_INFO = cssm_db_index_info; + external CSSM_LIST_ELEMENT_PTR Tail; +} -final class cssm_db_record_index_info extends ffi.Struct { - @CSSM_DB_RECORDTYPE() - external int DataRecordType; +typedef CSSM_LIST = cssm_list; - @uint32() - external int NumberOfIndexes; +final class UnnamedUnion2 extends ffi.Union { + external CSSM_LIST Sublist; - external CSSM_DB_INDEX_INFO_PTR IndexInfo; + external SecAsn1Item Word; } -typedef CSSM_DB_INDEX_INFO_PTR = ffi.Pointer; +final class cssm_list_element extends ffi.Struct { + external ffi.Pointer NextElement; -final class cssm_dbinfo extends ffi.Struct { - @uint32() - external int NumberOfRecordTypes; + @CSSM_WORDID_TYPE() + external int WordID; - external CSSM_DB_PARSING_MODULE_INFO_PTR DefaultParsingModules; + @CSSM_LIST_ELEMENT_TYPE() + external int ElementType; - external CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR RecordAttributeNames; + external UnnamedUnion2 Element; +} - external CSSM_DB_RECORD_INDEX_INFO_PTR RecordIndexes; +typedef CSSM_LIST_PTR = ffi.Pointer; +typedef CSSM_LIST_ELEMENT = cssm_list_element; + +final class CSSM_TUPLE extends ffi.Struct { + external CSSM_LIST Issuer; + + external CSSM_LIST Subject; @CSSM_BOOL() - external int IsLocal; + external int Delegate; - external ffi.Pointer AccessPath; + external CSSM_LIST AuthorizationTag; - external ffi.Pointer Reserved; + external CSSM_LIST ValidityPeriod; } -typedef CSSM_DB_PARSING_MODULE_INFO_PTR - = ffi.Pointer; -typedef CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR - = ffi.Pointer; -typedef CSSM_DB_RECORD_INDEX_INFO_PTR = ffi.Pointer; +typedef CSSM_TUPLE_PTR = ffi.Pointer; -final class cssm_selection_predicate extends ffi.Struct { - @CSSM_DB_OPERATOR() - external int DbOperator; +final class cssm_tuplegroup extends ffi.Struct { + @uint32() + external int NumberOfTuples; - external CSSM_DB_ATTRIBUTE_DATA Attribute; + external CSSM_TUPLE_PTR Tuples; } -typedef CSSM_DB_OPERATOR = uint32; -typedef CSSM_DB_ATTRIBUTE_DATA = cssm_db_attribute_data; +typedef CSSM_TUPLEGROUP = cssm_tuplegroup; +typedef CSSM_TUPLEGROUP_PTR = ffi.Pointer; +typedef CSSM_SAMPLE_TYPE = CSSM_WORDID_TYPE; -final class cssm_query_limits extends ffi.Struct { - @uint32() - external int TimeLimit; +final class cssm_sample extends ffi.Struct { + external CSSM_LIST TypedSample; - @uint32() - external int SizeLimit; + external ffi.Pointer Verifier; } -final class cssm_query extends ffi.Struct { - @CSSM_DB_RECORDTYPE() - external int RecordType; - - @CSSM_DB_CONJUNCTIVE() - external int Conjunctive; +typedef CSSM_SAMPLE = cssm_sample; +typedef CSSM_SAMPLE_PTR = ffi.Pointer; +final class cssm_samplegroup extends ffi.Struct { @uint32() - external int NumSelectionPredicates; + external int NumberOfSamples; - external CSSM_SELECTION_PREDICATE_PTR SelectionPredicate; + external ffi.Pointer Samples; +} - external CSSM_QUERY_LIMITS QueryLimits; +typedef CSSM_SAMPLEGROUP = cssm_samplegroup; +typedef CSSM_SAMPLEGROUP_PTR = ffi.Pointer; +typedef CSSM_MALLOCFunction = ffi.Pointer Function( + CSSM_SIZE size, ffi.Pointer allocref); +typedef DartCSSM_MALLOCFunction = ffi.Pointer Function( + DartCSSM_SIZE size, ffi.Pointer allocref); +typedef CSSM_MALLOC = ffi.Pointer>; +typedef CSSM_FREEFunction = ffi.Void Function( + ffi.Pointer memblock, ffi.Pointer allocref); +typedef DartCSSM_FREEFunction = void Function( + ffi.Pointer memblock, ffi.Pointer allocref); +typedef CSSM_FREE = ffi.Pointer>; +typedef CSSM_REALLOCFunction = ffi.Pointer Function( + ffi.Pointer memblock, + CSSM_SIZE size, + ffi.Pointer allocref); +typedef DartCSSM_REALLOCFunction = ffi.Pointer Function( + ffi.Pointer memblock, + DartCSSM_SIZE size, + ffi.Pointer allocref); +typedef CSSM_REALLOC = ffi.Pointer>; +typedef CSSM_CALLOCFunction = ffi.Pointer Function( + uint32 num, CSSM_SIZE size, ffi.Pointer allocref); +typedef DartCSSM_CALLOCFunction = ffi.Pointer Function( + Dartuint32 num, DartCSSM_SIZE size, ffi.Pointer allocref); +typedef CSSM_CALLOC = ffi.Pointer>; - @CSSM_QUERY_FLAGS() - external int QueryFlags; -} +final class cssm_memory_funcs extends ffi.Struct { + external CSSM_MALLOC malloc_func; -typedef CSSM_DB_CONJUNCTIVE = uint32; -typedef CSSM_SELECTION_PREDICATE_PTR = ffi.Pointer; -typedef CSSM_QUERY_LIMITS = cssm_query_limits; -typedef CSSM_QUERY_FLAGS = uint32; + external CSSM_FREE free_func; -final class cssm_dl_pkcs11_attributes extends ffi.Struct { - @uint32() - external int DeviceAccessFlags; -} + external CSSM_REALLOC realloc_func; -final class cssm_name_list extends ffi.Struct { - @uint32() - external int NumStrings; + external CSSM_CALLOC calloc_func; - external ffi.Pointer> String; + external ffi.Pointer AllocRef; } -final class cssm_db_schema_attribute_info extends ffi.Struct { - @uint32() - external int AttributeId; +typedef CSSM_MEMORY_FUNCS = cssm_memory_funcs; +typedef CSSM_MEMORY_FUNCS_PTR = ffi.Pointer; +typedef CSSM_API_MEMORY_FUNCS = CSSM_MEMORY_FUNCS; +typedef CSSM_API_MEMORY_FUNCS_PTR = ffi.Pointer; +typedef CSSM_CHALLENGE_CALLBACKFunction = CSSM_RETURN Function( + ffi.Pointer Challenge, + CSSM_SAMPLEGROUP_PTR Response, + ffi.Pointer CallerCtx, + ffi.Pointer MemFuncs); +typedef DartCSSM_CHALLENGE_CALLBACKFunction = Dartsint32 Function( + ffi.Pointer Challenge, + CSSM_SAMPLEGROUP_PTR Response, + ffi.Pointer CallerCtx, + ffi.Pointer MemFuncs); +typedef CSSM_CHALLENGE_CALLBACK + = ffi.Pointer>; +typedef CSSM_CERT_TYPE = uint32; +typedef CSSM_CERT_TYPE_PTR = ffi.Pointer; +typedef CSSM_CERT_ENCODING = uint32; +typedef CSSM_CERT_ENCODING_PTR = ffi.Pointer; - external ffi.Pointer AttributeName; +final class cssm_encoded_cert extends ffi.Struct { + @CSSM_CERT_TYPE() + external int CertType; - external SecAsn1Oid AttributeNameID; + @CSSM_CERT_ENCODING() + external int CertEncoding; - @CSSM_DB_ATTRIBUTE_FORMAT() - external int DataType; + external SecAsn1Item CertBlob; } -final class cssm_db_schema_index_info extends ffi.Struct { - @uint32() - external int AttributeId; +typedef CSSM_ENCODED_CERT = cssm_encoded_cert; +typedef CSSM_ENCODED_CERT_PTR = ffi.Pointer; +typedef CSSM_CERT_PARSE_FORMAT = uint32; +typedef CSSM_CERT_PARSE_FORMAT_PTR = ffi.Pointer; - @uint32() - external int IndexId; +final class cssm_parsed_cert extends ffi.Struct { + @CSSM_CERT_TYPE() + external int CertType; - @CSSM_DB_INDEX_TYPE() - external int IndexType; + @CSSM_CERT_PARSE_FORMAT() + external int ParsedCertFormat; - @CSSM_DB_INDEXED_DATA_LOCATION() - external int IndexedDataLocation; + external ffi.Pointer ParsedCert; } -final class cssm_x509_type_value_pair extends ffi.Struct { - external SecAsn1Oid type; +typedef CSSM_PARSED_CERT = cssm_parsed_cert; +typedef CSSM_PARSED_CERT_PTR = ffi.Pointer; - @CSSM_BER_TAG() - external int valueType; +final class cssm_cert_pair extends ffi.Struct { + external CSSM_ENCODED_CERT EncodedCert; - external SecAsn1Item value; + external CSSM_PARSED_CERT ParsedCert; } -typedef CSSM_BER_TAG = uint8; - -final class cssm_x509_rdn extends ffi.Struct { - @uint32() - external int numberOfPairs; +typedef CSSM_CERT_PAIR = cssm_cert_pair; +typedef CSSM_CERT_PAIR_PTR = ffi.Pointer; +typedef CSSM_CERTGROUP_TYPE = uint32; +typedef CSSM_CERTGROUP_TYPE_PTR = ffi.Pointer; - external CSSM_X509_TYPE_VALUE_PAIR_PTR AttributeTypeAndValue; -} +final class UnnamedUnion3 extends ffi.Union { + external CSSM_DATA_PTR CertList; -typedef CSSM_X509_TYPE_VALUE_PAIR_PTR = ffi.Pointer; + external CSSM_ENCODED_CERT_PTR EncodedCertList; -final class cssm_x509_name extends ffi.Struct { - @uint32() - external int numberOfRDNs; + external CSSM_PARSED_CERT_PTR ParsedCertList; - external CSSM_X509_RDN_PTR RelativeDistinguishedName; + external CSSM_CERT_PAIR_PTR PairCertList; } -typedef CSSM_X509_RDN_PTR = ffi.Pointer; - -final class cssm_x509_time extends ffi.Struct { - @CSSM_BER_TAG() - external int timeType; +final class cssm_certgroup extends ffi.Struct { + @CSSM_CERT_TYPE() + external int CertType; - external SecAsn1Item time; -} + @CSSM_CERT_ENCODING() + external int CertEncoding; -final class x509_validity extends ffi.Struct { - external CSSM_X509_TIME notBefore; + @uint32() + external int NumCerts; - external CSSM_X509_TIME notAfter; + external UnnamedUnion3 GroupList; + + @CSSM_CERTGROUP_TYPE() + external int CertGroupType; + + external ffi.Pointer Reserved; } -typedef CSSM_X509_TIME = cssm_x509_time; +typedef CSSM_CERTGROUP = cssm_certgroup; +typedef CSSM_CERTGROUP_PTR = ffi.Pointer; -final class cssm_x509ext_basicConstraints extends ffi.Struct { - @CSSM_BOOL() - external int cA; +final class cssm_base_certs extends ffi.Struct { + @CSSM_TP_HANDLE() + external int TPHandle; - @CSSM_X509_OPTION() - external int pathLenConstraintPresent; + @CSSM_CL_HANDLE() + external int CLHandle; - @uint32() - external int pathLenConstraint; + external CSSM_CERTGROUP Certs; } -typedef CSSM_X509_OPTION = CSSM_BOOL; +typedef CSSM_BASE_CERTS = cssm_base_certs; +typedef CSSM_BASE_CERTS_PTR = ffi.Pointer; -final class cssm_x509_extensionTagAndValue extends ffi.Struct { - @CSSM_BER_TAG() - external int type; +final class cssm_access_credentials extends ffi.Struct { + @ffi.Array.multi([68]) + external ffi.Array EntryTag; - external SecAsn1Item value; -} + external CSSM_BASE_CERTS BaseCerts; -final class cssm_x509ext_pair extends ffi.Struct { - external CSSM_X509EXT_TAGandVALUE tagAndValue; + external CSSM_SAMPLEGROUP Samples; - external ffi.Pointer parsedValue; -} + external CSSM_CHALLENGE_CALLBACK Callback; -typedef CSSM_X509EXT_TAGandVALUE = cssm_x509_extensionTagAndValue; + external ffi.Pointer CallerCtx; +} -final class cssm_x509_extension extends ffi.Struct { - external SecAsn1Oid extnId; +typedef CSSM_ACCESS_CREDENTIALS = cssm_access_credentials; +typedef CSSM_ACCESS_CREDENTIALS_PTR = ffi.Pointer; +typedef CSSM_ACL_SUBJECT_TYPE = sint32; +typedef CSSM_ACL_AUTHORIZATION_TAG = sint32; - @CSSM_BOOL() - external int critical; +final class cssm_authorizationgroup extends ffi.Struct { + @uint32() + external int NumberOfAuthTags; - @ffi.UnsignedInt() - external int formatAsInt; + external ffi.Pointer AuthTags; +} - extension_data_format get format => - extension_data_format.fromValue(formatAsInt); +typedef CSSM_AUTHORIZATIONGROUP = cssm_authorizationgroup; +typedef CSSM_AUTHORIZATIONGROUP_PTR = ffi.Pointer; - external cssm_x509ext_value value; +final class cssm_acl_validity_period extends ffi.Struct { + external SecAsn1Item StartDate; - external SecAsn1Item BERvalue; + external SecAsn1Item EndDate; } -enum extension_data_format { - CSSM_X509_DATAFORMAT_ENCODED(0), - CSSM_X509_DATAFORMAT_PARSED(1), - CSSM_X509_DATAFORMAT_PAIR(2); +typedef CSSM_ACL_VALIDITY_PERIOD = cssm_acl_validity_period; +typedef CSSM_ACL_VALIDITY_PERIOD_PTR = ffi.Pointer; - final int value; - const extension_data_format(this.value); +final class cssm_acl_entry_prototype extends ffi.Struct { + external CSSM_LIST TypedSubject; - static extension_data_format fromValue(int value) => switch (value) { - 0 => CSSM_X509_DATAFORMAT_ENCODED, - 1 => CSSM_X509_DATAFORMAT_PARSED, - 2 => CSSM_X509_DATAFORMAT_PAIR, - _ => throw ArgumentError( - "Unknown value for extension_data_format: $value"), - }; -} + @CSSM_BOOL() + external int Delegate; -final class cssm_x509ext_value extends ffi.Union { - external ffi.Pointer tagAndValue; + external CSSM_AUTHORIZATIONGROUP Authorization; - external ffi.Pointer parsedValue; + external CSSM_ACL_VALIDITY_PERIOD TimeRange; - external ffi.Pointer valuePair; + @ffi.Array.multi([68]) + external ffi.Array EntryTag; } -typedef CSSM_X509EXT_PAIR = cssm_x509ext_pair; +typedef CSSM_ACL_ENTRY_PROTOTYPE = cssm_acl_entry_prototype; +typedef CSSM_ACL_ENTRY_PROTOTYPE_PTR = ffi.Pointer; -final class cssm_x509_extensions extends ffi.Struct { - @uint32() - external int numberOfExtensions; +final class cssm_acl_owner_prototype extends ffi.Struct { + external CSSM_LIST TypedSubject; - external CSSM_X509_EXTENSION_PTR extensions; + @CSSM_BOOL() + external int Delegate; } -typedef CSSM_X509_EXTENSION_PTR = ffi.Pointer; - -final class cssm_x509_tbs_certificate extends ffi.Struct { - external SecAsn1Item version; +typedef CSSM_ACL_OWNER_PROTOTYPE = cssm_acl_owner_prototype; +typedef CSSM_ACL_OWNER_PROTOTYPE_PTR = ffi.Pointer; +typedef CSSM_ACL_SUBJECT_CALLBACKFunction = CSSM_RETURN Function( + ffi.Pointer SubjectRequest, + CSSM_LIST_PTR SubjectResponse, + ffi.Pointer CallerContext, + ffi.Pointer MemFuncs); +typedef DartCSSM_ACL_SUBJECT_CALLBACKFunction = Dartsint32 Function( + ffi.Pointer SubjectRequest, + CSSM_LIST_PTR SubjectResponse, + ffi.Pointer CallerContext, + ffi.Pointer MemFuncs); +typedef CSSM_ACL_SUBJECT_CALLBACK + = ffi.Pointer>; - external SecAsn1Item serialNumber; +final class cssm_acl_entry_input extends ffi.Struct { + external CSSM_ACL_ENTRY_PROTOTYPE Prototype; - external SecAsn1AlgId signature; + external CSSM_ACL_SUBJECT_CALLBACK Callback; - external CSSM_X509_NAME issuer; + external ffi.Pointer CallerContext; +} - external CSSM_X509_VALIDITY validity; +typedef CSSM_ACL_ENTRY_INPUT = cssm_acl_entry_input; +typedef CSSM_ACL_ENTRY_INPUT_PTR = ffi.Pointer; - external CSSM_X509_NAME subject; +final class cssm_resource_control_context extends ffi.Struct { + external CSSM_ACCESS_CREDENTIALS_PTR AccessCred; - external SecAsn1PubKeyInfo subjectPublicKeyInfo; + external CSSM_ACL_ENTRY_INPUT InitialAclEntry; +} - external SecAsn1Item issuerUniqueIdentifier; +typedef CSSM_RESOURCE_CONTROL_CONTEXT = cssm_resource_control_context; +typedef CSSM_RESOURCE_CONTROL_CONTEXT_PTR + = ffi.Pointer; +typedef CSSM_ACL_HANDLE = CSSM_HANDLE; - external SecAsn1Item subjectUniqueIdentifier; +final class cssm_acl_entry_info extends ffi.Struct { + external CSSM_ACL_ENTRY_PROTOTYPE EntryPublicInfo; - external CSSM_X509_EXTENSIONS extensions; + @CSSM_ACL_HANDLE() + external int EntryHandle; } -typedef CSSM_X509_NAME = cssm_x509_name; -typedef CSSM_X509_VALIDITY = x509_validity; -typedef CSSM_X509_EXTENSIONS = cssm_x509_extensions; +typedef CSSM_ACL_ENTRY_INFO = cssm_acl_entry_info; +typedef CSSM_ACL_ENTRY_INFO_PTR = ffi.Pointer; +typedef CSSM_ACL_EDIT_MODE = uint32; -final class cssm_x509_signature extends ffi.Struct { - external SecAsn1AlgId algorithmIdentifier; +final class cssm_acl_edit extends ffi.Struct { + @CSSM_ACL_EDIT_MODE() + external int EditMode; - external SecAsn1Item encrypted; + @CSSM_ACL_HANDLE() + external int OldEntryHandle; + + external ffi.Pointer NewEntry; } -final class cssm_x509_signed_certificate extends ffi.Struct { - external CSSM_X509_TBS_CERTIFICATE certificate; +typedef CSSM_ACL_EDIT = cssm_acl_edit; +typedef CSSM_ACL_EDIT_PTR = ffi.Pointer; +typedef CSSM_PROC_ADDRFunction = ffi.Void Function(); +typedef DartCSSM_PROC_ADDRFunction = void Function(); +typedef CSSM_PROC_ADDR + = ffi.Pointer>; +typedef CSSM_PROC_ADDR_PTR = ffi.Pointer; - external CSSM_X509_SIGNATURE signature; +final class cssm_func_name_addr extends ffi.Struct { + @ffi.Array.multi([68]) + external ffi.Array Name; + + external CSSM_PROC_ADDR Address; } -typedef CSSM_X509_TBS_CERTIFICATE = cssm_x509_tbs_certificate; -typedef CSSM_X509_SIGNATURE = cssm_x509_signature; +typedef CSSM_FUNC_NAME_ADDR = cssm_func_name_addr; +typedef CSSM_FUNC_NAME_ADDR_PTR = ffi.Pointer; -final class cssm_x509ext_policyQualifierInfo extends ffi.Struct { - external SecAsn1Oid policyQualifierId; +final class cssm_date extends ffi.Struct { + @ffi.Array.multi([4]) + external ffi.Array Year; - external SecAsn1Item value; + @ffi.Array.multi([2]) + external ffi.Array Month; + + @ffi.Array.multi([2]) + external ffi.Array Day; } -final class cssm_x509ext_policyQualifiers extends ffi.Struct { +typedef CSSM_DATE = cssm_date; +typedef CSSM_DATE_PTR = ffi.Pointer; + +final class cssm_range extends ffi.Struct { @uint32() - external int numberOfPolicyQualifiers; + external int Min; - external ffi.Pointer policyQualifier; + @uint32() + external int Max; } -typedef CSSM_X509EXT_POLICYQUALIFIERINFO = cssm_x509ext_policyQualifierInfo; +typedef CSSM_RANGE = cssm_range; +typedef CSSM_RANGE_PTR = ffi.Pointer; -final class cssm_x509ext_policyInfo extends ffi.Struct { - external SecAsn1Oid policyIdentifier; +final class cssm_query_size_data extends ffi.Struct { + @uint32() + external int SizeInputBlock; - external CSSM_X509EXT_POLICYQUALIFIERS policyQualifiers; + @uint32() + external int SizeOutputBlock; } -typedef CSSM_X509EXT_POLICYQUALIFIERS = cssm_x509ext_policyQualifiers; - -final class cssm_x509_revoked_cert_entry extends ffi.Struct { - external SecAsn1Item certificateSerialNumber; +typedef CSSM_QUERY_SIZE_DATA = cssm_query_size_data; +typedef CSSM_QUERY_SIZE_DATA_PTR = ffi.Pointer; +typedef CSSM_HEADERVERSION = uint32; - external CSSM_X509_TIME revocationDate; +final class cssm_key_size extends ffi.Struct { + @uint32() + external int LogicalKeySizeInBits; - external CSSM_X509_EXTENSIONS extensions; + @uint32() + external int EffectiveKeySizeInBits; } -final class cssm_x509_revoked_cert_list extends ffi.Struct { - @uint32() - external int numberOfRevokedCertEntries; +typedef CSSM_KEY_SIZE = cssm_key_size; +typedef CSSM_KEY_SIZE_PTR = ffi.Pointer; +typedef CSSM_KEYBLOB_TYPE = uint32; +typedef CSSM_KEYBLOB_FORMAT = uint32; +typedef CSSM_KEYCLASS = uint32; +typedef CSSM_KEYATTR_FLAGS = uint32; +typedef CSSM_KEYUSE = uint32; +typedef CSSM_ALGORITHMS = uint32; +typedef CSSM_ENCRYPT_MODE = uint32; - external CSSM_X509_REVOKED_CERT_ENTRY_PTR revokedCertEntry; -} +final class cssm_keyheader extends ffi.Struct { + @CSSM_HEADERVERSION() + external int HeaderVersion; -typedef CSSM_X509_REVOKED_CERT_ENTRY_PTR - = ffi.Pointer; + external CSSM_GUID CspId; -final class cssm_x509_tbs_certlist extends ffi.Struct { - external SecAsn1Item version; + @CSSM_KEYBLOB_TYPE() + external int BlobType; - external SecAsn1AlgId signature; + @CSSM_KEYBLOB_FORMAT() + external int Format; - external CSSM_X509_NAME issuer; + @CSSM_ALGORITHMS() + external int AlgorithmId; - external CSSM_X509_TIME thisUpdate; + @CSSM_KEYCLASS() + external int KeyClass; - external CSSM_X509_TIME nextUpdate; + @uint32() + external int LogicalKeySizeInBits; - external CSSM_X509_REVOKED_CERT_LIST_PTR revokedCertificates; + @CSSM_KEYATTR_FLAGS() + external int KeyAttr; - external CSSM_X509_EXTENSIONS extensions; -} + @CSSM_KEYUSE() + external int KeyUsage; -typedef CSSM_X509_REVOKED_CERT_LIST_PTR - = ffi.Pointer; + external CSSM_DATE StartDate; -final class cssm_x509_signed_crl extends ffi.Struct { - external CSSM_X509_TBS_CERTLIST tbsCertList; + external CSSM_DATE EndDate; - external CSSM_X509_SIGNATURE signature; + @CSSM_ALGORITHMS() + external int WrapAlgorithmId; + + @CSSM_ENCRYPT_MODE() + external int WrapMode; + + @uint32() + external int Reserved; } -typedef CSSM_X509_TBS_CERTLIST = cssm_x509_tbs_certlist; +typedef CSSM_KEYHEADER = cssm_keyheader; +typedef CSSM_KEYHEADER_PTR = ffi.Pointer; -final class __CE_OtherName extends ffi.Struct { - external SecAsn1Oid typeId; +final class cssm_key extends ffi.Struct { + external CSSM_KEYHEADER KeyHeader; - external SecAsn1Item value; + external SecAsn1Item KeyData; } -final class __CE_GeneralName extends ffi.Struct { - @ffi.UnsignedInt() - external int nameTypeAsInt; - - __CE_GeneralNameType get nameType => - __CE_GeneralNameType.fromValue(nameTypeAsInt); +typedef CSSM_KEY = cssm_key; +typedef CSSM_KEY_PTR = ffi.Pointer; +typedef CSSM_WRAP_KEY = CSSM_KEY; +typedef CSSM_WRAP_KEY_PTR = ffi.Pointer; +typedef CSSM_CSPTYPE = uint32; - @CSSM_BOOL() - external int berEncoded; +final class cssm_dl_db_handle extends ffi.Struct { + @CSSM_DL_HANDLE() + external int DLHandle; - external SecAsn1Item name; + @CSSM_DB_HANDLE() + external int DBHandle; } -enum __CE_GeneralNameType { - GNT_OtherName(0), - GNT_RFC822Name(1), - GNT_DNSName(2), - GNT_X400Address(3), - GNT_DirectoryName(4), - GNT_EdiPartyName(5), - GNT_URI(6), - GNT_IPAddress(7), - GNT_RegisteredID(8); +typedef CSSM_DL_DB_HANDLE = cssm_dl_db_handle; +typedef CSSM_DL_DB_HANDLE_PTR = ffi.Pointer; +typedef CSSM_CONTEXT_TYPE = uint32; +typedef CSSM_ATTRIBUTE_TYPE = uint32; +typedef CSSM_PADDING = uint32; +typedef CSSM_KEY_TYPE = CSSM_ALGORITHMS; - final int value; - const __CE_GeneralNameType(this.value); +final class cssm_kr_profile extends ffi.Opaque {} - static __CE_GeneralNameType fromValue(int value) => switch (value) { - 0 => GNT_OtherName, - 1 => GNT_RFC822Name, - 2 => GNT_DNSName, - 3 => GNT_X400Address, - 4 => GNT_DirectoryName, - 5 => GNT_EdiPartyName, - 6 => GNT_URI, - 7 => GNT_IPAddress, - 8 => GNT_RegisteredID, - _ => - throw ArgumentError("Unknown value for __CE_GeneralNameType: $value"), - }; -} +final class cssm_context_attribute_value extends ffi.Union { + external ffi.Pointer String; -final class __CE_GeneralNames extends ffi.Struct { @uint32() - external int numNames; + external int Uint32; - external ffi.Pointer generalName; -} + external CSSM_ACCESS_CREDENTIALS_PTR AccessCredentials; -typedef CE_GeneralName = __CE_GeneralName; + external CSSM_KEY_PTR Key; -final class __CE_AuthorityKeyID extends ffi.Struct { - @CSSM_BOOL() - external int keyIdentifierPresent; + external CSSM_DATA_PTR Data; - external SecAsn1Item keyIdentifier; + @CSSM_PADDING() + external int Padding; - @CSSM_BOOL() - external int generalNamesPresent; + external CSSM_DATE_PTR Date; - external ffi.Pointer generalNames; + external CSSM_RANGE_PTR Range; - @CSSM_BOOL() - external int serialNumberPresent; + external CSSM_CRYPTO_DATA_PTR CryptoData; - external SecAsn1Item serialNumber; + external CSSM_VERSION_PTR Version; + + external CSSM_DL_DB_HANDLE_PTR DLDBHandle; + + external ffi.Pointer KRProfile; } -typedef CE_GeneralNames = __CE_GeneralNames; +final class cssm_context_attribute extends ffi.Struct { + @CSSM_ATTRIBUTE_TYPE() + external int AttributeType; -final class __CE_ExtendedKeyUsage extends ffi.Struct { @uint32() - external int numPurposes; + external int AttributeLength; - external CSSM_OID_PTR purposes; + external cssm_context_attribute_value Attribute; } -typedef CSSM_OID_PTR = ffi.Pointer; +typedef CSSM_CONTEXT_ATTRIBUTE = cssm_context_attribute; +typedef CSSM_CONTEXT_ATTRIBUTE_PTR = ffi.Pointer; -final class __CE_BasicConstraints extends ffi.Struct { - @CSSM_BOOL() - external int cA; +final class cssm_context extends ffi.Struct { + @CSSM_CONTEXT_TYPE() + external int ContextType; - @CSSM_BOOL() - external int pathLenConstraintPresent; + @CSSM_ALGORITHMS() + external int AlgorithmType; @uint32() - external int pathLenConstraint; -} + external int NumberOfAttributes; -final class __CE_PolicyQualifierInfo extends ffi.Struct { - external SecAsn1Oid policyQualifierId; + external CSSM_CONTEXT_ATTRIBUTE_PTR ContextAttributes; - external SecAsn1Item qualifier; -} + @CSSM_CSP_HANDLE() + external int CSPHandle; -final class __CE_PolicyInformation extends ffi.Struct { - external SecAsn1Oid certPolicyId; + @CSSM_BOOL() + external int Privileged; @uint32() - external int numPolicyQualifiers; - - external ffi.Pointer policyQualifiers; -} - -typedef CE_PolicyQualifierInfo = __CE_PolicyQualifierInfo; + external int EncryptionProhibited; -final class __CE_CertPolicies extends ffi.Struct { @uint32() - external int numPolicies; + external int WorkFactor; - external ffi.Pointer policies; + @uint32() + external int Reserved; } -typedef CE_PolicyInformation = __CE_PolicyInformation; - -final class __CE_DistributionPointName extends ffi.Struct { - @ffi.UnsignedInt() - external int nameTypeAsInt; - - __CE_CrlDistributionPointNameType get nameType => - __CE_CrlDistributionPointNameType.fromValue(nameTypeAsInt); +typedef CSSM_CONTEXT = cssm_context; +typedef CSSM_CONTEXT_PTR = ffi.Pointer; +typedef CSSM_SC_FLAGS = uint32; +typedef CSSM_CSP_READER_FLAGS = uint32; +typedef CSSM_CSP_FLAGS = uint32; +typedef CSSM_PKCS_OAEP_MGF = uint32; +typedef CSSM_PKCS_OAEP_PSOURCE = uint32; - external UnnamedUnion5 dpn; -} +final class cssm_pkcs1_oaep_params extends ffi.Struct { + @uint32() + external int HashAlgorithm; -enum __CE_CrlDistributionPointNameType { - CE_CDNT_FullName(0), - CE_CDNT_NameRelativeToCrlIssuer(1); + external SecAsn1Item HashParams; - final int value; - const __CE_CrlDistributionPointNameType(this.value); + @CSSM_PKCS_OAEP_MGF() + external int MGF; - static __CE_CrlDistributionPointNameType fromValue(int value) => - switch (value) { - 0 => CE_CDNT_FullName, - 1 => CE_CDNT_NameRelativeToCrlIssuer, - _ => throw ArgumentError( - "Unknown value for __CE_CrlDistributionPointNameType: $value"), - }; -} + external SecAsn1Item MGFParams; -final class UnnamedUnion5 extends ffi.Union { - external ffi.Pointer fullName; + @CSSM_PKCS_OAEP_PSOURCE() + external int PSource; - external CSSM_X509_RDN_PTR rdn; + external SecAsn1Item PSourceParams; } -final class __CE_CRLDistributionPoint extends ffi.Struct { - external ffi.Pointer distPointName; +typedef CSSM_PKCS1_OAEP_PARAMS = cssm_pkcs1_oaep_params; +typedef CSSM_PKCS1_OAEP_PARAMS_PTR = ffi.Pointer; +final class cssm_csp_operational_statistics extends ffi.Struct { @CSSM_BOOL() - external int reasonsPresent; - - @CE_CrlDistReasonFlags() - external int reasons; + external int UserAuthenticated; - external ffi.Pointer crlIssuer; -} + @CSSM_CSP_FLAGS() + external int DeviceFlags; -typedef CE_DistributionPointName = __CE_DistributionPointName; -typedef CE_CrlDistReasonFlags = uint8; + @uint32() + external int TokenMaxSessionCount; -final class __CE_CRLDistPointsSyntax extends ffi.Struct { @uint32() - external int numDistPoints; + external int TokenOpenedSessionCount; - external ffi.Pointer distPoints; -} + @uint32() + external int TokenMaxRWSessionCount; -typedef CE_CRLDistributionPoint = __CE_CRLDistributionPoint; + @uint32() + external int TokenOpenedRWSessionCount; -final class __CE_AccessDescription extends ffi.Struct { - external SecAsn1Oid accessMethod; + @uint32() + external int TokenTotalPublicMem; - external CE_GeneralName accessLocation; -} + @uint32() + external int TokenFreePublicMem; -final class __CE_AuthorityInfoAccess extends ffi.Struct { @uint32() - external int numAccessDescriptions; + external int TokenTotalPrivateMem; - external ffi.Pointer accessDescriptions; + @uint32() + external int TokenFreePrivateMem; } -typedef CE_AccessDescription = __CE_AccessDescription; +typedef CSSM_CSP_OPERATIONAL_STATISTICS = cssm_csp_operational_statistics; +typedef CSSM_CSP_OPERATIONAL_STATISTICS_PTR + = ffi.Pointer; -final class __CE_SemanticsInformation extends ffi.Struct { - external ffi.Pointer semanticsIdentifier; +final class cssm_pkcs5_pbkdf1_params extends ffi.Struct { + external SecAsn1Item Passphrase; - external ffi.Pointer - nameRegistrationAuthorities; + external SecAsn1Item InitVector; } -typedef CE_NameRegistrationAuthorities = CE_GeneralNames; +typedef CSSM_PKCS5_PBKDF1_PARAMS = cssm_pkcs5_pbkdf1_params; +typedef CSSM_PKCS5_PBKDF1_PARAMS_PTR = ffi.Pointer; +typedef CSSM_PKCS5_PBKDF2_PRF = uint32; -final class __CE_QC_Statement extends ffi.Struct { - external SecAsn1Oid statementId; +final class cssm_pkcs5_pbkdf2_params extends ffi.Struct { + external SecAsn1Item Passphrase; - external ffi.Pointer semanticsInfo; - - external ffi.Pointer otherInfo; + @CSSM_PKCS5_PBKDF2_PRF() + external int PseudoRandomFunction; } -typedef CE_SemanticsInformation = __CE_SemanticsInformation; +typedef CSSM_PKCS5_PBKDF2_PARAMS = cssm_pkcs5_pbkdf2_params; +typedef CSSM_PKCS5_PBKDF2_PARAMS_PTR = ffi.Pointer; -final class __CE_QC_Statements extends ffi.Struct { - @uint32() - external int numQCStatements; +final class cssm_kea_derive_params extends ffi.Struct { + external SecAsn1Item Rb; - external ffi.Pointer qcStatements; + external SecAsn1Item Yb; } -typedef CE_QC_Statement = __CE_QC_Statement; - -final class __CE_IssuingDistributionPoint extends ffi.Struct { - external ffi.Pointer distPointName; - - @CSSM_BOOL() - external int onlyUserCertsPresent; - - @CSSM_BOOL() - external int onlyUserCerts; - - @CSSM_BOOL() - external int onlyCACertsPresent; +typedef CSSM_KEA_DERIVE_PARAMS = cssm_kea_derive_params; +typedef CSSM_KEA_DERIVE_PARAMS_PTR = ffi.Pointer; - @CSSM_BOOL() - external int onlyCACerts; +final class cssm_tp_authority_id extends ffi.Struct { + external ffi.Pointer AuthorityCert; - @CSSM_BOOL() - external int onlySomeReasonsPresent; + external CSSM_NET_ADDRESS_PTR AuthorityLocation; +} - @CE_CrlDistReasonFlags() - external int onlySomeReasons; +typedef CSSM_TP_AUTHORITY_ID = cssm_tp_authority_id; +typedef CSSM_TP_AUTHORITY_ID_PTR = ffi.Pointer; +typedef CSSM_TP_AUTHORITY_REQUEST_TYPE = uint32; +typedef CSSM_TP_AUTHORITY_REQUEST_TYPE_PTR = ffi.Pointer; +typedef CSSM_TP_VERIFICATION_RESULTS_CALLBACKFunction = CSSM_RETURN Function( + CSSM_MODULE_HANDLE ModuleHandle, + ffi.Pointer CallerCtx, + CSSM_DATA_PTR VerifiedCert); +typedef DartCSSM_TP_VERIFICATION_RESULTS_CALLBACKFunction = Dartsint32 Function( + DartCSSM_INTPTR ModuleHandle, + ffi.Pointer CallerCtx, + CSSM_DATA_PTR VerifiedCert); +typedef CSSM_TP_VERIFICATION_RESULTS_CALLBACK = ffi + .Pointer>; +typedef CSSM_OID_PTR = ffi.Pointer; - @CSSM_BOOL() - external int indirectCrlPresent; +final class cssm_field extends ffi.Struct { + external SecAsn1Oid FieldOid; - @CSSM_BOOL() - external int indirectCrl; + external SecAsn1Item FieldValue; } -final class __CE_GeneralSubtree extends ffi.Struct { - external ffi.Pointer base; +typedef CSSM_FIELD = cssm_field; +typedef CSSM_FIELD_PTR = ffi.Pointer; +final class cssm_tp_policyinfo extends ffi.Struct { @uint32() - external int minimum; + external int NumberOfPolicyIds; - @CSSM_BOOL() - external int maximumPresent; + external CSSM_FIELD_PTR PolicyIds; - @uint32() - external int maximum; + external ffi.Pointer PolicyControl; } -final class __CE_GeneralSubtrees extends ffi.Struct { +typedef CSSM_TP_POLICYINFO = cssm_tp_policyinfo; +typedef CSSM_TP_POLICYINFO_PTR = ffi.Pointer; +typedef CSSM_TP_SERVICES = uint32; +typedef CSSM_TP_ACTION = uint32; +typedef CSSM_TP_STOP_ON = uint32; +typedef CSSM_TIMESTRING = ffi.Pointer; + +final class cssm_dl_db_list extends ffi.Struct { @uint32() - external int numSubtrees; + external int NumHandles; - external ffi.Pointer subtrees; + external CSSM_DL_DB_HANDLE_PTR DLDBHandle; } -typedef CE_GeneralSubtree = __CE_GeneralSubtree; - -final class __CE_NameConstraints extends ffi.Struct { - external ffi.Pointer permitted; +typedef CSSM_DL_DB_LIST = cssm_dl_db_list; +typedef CSSM_DL_DB_LIST_PTR = ffi.Pointer; - external ffi.Pointer excluded; -} +final class cssm_tp_callerauth_context extends ffi.Struct { + external CSSM_TP_POLICYINFO Policy; -typedef CE_GeneralSubtrees = __CE_GeneralSubtrees; + external CSSM_TIMESTRING VerifyTime; -final class __CE_PolicyMapping extends ffi.Struct { - external SecAsn1Oid issuerDomainPolicy; + @CSSM_TP_STOP_ON() + external int VerificationAbortOn; - external SecAsn1Oid subjectDomainPolicy; -} + external CSSM_TP_VERIFICATION_RESULTS_CALLBACK CallbackWithVerifiedCert; -final class __CE_PolicyMappings extends ffi.Struct { @uint32() - external int numPolicyMappings; - - external ffi.Pointer policyMappings; -} - -typedef CE_PolicyMapping = __CE_PolicyMapping; - -final class __CE_PolicyConstraints extends ffi.Struct { - @CSSM_BOOL() - external int requireExplicitPolicyPresent; + external int NumberOfAnchorCerts; - @uint32() - external int requireExplicitPolicy; + external CSSM_DATA_PTR AnchorCerts; - @CSSM_BOOL() - external int inhibitPolicyMappingPresent; + external CSSM_DL_DB_LIST_PTR DBList; - @uint32() - external int inhibitPolicyMapping; + external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; } -final class CE_Data extends ffi.Union { - external CE_AuthorityKeyID authorityKeyID; +typedef CSSM_TP_CALLERAUTH_CONTEXT = cssm_tp_callerauth_context; +typedef CSSM_TP_CALLERAUTH_CONTEXT_PTR + = ffi.Pointer; +typedef CSSM_CRL_PARSE_FORMAT = uint32; +typedef CSSM_CRL_PARSE_FORMAT_PTR = ffi.Pointer; +typedef CSSM_CRL_TYPE = uint32; +typedef CSSM_CRL_TYPE_PTR = ffi.Pointer; +typedef CSSM_CRL_ENCODING = uint32; +typedef CSSM_CRL_ENCODING_PTR = ffi.Pointer; - external CE_SubjectKeyID subjectKeyID; +final class cssm_encoded_crl extends ffi.Struct { + @CSSM_CRL_TYPE() + external int CrlType; - @CE_KeyUsage() - external int keyUsage; + @CSSM_CRL_ENCODING() + external int CrlEncoding; - external CE_GeneralNames subjectAltName; + external SecAsn1Item CrlBlob; +} - external CE_GeneralNames issuerAltName; +typedef CSSM_ENCODED_CRL = cssm_encoded_crl; +typedef CSSM_ENCODED_CRL_PTR = ffi.Pointer; - external CE_ExtendedKeyUsage extendedKeyUsage; +final class cssm_parsed_crl extends ffi.Struct { + @CSSM_CRL_TYPE() + external int CrlType; - external CE_BasicConstraints basicConstraints; + @CSSM_CRL_PARSE_FORMAT() + external int ParsedCrlFormat; - external CE_CertPolicies certPolicies; + external ffi.Pointer ParsedCrl; +} - @CE_NetscapeCertType() - external int netscapeCertType; +typedef CSSM_PARSED_CRL = cssm_parsed_crl; +typedef CSSM_PARSED_CRL_PTR = ffi.Pointer; - @CE_CrlNumber() - external int crlNumber; +final class cssm_crl_pair extends ffi.Struct { + external CSSM_ENCODED_CRL EncodedCrl; - @CE_DeltaCrl() - external int deltaCrl; + external CSSM_PARSED_CRL ParsedCrl; +} - @CE_CrlReason() - external int crlReason; +typedef CSSM_CRL_PAIR = cssm_crl_pair; +typedef CSSM_CRL_PAIR_PTR = ffi.Pointer; +typedef CSSM_CRLGROUP_TYPE = uint32; +typedef CSSM_CRLGROUP_TYPE_PTR = ffi.Pointer; - external CE_CRLDistPointsSyntax crlDistPoints; +final class UnnamedUnion4 extends ffi.Union { + external CSSM_DATA_PTR CrlList; - external CE_IssuingDistributionPoint issuingDistPoint; + external CSSM_ENCODED_CRL_PTR EncodedCrlList; - external CE_AuthorityInfoAccess authorityInfoAccess; + external CSSM_PARSED_CRL_PTR ParsedCrlList; - external CE_QC_Statements qualifiedCertStatements; + external CSSM_CRL_PAIR_PTR PairCrlList; +} - external CE_NameConstraints nameConstraints; +final class cssm_crlgroup extends ffi.Struct { + @CSSM_CRL_TYPE() + external int CrlType; - external CE_PolicyMappings policyMappings; + @CSSM_CRL_ENCODING() + external int CrlEncoding; - external CE_PolicyConstraints policyConstraints; + @uint32() + external int NumberOfCrls; - @CE_InhibitAnyPolicy() - external int inhibitAnyPolicy; + external UnnamedUnion4 GroupCrlList; - external SecAsn1Item rawData; + @CSSM_CRLGROUP_TYPE() + external int CrlGroupType; } -typedef CE_AuthorityKeyID = __CE_AuthorityKeyID; -typedef CE_SubjectKeyID = SecAsn1Item; -typedef CE_KeyUsage = uint16; -typedef CE_ExtendedKeyUsage = __CE_ExtendedKeyUsage; -typedef CE_BasicConstraints = __CE_BasicConstraints; -typedef CE_CertPolicies = __CE_CertPolicies; -typedef CE_NetscapeCertType = uint16; -typedef CE_CrlNumber = uint32; -typedef CE_DeltaCrl = uint32; -typedef CE_CrlReason = uint32; -typedef CE_CRLDistPointsSyntax = __CE_CRLDistPointsSyntax; -typedef CE_IssuingDistributionPoint = __CE_IssuingDistributionPoint; -typedef CE_AuthorityInfoAccess = __CE_AuthorityInfoAccess; -typedef CE_QC_Statements = __CE_QC_Statements; -typedef CE_NameConstraints = __CE_NameConstraints; -typedef CE_PolicyMappings = __CE_PolicyMappings; -typedef CE_PolicyConstraints = __CE_PolicyConstraints; -typedef CE_InhibitAnyPolicy = uint32; - -final class __CE_DataAndType extends ffi.Struct { - @ffi.UnsignedInt() - external int typeAsInt; - - __CE_DataType get type => __CE_DataType.fromValue(typeAsInt); +typedef CSSM_CRLGROUP = cssm_crlgroup; +typedef CSSM_CRLGROUP_PTR = ffi.Pointer; - external CE_Data extension1; +final class cssm_fieldgroup extends ffi.Struct { + @ffi.Int() + external int NumberOfFields; - @CSSM_BOOL() - external int critical; + external CSSM_FIELD_PTR Fields; } -enum __CE_DataType { - DT_AuthorityKeyID(0), - DT_SubjectKeyID(1), - DT_KeyUsage(2), - DT_SubjectAltName(3), - DT_IssuerAltName(4), - DT_ExtendedKeyUsage(5), - DT_BasicConstraints(6), - DT_CertPolicies(7), - DT_NetscapeCertType(8), - DT_CrlNumber(9), - DT_DeltaCrl(10), - DT_CrlReason(11), - DT_CrlDistributionPoints(12), - DT_IssuingDistributionPoint(13), - DT_AuthorityInfoAccess(14), - DT_Other(15), - DT_QC_Statements(16), - DT_NameConstraints(17), - DT_PolicyMappings(18), - DT_PolicyConstraints(19), - DT_InhibitAnyPolicy(20); +typedef CSSM_FIELDGROUP = cssm_fieldgroup; +typedef CSSM_FIELDGROUP_PTR = ffi.Pointer; +typedef CSSM_EVIDENCE_FORM = uint32; - final int value; - const __CE_DataType(this.value); +final class cssm_evidence extends ffi.Struct { + @CSSM_EVIDENCE_FORM() + external int EvidenceForm; - static __CE_DataType fromValue(int value) => switch (value) { - 0 => DT_AuthorityKeyID, - 1 => DT_SubjectKeyID, - 2 => DT_KeyUsage, - 3 => DT_SubjectAltName, - 4 => DT_IssuerAltName, - 5 => DT_ExtendedKeyUsage, - 6 => DT_BasicConstraints, - 7 => DT_CertPolicies, - 8 => DT_NetscapeCertType, - 9 => DT_CrlNumber, - 10 => DT_DeltaCrl, - 11 => DT_CrlReason, - 12 => DT_CrlDistributionPoints, - 13 => DT_IssuingDistributionPoint, - 14 => DT_AuthorityInfoAccess, - 15 => DT_Other, - 16 => DT_QC_Statements, - 17 => DT_NameConstraints, - 18 => DT_PolicyMappings, - 19 => DT_PolicyConstraints, - 20 => DT_InhibitAnyPolicy, - _ => throw ArgumentError("Unknown value for __CE_DataType: $value"), - }; + external ffi.Pointer Evidence; } -final class cssm_acl_process_subject_selector extends ffi.Struct { - @uint16() - external int version; - - @uint16() - external int mask; +typedef CSSM_EVIDENCE = cssm_evidence; +typedef CSSM_EVIDENCE_PTR = ffi.Pointer; - @uint32() - external int uid; +final class cssm_tp_verify_context extends ffi.Struct { + @CSSM_TP_ACTION() + external int Action; - @uint32() - external int gid; -} + external SecAsn1Item ActionData; -final class cssm_acl_keychain_prompt_selector extends ffi.Struct { - @uint16() - external int version; + external CSSM_CRLGROUP Crls; - @uint16() - external int flags; + external CSSM_TP_CALLERAUTH_CONTEXT_PTR Cred; } -final class cssm_appledl_open_parameters extends ffi.Struct { - @uint32() - external int length; - - @uint32() - external int version; - - @CSSM_BOOL() - external int autoCommit; +typedef CSSM_TP_VERIFY_CONTEXT = cssm_tp_verify_context; +typedef CSSM_TP_VERIFY_CONTEXT_PTR = ffi.Pointer; +final class cssm_tp_verify_context_result extends ffi.Struct { @uint32() - external int mask; + external int NumberOfEvidences; - @mode_t() - external int mode; + external CSSM_EVIDENCE_PTR Evidence; } -final class cssm_applecspdl_db_settings_parameters extends ffi.Struct { +typedef CSSM_TP_VERIFY_CONTEXT_RESULT = cssm_tp_verify_context_result; +typedef CSSM_TP_VERIFY_CONTEXT_RESULT_PTR + = ffi.Pointer; + +final class cssm_tp_request_set extends ffi.Struct { @uint32() - external int idleTimeout; + external int NumberOfRequests; - @uint8() - external int lockOnSleep; + external ffi.Pointer Requests; } -final class cssm_applecspdl_db_is_locked_parameters extends ffi.Struct { - @uint8() - external int isLocked; -} +typedef CSSM_TP_REQUEST_SET = cssm_tp_request_set; +typedef CSSM_TP_REQUEST_SET_PTR = ffi.Pointer; -final class cssm_applecspdl_db_change_password_parameters extends ffi.Struct { - external ffi.Pointer accessCredentials; +final class cssm_tp_result_set extends ffi.Struct { + @uint32() + external int NumberOfResults; + + external ffi.Pointer Results; } -typedef CSSM_ACCESS_CREDENTIALS = cssm_access_credentials; +typedef CSSM_TP_RESULT_SET = cssm_tp_result_set; +typedef CSSM_TP_RESULT_SET_PTR = ffi.Pointer; +typedef CSSM_TP_CONFIRM_STATUS = uint32; +typedef CSSM_TP_CONFIRM_STATUS_PTR = ffi.Pointer; -final class CSSM_APPLE_TP_NAME_OID extends ffi.Struct { - external ffi.Pointer string; +final class cssm_tp_confirm_response extends ffi.Struct { + @uint32() + external int NumberOfResponses; - external ffi.Pointer oid; + external CSSM_TP_CONFIRM_STATUS_PTR Responses; } -final class CSSM_APPLE_TP_CERT_REQUEST extends ffi.Struct { - @CSSM_CSP_HANDLE() - external int cspHand; +typedef CSSM_TP_CONFIRM_RESPONSE = cssm_tp_confirm_response; +typedef CSSM_TP_CONFIRM_RESPONSE_PTR = ffi.Pointer; + +final class cssm_tp_certissue_input extends ffi.Struct { + external CSSM_SUBSERVICE_UID CSPSubserviceUid; @CSSM_CL_HANDLE() - external int clHand; + external int CLHandle; @uint32() - external int serialNumber; + external int NumberOfTemplateFields; - @uint32() - external int numSubjectNames; + external CSSM_FIELD_PTR SubjectCertFields; - external ffi.Pointer subjectNames; + @CSSM_TP_SERVICES() + external int MoreServiceRequests; @uint32() - external int numIssuerNames; + external int NumberOfServiceControls; - external ffi.Pointer issuerNames; + external CSSM_FIELD_PTR ServiceControls; - external CSSM_X509_NAME_PTR issuerNameX509; + external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; +} - external ffi.Pointer certPublicKey; +typedef CSSM_TP_CERTISSUE_INPUT = cssm_tp_certissue_input; +typedef CSSM_TP_CERTISSUE_INPUT_PTR = ffi.Pointer; +typedef CSSM_TP_CERTISSUE_STATUS = uint32; - external ffi.Pointer issuerPrivateKey; +final class cssm_tp_certissue_output extends ffi.Struct { + @CSSM_TP_CERTISSUE_STATUS() + external int IssueStatus; - @CSSM_ALGORITHMS() - external int signatureAlg; + external CSSM_CERTGROUP_PTR CertGroup; - external SecAsn1Oid signatureOid; + @CSSM_TP_SERVICES() + external int PerformedServiceRequests; +} - @uint32() - external int notBefore; +typedef CSSM_TP_CERTISSUE_OUTPUT = cssm_tp_certissue_output; +typedef CSSM_TP_CERTISSUE_OUTPUT_PTR = ffi.Pointer; +typedef CSSM_TP_CERTCHANGE_ACTION = uint32; +typedef CSSM_TP_CERTCHANGE_REASON = uint32; - @uint32() - external int notAfter; +final class cssm_tp_certchange_input extends ffi.Struct { + @CSSM_TP_CERTCHANGE_ACTION() + external int Action; - @uint32() - external int numExtensions; + @CSSM_TP_CERTCHANGE_REASON() + external int Reason; - external ffi.Pointer extensions; + @CSSM_CL_HANDLE() + external int CLHandle; - external ffi.Pointer challengeString; -} + external CSSM_DATA_PTR Cert; -typedef CSSM_X509_NAME_PTR = ffi.Pointer; -typedef CSSM_KEY = cssm_key; -typedef CE_DataAndType = __CE_DataAndType; + external CSSM_FIELD_PTR ChangeInfo; -final class CSSM_APPLE_TP_SSL_OPTIONS extends ffi.Struct { - @uint32() - external int Version; + external CSSM_TIMESTRING StartTime; - @uint32() - external int ServerNameLen; + external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; +} - external ffi.Pointer ServerName; +typedef CSSM_TP_CERTCHANGE_INPUT = cssm_tp_certchange_input; +typedef CSSM_TP_CERTCHANGE_INPUT_PTR = ffi.Pointer; +typedef CSSM_TP_CERTCHANGE_STATUS = uint32; - @uint32() - external int Flags; +final class cssm_tp_certchange_output extends ffi.Struct { + @CSSM_TP_CERTCHANGE_STATUS() + external int ActionStatus; + + external CSSM_FIELD RevokeInfo; } -final class CSSM_APPLE_TP_CRL_OPTIONS extends ffi.Struct { - @uint32() - external int Version; +typedef CSSM_TP_CERTCHANGE_OUTPUT = cssm_tp_certchange_output; +typedef CSSM_TP_CERTCHANGE_OUTPUT_PTR = ffi.Pointer; - @CSSM_APPLE_TP_CRL_OPT_FLAGS() - external int CrlFlags; +final class cssm_tp_certverify_input extends ffi.Struct { + @CSSM_CL_HANDLE() + external int CLHandle; - external CSSM_DL_DB_HANDLE_PTR crlStore; -} + external CSSM_DATA_PTR Cert; -typedef CSSM_APPLE_TP_CRL_OPT_FLAGS = uint32; + external CSSM_TP_VERIFY_CONTEXT_PTR VerifyContext; +} -final class CSSM_APPLE_TP_SMIME_OPTIONS extends ffi.Struct { - @uint32() - external int Version; +typedef CSSM_TP_CERTVERIFY_INPUT = cssm_tp_certverify_input; +typedef CSSM_TP_CERTVERIFY_INPUT_PTR = ffi.Pointer; +typedef CSSM_TP_CERTVERIFY_STATUS = uint32; - @CE_KeyUsage() - external int IntendedUsage; +final class cssm_tp_certverify_output extends ffi.Struct { + @CSSM_TP_CERTVERIFY_STATUS() + external int VerifyStatus; @uint32() - external int SenderEmailLen; + external int NumberOfEvidence; - external ffi.Pointer SenderEmail; + external CSSM_EVIDENCE_PTR Evidence; } -final class CSSM_APPLE_TP_ACTION_DATA extends ffi.Struct { - @uint32() - external int Version; +typedef CSSM_TP_CERTVERIFY_OUTPUT = cssm_tp_certverify_output; +typedef CSSM_TP_CERTVERIFY_OUTPUT_PTR = ffi.Pointer; - @CSSM_APPLE_TP_ACTION_FLAGS() - external int ActionFlags; -} +final class cssm_tp_certnotarize_input extends ffi.Struct { + @CSSM_CL_HANDLE() + external int CLHandle; -typedef CSSM_APPLE_TP_ACTION_FLAGS = uint32; + @uint32() + external int NumberOfFields; -final class CSSM_TP_APPLE_EVIDENCE_INFO extends ffi.Struct { - @CSSM_TP_APPLE_CERT_STATUS() - external int StatusBits; + external CSSM_FIELD_PTR MoreFields; + + external CSSM_FIELD_PTR SignScope; @uint32() - external int NumStatusCodes; + external int ScopeSize; - external ffi.Pointer StatusCodes; + @CSSM_TP_SERVICES() + external int MoreServiceRequests; @uint32() - external int Index; + external int NumberOfServiceControls; - external CSSM_DL_DB_HANDLE DlDbHandle; + external CSSM_FIELD_PTR ServiceControls; - external CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord; + external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; } -typedef CSSM_TP_APPLE_CERT_STATUS = uint32; -typedef CSSM_DL_DB_HANDLE = cssm_dl_db_handle; -typedef CSSM_DB_UNIQUE_RECORD_PTR = ffi.Pointer; +typedef CSSM_TP_CERTNOTARIZE_INPUT = cssm_tp_certnotarize_input; +typedef CSSM_TP_CERTNOTARIZE_INPUT_PTR + = ffi.Pointer; +typedef CSSM_TP_CERTNOTARIZE_STATUS = uint32; -final class CSSM_TP_APPLE_EVIDENCE_HEADER extends ffi.Struct { - @uint32() - external int Version; -} +final class cssm_tp_certnotarize_output extends ffi.Struct { + @CSSM_TP_CERTNOTARIZE_STATUS() + external int NotarizeStatus; -final class CSSM_APPLE_CL_CSR_REQUEST extends ffi.Struct { - external CSSM_X509_NAME_PTR subjectNameX509; + external CSSM_CERTGROUP_PTR NotarizedCertGroup; - @CSSM_ALGORITHMS() - external int signatureAlg; + @CSSM_TP_SERVICES() + external int PerformedServiceRequests; +} - external SecAsn1Oid signatureOid; +typedef CSSM_TP_CERTNOTARIZE_OUTPUT = cssm_tp_certnotarize_output; +typedef CSSM_TP_CERTNOTARIZE_OUTPUT_PTR + = ffi.Pointer; - @CSSM_CSP_HANDLE() - external int cspHand; +final class cssm_tp_certreclaim_input extends ffi.Struct { + @CSSM_CL_HANDLE() + external int CLHandle; - external ffi.Pointer subjectPublicKey; + @uint32() + external int NumberOfSelectionFields; - external ffi.Pointer subjectPrivateKey; + external CSSM_FIELD_PTR SelectionFields; - external ffi.Pointer challengeString; + external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; } -final class __SecTrust extends ffi.Opaque {} - -typedef SecTrustRef = ffi.Pointer<__SecTrust>; +typedef CSSM_TP_CERTRECLAIM_INPUT = cssm_tp_certreclaim_input; +typedef CSSM_TP_CERTRECLAIM_INPUT_PTR = ffi.Pointer; +typedef CSSM_TP_CERTRECLAIM_STATUS = uint32; -enum SecTrustResultType { - kSecTrustResultInvalid(0), - kSecTrustResultProceed(1), - kSecTrustResultConfirm(2), - kSecTrustResultDeny(3), - kSecTrustResultUnspecified(4), - kSecTrustResultRecoverableTrustFailure(5), - kSecTrustResultFatalTrustFailure(6), - kSecTrustResultOtherError(7); +final class cssm_tp_certreclaim_output extends ffi.Struct { + @CSSM_TP_CERTRECLAIM_STATUS() + external int ReclaimStatus; - final int value; - const SecTrustResultType(this.value); + external CSSM_CERTGROUP_PTR ReclaimedCertGroup; - static SecTrustResultType fromValue(int value) => switch (value) { - 0 => kSecTrustResultInvalid, - 1 => kSecTrustResultProceed, - 2 => kSecTrustResultConfirm, - 3 => kSecTrustResultDeny, - 4 => kSecTrustResultUnspecified, - 5 => kSecTrustResultRecoverableTrustFailure, - 6 => kSecTrustResultFatalTrustFailure, - 7 => kSecTrustResultOtherError, - _ => - throw ArgumentError("Unknown value for SecTrustResultType: $value"), - }; + @CSSM_LONG_HANDLE() + external int KeyCacheHandle; } -typedef SecTrustCallback = ffi.Pointer; -typedef DartSecTrustCallback - = objc.ObjCBlock, ffi.Uint32)>; -void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrTrampoline( - ffi.Pointer block, SecTrustRef arg0, int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(SecTrustRef arg0, ffi.Uint32 arg1)>>() - .asFunction()(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, SecTrustRef, ffi.Uint32)>( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline( - ffi.Pointer block, SecTrustRef arg0, int arg1) => - (objc.getBlockClosure(block) as void Function(SecTrustRef, int))( - arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, SecTrustRef, ffi.Uint32)>( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerTrampoline( - ffi.Pointer block, SecTrustRef arg0, int arg1) { - (objc.getBlockClosure(block) as void Function(SecTrustRef, int))(arg0, arg1); - objc.objectRelease(block.cast()); -} +typedef CSSM_TP_CERTRECLAIM_OUTPUT = cssm_tp_certreclaim_output; +typedef CSSM_TP_CERTRECLAIM_OUTPUT_PTR + = ffi.Pointer; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, SecTrustRef, ffi.Uint32)> - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerCallable = ffi - .NativeCallable< - ffi.Void Function(ffi.Pointer, SecTrustRef, - ffi.Uint32)>.listener( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerTrampoline) - ..keepIsolateAlive = false; +final class cssm_tp_crlissue_input extends ffi.Struct { + @CSSM_CL_HANDLE() + external int CLHandle; -/// Construction methods for `objc.ObjCBlock, ffi.Uint32)>`. -abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock, ffi.Uint32)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__SecTrust>, - ffi.Uint32)>(pointer, retain: retain, release: release); + @uint32() + external int CrlIdentifier; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32)> fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock, ffi.Uint32)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + external CSSM_TIMESTRING CrlThisTime; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32)> fromFunction( - void Function(SecTrustRef, SecTrustResultType) fn) => - objc.ObjCBlock, ffi.Uint32)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureCallable, - (SecTrustRef arg0, int arg1) => - fn(arg0, SecTrustResultType.fromValue(arg1))), - retain: false, - release: true); + external CSSM_FIELD_PTR PolicyIdentifier; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock, ffi.Uint32)> - listener(void Function(SecTrustRef, SecTrustResultType) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerCallable - .nativeFunction - .cast(), - (SecTrustRef arg0, int arg1) => - fn(arg0, SecTrustResultType.fromValue(arg1))); - final wrapper = _wrapListenerBlock_129ffij(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32)>(wrapper, - retain: false, release: true); - } + external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; } -/// Call operator for `objc.ObjCBlock, ffi.Uint32)>`. -extension ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_CallExtension - on objc.ObjCBlock, ffi.Uint32)> { - void call(SecTrustRef arg0, SecTrustResultType arg1) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - SecTrustRef arg0, ffi.Uint32 arg1)>>() - .asFunction< - void Function(ffi.Pointer, SecTrustRef, - int)>()(ref.pointer, arg0, arg1.value); +typedef CSSM_TP_CRLISSUE_INPUT = cssm_tp_crlissue_input; +typedef CSSM_TP_CRLISSUE_INPUT_PTR = ffi.Pointer; +typedef CSSM_TP_CRLISSUE_STATUS = uint32; + +final class cssm_tp_crlissue_output extends ffi.Struct { + @CSSM_TP_CRLISSUE_STATUS() + external int IssueStatus; + + external CSSM_ENCODED_CRL_PTR Crl; + + external CSSM_TIMESTRING CrlNextTime; } -typedef SecTrustWithErrorCallback = ffi.Pointer; -typedef DartSecTrustWithErrorCallback = objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)>; -void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrTrampoline( - ffi.Pointer block, - SecTrustRef arg0, - bool arg1, - CFErrorRef arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - SecTrustRef arg0, ffi.Bool arg1, CFErrorRef arg2)>>() - .asFunction()( - arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, SecTrustRef, - ffi.Bool, CFErrorRef)>( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline( - ffi.Pointer block, - SecTrustRef arg0, - bool arg1, - CFErrorRef arg2) => - (objc.getBlockClosure(block) as void Function( - SecTrustRef, bool, CFErrorRef))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, SecTrustRef, - ffi.Bool, CFErrorRef)>( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerTrampoline( - ffi.Pointer block, - SecTrustRef arg0, - bool arg1, - CFErrorRef arg2) { - (objc.getBlockClosure(block) as void Function(SecTrustRef, bool, CFErrorRef))( - arg0, arg1, arg2); - objc.objectRelease(block.cast()); +typedef CSSM_TP_CRLISSUE_OUTPUT = cssm_tp_crlissue_output; +typedef CSSM_TP_CRLISSUE_OUTPUT_PTR = ffi.Pointer; +typedef CSSM_TP_FORM_TYPE = uint32; +typedef CSSM_CL_TEMPLATE_TYPE = uint32; +typedef CSSM_CERT_BUNDLE_TYPE = uint32; +typedef CSSM_CERT_BUNDLE_ENCODING = uint32; + +final class cssm_cert_bundle_header extends ffi.Struct { + @CSSM_CERT_BUNDLE_TYPE() + external int BundleType; + + @CSSM_CERT_BUNDLE_ENCODING() + external int BundleEncoding; } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, SecTrustRef, ffi.Bool, CFErrorRef)> - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerCallable = ffi - .NativeCallable< - ffi.Void Function(ffi.Pointer, SecTrustRef, - ffi.Bool, CFErrorRef)>.listener( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerTrampoline) - ..keepIsolateAlive = false; +typedef CSSM_CERT_BUNDLE_HEADER = cssm_cert_bundle_header; +typedef CSSM_CERT_BUNDLE_HEADER_PTR = ffi.Pointer; -/// Construction methods for `objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)>`. -abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, - ffi.Pointer<__CFError>)>(pointer, - retain: retain, release: release); +final class cssm_cert_bundle extends ffi.Struct { + external CSSM_CERT_BUNDLE_HEADER BundleHeader; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)> - fromFunctionPointer(ffi.Pointer> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, - ffi.Pointer<__CFError>)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + external SecAsn1Item Bundle; +} - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)> - fromFunction(void Function(SecTrustRef, bool, CFErrorRef) fn) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, - ffi.Pointer<__CFError>)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureCallable, - (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => - fn(arg0, arg1, arg2)), - retain: false, - release: true); +typedef CSSM_CERT_BUNDLE = cssm_cert_bundle; +typedef CSSM_CERT_BUNDLE_PTR = ffi.Pointer; +typedef CSSM_DB_ATTRIBUTE_NAME_FORMAT = uint32; +typedef CSSM_DB_ATTRIBUTE_NAME_FORMAT_PTR = ffi.Pointer; +typedef CSSM_DB_ATTRIBUTE_FORMAT = uint32; +typedef CSSM_DB_ATTRIBUTE_FORMAT_PTR = ffi.Pointer; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> listener( - void Function(SecTrustRef, bool, CFErrorRef) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerCallable - .nativeFunction - .cast(), - (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2)); - final wrapper = _wrapListenerBlock_1458n52(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, - ffi.Pointer<__CFError>)>(wrapper, retain: false, release: true); - } +final class cssm_db_attribute_label extends ffi.Union { + external ffi.Pointer AttributeName; + + external SecAsn1Oid AttributeOID; + + @uint32() + external int AttributeID; } -/// Call operator for `objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)>`. -extension ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> { - void call(SecTrustRef arg0, bool arg1, CFErrorRef arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - SecTrustRef arg0, ffi.Bool arg1, CFErrorRef arg2)>>() - .asFunction< - void Function(ffi.Pointer, SecTrustRef, bool, - CFErrorRef)>()(ref.pointer, arg0, arg1, arg2); +final class cssm_db_attribute_info extends ffi.Struct { + @CSSM_DB_ATTRIBUTE_NAME_FORMAT() + external int AttributeNameFormat; + + external cssm_db_attribute_label Label; + + @CSSM_DB_ATTRIBUTE_FORMAT() + external int AttributeFormat; } -typedef SecKeyRef = ffi.Pointer<__SecKey>; -typedef SecCertificateRef = ffi.Pointer<__SecCertificate>; +typedef CSSM_DB_ATTRIBUTE_INFO = cssm_db_attribute_info; +typedef CSSM_DB_ATTRIBUTE_INFO_PTR = ffi.Pointer; -enum SecTrustOptionFlags { - kSecTrustOptionAllowExpired(1), - kSecTrustOptionLeafIsCA(2), - kSecTrustOptionFetchIssuerFromNet(4), - kSecTrustOptionAllowExpiredRoot(8), - kSecTrustOptionRequireRevPerCert(16), - kSecTrustOptionUseTrustSettings(32), - kSecTrustOptionImplicitAnchors(64); +final class cssm_db_attribute_data extends ffi.Struct { + external CSSM_DB_ATTRIBUTE_INFO Info; - final int value; - const SecTrustOptionFlags(this.value); + @uint32() + external int NumberOfValues; - static SecTrustOptionFlags fromValue(int value) => switch (value) { - 1 => kSecTrustOptionAllowExpired, - 2 => kSecTrustOptionLeafIsCA, - 4 => kSecTrustOptionFetchIssuerFromNet, - 8 => kSecTrustOptionAllowExpiredRoot, - 16 => kSecTrustOptionRequireRevPerCert, - 32 => kSecTrustOptionUseTrustSettings, - 64 => kSecTrustOptionImplicitAnchors, - _ => - throw ArgumentError("Unknown value for SecTrustOptionFlags: $value"), - }; + external CSSM_DATA_PTR Value; } -typedef CSSM_TP_VERIFY_CONTEXT_RESULT_PTR - = ffi.Pointer; -typedef SecKeychainRef = ffi.Pointer<__SecKeychain>; -typedef SecIdentityRef = ffi.Pointer<__SecIdentity>; -typedef SSLCipherSuite = ffi.Uint16; -typedef DartSSLCipherSuite = int; +typedef CSSM_DB_ATTRIBUTE_DATA = cssm_db_attribute_data; +typedef CSSM_DB_ATTRIBUTE_DATA_PTR = ffi.Pointer; +typedef CSSM_DB_RECORDTYPE = uint32; -/// OS_sec_trust -abstract final class OS_sec_trust { - /// Builds an object that implements the OS_sec_trust protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +final class cssm_db_record_attribute_info extends ffi.Struct { + @CSSM_DB_RECORDTYPE() + external int DataRecordType; - return builder.build(); - } + @uint32() + external int NumberOfAttributes; - /// Adds the implementation of the OS_sec_trust protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + external CSSM_DB_ATTRIBUTE_INFO_PTR AttributeInfo; } -late final _protocol_OS_sec_trust = objc.getProtocol("OS_sec_trust"); +typedef CSSM_DB_RECORD_ATTRIBUTE_INFO = cssm_db_record_attribute_info; +typedef CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR + = ffi.Pointer; -/// OS_sec_identity -abstract final class OS_sec_identity { - /// Builds an object that implements the OS_sec_identity protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +final class cssm_db_record_attribute_data extends ffi.Struct { + @CSSM_DB_RECORDTYPE() + external int DataRecordType; - return builder.build(); - } + @uint32() + external int SemanticInformation; - /// Adds the implementation of the OS_sec_identity protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} + @uint32() + external int NumberOfAttributes; -late final _protocol_OS_sec_identity = objc.getProtocol("OS_sec_identity"); + external CSSM_DB_ATTRIBUTE_DATA_PTR AttributeData; +} -/// OS_sec_certificate -abstract final class OS_sec_certificate { - /// Builds an object that implements the OS_sec_certificate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +typedef CSSM_DB_RECORD_ATTRIBUTE_DATA = cssm_db_record_attribute_data; +typedef CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR + = ffi.Pointer; - return builder.build(); - } +final class cssm_db_parsing_module_info extends ffi.Struct { + @CSSM_DB_RECORDTYPE() + external int RecordType; - /// Adds the implementation of the OS_sec_certificate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + external CSSM_SUBSERVICE_UID ModuleSubserviceUid; } -late final _protocol_OS_sec_certificate = - objc.getProtocol("OS_sec_certificate"); -typedef sec_trust_t = ffi.Pointer; -typedef Dartsec_trust_t = objc.NSObject; -typedef sec_identity_t = ffi.Pointer; -typedef Dartsec_identity_t = objc.NSObject; -void _ObjCBlock_ffiVoid_seccertificatet_fnPtrTrampoline( - ffi.Pointer block, sec_certificate_t arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_seccertificatet_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, sec_certificate_t)>( - _ObjCBlock_ffiVoid_seccertificatet_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_seccertificatet_closureTrampoline( - ffi.Pointer block, sec_certificate_t arg0) => - (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_seccertificatet_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, sec_certificate_t)>( - _ObjCBlock_ffiVoid_seccertificatet_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_seccertificatet_listenerTrampoline( - ffi.Pointer block, sec_certificate_t arg0) { - (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); - objc.objectRelease(block.cast()); +typedef CSSM_DB_PARSING_MODULE_INFO = cssm_db_parsing_module_info; +typedef CSSM_DB_PARSING_MODULE_INFO_PTR + = ffi.Pointer; +typedef CSSM_DB_INDEX_TYPE = uint32; +typedef CSSM_DB_INDEXED_DATA_LOCATION = uint32; + +final class cssm_db_index_info extends ffi.Struct { + @CSSM_DB_INDEX_TYPE() + external int IndexType; + + @CSSM_DB_INDEXED_DATA_LOCATION() + external int IndexedDataLocation; + + external CSSM_DB_ATTRIBUTE_INFO Info; } -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, sec_certificate_t)> - _ObjCBlock_ffiVoid_seccertificatet_listenerCallable = ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, sec_certificate_t)>.listener( - _ObjCBlock_ffiVoid_seccertificatet_listenerTrampoline) - ..keepIsolateAlive = false; +typedef CSSM_DB_INDEX_INFO = cssm_db_index_info; +typedef CSSM_DB_INDEX_INFO_PTR = ffi.Pointer; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_seccertificatet { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); +final class cssm_db_unique_record extends ffi.Struct { + external CSSM_DB_INDEX_INFO RecordLocator; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_seccertificatet_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + external SecAsn1Item RecordIdentifier; +} - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(Dartsec_certificate_t) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_seccertificatet_closureCallable, - (sec_certificate_t arg0) => fn(objc.NSObject.castFromPointer(arg0, - retain: true, release: true))), - retain: false, - release: true); +typedef CSSM_DB_UNIQUE_RECORD = cssm_db_unique_record; +typedef CSSM_DB_UNIQUE_RECORD_PTR = ffi.Pointer; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(Dartsec_certificate_t) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_seccertificatet_listenerCallable.nativeFunction - .cast(), - (sec_certificate_t arg0) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true))); - final wrapper = _wrapListenerBlock_ukcdfq(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} +final class cssm_db_record_index_info extends ffi.Struct { + @CSSM_DB_RECORDTYPE() + external int DataRecordType; -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_seccertificatet_CallExtension - on objc.ObjCBlock { - void call(Dartsec_certificate_t arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - sec_certificate_t arg0)>>() - .asFunction< - void Function(ffi.Pointer, - sec_certificate_t)>()(ref.pointer, arg0.ref.pointer); + @uint32() + external int NumberOfIndexes; + + external CSSM_DB_INDEX_INFO_PTR IndexInfo; } -typedef sec_certificate_t = ffi.Pointer; -typedef Dartsec_certificate_t = objc.NSObject; +typedef CSSM_DB_RECORD_INDEX_INFO = cssm_db_record_index_info; +typedef CSSM_DB_RECORD_INDEX_INFO_PTR = ffi.Pointer; +typedef CSSM_DB_ACCESS_TYPE = uint32; +typedef CSSM_DB_ACCESS_TYPE_PTR = ffi.Pointer; +typedef CSSM_DB_MODIFY_MODE = uint32; -/// OS_sec_protocol_metadata -abstract final class OS_sec_protocol_metadata { - /// Builds an object that implements the OS_sec_protocol_metadata protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +final class cssm_dbinfo extends ffi.Struct { + @uint32() + external int NumberOfRecordTypes; - return builder.build(); - } + external CSSM_DB_PARSING_MODULE_INFO_PTR DefaultParsingModules; - /// Adds the implementation of the OS_sec_protocol_metadata protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} + external CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR RecordAttributeNames; -late final _protocol_OS_sec_protocol_metadata = - objc.getProtocol("OS_sec_protocol_metadata"); -typedef sec_protocol_metadata_t = ffi.Pointer; -typedef Dartsec_protocol_metadata_t = objc.NSObject; + external CSSM_DB_RECORD_INDEX_INFO_PTR RecordIndexes; -enum tls_protocol_version_t { - tls_protocol_version_TLSv10(769), - tls_protocol_version_TLSv11(770), - tls_protocol_version_TLSv12(771), - tls_protocol_version_TLSv13(772), - tls_protocol_version_DTLSv10(-257), - tls_protocol_version_DTLSv12(-259); + @CSSM_BOOL() + external int IsLocal; - final int value; - const tls_protocol_version_t(this.value); + external ffi.Pointer AccessPath; - static tls_protocol_version_t fromValue(int value) => switch (value) { - 769 => tls_protocol_version_TLSv10, - 770 => tls_protocol_version_TLSv11, - 771 => tls_protocol_version_TLSv12, - 772 => tls_protocol_version_TLSv13, - -257 => tls_protocol_version_DTLSv10, - -259 => tls_protocol_version_DTLSv12, - _ => throw ArgumentError( - "Unknown value for tls_protocol_version_t: $value"), - }; + external ffi.Pointer Reserved; } -enum SSLProtocol { - kSSLProtocolUnknown(0), - kTLSProtocol1(4), - kTLSProtocol11(7), - kTLSProtocol12(8), - kDTLSProtocol1(9), - kTLSProtocol13(10), - kDTLSProtocol12(11), - kTLSProtocolMaxSupported(999), - kSSLProtocol2(1), - kSSLProtocol3(2), - kSSLProtocol3Only(3), - kTLSProtocol1Only(5), - kSSLProtocolAll(6); +typedef CSSM_DBINFO = cssm_dbinfo; +typedef CSSM_DBINFO_PTR = ffi.Pointer; +typedef CSSM_DB_OPERATOR = uint32; +typedef CSSM_DB_OPERATOR_PTR = ffi.Pointer; +typedef CSSM_DB_CONJUNCTIVE = uint32; +typedef CSSM_DB_CONJUNCTIVE_PTR = ffi.Pointer; - final int value; - const SSLProtocol(this.value); +final class cssm_selection_predicate extends ffi.Struct { + @CSSM_DB_OPERATOR() + external int DbOperator; - static SSLProtocol fromValue(int value) => switch (value) { - 0 => kSSLProtocolUnknown, - 4 => kTLSProtocol1, - 7 => kTLSProtocol11, - 8 => kTLSProtocol12, - 9 => kDTLSProtocol1, - 10 => kTLSProtocol13, - 11 => kDTLSProtocol12, - 999 => kTLSProtocolMaxSupported, - 1 => kSSLProtocol2, - 2 => kSSLProtocol3, - 3 => kSSLProtocol3Only, - 5 => kTLSProtocol1Only, - 6 => kSSLProtocolAll, - _ => throw ArgumentError("Unknown value for SSLProtocol: $value"), - }; + external CSSM_DB_ATTRIBUTE_DATA Attribute; } -enum tls_ciphersuite_t { - tls_ciphersuite_RSA_WITH_3DES_EDE_CBC_SHA(10), - tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA(47), - tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA(53), - tls_ciphersuite_RSA_WITH_AES_128_GCM_SHA256(156), - tls_ciphersuite_RSA_WITH_AES_256_GCM_SHA384(157), - tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA256(60), - tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA256(61), - tls_ciphersuite_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA(-16376), - tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(-16375), - tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA(-16374), - tls_ciphersuite_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA(-16366), - tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA(-16365), - tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA(-16364), - tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256(-16349), - tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384(-16348), - tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA256(-16345), - tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA384(-16344), - tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(-16341), - tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384(-16340), - tls_ciphersuite_ECDHE_RSA_WITH_AES_128_GCM_SHA256(-16337), - tls_ciphersuite_ECDHE_RSA_WITH_AES_256_GCM_SHA384(-16336), - tls_ciphersuite_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256(-13144), - tls_ciphersuite_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256(-13143), - tls_ciphersuite_AES_128_GCM_SHA256(4865), - tls_ciphersuite_AES_256_GCM_SHA384(4866), - tls_ciphersuite_CHACHA20_POLY1305_SHA256(4867); +typedef CSSM_SELECTION_PREDICATE = cssm_selection_predicate; +typedef CSSM_SELECTION_PREDICATE_PTR = ffi.Pointer; - final int value; - const tls_ciphersuite_t(this.value); +final class cssm_query_limits extends ffi.Struct { + @uint32() + external int TimeLimit; - static tls_ciphersuite_t fromValue(int value) => switch (value) { - 10 => tls_ciphersuite_RSA_WITH_3DES_EDE_CBC_SHA, - 47 => tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA, - 53 => tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA, - 156 => tls_ciphersuite_RSA_WITH_AES_128_GCM_SHA256, - 157 => tls_ciphersuite_RSA_WITH_AES_256_GCM_SHA384, - 60 => tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA256, - 61 => tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA256, - -16376 => tls_ciphersuite_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, - -16375 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, - -16374 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, - -16366 => tls_ciphersuite_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, - -16365 => tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA, - -16364 => tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA, - -16349 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, - -16348 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, - -16345 => tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA256, - -16344 => tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA384, - -16341 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - -16340 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - -16337 => tls_ciphersuite_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - -16336 => tls_ciphersuite_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - -13144 => tls_ciphersuite_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, - -13143 => tls_ciphersuite_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, - 4865 => tls_ciphersuite_AES_128_GCM_SHA256, - 4866 => tls_ciphersuite_AES_256_GCM_SHA384, - 4867 => tls_ciphersuite_CHACHA20_POLY1305_SHA256, - _ => throw ArgumentError("Unknown value for tls_ciphersuite_t: $value"), - }; + @uint32() + external int SizeLimit; } -void _ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline( - ffi.Pointer block, int arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_Uint16_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Uint16)>(_ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_Uint16_closureTrampoline( - ffi.Pointer block, int arg0) => - (objc.getBlockClosure(block) as void Function(int))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_Uint16_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Uint16)>(_ObjCBlock_ffiVoid_Uint16_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_Uint16_listenerTrampoline( - ffi.Pointer block, int arg0) { - (objc.getBlockClosure(block) as void Function(int))(arg0); - objc.objectRelease(block.cast()); -} +typedef CSSM_QUERY_LIMITS = cssm_query_limits; +typedef CSSM_QUERY_LIMITS_PTR = ffi.Pointer; +typedef CSSM_QUERY_FLAGS = uint32; -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.Uint16)> - _ObjCBlock_ffiVoid_Uint16_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Uint16)>.listener(_ObjCBlock_ffiVoid_Uint16_listenerTrampoline) - ..keepIsolateAlive = false; +final class cssm_query extends ffi.Struct { + @CSSM_DB_RECORDTYPE() + external int RecordType; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_Uint16 { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); + @CSSM_DB_CONJUNCTIVE() + external int Conjunctive; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_Uint16_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + @uint32() + external int NumSelectionPredicates; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(int) fn) => - objc.ObjCBlock( - objc.newClosureBlock(_ObjCBlock_ffiVoid_Uint16_closureCallable, - (int arg0) => fn(arg0)), - retain: false, - release: true); + external CSSM_SELECTION_PREDICATE_PTR SelectionPredicate; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(int) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_Uint16_listenerCallable.nativeFunction.cast(), - (int arg0) => fn(arg0)); - final wrapper = _wrapListenerBlock_yo3tv0(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } + external CSSM_QUERY_LIMITS QueryLimits; + + @CSSM_QUERY_FLAGS() + external int QueryFlags; } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_Uint16_CallExtension - on objc.ObjCBlock { - void call(int arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Uint16 arg0)>>() - .asFunction, int)>()( - ref.pointer, arg0); +typedef CSSM_QUERY = cssm_query; +typedef CSSM_QUERY_PTR = ffi.Pointer; +typedef CSSM_DLTYPE = uint32; +typedef CSSM_DLTYPE_PTR = ffi.Pointer; +typedef CSSM_DL_CUSTOM_ATTRIBUTES = ffi.Pointer; +typedef CSSM_DL_LDAP_ATTRIBUTES = ffi.Pointer; +typedef CSSM_DL_ODBC_ATTRIBUTES = ffi.Pointer; +typedef CSSM_DL_FFS_ATTRIBUTES = ffi.Pointer; + +final class cssm_dl_pkcs11_attributes extends ffi.Struct { + @uint32() + external int DeviceAccessFlags; } -void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - dispatch_data_t arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - dispatch_data_t arg0, dispatch_data_t arg1)>>() - .asFunction()( - arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - dispatch_data_t, dispatch_data_t)>( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - dispatch_data_t arg1) => - (objc.getBlockClosure(block) as void Function( - dispatch_data_t, dispatch_data_t))(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - dispatch_data_t, dispatch_data_t)>( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerTrampoline( - ffi.Pointer block, - dispatch_data_t arg0, - dispatch_data_t arg1) { - (objc.getBlockClosure(block) as void Function( - dispatch_data_t, dispatch_data_t))(arg0, arg1); - objc.objectRelease(block.cast()); +typedef CSSM_DL_PKCS11_ATTRIBUTE = ffi.Pointer; +typedef CSSM_DL_PKCS11_ATTRIBUTE_PTR = ffi.Pointer; + +final class cssm_name_list extends ffi.Struct { + @uint32() + external int NumStrings; + + external ffi.Pointer> String; } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, dispatch_data_t, dispatch_data_t)> - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerCallable = ffi - .NativeCallable< - ffi.Void Function(ffi.Pointer, dispatch_data_t, - dispatch_data_t)>.listener( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerTrampoline) - ..keepIsolateAlive = false; +typedef CSSM_NAME_LIST = cssm_name_list; +typedef CSSM_NAME_LIST_PTR = ffi.Pointer; +typedef CSSM_DB_RETRIEVAL_MODES = uint32; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock( - pointer, - retain: retain, - release: release); +final class cssm_db_schema_attribute_info extends ffi.Struct { + @uint32() + external int AttributeId; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject)> fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + external ffi.Pointer AttributeName; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureCallable, - (dispatch_data_t arg0, dispatch_data_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, - retain: true, release: true), - objc.NSObject.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); + external SecAsn1Oid AttributeNameID; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock - listener(void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerCallable - .nativeFunction - .cast(), - (dispatch_data_t arg0, dispatch_data_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: false, release: true), - objc.NSObject.castFromPointer(arg1, retain: false, release: true))); - final wrapper = _wrapListenerBlock_1tjlcwl(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true); - } + @CSSM_DB_ATTRIBUTE_FORMAT() + external int DataType; } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_CallExtension - on objc.ObjCBlock { - void call(Dartdispatch_data_t arg0, Dartdispatch_data_t arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - dispatch_data_t arg0, dispatch_data_t arg1)>>() - .asFunction< - void Function(ffi.Pointer, - dispatch_data_t, dispatch_data_t)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer); -} +typedef CSSM_DB_SCHEMA_ATTRIBUTE_INFO = cssm_db_schema_attribute_info; +typedef CSSM_DB_SCHEMA_ATTRIBUTE_INFO_PTR + = ffi.Pointer; -/// OS_sec_protocol_options -abstract final class OS_sec_protocol_options { - /// Builds an object that implements the OS_sec_protocol_options protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); +final class cssm_db_schema_index_info extends ffi.Struct { + @uint32() + external int AttributeId; - return builder.build(); - } + @uint32() + external int IndexId; - /// Adds the implementation of the OS_sec_protocol_options protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} + @CSSM_DB_INDEX_TYPE() + external int IndexType; + + @CSSM_DB_INDEXED_DATA_LOCATION() + external int IndexedDataLocation; } -late final _protocol_OS_sec_protocol_options = - objc.getProtocol("OS_sec_protocol_options"); -typedef sec_protocol_options_t = ffi.Pointer; -typedef Dartsec_protocol_options_t = objc.NSObject; +typedef CSSM_DB_SCHEMA_INDEX_INFO = cssm_db_schema_index_info; +typedef CSSM_DB_SCHEMA_INDEX_INFO_PTR = ffi.Pointer; +typedef CSSM_BER_TAG = uint8; +typedef CSSM_X509_ALGORITHM_IDENTIFIER_PTR = ffi.Pointer; -enum tls_ciphersuite_group_t { - tls_ciphersuite_group_default(0), - tls_ciphersuite_group_compatibility(1), - tls_ciphersuite_group_legacy(2), - tls_ciphersuite_group_ats(3), - tls_ciphersuite_group_ats_compatibility(4); +final class cssm_x509_type_value_pair extends ffi.Struct { + external SecAsn1Oid type; - final int value; - const tls_ciphersuite_group_t(this.value); + @CSSM_BER_TAG() + external int valueType; - static tls_ciphersuite_group_t fromValue(int value) => switch (value) { - 0 => tls_ciphersuite_group_default, - 1 => tls_ciphersuite_group_compatibility, - 2 => tls_ciphersuite_group_legacy, - 3 => tls_ciphersuite_group_ats, - 4 => tls_ciphersuite_group_ats_compatibility, - _ => throw ArgumentError( - "Unknown value for tls_ciphersuite_group_t: $value"), - }; + external SecAsn1Item value; } -enum SSLCiphersuiteGroup { - kSSLCiphersuiteGroupDefault(0), - kSSLCiphersuiteGroupCompatibility(1), - kSSLCiphersuiteGroupLegacy(2), - kSSLCiphersuiteGroupATS(3), - kSSLCiphersuiteGroupATSCompatibility(4); +typedef CSSM_X509_TYPE_VALUE_PAIR = cssm_x509_type_value_pair; +typedef CSSM_X509_TYPE_VALUE_PAIR_PTR = ffi.Pointer; - final int value; - const SSLCiphersuiteGroup(this.value); +final class cssm_x509_rdn extends ffi.Struct { + @uint32() + external int numberOfPairs; - static SSLCiphersuiteGroup fromValue(int value) => switch (value) { - 0 => kSSLCiphersuiteGroupDefault, - 1 => kSSLCiphersuiteGroupCompatibility, - 2 => kSSLCiphersuiteGroupLegacy, - 3 => kSSLCiphersuiteGroupATS, - 4 => kSSLCiphersuiteGroupATSCompatibility, - _ => - throw ArgumentError("Unknown value for SSLCiphersuiteGroup: $value"), - }; + external CSSM_X509_TYPE_VALUE_PAIR_PTR AttributeTypeAndValue; } -typedef sec_protocol_pre_shared_key_selection_t - = ffi.Pointer; -typedef Dartsec_protocol_pre_shared_key_selection_t = objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)>; -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t - arg2)>>() - .asFunction< - void Function(sec_protocol_metadata_t, dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t)>()( - arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2) => - (objc.getBlockClosure(block) as void Function( - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t))( - arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2) { - (objc.getBlockClosure(block) as void Function( - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} +typedef CSSM_X509_RDN = cssm_x509_rdn; +typedef CSSM_X509_RDN_PTR = ffi.Pointer; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t)> - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t)>.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerTrampoline) - ..keepIsolateAlive = false; +final class cssm_x509_name extends ffi.Struct { + @uint32() + external int numberOfRDNs; -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)>(pointer, - retain: retain, release: release); + external CSSM_X509_RDN_PTR RelativeDistinguishedName; +} - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)> - fromFunctionPointer(ffi.Pointer> ptr) => - objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +typedef CSSM_X509_NAME = cssm_x509_name; +typedef CSSM_X509_NAME_PTR = ffi.Pointer; +typedef CSSM_X509_SUBJECT_PUBLIC_KEY_INFO_PTR = ffi.Pointer; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(void Function(Dartsec_protocol_metadata_t, Dartdispatch_data_t, Dartsec_protocol_pre_shared_key_selection_complete_t) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureCallable, - (sec_protocol_metadata_t arg0, dispatch_data_t arg1, sec_protocol_pre_shared_key_selection_complete_t arg2) => fn( - objc.NSObject.castFromPointer(arg0, retain: true, release: true), - objc.NSObject.castFromPointer(arg1, retain: true, release: true), - ObjCBlock_ffiVoid_seccertificatet.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); +final class cssm_x509_time extends ffi.Struct { + @CSSM_BER_TAG() + external int timeType; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)> listener( - void Function(Dartsec_protocol_metadata_t, Dartdispatch_data_t, - Dartsec_protocol_pre_shared_key_selection_complete_t) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerCallable - .nativeFunction - .cast(), - (sec_protocol_metadata_t arg0, dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2) => - fn( - objc.NSObject.castFromPointer(arg0, - retain: false, release: true), - objc.NSObject.castFromPointer(arg1, - retain: false, release: true), - ObjCBlock_ffiVoid_seccertificatet.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_10t0qpd(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)>(wrapper, - retain: false, release: true); - } + external SecAsn1Item time; } -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_CallExtension - on objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)> { - void - call(Dartsec_protocol_metadata_t arg0, Dartdispatch_data_t arg1, - Dartsec_protocol_pre_shared_key_selection_complete_t arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t - arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t)>()( - ref.pointer, - arg0.ref.pointer, - arg1.ref.pointer, - arg2.ref.pointer); +typedef CSSM_X509_TIME = cssm_x509_time; +typedef CSSM_X509_TIME_PTR = ffi.Pointer; + +final class x509_validity extends ffi.Struct { + external CSSM_X509_TIME notBefore; + + external CSSM_X509_TIME notAfter; } -typedef sec_protocol_pre_shared_key_selection_complete_t - = ffi.Pointer; -typedef Dartsec_protocol_pre_shared_key_selection_complete_t - = objc.ObjCBlock; -typedef sec_protocol_key_update_t = ffi.Pointer; -typedef Dartsec_protocol_key_update_t = objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.ObjCBlock)>; -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1)>>() - .asFunction< - void Function(sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1) => - (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, - sec_protocol_key_update_complete_t))(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1) { - (objc.getBlockClosure(block) as void Function( - sec_protocol_metadata_t, sec_protocol_key_update_complete_t))(arg0, arg1); - objc.objectRelease(block.cast()); +typedef CSSM_X509_VALIDITY = x509_validity; +typedef CSSM_X509_VALIDITY_PTR = ffi.Pointer; +typedef CSSM_X509_OPTION = CSSM_BOOL; + +final class cssm_x509ext_basicConstraints extends ffi.Struct { + @CSSM_BOOL() + external int cA; + + @CSSM_X509_OPTION() + external int pathLenConstraintPresent; + + @uint32() + external int pathLenConstraint; } -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - sec_protocol_metadata_t, sec_protocol_key_update_complete_t)> - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerTrampoline) - ..keepIsolateAlive = false; +typedef CSSM_X509EXT_BASICCONSTRAINTS = cssm_x509ext_basicConstraints; +typedef CSSM_X509EXT_BASICCONSTRAINTS_PTR + = ffi.Pointer; -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - objc.NSObject, objc.ObjCBlock)>( - pointer, - retain: retain, - release: release); +enum extension_data_format { + CSSM_X509_DATAFORMAT_ENCODED(0), + CSSM_X509_DATAFORMAT_PARSED(1), + CSSM_X509_DATAFORMAT_PAIR(2); - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + final int value; + const extension_data_format(this.value); - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_key_update_complete_t) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureCallable, - (sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1) => - fn(objc.NSObject.castFromPointer(arg0, retain: true, release: true), - ObjCBlock_ffiVoid.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); + static extension_data_format fromValue(int value) => switch (value) { + 0 => CSSM_X509_DATAFORMAT_ENCODED, + 1 => CSSM_X509_DATAFORMAT_PARSED, + 2 => CSSM_X509_DATAFORMAT_PAIR, + _ => throw ArgumentError( + "Unknown value for extension_data_format: $value"), + }; +} - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.ObjCBlock)> - listener( - void Function(Dartsec_protocol_metadata_t, - Dartsec_protocol_key_update_complete_t) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerCallable - .nativeFunction - .cast(), - (sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1) => - fn( - objc.NSObject.castFromPointer(arg0, - retain: false, release: true), - ObjCBlock_ffiVoid.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_cmbt6k(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - objc.NSObject, objc.ObjCBlock)>(wrapper, - retain: false, release: true); - } +final class cssm_x509_extensionTagAndValue extends ffi.Struct { + @CSSM_BER_TAG() + external int type; + + external SecAsn1Item value; } -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_CallExtension - on objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.ObjCBlock)> { - void call(Dartsec_protocol_metadata_t arg0, - Dartsec_protocol_key_update_complete_t arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1)>>() - .asFunction< - void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer); +typedef CSSM_X509EXT_TAGandVALUE = cssm_x509_extensionTagAndValue; +typedef CSSM_X509EXT_TAGandVALUE_PTR + = ffi.Pointer; + +final class cssm_x509ext_pair extends ffi.Struct { + external CSSM_X509EXT_TAGandVALUE tagAndValue; + + external ffi.Pointer parsedValue; } -typedef sec_protocol_key_update_complete_t = ffi.Pointer; -typedef Dartsec_protocol_key_update_complete_t - = objc.ObjCBlock; -typedef sec_protocol_challenge_t = ffi.Pointer; -typedef Dartsec_protocol_challenge_t = objc.ObjCBlock< - ffi.Void Function( - objc.NSObject, objc.ObjCBlock)>; -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1)>>() - .asFunction< - void Function(sec_protocol_metadata_t, - sec_protocol_challenge_complete_t)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1) => - (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, - sec_protocol_challenge_complete_t))(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1) { - (objc.getBlockClosure(block) as void Function( - sec_protocol_metadata_t, sec_protocol_challenge_complete_t))(arg0, arg1); - objc.objectRelease(block.cast()); +typedef CSSM_X509EXT_PAIR = cssm_x509ext_pair; +typedef CSSM_X509EXT_PAIR_PTR = ffi.Pointer; + +final class cssm_x509ext_value extends ffi.Union { + external ffi.Pointer tagAndValue; + + external ffi.Pointer parsedValue; + + external ffi.Pointer valuePair; } -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - sec_protocol_metadata_t, sec_protocol_challenge_complete_t)> - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t)>.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerTrampoline) - ..keepIsolateAlive = false; +final class cssm_x509_extension extends ffi.Struct { + external SecAsn1Oid extnId; -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - objc.NSObject, objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(objc.NSObject, - objc.ObjCBlock)>( - pointer, - retain: retain, - release: release); + @CSSM_BOOL() + external int critical; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock)> - fromFunctionPointer(ffi.Pointer> ptr) => - objc.ObjCBlock< - ffi.Void Function(objc.NSObject, - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + @ffi.UnsignedInt() + external int formatAsInt; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock)> - fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_challenge_complete_t) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureCallable, - (sec_protocol_metadata_t arg0, sec_protocol_challenge_complete_t arg1) => fn( - objc.NSObject.castFromPointer(arg0, retain: true, release: true), - ObjCBlock_ffiVoid_seccertificatet.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); + extension_data_format get format => + extension_data_format.fromValue(formatAsInt); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - objc.NSObject, objc.ObjCBlock)> - listener( - void Function(Dartsec_protocol_metadata_t, - Dartsec_protocol_challenge_complete_t) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerCallable - .nativeFunction - .cast(), - (sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1) => - fn( - objc.NSObject.castFromPointer(arg0, - retain: false, release: true), - ObjCBlock_ffiVoid_seccertificatet.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_cmbt6k(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSObject, - objc.ObjCBlock)>(wrapper, - retain: false, release: true); - } -} + external cssm_x509ext_value value; -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - objc.NSObject, objc.ObjCBlock)> { - void call(Dartsec_protocol_metadata_t arg0, - Dartsec_protocol_challenge_complete_t arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1)>>() - .asFunction< - void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer); + external SecAsn1Item BERvalue; } -typedef sec_protocol_challenge_complete_t = ffi.Pointer; -typedef Dartsec_protocol_challenge_complete_t - = objc.ObjCBlock; -typedef sec_protocol_verify_t = ffi.Pointer; -typedef Dartsec_protocol_verify_t = objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)>; -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2)>>() - .asFunction< - void Function(sec_protocol_metadata_t, sec_trust_t, - sec_protocol_verify_complete_t)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2) => - (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, - sec_trust_t, sec_protocol_verify_complete_t))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerTrampoline( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2) { - (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, - sec_trust_t, sec_protocol_verify_complete_t))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); +typedef CSSM_X509_EXTENSION = cssm_x509_extension; +typedef CSSM_X509_EXTENSION_PTR = ffi.Pointer; + +final class cssm_x509_extensions extends ffi.Struct { + @uint32() + external int numberOfExtensions; + + external CSSM_X509_EXTENSION_PTR extensions; } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t)> - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t)>.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerTrampoline) - ..keepIsolateAlive = false; +typedef CSSM_X509_EXTENSIONS = cssm_x509_extensions; +typedef CSSM_X509_EXTENSIONS_PTR = ffi.Pointer; -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)>(pointer, - retain: retain, release: release); +final class cssm_x509_tbs_certificate extends ffi.Struct { + external SecAsn1Item version; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)> - fromFunctionPointer(ffi.Pointer> ptr) => - objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + external SecAsn1Item serialNumber; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock)> - fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_trust_t, Dartsec_protocol_verify_complete_t) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureCallable, - (sec_protocol_metadata_t arg0, sec_trust_t arg1, sec_protocol_verify_complete_t arg2) => fn( - objc.NSObject.castFromPointer(arg0, retain: true, release: true), - objc.NSObject.castFromPointer(arg1, retain: true, release: true), - ObjCBlock_ffiVoid_bool.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); + external SecAsn1AlgId signature; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)> listener( - void Function(Dartsec_protocol_metadata_t, Dartsec_trust_t, - Dartsec_protocol_verify_complete_t) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerCallable - .nativeFunction - .cast(), - (sec_protocol_metadata_t arg0, sec_trust_t arg1, - sec_protocol_verify_complete_t arg2) => - fn( - objc.NSObject.castFromPointer(arg0, - retain: false, release: true), - objc.NSObject.castFromPointer(arg1, - retain: false, release: true), - ObjCBlock_ffiVoid_bool.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_10t0qpd(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)>(wrapper, - retain: false, release: true); - } -} + external CSSM_X509_NAME issuer; -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_CallExtension - on objc.ObjCBlock< - ffi.Void Function(objc.NSObject, objc.NSObject, - objc.ObjCBlock)> { - void call(Dartsec_protocol_metadata_t arg0, Dartsec_trust_t arg1, - Dartsec_protocol_verify_complete_t arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); -} + external CSSM_X509_VALIDITY validity; -typedef sec_protocol_verify_complete_t = ffi.Pointer; -typedef Dartsec_protocol_verify_complete_t - = objc.ObjCBlock; -void _ObjCBlock_ffiVoid_bool_fnPtrTrampoline( - ffi.Pointer block, bool arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Bool)>(_ObjCBlock_ffiVoid_bool_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_bool_closureTrampoline( - ffi.Pointer block, bool arg0) => - (objc.getBlockClosure(block) as void Function(bool))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Bool)>(_ObjCBlock_ffiVoid_bool_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_bool_listenerTrampoline( - ffi.Pointer block, bool arg0) { - (objc.getBlockClosure(block) as void Function(bool))(arg0); - objc.objectRelease(block.cast()); -} + external CSSM_X509_NAME subject; -ffi.NativeCallable, ffi.Bool)> - _ObjCBlock_ffiVoid_bool_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Bool)>.listener(_ObjCBlock_ffiVoid_bool_listenerTrampoline) - ..keepIsolateAlive = false; + external SecAsn1PubKeyInfo subjectPublicKeyInfo; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_bool { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); + external SecAsn1Item issuerUniqueIdentifier; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_bool_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + external SecAsn1Item subjectUniqueIdentifier; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(bool) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_closureCallable, (bool arg0) => fn(arg0)), - retain: false, - release: true); + external CSSM_X509_EXTENSIONS extensions; +} - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(bool) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_bool_listenerCallable.nativeFunction.cast(), - (bool arg0) => fn(arg0)); - final wrapper = _wrapListenerBlock_117qins(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } +typedef CSSM_X509_TBS_CERTIFICATE = cssm_x509_tbs_certificate; +typedef CSSM_X509_TBS_CERTIFICATE_PTR = ffi.Pointer; + +final class cssm_x509_signature extends ffi.Struct { + external SecAsn1AlgId algorithmIdentifier; + + external SecAsn1Item encrypted; } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_bool_CallExtension - on objc.ObjCBlock { - void call(bool arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, ffi.Bool arg0)>>() - .asFunction, bool)>()( - ref.pointer, arg0); +typedef CSSM_X509_SIGNATURE = cssm_x509_signature; +typedef CSSM_X509_SIGNATURE_PTR = ffi.Pointer; + +final class cssm_x509_signed_certificate extends ffi.Struct { + external CSSM_X509_TBS_CERTIFICATE certificate; + + external CSSM_X509_SIGNATURE signature; } -final class SSLContext extends ffi.Opaque {} +typedef CSSM_X509_SIGNED_CERTIFICATE = cssm_x509_signed_certificate; +typedef CSSM_X509_SIGNED_CERTIFICATE_PTR + = ffi.Pointer; -typedef SSLContextRef = ffi.Pointer; +final class cssm_x509ext_policyQualifierInfo extends ffi.Struct { + external SecAsn1Oid policyQualifierId; -enum SSLProtocolSide { - kSSLServerSide(0), - kSSLClientSide(1); + external SecAsn1Item value; +} - final int value; - const SSLProtocolSide(this.value); +typedef CSSM_X509EXT_POLICYQUALIFIERINFO = cssm_x509ext_policyQualifierInfo; +typedef CSSM_X509EXT_POLICYQUALIFIERINFO_PTR + = ffi.Pointer; - static SSLProtocolSide fromValue(int value) => switch (value) { - 0 => kSSLServerSide, - 1 => kSSLClientSide, - _ => throw ArgumentError("Unknown value for SSLProtocolSide: $value"), - }; +final class cssm_x509ext_policyQualifiers extends ffi.Struct { + @uint32() + external int numberOfPolicyQualifiers; + + external ffi.Pointer policyQualifier; } -enum SSLConnectionType { - kSSLStreamType(0), - kSSLDatagramType(1); +typedef CSSM_X509EXT_POLICYQUALIFIERS = cssm_x509ext_policyQualifiers; +typedef CSSM_X509EXT_POLICYQUALIFIERS_PTR + = ffi.Pointer; - final int value; - const SSLConnectionType(this.value); +final class cssm_x509ext_policyInfo extends ffi.Struct { + external SecAsn1Oid policyIdentifier; - static SSLConnectionType fromValue(int value) => switch (value) { - 0 => kSSLStreamType, - 1 => kSSLDatagramType, - _ => throw ArgumentError("Unknown value for SSLConnectionType: $value"), - }; + external CSSM_X509EXT_POLICYQUALIFIERS policyQualifiers; } -enum SSLSessionState { - kSSLIdle(0), - kSSLHandshake(1), - kSSLConnected(2), - kSSLClosed(3), - kSSLAborted(4); +typedef CSSM_X509EXT_POLICYINFO = cssm_x509ext_policyInfo; +typedef CSSM_X509EXT_POLICYINFO_PTR = ffi.Pointer; - final int value; - const SSLSessionState(this.value); +final class cssm_x509_revoked_cert_entry extends ffi.Struct { + external SecAsn1Item certificateSerialNumber; - static SSLSessionState fromValue(int value) => switch (value) { - 0 => kSSLIdle, - 1 => kSSLHandshake, - 2 => kSSLConnected, - 3 => kSSLClosed, - 4 => kSSLAborted, - _ => throw ArgumentError("Unknown value for SSLSessionState: $value"), - }; + external CSSM_X509_TIME revocationDate; + + external CSSM_X509_EXTENSIONS extensions; } -enum SSLSessionOption { - kSSLSessionOptionBreakOnServerAuth(0), - kSSLSessionOptionBreakOnCertRequested(1), - kSSLSessionOptionBreakOnClientAuth(2), - kSSLSessionOptionFalseStart(3), - kSSLSessionOptionSendOneByteRecord(4), - kSSLSessionOptionAllowServerIdentityChange(5), - kSSLSessionOptionFallback(6), - kSSLSessionOptionBreakOnClientHello(7), - kSSLSessionOptionAllowRenegotiation(8), - kSSLSessionOptionEnableSessionTickets(9); +typedef CSSM_X509_REVOKED_CERT_ENTRY = cssm_x509_revoked_cert_entry; +typedef CSSM_X509_REVOKED_CERT_ENTRY_PTR + = ffi.Pointer; - final int value; - const SSLSessionOption(this.value); +final class cssm_x509_revoked_cert_list extends ffi.Struct { + @uint32() + external int numberOfRevokedCertEntries; - static SSLSessionOption fromValue(int value) => switch (value) { - 0 => kSSLSessionOptionBreakOnServerAuth, - 1 => kSSLSessionOptionBreakOnCertRequested, - 2 => kSSLSessionOptionBreakOnClientAuth, - 3 => kSSLSessionOptionFalseStart, - 4 => kSSLSessionOptionSendOneByteRecord, - 5 => kSSLSessionOptionAllowServerIdentityChange, - 6 => kSSLSessionOptionFallback, - 7 => kSSLSessionOptionBreakOnClientHello, - 8 => kSSLSessionOptionAllowRenegotiation, - 9 => kSSLSessionOptionEnableSessionTickets, - _ => throw ArgumentError("Unknown value for SSLSessionOption: $value"), - }; + external CSSM_X509_REVOKED_CERT_ENTRY_PTR revokedCertEntry; } -typedef SSLReadFunc = ffi.Pointer>; -typedef SSLReadFuncFunction = OSStatus Function(SSLConnectionRef connection, - ffi.Pointer data, ffi.Pointer dataLength); -typedef DartSSLReadFuncFunction = DartSInt32 Function( - SSLConnectionRef connection, - ffi.Pointer data, - ffi.Pointer dataLength); -typedef SSLConnectionRef = ffi.Pointer; -typedef SSLWriteFunc = ffi.Pointer>; -typedef SSLWriteFuncFunction = OSStatus Function(SSLConnectionRef connection, - ffi.Pointer data, ffi.Pointer dataLength); -typedef DartSSLWriteFuncFunction = DartSInt32 Function( - SSLConnectionRef connection, - ffi.Pointer data, - ffi.Pointer dataLength); +typedef CSSM_X509_REVOKED_CERT_LIST = cssm_x509_revoked_cert_list; +typedef CSSM_X509_REVOKED_CERT_LIST_PTR + = ffi.Pointer; -enum SSLAuthenticate { - kNeverAuthenticate(0), - kAlwaysAuthenticate(1), - kTryAuthenticate(2); +final class cssm_x509_tbs_certlist extends ffi.Struct { + external SecAsn1Item version; - final int value; - const SSLAuthenticate(this.value); + external SecAsn1AlgId signature; - static SSLAuthenticate fromValue(int value) => switch (value) { - 0 => kNeverAuthenticate, - 1 => kAlwaysAuthenticate, - 2 => kTryAuthenticate, - _ => throw ArgumentError("Unknown value for SSLAuthenticate: $value"), - }; + external CSSM_X509_NAME issuer; + + external CSSM_X509_TIME thisUpdate; + + external CSSM_X509_TIME nextUpdate; + + external CSSM_X509_REVOKED_CERT_LIST_PTR revokedCertificates; + + external CSSM_X509_EXTENSIONS extensions; } -enum SSLClientCertificateState { - kSSLClientCertNone(0), - kSSLClientCertRequested(1), - kSSLClientCertSent(2), - kSSLClientCertRejected(3); +typedef CSSM_X509_TBS_CERTLIST = cssm_x509_tbs_certlist; +typedef CSSM_X509_TBS_CERTLIST_PTR = ffi.Pointer; - final int value; - const SSLClientCertificateState(this.value); +final class cssm_x509_signed_crl extends ffi.Struct { + external CSSM_X509_TBS_CERTLIST tbsCertList; - static SSLClientCertificateState fromValue(int value) => switch (value) { - 0 => kSSLClientCertNone, - 1 => kSSLClientCertRequested, - 2 => kSSLClientCertSent, - 3 => kSSLClientCertRejected, - _ => throw ArgumentError( - "Unknown value for SSLClientCertificateState: $value"), - }; + external CSSM_X509_SIGNATURE signature; } -/// NSURLSession is a replacement API for NSURLConnection. It provides -/// options that affect the policy of, and various aspects of the -/// mechanism by which NSURLRequest objects are retrieved from the -/// network. -/// -/// An NSURLSession may be bound to a delegate object. The delegate is -/// invoked for certain events during the lifetime of a session, such as -/// server authentication or determining whether a resource to be loaded -/// should be converted into a download. -/// -/// NSURLSession instances are thread-safe. -/// -/// The default NSURLSession uses a system provided delegate and is -/// appropriate to use in place of existing code that uses -/// +[NSURLConnection sendAsynchronousRequest:queue:completionHandler:] -/// -/// An NSURLSession creates NSURLSessionTask objects which represent the -/// action of a resource being loaded. These are analogous to -/// NSURLConnection objects but provide for more control and a unified -/// delegate model. -/// -/// NSURLSessionTask objects are always created in a suspended state and -/// must be sent the -resume message before they will execute. -/// -/// Subclasses of NSURLSessionTask are used to syntactically -/// differentiate between data and file downloads. -/// -/// An NSURLSessionDataTask receives the resource as a series of calls to -/// the URLSession:dataTask:didReceiveData: delegate method. This is type of -/// task most commonly associated with retrieving objects for immediate parsing -/// by the consumer. -/// -/// An NSURLSessionUploadTask differs from an NSURLSessionDataTask -/// in how its instance is constructed. Upload tasks are explicitly created -/// by referencing a file or data object to upload, or by utilizing the -/// -URLSession:task:needNewBodyStream: delegate message to supply an upload -/// body. -/// -/// An NSURLSessionDownloadTask will directly write the response data to -/// a temporary file. When completed, the delegate is sent -/// URLSession:downloadTask:didFinishDownloadingToURL: and given an opportunity -/// to move this file to a permanent location in its sandboxed container, or to -/// otherwise read the file. If canceled, an NSURLSessionDownloadTask can -/// produce a data blob that can be used to resume a download at a later -/// time. -/// -/// Beginning with iOS 9 and Mac OS X 10.11, NSURLSessionStream is -/// available as a task type. This allows for direct TCP/IP connection -/// to a given host and port with optional secure handshaking and -/// navigation of proxies. Data tasks may also be upgraded to a -/// NSURLSessionStream task via the HTTP Upgrade: header and appropriate -/// use of the pipelining option of NSURLSessionConfiguration. See RFC -/// 2817 and RFC 6455 for information about the Upgrade: header, and -/// comments below on turning data tasks into stream tasks. -/// -/// An NSURLSessionWebSocketTask is a task that allows clients to connect to servers supporting -/// WebSocket. The task will perform the HTTP handshake to upgrade the connection -/// and once the WebSocket handshake is successful, the client can read and write -/// messages that will be framed using the WebSocket protocol by the framework. -class NSURLSession extends objc.NSObject { - NSURLSession._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); +typedef CSSM_X509_SIGNED_CRL = cssm_x509_signed_crl; +typedef CSSM_X509_SIGNED_CRL_PTR = ffi.Pointer; - /// Constructs a [NSURLSession] that points to the same underlying object as [other]. - NSURLSession.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); +enum __CE_GeneralNameType { + GNT_OtherName(0), + GNT_RFC822Name(1), + GNT_DNSName(2), + GNT_X400Address(3), + GNT_DirectoryName(4), + GNT_EdiPartyName(5), + GNT_URI(6), + GNT_IPAddress(7), + GNT_RegisteredID(8); - /// Constructs a [NSURLSession] that wraps the given raw object pointer. - NSURLSession.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); + final int value; + const __CE_GeneralNameType(this.value); - /// Returns whether [obj] is an instance of [NSURLSession]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSession); - } + static __CE_GeneralNameType fromValue(int value) => switch (value) { + 0 => GNT_OtherName, + 1 => GNT_RFC822Name, + 2 => GNT_DNSName, + 3 => GNT_X400Address, + 4 => GNT_DirectoryName, + 5 => GNT_EdiPartyName, + 6 => GNT_URI, + 7 => GNT_IPAddress, + 8 => GNT_RegisteredID, + _ => + throw ArgumentError("Unknown value for __CE_GeneralNameType: $value"), + }; +} - /// The shared session uses the currently set global NSURLCache, - /// NSHTTPCookieStorage and NSURLCredentialStorage objects. - static NSURLSession getSharedSession() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLSession, _sel_sharedSession); - return NSURLSession.castFromPointer(_ret, retain: true, release: true); - } +final class __CE_OtherName extends ffi.Struct { + external SecAsn1Oid typeId; - /// Customization of NSURLSession occurs during creation of a new session. - /// If you only need to use the convenience routines with custom - /// configuration options it is not necessary to specify a delegate. - /// If you do specify a delegate, the delegate will be retained until after - /// the delegate has been sent the URLSession:didBecomeInvalidWithError: message. - static NSURLSession sessionWithConfiguration_( - NSURLSessionConfiguration configuration) { - final _ret = _objc_msgSend_juohf7(_class_NSURLSession, - _sel_sessionWithConfiguration_, configuration.ref.pointer); - return NSURLSession.castFromPointer(_ret, retain: true, release: true); - } + external SecAsn1Item value; +} - /// sessionWithConfiguration:delegate:delegateQueue: - static NSURLSession sessionWithConfiguration_delegate_delegateQueue_( - NSURLSessionConfiguration configuration, - objc.ObjCObjectBase? delegate, - NSOperationQueue? queue) { - final _ret = _objc_msgSend_aud7dn( - _class_NSURLSession, - _sel_sessionWithConfiguration_delegate_delegateQueue_, - configuration.ref.pointer, - delegate?.ref.pointer ?? ffi.nullptr, - queue?.ref.pointer ?? ffi.nullptr); - return NSURLSession.castFromPointer(_ret, retain: true, release: true); - } +typedef CE_OtherName = __CE_OtherName; - /// delegateQueue - NSOperationQueue get delegateQueue { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegateQueue); - return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); - } +final class __CE_GeneralName extends ffi.Struct { + @ffi.UnsignedInt() + external int nameTypeAsInt; - /// delegate - objc.ObjCObjectBase? get delegate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } + __CE_GeneralNameType get nameType => + __CE_GeneralNameType.fromValue(nameTypeAsInt); - /// configuration - NSURLSessionConfiguration get configuration { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_configuration); - return NSURLSessionConfiguration.castFromPointer(_ret, - retain: true, release: true); - } + @CSSM_BOOL() + external int berEncoded; - /// The sessionDescription property is available for the developer to - /// provide a descriptive label for the session. - objc.NSString? get sessionDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_sessionDescription); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } + external SecAsn1Item name; +} - /// The sessionDescription property is available for the developer to - /// provide a descriptive label for the session. - set sessionDescription(objc.NSString? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setSessionDescription_, - value?.ref.pointer ?? ffi.nullptr); - } +typedef CE_GeneralName = __CE_GeneralName; - /// -finishTasksAndInvalidate returns immediately and existing tasks will be allowed - /// to run to completion. New tasks may not be created. The session - /// will continue to make delegate callbacks until URLSession:didBecomeInvalidWithError: - /// has been issued. - /// - /// -finishTasksAndInvalidate and -invalidateAndCancel do not - /// have any effect on the shared session singleton. - /// - /// When invalidating a background session, it is not safe to create another background - /// session with the same identifier until URLSession:didBecomeInvalidWithError: has - /// been issued. - void finishTasksAndInvalidate() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_finishTasksAndInvalidate); - } +final class __CE_GeneralNames extends ffi.Struct { + @uint32() + external int numNames; - /// -invalidateAndCancel acts as -finishTasksAndInvalidate, but issues - /// -cancel to all outstanding tasks for this session. Note task - /// cancellation is subject to the state of the task, and some tasks may - /// have already have completed at the time they are sent -cancel. - void invalidateAndCancel() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_invalidateAndCancel); - } + external ffi.Pointer generalName; +} - /// empty all cookies, cache and credential stores, removes disk files, issues -flushWithCompletionHandler:. Invokes completionHandler() on the delegate queue. - void resetWithCompletionHandler_( - objc.ObjCBlock completionHandler) { - _objc_msgSend_4daxhl(this.ref.pointer, _sel_resetWithCompletionHandler_, - completionHandler.ref.pointer); - } +typedef CE_GeneralNames = __CE_GeneralNames; - /// flush storage to disk and clear transient network caches. Invokes completionHandler() on the delegate queue. - void flushWithCompletionHandler_( - objc.ObjCBlock completionHandler) { - _objc_msgSend_4daxhl(this.ref.pointer, _sel_flushWithCompletionHandler_, - completionHandler.ref.pointer); - } +final class __CE_AuthorityKeyID extends ffi.Struct { + @CSSM_BOOL() + external int keyIdentifierPresent; - /// invokes completionHandler with outstanding data, upload and download tasks. - void getTasksWithCompletionHandler_( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - completionHandler) { - _objc_msgSend_4daxhl(this.ref.pointer, _sel_getTasksWithCompletionHandler_, - completionHandler.ref.pointer); - } + external SecAsn1Item keyIdentifier; - /// invokes completionHandler with all outstanding tasks. - void getAllTasksWithCompletionHandler_( - objc.ObjCBlock)> - completionHandler) { - _objc_msgSend_4daxhl(this.ref.pointer, - _sel_getAllTasksWithCompletionHandler_, completionHandler.ref.pointer); - } + @CSSM_BOOL() + external int generalNamesPresent; - /// Creates a data task with the given request. The request may have a body stream. - NSURLSessionDataTask dataTaskWithRequest_(NSURLRequest request) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_dataTaskWithRequest_, request.ref.pointer); - return NSURLSessionDataTask.castFromPointer(_ret, - retain: true, release: true); - } + external ffi.Pointer generalNames; - /// Creates a data task to retrieve the contents of the given URL. - NSURLSessionDataTask dataTaskWithURL_(objc.NSURL url) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_dataTaskWithURL_, url.ref.pointer); - return NSURLSessionDataTask.castFromPointer(_ret, - retain: true, release: true); - } + @CSSM_BOOL() + external int serialNumberPresent; - /// Creates an upload task with the given request. The body of the request will be created from the file referenced by fileURL - NSURLSessionUploadTask uploadTaskWithRequest_fromFile_( - NSURLRequest request, objc.NSURL fileURL) { - final _ret = _objc_msgSend_iq11qg( - this.ref.pointer, - _sel_uploadTaskWithRequest_fromFile_, - request.ref.pointer, - fileURL.ref.pointer); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: true, release: true); - } + external SecAsn1Item serialNumber; +} - /// Creates an upload task with the given request. The body of the request is provided from the bodyData. - NSURLSessionUploadTask uploadTaskWithRequest_fromData_( - NSURLRequest request, objc.NSData bodyData) { - final _ret = _objc_msgSend_iq11qg( - this.ref.pointer, - _sel_uploadTaskWithRequest_fromData_, - request.ref.pointer, - bodyData.ref.pointer); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: true, release: true); - } +typedef CE_AuthorityKeyID = __CE_AuthorityKeyID; +typedef CE_SubjectKeyID = SecAsn1Item; +typedef CE_KeyUsage = uint16; +typedef CE_CrlReason = uint32; - /// Creates an upload task from a resume data blob. Requires the server to support the latest resumable uploads - /// Internet-Draft from the HTTP Working Group, found at - /// https://datatracker.ietf.org/doc/draft-ietf-httpbis-resumable-upload/ - /// If resuming from an upload file, the file must still exist and be unmodified. If the upload cannot be successfully - /// resumed, URLSession:task:didCompleteWithError: will be called. - /// - /// - Parameter resumeData: Resume data blob from an incomplete upload, such as data returned by the cancelByProducingResumeData: method. - /// - Returns: A new session upload task, or nil if the resumeData is invalid. - NSURLSessionUploadTask uploadTaskWithResumeData_(objc.NSData resumeData) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_uploadTaskWithResumeData_, resumeData.ref.pointer); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: true, release: true); - } +final class __CE_ExtendedKeyUsage extends ffi.Struct { + @uint32() + external int numPurposes; - /// Creates an upload task with the given request. The previously set body stream of the request (if any) is ignored and the URLSession:task:needNewBodyStream: delegate will be called when the body payload is required. - NSURLSessionUploadTask uploadTaskWithStreamedRequest_(NSURLRequest request) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_uploadTaskWithStreamedRequest_, request.ref.pointer); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: true, release: true); - } + external CSSM_OID_PTR purposes; +} - /// Creates a download task with the given request. - NSURLSessionDownloadTask downloadTaskWithRequest_(NSURLRequest request) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_downloadTaskWithRequest_, request.ref.pointer); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: true, release: true); - } +typedef CE_ExtendedKeyUsage = __CE_ExtendedKeyUsage; - /// Creates a download task to download the contents of the given URL. - NSURLSessionDownloadTask downloadTaskWithURL_(objc.NSURL url) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_downloadTaskWithURL_, url.ref.pointer); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: true, release: true); - } +final class __CE_BasicConstraints extends ffi.Struct { + @CSSM_BOOL() + external int cA; - /// Creates a download task with the resume data. If the download cannot be successfully resumed, URLSession:task:didCompleteWithError: will be called. - NSURLSessionDownloadTask downloadTaskWithResumeData_(objc.NSData resumeData) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_downloadTaskWithResumeData_, resumeData.ref.pointer); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: true, release: true); - } + @CSSM_BOOL() + external int pathLenConstraintPresent; - /// Creates a bidirectional stream task to a given host and port. - NSURLSessionStreamTask streamTaskWithHostName_port_( - objc.NSString hostname, DartNSInteger port) { - final _ret = _objc_msgSend_spwp90(this.ref.pointer, - _sel_streamTaskWithHostName_port_, hostname.ref.pointer, port); - return NSURLSessionStreamTask.castFromPointer(_ret, - retain: true, release: true); - } + @uint32() + external int pathLenConstraint; +} - /// Creates a bidirectional stream task with an NSNetService to identify the endpoint. - /// The NSNetService will be resolved before any IO completes. - NSURLSessionStreamTask streamTaskWithNetService_(NSNetService service) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_streamTaskWithNetService_, service.ref.pointer); - return NSURLSessionStreamTask.castFromPointer(_ret, - retain: true, release: true); - } +typedef CE_BasicConstraints = __CE_BasicConstraints; - /// Creates a WebSocket task given the url. The given url must have a ws or wss scheme. - NSURLSessionWebSocketTask webSocketTaskWithURL_(objc.NSURL url) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_webSocketTaskWithURL_, url.ref.pointer); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: true, release: true); - } +final class __CE_PolicyQualifierInfo extends ffi.Struct { + external SecAsn1Oid policyQualifierId; - /// Creates a WebSocket task given the url and an array of protocols. The protocols will be used in the WebSocket handshake to - /// negotiate a preferred protocol with the server - /// Note - The protocol will not affect the WebSocket framing. More details on the protocol can be found by reading the WebSocket RFC - NSURLSessionWebSocketTask webSocketTaskWithURL_protocols_( - objc.NSURL url, objc.ObjCObjectBase protocols) { - final _ret = _objc_msgSend_iq11qg( - this.ref.pointer, - _sel_webSocketTaskWithURL_protocols_, - url.ref.pointer, - protocols.ref.pointer); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: true, release: true); - } + external SecAsn1Item qualifier; +} - /// Creates a WebSocket task given the request. The request properties can be modified and will be used by the task during the HTTP handshake phase. - /// Clients who want to add custom protocols can do so by directly adding headers with the key Sec-WebSocket-Protocol - /// and a comma separated list of protocols they wish to negotiate with the server. The custom HTTP headers provided by the client will remain unchanged for the handshake with the server. - NSURLSessionWebSocketTask webSocketTaskWithRequest_(NSURLRequest request) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_webSocketTaskWithRequest_, request.ref.pointer); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: true, release: true); - } +typedef CE_PolicyQualifierInfo = __CE_PolicyQualifierInfo; - /// init - NSURLSession init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSession.castFromPointer(_ret, retain: false, release: true); - } +final class __CE_PolicyInformation extends ffi.Struct { + external SecAsn1Oid certPolicyId; - /// new - static NSURLSession new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLSession, _sel_new); - return NSURLSession.castFromPointer(_ret, retain: false, release: true); - } + @uint32() + external int numPolicyQualifiers; - /// dataTaskWithRequest:completionHandler: - NSURLSessionDataTask dataTaskWithRequest_completionHandler_( - NSURLRequest request, - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> - completionHandler) { - final _ret = _objc_msgSend_1kkhn3j( - this.ref.pointer, - _sel_dataTaskWithRequest_completionHandler_, - request.ref.pointer, - completionHandler.ref.pointer); - return NSURLSessionDataTask.castFromPointer(_ret, - retain: true, release: true); - } + external ffi.Pointer policyQualifiers; +} - /// dataTaskWithURL:completionHandler: - NSURLSessionDataTask dataTaskWithURL_completionHandler_( - objc.NSURL url, - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> - completionHandler) { - final _ret = _objc_msgSend_1kkhn3j( - this.ref.pointer, - _sel_dataTaskWithURL_completionHandler_, - url.ref.pointer, - completionHandler.ref.pointer); - return NSURLSessionDataTask.castFromPointer(_ret, - retain: true, release: true); - } +typedef CE_PolicyInformation = __CE_PolicyInformation; - /// uploadTaskWithRequest:fromFile:completionHandler: - NSURLSessionUploadTask uploadTaskWithRequest_fromFile_completionHandler_( - NSURLRequest request, - objc.NSURL fileURL, - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> - completionHandler) { - final _ret = _objc_msgSend_37obke( - this.ref.pointer, - _sel_uploadTaskWithRequest_fromFile_completionHandler_, - request.ref.pointer, - fileURL.ref.pointer, - completionHandler.ref.pointer); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: true, release: true); - } +final class __CE_CertPolicies extends ffi.Struct { + @uint32() + external int numPolicies; - /// uploadTaskWithRequest:fromData:completionHandler: - NSURLSessionUploadTask uploadTaskWithRequest_fromData_completionHandler_( - NSURLRequest request, - objc.NSData? bodyData, - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> - completionHandler) { - final _ret = _objc_msgSend_37obke( - this.ref.pointer, - _sel_uploadTaskWithRequest_fromData_completionHandler_, - request.ref.pointer, - bodyData?.ref.pointer ?? ffi.nullptr, - completionHandler.ref.pointer); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: true, release: true); - } + external ffi.Pointer policies; +} - /// uploadTaskWithResumeData:completionHandler: - NSURLSessionUploadTask uploadTaskWithResumeData_completionHandler_( - objc.NSData resumeData, - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> - completionHandler) { - final _ret = _objc_msgSend_1kkhn3j( - this.ref.pointer, - _sel_uploadTaskWithResumeData_completionHandler_, - resumeData.ref.pointer, - completionHandler.ref.pointer); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: true, release: true); - } +typedef CE_CertPolicies = __CE_CertPolicies; +typedef CE_NetscapeCertType = uint16; +typedef CE_CrlDistReasonFlags = uint8; - /// downloadTaskWithRequest:completionHandler: - NSURLSessionDownloadTask downloadTaskWithRequest_completionHandler_( - NSURLRequest request, - objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> - completionHandler) { - final _ret = _objc_msgSend_1kkhn3j( - this.ref.pointer, - _sel_downloadTaskWithRequest_completionHandler_, - request.ref.pointer, - completionHandler.ref.pointer); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: true, release: true); - } +enum __CE_CrlDistributionPointNameType { + CE_CDNT_FullName(0), + CE_CDNT_NameRelativeToCrlIssuer(1); - /// downloadTaskWithURL:completionHandler: - NSURLSessionDownloadTask downloadTaskWithURL_completionHandler_( - objc.NSURL url, - objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> - completionHandler) { - final _ret = _objc_msgSend_1kkhn3j( - this.ref.pointer, - _sel_downloadTaskWithURL_completionHandler_, - url.ref.pointer, - completionHandler.ref.pointer); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: true, release: true); - } + final int value; + const __CE_CrlDistributionPointNameType(this.value); - /// downloadTaskWithResumeData:completionHandler: - NSURLSessionDownloadTask downloadTaskWithResumeData_completionHandler_( - objc.NSData resumeData, - objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> - completionHandler) { - final _ret = _objc_msgSend_1kkhn3j( - this.ref.pointer, - _sel_downloadTaskWithResumeData_completionHandler_, - resumeData.ref.pointer, - completionHandler.ref.pointer); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: true, release: true); - } + static __CE_CrlDistributionPointNameType fromValue(int value) => + switch (value) { + 0 => CE_CDNT_FullName, + 1 => CE_CDNT_NameRelativeToCrlIssuer, + _ => throw ArgumentError( + "Unknown value for __CE_CrlDistributionPointNameType: $value"), + }; +} - /// allocWithZone: - static NSURLSession allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSURLSession, _sel_allocWithZone_, zone); - return NSURLSession.castFromPointer(_ret, retain: false, release: true); - } +final class UnnamedUnion5 extends ffi.Union { + external ffi.Pointer fullName; - /// alloc - static NSURLSession alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLSession, _sel_alloc); - return NSURLSession.castFromPointer(_ret, retain: false, release: true); - } + external CSSM_X509_RDN_PTR rdn; } -late final _class_NSURLSession = objc.getClass("NSURLSession"); -late final _sel_sharedSession = objc.registerName("sharedSession"); +final class __CE_DistributionPointName extends ffi.Struct { + @ffi.UnsignedInt() + external int nameTypeAsInt; -/// Configuration options for an NSURLSession. When a session is -/// created, a copy of the configuration object is made - you cannot -/// modify the configuration of a session after it has been created. -/// -/// The shared session uses the global singleton credential, cache -/// and cookie storage objects. -/// -/// An ephemeral session has no persistent disk storage for cookies, -/// cache or credentials. -/// -/// A background session can be used to perform networking operations -/// on behalf of a suspended application, within certain constraints. -class NSURLSessionConfiguration extends objc.NSObject { - NSURLSessionConfiguration._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + __CE_CrlDistributionPointNameType get nameType => + __CE_CrlDistributionPointNameType.fromValue(nameTypeAsInt); - /// Constructs a [NSURLSessionConfiguration] that points to the same underlying object as [other]. - NSURLSessionConfiguration.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + external UnnamedUnion5 dpn; +} - /// Constructs a [NSURLSessionConfiguration] that wraps the given raw object pointer. - NSURLSessionConfiguration.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); +typedef CE_DistributionPointName = __CE_DistributionPointName; - /// Returns whether [obj] is an instance of [NSURLSessionConfiguration]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionConfiguration); - } +final class __CE_CRLDistributionPoint extends ffi.Struct { + external ffi.Pointer distPointName; - /// defaultSessionConfiguration - static NSURLSessionConfiguration getDefaultSessionConfiguration() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSURLSessionConfiguration, _sel_defaultSessionConfiguration); - return NSURLSessionConfiguration.castFromPointer(_ret, - retain: true, release: true); - } + @CSSM_BOOL() + external int reasonsPresent; - /// ephemeralSessionConfiguration - static NSURLSessionConfiguration getEphemeralSessionConfiguration() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSURLSessionConfiguration, _sel_ephemeralSessionConfiguration); - return NSURLSessionConfiguration.castFromPointer(_ret, - retain: true, release: true); - } + @CE_CrlDistReasonFlags() + external int reasons; - /// backgroundSessionConfigurationWithIdentifier: - static NSURLSessionConfiguration - backgroundSessionConfigurationWithIdentifier_(objc.NSString identifier) { - final _ret = _objc_msgSend_juohf7( - _class_NSURLSessionConfiguration, - _sel_backgroundSessionConfigurationWithIdentifier_, - identifier.ref.pointer); - return NSURLSessionConfiguration.castFromPointer(_ret, - retain: true, release: true); - } + external ffi.Pointer crlIssuer; +} - /// identifier for the background session configuration - objc.NSString? get identifier { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_identifier); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } +typedef CE_CRLDistributionPoint = __CE_CRLDistributionPoint; - /// default cache policy for requests - NSURLRequestCachePolicy get requestCachePolicy { - final _ret = - _objc_msgSend_2xak1q(this.ref.pointer, _sel_requestCachePolicy); - return NSURLRequestCachePolicy.fromValue(_ret); - } +final class __CE_CRLDistPointsSyntax extends ffi.Struct { + @uint32() + external int numDistPoints; - /// default cache policy for requests - set requestCachePolicy(NSURLRequestCachePolicy value) { - return _objc_msgSend_12vaadl( - this.ref.pointer, _sel_setRequestCachePolicy_, value.value); - } + external ffi.Pointer distPoints; +} - /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. - DartNSTimeInterval get timeoutIntervalForRequest { - return _objc_msgSend_10noklm( - this.ref.pointer, _sel_timeoutIntervalForRequest); - } +typedef CE_CRLDistPointsSyntax = __CE_CRLDistPointsSyntax; - /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. - set timeoutIntervalForRequest(DartNSTimeInterval value) { - return _objc_msgSend_suh039( - this.ref.pointer, _sel_setTimeoutIntervalForRequest_, value); - } +final class __CE_AccessDescription extends ffi.Struct { + external SecAsn1Oid accessMethod; - /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. - DartNSTimeInterval get timeoutIntervalForResource { - return _objc_msgSend_10noklm( - this.ref.pointer, _sel_timeoutIntervalForResource); - } + external CE_GeneralName accessLocation; +} - /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. - set timeoutIntervalForResource(DartNSTimeInterval value) { - return _objc_msgSend_suh039( - this.ref.pointer, _sel_setTimeoutIntervalForResource_, value); - } +typedef CE_AccessDescription = __CE_AccessDescription; - /// type of service for requests. - NSURLRequestNetworkServiceType get networkServiceType { - final _ret = - _objc_msgSend_ttt73t(this.ref.pointer, _sel_networkServiceType); - return NSURLRequestNetworkServiceType.fromValue(_ret); - } +final class __CE_AuthorityInfoAccess extends ffi.Struct { + @uint32() + external int numAccessDescriptions; - /// type of service for requests. - set networkServiceType(NSURLRequestNetworkServiceType value) { - return _objc_msgSend_br89tg( - this.ref.pointer, _sel_setNetworkServiceType_, value.value); - } + external ffi.Pointer accessDescriptions; +} - /// allow request to route over cellular. - bool get allowsCellularAccess { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_allowsCellularAccess); - } +typedef CE_AuthorityInfoAccess = __CE_AuthorityInfoAccess; +typedef CE_NameRegistrationAuthorities = CE_GeneralNames; - /// allow request to route over cellular. - set allowsCellularAccess(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setAllowsCellularAccess_, value); - } +final class __CE_SemanticsInformation extends ffi.Struct { + external ffi.Pointer semanticsIdentifier; - /// allow request to route over expensive networks. Defaults to YES. - bool get allowsExpensiveNetworkAccess { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_allowsExpensiveNetworkAccess); - } + external ffi.Pointer + nameRegistrationAuthorities; +} - /// allow request to route over expensive networks. Defaults to YES. - set allowsExpensiveNetworkAccess(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setAllowsExpensiveNetworkAccess_, value); - } +typedef CE_SemanticsInformation = __CE_SemanticsInformation; - /// allow request to route over networks in constrained mode. Defaults to YES. - bool get allowsConstrainedNetworkAccess { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_allowsConstrainedNetworkAccess); - } +final class __CE_QC_Statement extends ffi.Struct { + external SecAsn1Oid statementId; - /// allow request to route over networks in constrained mode. Defaults to YES. - set allowsConstrainedNetworkAccess(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setAllowsConstrainedNetworkAccess_, value); - } + external ffi.Pointer semanticsInfo; - /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. - bool get requiresDNSSECValidation { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_requiresDNSSECValidation); - } + external ffi.Pointer otherInfo; +} - /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. - set requiresDNSSECValidation(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setRequiresDNSSECValidation_, value); - } +typedef CE_QC_Statement = __CE_QC_Statement; - /// Causes tasks to wait for network connectivity to become available, rather - /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) - /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest - /// property does not apply, but the timeoutIntervalForResource property does. - /// - /// Unsatisfactory connectivity (that requires waiting) includes cases where the - /// device has limited or insufficient connectivity for a task (e.g., only has a - /// cellular connection but the allowsCellularAccess property is NO, or requires - /// a VPN connection in order to reach the desired host). - /// - /// Default value is NO. Ignored by background sessions, as background sessions - /// always wait for connectivity. - bool get waitsForConnectivity { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_waitsForConnectivity); - } +final class __CE_QC_Statements extends ffi.Struct { + @uint32() + external int numQCStatements; - /// Causes tasks to wait for network connectivity to become available, rather - /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) - /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest - /// property does not apply, but the timeoutIntervalForResource property does. - /// - /// Unsatisfactory connectivity (that requires waiting) includes cases where the - /// device has limited or insufficient connectivity for a task (e.g., only has a - /// cellular connection but the allowsCellularAccess property is NO, or requires - /// a VPN connection in order to reach the desired host). - /// - /// Default value is NO. Ignored by background sessions, as background sessions - /// always wait for connectivity. - set waitsForConnectivity(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setWaitsForConnectivity_, value); - } + external ffi.Pointer qcStatements; +} - /// allows background tasks to be scheduled at the discretion of the system for optimal performance. - bool get discretionary { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isDiscretionary); - } +typedef CE_QC_Statements = __CE_QC_Statements; +typedef CE_CrlNumber = uint32; +typedef CE_DeltaCrl = uint32; - /// allows background tasks to be scheduled at the discretion of the system for optimal performance. - set discretionary(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setDiscretionary_, value); - } +final class __CE_IssuingDistributionPoint extends ffi.Struct { + external ffi.Pointer distPointName; - /// The identifier of the shared data container into which files in background sessions should be downloaded. - /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or - /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. - objc.NSString? get sharedContainerIdentifier { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_sharedContainerIdentifier); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } + @CSSM_BOOL() + external int onlyUserCertsPresent; - /// The identifier of the shared data container into which files in background sessions should be downloaded. - /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or - /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. - set sharedContainerIdentifier(objc.NSString? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setSharedContainerIdentifier_, value?.ref.pointer ?? ffi.nullptr); - } + @CSSM_BOOL() + external int onlyUserCerts; - /// Allows the app to be resumed or launched in the background when tasks in background sessions complete - /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: - /// and the default value is YES. - /// - /// NOTE: macOS apps based on AppKit do not support background launch. - bool get sessionSendsLaunchEvents { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_sessionSendsLaunchEvents); - } + @CSSM_BOOL() + external int onlyCACertsPresent; - /// Allows the app to be resumed or launched in the background when tasks in background sessions complete - /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: - /// and the default value is YES. - /// - /// NOTE: macOS apps based on AppKit do not support background launch. - set sessionSendsLaunchEvents(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setSessionSendsLaunchEvents_, value); - } + @CSSM_BOOL() + external int onlyCACerts; - /// The proxy dictionary, as described by - objc.NSDictionary? get connectionProxyDictionary { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_connectionProxyDictionary); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } + @CSSM_BOOL() + external int onlySomeReasonsPresent; - /// The proxy dictionary, as described by - set connectionProxyDictionary(objc.NSDictionary? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setConnectionProxyDictionary_, value?.ref.pointer ?? ffi.nullptr); - } + @CE_CrlDistReasonFlags() + external int onlySomeReasons; - /// The minimum allowable versions of the TLS protocol, from - SSLProtocol get TLSMinimumSupportedProtocol { - final _ret = _objc_msgSend_ewo6ux( - this.ref.pointer, _sel_TLSMinimumSupportedProtocol); - return SSLProtocol.fromValue(_ret); - } + @CSSM_BOOL() + external int indirectCrlPresent; - /// The minimum allowable versions of the TLS protocol, from - set TLSMinimumSupportedProtocol(SSLProtocol value) { - return _objc_msgSend_hcgw10( - this.ref.pointer, _sel_setTLSMinimumSupportedProtocol_, value.value); - } + @CSSM_BOOL() + external int indirectCrl; +} - /// The maximum allowable versions of the TLS protocol, from - SSLProtocol get TLSMaximumSupportedProtocol { - final _ret = _objc_msgSend_ewo6ux( - this.ref.pointer, _sel_TLSMaximumSupportedProtocol); - return SSLProtocol.fromValue(_ret); - } +typedef CE_IssuingDistributionPoint = __CE_IssuingDistributionPoint; - /// The maximum allowable versions of the TLS protocol, from - set TLSMaximumSupportedProtocol(SSLProtocol value) { - return _objc_msgSend_hcgw10( - this.ref.pointer, _sel_setTLSMaximumSupportedProtocol_, value.value); - } +final class __CE_GeneralSubtree extends ffi.Struct { + external ffi.Pointer base; - /// The minimum allowable versions of the TLS protocol, from - tls_protocol_version_t get TLSMinimumSupportedProtocolVersion { - final _ret = _objc_msgSend_a6qtz( - this.ref.pointer, _sel_TLSMinimumSupportedProtocolVersion); - return tls_protocol_version_t.fromValue(_ret); - } + @uint32() + external int minimum; - /// The minimum allowable versions of the TLS protocol, from - set TLSMinimumSupportedProtocolVersion(tls_protocol_version_t value) { - return _objc_msgSend_yb8bfm(this.ref.pointer, - _sel_setTLSMinimumSupportedProtocolVersion_, value.value); - } + @CSSM_BOOL() + external int maximumPresent; - /// The maximum allowable versions of the TLS protocol, from - tls_protocol_version_t get TLSMaximumSupportedProtocolVersion { - final _ret = _objc_msgSend_a6qtz( - this.ref.pointer, _sel_TLSMaximumSupportedProtocolVersion); - return tls_protocol_version_t.fromValue(_ret); - } + @uint32() + external int maximum; +} - /// The maximum allowable versions of the TLS protocol, from - set TLSMaximumSupportedProtocolVersion(tls_protocol_version_t value) { - return _objc_msgSend_yb8bfm(this.ref.pointer, - _sel_setTLSMaximumSupportedProtocolVersion_, value.value); - } +typedef CE_GeneralSubtree = __CE_GeneralSubtree; - /// Allow the use of HTTP pipelining - bool get HTTPShouldUsePipelining { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldUsePipelining); - } +final class __CE_GeneralSubtrees extends ffi.Struct { + @uint32() + external int numSubtrees; - /// Allow the use of HTTP pipelining - set HTTPShouldUsePipelining(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setHTTPShouldUsePipelining_, value); - } + external ffi.Pointer subtrees; +} - /// Allow the session to set cookies on requests - bool get HTTPShouldSetCookies { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldSetCookies); - } +typedef CE_GeneralSubtrees = __CE_GeneralSubtrees; - /// Allow the session to set cookies on requests - set HTTPShouldSetCookies(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setHTTPShouldSetCookies_, value); - } +final class __CE_NameConstraints extends ffi.Struct { + external ffi.Pointer permitted; - /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. - NSHTTPCookieAcceptPolicy get HTTPCookieAcceptPolicy { - final _ret = - _objc_msgSend_1jpuqgg(this.ref.pointer, _sel_HTTPCookieAcceptPolicy); - return NSHTTPCookieAcceptPolicy.fromValue(_ret); - } + external ffi.Pointer excluded; +} - /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. - set HTTPCookieAcceptPolicy(NSHTTPCookieAcceptPolicy value) { - return _objc_msgSend_199e8fv( - this.ref.pointer, _sel_setHTTPCookieAcceptPolicy_, value.value); - } +typedef CE_NameConstraints = __CE_NameConstraints; - /// Specifies additional headers which will be set on outgoing requests. - /// Note that these headers are added to the request only if not already present. - objc.NSDictionary? get HTTPAdditionalHeaders { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPAdditionalHeaders); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } +final class __CE_PolicyMapping extends ffi.Struct { + external SecAsn1Oid issuerDomainPolicy; - /// Specifies additional headers which will be set on outgoing requests. - /// Note that these headers are added to the request only if not already present. - set HTTPAdditionalHeaders(objc.NSDictionary? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setHTTPAdditionalHeaders_, value?.ref.pointer ?? ffi.nullptr); - } + external SecAsn1Oid subjectDomainPolicy; +} - /// The maximum number of simultaneous persistent connections per host - DartNSInteger get HTTPMaximumConnectionsPerHost { - return _objc_msgSend_z1fx1b( - this.ref.pointer, _sel_HTTPMaximumConnectionsPerHost); - } +typedef CE_PolicyMapping = __CE_PolicyMapping; - /// The maximum number of simultaneous persistent connections per host - set HTTPMaximumConnectionsPerHost(DartNSInteger value) { - return _objc_msgSend_ke7qz2( - this.ref.pointer, _sel_setHTTPMaximumConnectionsPerHost_, value); - } +final class __CE_PolicyMappings extends ffi.Struct { + @uint32() + external int numPolicyMappings; - /// The cookie storage object to use, or nil to indicate that no cookies should be handled - NSHTTPCookieStorage? get HTTPCookieStorage { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPCookieStorage); - return _ret.address == 0 - ? null - : NSHTTPCookieStorage.castFromPointer(_ret, - retain: true, release: true); - } + external ffi.Pointer policyMappings; +} - /// The cookie storage object to use, or nil to indicate that no cookies should be handled - set HTTPCookieStorage(NSHTTPCookieStorage? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setHTTPCookieStorage_, - value?.ref.pointer ?? ffi.nullptr); - } +typedef CE_PolicyMappings = __CE_PolicyMappings; - /// The credential storage object, or nil to indicate that no credential storage is to be used - NSURLCredentialStorage? get URLCredentialStorage { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_URLCredentialStorage); - return _ret.address == 0 - ? null - : NSURLCredentialStorage.castFromPointer(_ret, - retain: true, release: true); - } +final class __CE_PolicyConstraints extends ffi.Struct { + @CSSM_BOOL() + external int requireExplicitPolicyPresent; - /// The credential storage object, or nil to indicate that no credential storage is to be used - set URLCredentialStorage(NSURLCredentialStorage? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setURLCredentialStorage_, - value?.ref.pointer ?? ffi.nullptr); - } + @uint32() + external int requireExplicitPolicy; - /// The URL resource cache, or nil to indicate that no caching is to be performed - NSURLCache? get URLCache { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_URLCache); - return _ret.address == 0 - ? null - : NSURLCache.castFromPointer(_ret, retain: true, release: true); - } + @CSSM_BOOL() + external int inhibitPolicyMappingPresent; - /// The URL resource cache, or nil to indicate that no caching is to be performed - set URLCache(NSURLCache? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setURLCache_, value?.ref.pointer ?? ffi.nullptr); - } + @uint32() + external int inhibitPolicyMapping; +} - /// Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open - /// and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) - bool get shouldUseExtendedBackgroundIdleMode { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_shouldUseExtendedBackgroundIdleMode); - } +typedef CE_PolicyConstraints = __CE_PolicyConstraints; +typedef CE_InhibitAnyPolicy = uint32; - /// Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open - /// and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) - set shouldUseExtendedBackgroundIdleMode(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setShouldUseExtendedBackgroundIdleMode_, value); - } +enum __CE_DataType { + DT_AuthorityKeyID(0), + DT_SubjectKeyID(1), + DT_KeyUsage(2), + DT_SubjectAltName(3), + DT_IssuerAltName(4), + DT_ExtendedKeyUsage(5), + DT_BasicConstraints(6), + DT_CertPolicies(7), + DT_NetscapeCertType(8), + DT_CrlNumber(9), + DT_DeltaCrl(10), + DT_CrlReason(11), + DT_CrlDistributionPoints(12), + DT_IssuingDistributionPoint(13), + DT_AuthorityInfoAccess(14), + DT_Other(15), + DT_QC_Statements(16), + DT_NameConstraints(17), + DT_PolicyMappings(18), + DT_PolicyConstraints(19), + DT_InhibitAnyPolicy(20); - /// An optional array of Class objects which subclass NSURLProtocol. - /// The Class will be sent +canInitWithRequest: when determining if - /// an instance of the class can be used for a given URL scheme. - /// You should not use +[NSURLProtocol registerClass:], as that - /// method will register your class with the default session rather - /// than with an instance of NSURLSession. - /// Custom NSURLProtocol subclasses are not available to background - /// sessions. - objc.ObjCObjectBase? get protocolClasses { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_protocolClasses); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } + final int value; + const __CE_DataType(this.value); - /// An optional array of Class objects which subclass NSURLProtocol. - /// The Class will be sent +canInitWithRequest: when determining if - /// an instance of the class can be used for a given URL scheme. - /// You should not use +[NSURLProtocol registerClass:], as that - /// method will register your class with the default session rather - /// than with an instance of NSURLSession. - /// Custom NSURLProtocol subclasses are not available to background - /// sessions. - set protocolClasses(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setProtocolClasses_, - value?.ref.pointer ?? ffi.nullptr); - } + static __CE_DataType fromValue(int value) => switch (value) { + 0 => DT_AuthorityKeyID, + 1 => DT_SubjectKeyID, + 2 => DT_KeyUsage, + 3 => DT_SubjectAltName, + 4 => DT_IssuerAltName, + 5 => DT_ExtendedKeyUsage, + 6 => DT_BasicConstraints, + 7 => DT_CertPolicies, + 8 => DT_NetscapeCertType, + 9 => DT_CrlNumber, + 10 => DT_DeltaCrl, + 11 => DT_CrlReason, + 12 => DT_CrlDistributionPoints, + 13 => DT_IssuingDistributionPoint, + 14 => DT_AuthorityInfoAccess, + 15 => DT_Other, + 16 => DT_QC_Statements, + 17 => DT_NameConstraints, + 18 => DT_PolicyMappings, + 19 => DT_PolicyConstraints, + 20 => DT_InhibitAnyPolicy, + _ => throw ArgumentError("Unknown value for __CE_DataType: $value"), + }; +} - /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone - NSURLSessionMultipathServiceType get multipathServiceType { - final _ret = - _objc_msgSend_zqvllq(this.ref.pointer, _sel_multipathServiceType); - return NSURLSessionMultipathServiceType.fromValue(_ret); - } +final class CE_Data extends ffi.Union { + external CE_AuthorityKeyID authorityKeyID; - /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone - set multipathServiceType(NSURLSessionMultipathServiceType value) { - return _objc_msgSend_1ngj1qh( - this.ref.pointer, _sel_setMultipathServiceType_, value.value); - } + external CE_SubjectKeyID subjectKeyID; - /// init - NSURLSessionConfiguration init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSessionConfiguration.castFromPointer(_ret, - retain: false, release: true); - } + @CE_KeyUsage() + external int keyUsage; - /// new - static NSURLSessionConfiguration new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionConfiguration, _sel_new); - return NSURLSessionConfiguration.castFromPointer(_ret, - retain: false, release: true); - } + external CE_GeneralNames subjectAltName; - /// backgroundSessionConfiguration: - static NSURLSessionConfiguration backgroundSessionConfiguration_( - objc.NSString identifier) { - final _ret = _objc_msgSend_juohf7(_class_NSURLSessionConfiguration, - _sel_backgroundSessionConfiguration_, identifier.ref.pointer); - return NSURLSessionConfiguration.castFromPointer(_ret, - retain: true, release: true); - } + external CE_GeneralNames issuerAltName; - /// allocWithZone: - static NSURLSessionConfiguration allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSURLSessionConfiguration, _sel_allocWithZone_, zone); - return NSURLSessionConfiguration.castFromPointer(_ret, - retain: false, release: true); - } + external CE_ExtendedKeyUsage extendedKeyUsage; - /// alloc - static NSURLSessionConfiguration alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionConfiguration, _sel_alloc); - return NSURLSessionConfiguration.castFromPointer(_ret, - retain: false, release: true); - } -} + external CE_BasicConstraints basicConstraints; -late final _class_NSURLSessionConfiguration = - objc.getClass("NSURLSessionConfiguration"); -late final _sel_defaultSessionConfiguration = - objc.registerName("defaultSessionConfiguration"); -late final _sel_ephemeralSessionConfiguration = - objc.registerName("ephemeralSessionConfiguration"); -late final _sel_backgroundSessionConfigurationWithIdentifier_ = - objc.registerName("backgroundSessionConfigurationWithIdentifier:"); -late final _sel_identifier = objc.registerName("identifier"); -late final _sel_requestCachePolicy = objc.registerName("requestCachePolicy"); -late final _sel_setRequestCachePolicy_ = - objc.registerName("setRequestCachePolicy:"); -late final _sel_timeoutIntervalForRequest = - objc.registerName("timeoutIntervalForRequest"); -late final _sel_setTimeoutIntervalForRequest_ = - objc.registerName("setTimeoutIntervalForRequest:"); -late final _sel_timeoutIntervalForResource = - objc.registerName("timeoutIntervalForResource"); -late final _sel_setTimeoutIntervalForResource_ = - objc.registerName("setTimeoutIntervalForResource:"); -late final _sel_waitsForConnectivity = - objc.registerName("waitsForConnectivity"); -late final _sel_setWaitsForConnectivity_ = - objc.registerName("setWaitsForConnectivity:"); -late final _sel_isDiscretionary = objc.registerName("isDiscretionary"); -late final _sel_setDiscretionary_ = objc.registerName("setDiscretionary:"); -late final _sel_sharedContainerIdentifier = - objc.registerName("sharedContainerIdentifier"); -late final _sel_setSharedContainerIdentifier_ = - objc.registerName("setSharedContainerIdentifier:"); -late final _sel_sessionSendsLaunchEvents = - objc.registerName("sessionSendsLaunchEvents"); -late final _sel_setSessionSendsLaunchEvents_ = - objc.registerName("setSessionSendsLaunchEvents:"); -late final _sel_connectionProxyDictionary = - objc.registerName("connectionProxyDictionary"); -late final _sel_setConnectionProxyDictionary_ = - objc.registerName("setConnectionProxyDictionary:"); -late final _sel_TLSMinimumSupportedProtocol = - objc.registerName("TLSMinimumSupportedProtocol"); -final _objc_msgSend_ewo6ux = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setTLSMinimumSupportedProtocol_ = - objc.registerName("setTLSMinimumSupportedProtocol:"); -final _objc_msgSend_hcgw10 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_TLSMaximumSupportedProtocol = - objc.registerName("TLSMaximumSupportedProtocol"); -late final _sel_setTLSMaximumSupportedProtocol_ = - objc.registerName("setTLSMaximumSupportedProtocol:"); -late final _sel_TLSMinimumSupportedProtocolVersion = - objc.registerName("TLSMinimumSupportedProtocolVersion"); -final _objc_msgSend_a6qtz = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Uint16 Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setTLSMinimumSupportedProtocolVersion_ = - objc.registerName("setTLSMinimumSupportedProtocolVersion:"); -final _objc_msgSend_yb8bfm = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Uint16)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_TLSMaximumSupportedProtocolVersion = - objc.registerName("TLSMaximumSupportedProtocolVersion"); -late final _sel_setTLSMaximumSupportedProtocolVersion_ = - objc.registerName("setTLSMaximumSupportedProtocolVersion:"); -late final _sel_HTTPShouldSetCookies = - objc.registerName("HTTPShouldSetCookies"); -late final _sel_setHTTPShouldSetCookies_ = - objc.registerName("setHTTPShouldSetCookies:"); -late final _sel_HTTPCookieAcceptPolicy = - objc.registerName("HTTPCookieAcceptPolicy"); -late final _sel_setHTTPCookieAcceptPolicy_ = - objc.registerName("setHTTPCookieAcceptPolicy:"); -late final _sel_HTTPAdditionalHeaders = - objc.registerName("HTTPAdditionalHeaders"); -late final _sel_setHTTPAdditionalHeaders_ = - objc.registerName("setHTTPAdditionalHeaders:"); -late final _sel_HTTPMaximumConnectionsPerHost = - objc.registerName("HTTPMaximumConnectionsPerHost"); -final _objc_msgSend_z1fx1b = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setHTTPMaximumConnectionsPerHost_ = - objc.registerName("setHTTPMaximumConnectionsPerHost:"); -final _objc_msgSend_ke7qz2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_HTTPCookieStorage = objc.registerName("HTTPCookieStorage"); -late final _sel_setHTTPCookieStorage_ = - objc.registerName("setHTTPCookieStorage:"); + external CE_CertPolicies certPolicies; -/// NSURLCredentialStorage -class NSURLCredentialStorage extends objc.ObjCObjectBase { - NSURLCredentialStorage._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super(pointer, retain: retain, release: release); + @CE_NetscapeCertType() + external int netscapeCertType; - /// Constructs a [NSURLCredentialStorage] that points to the same underlying object as [other]. - NSURLCredentialStorage.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + @CE_CrlNumber() + external int crlNumber; - /// Constructs a [NSURLCredentialStorage] that wraps the given raw object pointer. - NSURLCredentialStorage.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); + @CE_DeltaCrl() + external int deltaCrl; - /// Returns whether [obj] is an instance of [NSURLCredentialStorage]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLCredentialStorage); - } -} + @CE_CrlReason() + external int crlReason; -late final _class_NSURLCredentialStorage = - objc.getClass("NSURLCredentialStorage"); -late final _sel_URLCredentialStorage = - objc.registerName("URLCredentialStorage"); -late final _sel_setURLCredentialStorage_ = - objc.registerName("setURLCredentialStorage:"); -late final _sel_URLCache = objc.registerName("URLCache"); -late final _sel_setURLCache_ = objc.registerName("setURLCache:"); -late final _sel_shouldUseExtendedBackgroundIdleMode = - objc.registerName("shouldUseExtendedBackgroundIdleMode"); -late final _sel_setShouldUseExtendedBackgroundIdleMode_ = - objc.registerName("setShouldUseExtendedBackgroundIdleMode:"); -late final _sel_protocolClasses = objc.registerName("protocolClasses"); -late final _sel_setProtocolClasses_ = objc.registerName("setProtocolClasses:"); + external CE_CRLDistPointsSyntax crlDistPoints; -/// ! -/// @enum NSURLSessionMultipathServiceType -/// -/// @discussion The NSURLSessionMultipathServiceType enum defines constants that -/// can be used to specify the multipath service type to associate an NSURLSession. The -/// multipath service type determines whether multipath TCP should be attempted and the conditions -/// for creating and switching between subflows. Using these service types requires the appropriate entitlement. Any connection attempt will fail if the process does not have the required entitlement. -/// A primary interface is a generally less expensive interface in terms of both cost and power (such as WiFi or ethernet). A secondary interface is more expensive (such as 3G or LTE). -/// -/// @constant NSURLSessionMultipathServiceTypeNone Specifies that multipath tcp should not be used. Connections will use a single flow. -/// This is the default value. No entitlement is required to set this value. -/// -/// @constant NSURLSessionMultipathServiceTypeHandover Specifies that a secondary subflow should only be used -/// when the primary subflow is not performing adequately. Requires the com.apple.developer.networking.multipath entitlement. -/// -/// @constant NSURLSessionMultipathServiceTypeInteractive Specifies that a secondary subflow should be used if the -/// primary subflow is not performing adequately (packet loss, high round trip times, bandwidth issues). The secondary -/// subflow will be created more aggressively than with NSURLSessionMultipathServiceTypeHandover. Requires the com.apple.developer.networking.multipath entitlement. -/// -/// @constant NSURLSessionMultipathServiceTypeAggregate Specifies that multiple subflows across multiple interfaces should be -/// used for better bandwidth. This mode is only available for experimentation on devices configured for development use. -/// It can be enabled in the Developer section of the Settings app. -enum NSURLSessionMultipathServiceType { - /// None - no multipath (default) - NSURLSessionMultipathServiceTypeNone(0), + external CE_IssuingDistributionPoint issuingDistPoint; - /// Handover - secondary flows brought up when primary flow is not performing adequately. - NSURLSessionMultipathServiceTypeHandover(1), + external CE_AuthorityInfoAccess authorityInfoAccess; - /// Interactive - secondary flows created more aggressively. - NSURLSessionMultipathServiceTypeInteractive(2), + external CE_QC_Statements qualifiedCertStatements; - /// Aggregate - multiple subflows used for greater bandwidth. - NSURLSessionMultipathServiceTypeAggregate(3); + external CE_NameConstraints nameConstraints; - final int value; - const NSURLSessionMultipathServiceType(this.value); + external CE_PolicyMappings policyMappings; - static NSURLSessionMultipathServiceType fromValue(int value) => - switch (value) { - 0 => NSURLSessionMultipathServiceTypeNone, - 1 => NSURLSessionMultipathServiceTypeHandover, - 2 => NSURLSessionMultipathServiceTypeInteractive, - 3 => NSURLSessionMultipathServiceTypeAggregate, - _ => throw ArgumentError( - "Unknown value for NSURLSessionMultipathServiceType: $value"), - }; -} + external CE_PolicyConstraints policyConstraints; -late final _sel_multipathServiceType = - objc.registerName("multipathServiceType"); -final _objc_msgSend_zqvllq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setMultipathServiceType_ = - objc.registerName("setMultipathServiceType:"); -final _objc_msgSend_1ngj1qh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_backgroundSessionConfiguration_ = - objc.registerName("backgroundSessionConfiguration:"); -late final _sel_sessionWithConfiguration_ = - objc.registerName("sessionWithConfiguration:"); + @CE_InhibitAnyPolicy() + external int inhibitAnyPolicy; -/// NSOperationQueue -class NSOperationQueue extends objc.NSObject { - NSOperationQueue._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); + external SecAsn1Item rawData; +} - /// Constructs a [NSOperationQueue] that points to the same underlying object as [other]. - NSOperationQueue.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); +final class __CE_DataAndType extends ffi.Struct { + @ffi.UnsignedInt() + external int typeAsInt; - /// Constructs a [NSOperationQueue] that wraps the given raw object pointer. - NSOperationQueue.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); + __CE_DataType get type => __CE_DataType.fromValue(typeAsInt); - /// Returns whether [obj] is an instance of [NSOperationQueue]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSOperationQueue); - } + external CE_Data extension1; - /// @property progress - /// @discussion The `progress` property represents a total progress of the operations executed in the queue. By default NSOperationQueue - /// does not report progress until the `totalUnitCount` of the progress is set. When the `totalUnitCount` property of the progress is set the - /// queue then opts into participating in progress reporting. When enabled, each operation will contribute 1 unit of completion to the - /// overall progress of the queue for operations that are finished by the end of main (operations that override start and do not invoke super - /// will not contribute to progress). Special attention to race conditions should be made when updating the `totalUnitCount` of the progress - /// as well as care should be taken to avoid 'backwards progress'. For example; when a NSOperationQueue's progress is 5/10, representing 50% - /// completed, and there are 90 more operations about to be added and the `totalUnitCount` that would then make the progress report as 5/100 - /// which represents 5%. In this example it would mean that any progress bar would jump from displaying 50% back to 5%, which might not be - /// desirable. In the cases where the `totalUnitCount` needs to be adjusted it is suggested to do this for thread-safety in a barrier by - /// using the `addBarrierBlock:` API. This ensures that no un-expected execution state occurs adjusting into a potentially backwards moving - /// progress scenario. - /// - /// @example - /// NSOperationQueue *queue = [[NSOperationQueue alloc] init]; - /// queue.progress.totalUnitCount = 10; - NSProgress get progress { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_progress); - return NSProgress.castFromPointer(_ret, retain: true, release: true); - } + @CSSM_BOOL() + external int critical; +} - /// addOperation: - void addOperation_(NSOperation op) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_addOperation_, op.ref.pointer); - } +typedef CE_DataAndType = __CE_DataAndType; - /// addOperations:waitUntilFinished: - void addOperations_waitUntilFinished_(objc.NSArray ops, bool wait) { - _objc_msgSend_1n1qwdd(this.ref.pointer, - _sel_addOperations_waitUntilFinished_, ops.ref.pointer, wait); - } +final class cssm_acl_process_subject_selector extends ffi.Struct { + @uint16() + external int version; - /// addOperationWithBlock: - void addOperationWithBlock_(objc.ObjCBlock block) { - _objc_msgSend_4daxhl( - this.ref.pointer, _sel_addOperationWithBlock_, block.ref.pointer); - } + @uint16() + external int mask; - /// @method addBarrierBlock: - /// @param barrier A block to execute - /// @discussion The `addBarrierBlock:` method executes the block when the NSOperationQueue has finished all enqueued operations and - /// prevents any subsequent operations to be executed until the barrier has been completed. This acts similarly to the - /// `dispatch_barrier_async` function. - void addBarrierBlock_(objc.ObjCBlock barrier) { - _objc_msgSend_4daxhl( - this.ref.pointer, _sel_addBarrierBlock_, barrier.ref.pointer); - } + @uint32() + external int uid; - /// maxConcurrentOperationCount - DartNSInteger get maxConcurrentOperationCount { - return _objc_msgSend_z1fx1b( - this.ref.pointer, _sel_maxConcurrentOperationCount); - } + @uint32() + external int gid; +} - /// setMaxConcurrentOperationCount: - set maxConcurrentOperationCount(DartNSInteger value) { - return _objc_msgSend_ke7qz2( - this.ref.pointer, _sel_setMaxConcurrentOperationCount_, value); - } +typedef CSSM_ACL_PROCESS_SUBJECT_SELECTOR = cssm_acl_process_subject_selector; - /// isSuspended - bool get suspended { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isSuspended); - } +final class cssm_acl_keychain_prompt_selector extends ffi.Struct { + @uint16() + external int version; - /// setSuspended: - set suspended(bool value) { - return _objc_msgSend_117qins(this.ref.pointer, _sel_setSuspended_, value); - } + @uint16() + external int flags; +} - /// name - objc.NSString? get name { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } +typedef CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR = cssm_acl_keychain_prompt_selector; +typedef CSSM_ACL_PREAUTH_TRACKING_STATE = uint32; - /// setName: - set name(objc.NSString? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); - } +final class cssm_appledl_open_parameters extends ffi.Struct { + @uint32() + external int length; - /// qualityOfService - NSQualityOfService get qualityOfService { - final _ret = _objc_msgSend_17dnyeh(this.ref.pointer, _sel_qualityOfService); - return NSQualityOfService.fromValue(_ret); - } + @uint32() + external int version; - /// setQualityOfService: - set qualityOfService(NSQualityOfService value) { - return _objc_msgSend_1fcr8u4( - this.ref.pointer, _sel_setQualityOfService_, value.value); - } + @CSSM_BOOL() + external int autoCommit; - /// actually retain - Dartdispatch_queue_t get underlyingQueue { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_underlyingQueue); - return objc.NSObject.castFromPointer(_ret, retain: true, release: true); - } + @uint32() + external int mask; - /// actually retain - set underlyingQueue(Dartdispatch_queue_t value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setUnderlyingQueue_, value.ref.pointer); - } + @mode_t() + external int mode; +} - /// cancelAllOperations - void cancelAllOperations() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancelAllOperations); - } +typedef CSSM_APPLEDL_OPEN_PARAMETERS = cssm_appledl_open_parameters; +typedef CSSM_APPLEDL_OPEN_PARAMETERS_PTR + = ffi.Pointer; - /// waitUntilAllOperationsAreFinished - void waitUntilAllOperationsAreFinished() { - _objc_msgSend_ksby9f( - this.ref.pointer, _sel_waitUntilAllOperationsAreFinished); - } +final class cssm_applecspdl_db_settings_parameters extends ffi.Struct { + @uint32() + external int idleTimeout; - /// currentQueue - static NSOperationQueue? getCurrentQueue() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSOperationQueue, _sel_currentQueue); - return _ret.address == 0 - ? null - : NSOperationQueue.castFromPointer(_ret, retain: true, release: true); - } + @uint8() + external int lockOnSleep; +} - /// mainQueue - static NSOperationQueue getMainQueue() { - final _ret = _objc_msgSend_1unuoxw(_class_NSOperationQueue, _sel_mainQueue); - return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); - } +typedef CSSM_APPLECSPDL_DB_SETTINGS_PARAMETERS + = cssm_applecspdl_db_settings_parameters; +typedef CSSM_APPLECSPDL_DB_SETTINGS_PARAMETERS_PTR + = ffi.Pointer; - /// These two functions are inherently a race condition and should be avoided if possible - objc.NSArray get operations { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_operations); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } +final class cssm_applecspdl_db_is_locked_parameters extends ffi.Struct { + @uint8() + external int isLocked; +} - /// operationCount - DartNSUInteger get operationCount { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_operationCount); - } +typedef CSSM_APPLECSPDL_DB_IS_LOCKED_PARAMETERS + = cssm_applecspdl_db_is_locked_parameters; +typedef CSSM_APPLECSPDL_DB_IS_LOCKED_PARAMETERS_PTR + = ffi.Pointer; - /// init - NSOperationQueue init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); - } +final class cssm_applecspdl_db_change_password_parameters extends ffi.Struct { + external ffi.Pointer accessCredentials; +} - /// new - static NSOperationQueue new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSOperationQueue, _sel_new); - return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); - } +typedef CSSM_APPLECSPDL_DB_CHANGE_PASSWORD_PARAMETERS + = cssm_applecspdl_db_change_password_parameters; +typedef CSSM_APPLECSPDL_DB_CHANGE_PASSWORD_PARAMETERS_PTR + = ffi.Pointer; - /// allocWithZone: - static NSOperationQueue allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSOperationQueue, _sel_allocWithZone_, zone); - return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); - } +final class CSSM_APPLE_TP_NAME_OID extends ffi.Struct { + external ffi.Pointer string; - /// alloc - static NSOperationQueue alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSOperationQueue, _sel_alloc); - return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); - } + external ffi.Pointer oid; } -late final _class_NSOperationQueue = objc.getClass("NSOperationQueue"); - -/// NSOperation -class NSOperation extends objc.NSObject { - NSOperation._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); +final class CSSM_APPLE_TP_CERT_REQUEST extends ffi.Struct { + @CSSM_CSP_HANDLE() + external int cspHand; - /// Constructs a [NSOperation] that points to the same underlying object as [other]. - NSOperation.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + @CSSM_CL_HANDLE() + external int clHand; - /// Constructs a [NSOperation] that wraps the given raw object pointer. - NSOperation.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); + @uint32() + external int serialNumber; - /// Returns whether [obj] is an instance of [NSOperation]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSOperation); - } + @uint32() + external int numSubjectNames; - /// start - void start() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_start); - } + external ffi.Pointer subjectNames; - /// main - void main() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_main); - } + @uint32() + external int numIssuerNames; - /// isCancelled - bool get cancelled { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancelled); - } + external ffi.Pointer issuerNames; - /// cancel - void cancel() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancel); - } + external CSSM_X509_NAME_PTR issuerNameX509; - /// isExecuting - bool get executing { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isExecuting); - } + external ffi.Pointer certPublicKey; - /// isFinished - bool get finished { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isFinished); - } + external ffi.Pointer issuerPrivateKey; - /// To be deprecated; use and override 'asynchronous' below - bool get concurrent { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isConcurrent); - } + @CSSM_ALGORITHMS() + external int signatureAlg; - /// isAsynchronous - bool get asynchronous { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isAsynchronous); - } + external SecAsn1Oid signatureOid; - /// isReady - bool get ready { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isReady); - } + @uint32() + external int notBefore; - /// addDependency: - void addDependency_(NSOperation op) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_addDependency_, op.ref.pointer); - } + @uint32() + external int notAfter; - /// removeDependency: - void removeDependency_(NSOperation op) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_removeDependency_, op.ref.pointer); - } + @uint32() + external int numExtensions; - /// dependencies - objc.NSArray get dependencies { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_dependencies); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } + external ffi.Pointer extensions; - /// queuePriority - NSOperationQueuePriority get queuePriority { - final _ret = _objc_msgSend_10n15g8(this.ref.pointer, _sel_queuePriority); - return NSOperationQueuePriority.fromValue(_ret); - } + external ffi.Pointer challengeString; +} - /// setQueuePriority: - set queuePriority(NSOperationQueuePriority value) { - return _objc_msgSend_d8yjnr( - this.ref.pointer, _sel_setQueuePriority_, value.value); - } +final class CSSM_APPLE_TP_SSL_OPTIONS extends ffi.Struct { + @uint32() + external int Version; - /// completionBlock - objc.ObjCBlock? get completionBlock { - final _ret = _objc_msgSend_2osec1(this.ref.pointer, _sel_completionBlock); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); - } + @uint32() + external int ServerNameLen; - /// setCompletionBlock: - set completionBlock(objc.ObjCBlock? value) { - return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setCompletionBlock_, - value?.ref.pointer ?? ffi.nullptr); - } + external ffi.Pointer ServerName; - /// waitUntilFinished - void waitUntilFinished() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_waitUntilFinished); - } + @uint32() + external int Flags; +} - /// threadPriority - double get threadPriority { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_threadPriority); - } +typedef CSSM_APPLE_TP_CRL_OPT_FLAGS = uint32; - /// setThreadPriority: - set threadPriority(double value) { - return _objc_msgSend_suh039( - this.ref.pointer, _sel_setThreadPriority_, value); - } +final class CSSM_APPLE_TP_CRL_OPTIONS extends ffi.Struct { + @uint32() + external int Version; - /// qualityOfService - NSQualityOfService get qualityOfService { - final _ret = _objc_msgSend_17dnyeh(this.ref.pointer, _sel_qualityOfService); - return NSQualityOfService.fromValue(_ret); - } + @CSSM_APPLE_TP_CRL_OPT_FLAGS() + external int CrlFlags; - /// setQualityOfService: - set qualityOfService(NSQualityOfService value) { - return _objc_msgSend_1fcr8u4( - this.ref.pointer, _sel_setQualityOfService_, value.value); - } + external CSSM_DL_DB_HANDLE_PTR crlStore; +} - /// name - objc.NSString? get name { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } +final class CSSM_APPLE_TP_SMIME_OPTIONS extends ffi.Struct { + @uint32() + external int Version; - /// setName: - set name(objc.NSString? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); - } + @CE_KeyUsage() + external int IntendedUsage; - /// init - NSOperation init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSOperation.castFromPointer(_ret, retain: false, release: true); - } + @uint32() + external int SenderEmailLen; - /// new - static NSOperation new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSOperation, _sel_new); - return NSOperation.castFromPointer(_ret, retain: false, release: true); - } + external ffi.Pointer SenderEmail; +} - /// allocWithZone: - static NSOperation allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSOperation, _sel_allocWithZone_, zone); - return NSOperation.castFromPointer(_ret, retain: false, release: true); - } +typedef CSSM_APPLE_TP_ACTION_FLAGS = uint32; - /// alloc - static NSOperation alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSOperation, _sel_alloc); - return NSOperation.castFromPointer(_ret, retain: false, release: true); - } +final class CSSM_APPLE_TP_ACTION_DATA extends ffi.Struct { + @uint32() + external int Version; + + @CSSM_APPLE_TP_ACTION_FLAGS() + external int ActionFlags; } -late final _class_NSOperation = objc.getClass("NSOperation"); -late final _sel_start = objc.registerName("start"); -late final _sel_main = objc.registerName("main"); -late final _sel_isExecuting = objc.registerName("isExecuting"); -late final _sel_isConcurrent = objc.registerName("isConcurrent"); -late final _sel_isAsynchronous = objc.registerName("isAsynchronous"); -late final _sel_isReady = objc.registerName("isReady"); -late final _sel_addDependency_ = objc.registerName("addDependency:"); -late final _sel_removeDependency_ = objc.registerName("removeDependency:"); -late final _sel_dependencies = objc.registerName("dependencies"); +typedef CSSM_TP_APPLE_CERT_STATUS = uint32; -enum NSOperationQueuePriority { - NSOperationQueuePriorityVeryLow(-8), - NSOperationQueuePriorityLow(-4), - NSOperationQueuePriorityNormal(0), - NSOperationQueuePriorityHigh(4), - NSOperationQueuePriorityVeryHigh(8); +final class CSSM_TP_APPLE_EVIDENCE_INFO extends ffi.Struct { + @CSSM_TP_APPLE_CERT_STATUS() + external int StatusBits; - final int value; - const NSOperationQueuePriority(this.value); + @uint32() + external int NumStatusCodes; - static NSOperationQueuePriority fromValue(int value) => switch (value) { - -8 => NSOperationQueuePriorityVeryLow, - -4 => NSOperationQueuePriorityLow, - 0 => NSOperationQueuePriorityNormal, - 4 => NSOperationQueuePriorityHigh, - 8 => NSOperationQueuePriorityVeryHigh, - _ => throw ArgumentError( - "Unknown value for NSOperationQueuePriority: $value"), - }; + external ffi.Pointer StatusCodes; + + @uint32() + external int Index; + + external CSSM_DL_DB_HANDLE DlDbHandle; + + external CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord; } -late final _sel_queuePriority = objc.registerName("queuePriority"); -final _objc_msgSend_10n15g8 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setQueuePriority_ = objc.registerName("setQueuePriority:"); -final _objc_msgSend_d8yjnr = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_completionBlock = objc.registerName("completionBlock"); -late final _sel_setCompletionBlock_ = objc.registerName("setCompletionBlock:"); -late final _sel_waitUntilFinished = objc.registerName("waitUntilFinished"); -late final _sel_threadPriority = objc.registerName("threadPriority"); -late final _sel_setThreadPriority_ = objc.registerName("setThreadPriority:"); +final class CSSM_TP_APPLE_EVIDENCE_HEADER extends ffi.Struct { + @uint32() + external int Version; +} -enum NSQualityOfService { - NSQualityOfServiceUserInteractive(33), - NSQualityOfServiceUserInitiated(25), - NSQualityOfServiceUtility(17), - NSQualityOfServiceBackground(9), - NSQualityOfServiceDefault(-1); +final class CSSM_APPLE_CL_CSR_REQUEST extends ffi.Struct { + external CSSM_X509_NAME_PTR subjectNameX509; + + @CSSM_ALGORITHMS() + external int signatureAlg; + + external SecAsn1Oid signatureOid; + + @CSSM_CSP_HANDLE() + external int cspHand; + + external ffi.Pointer subjectPublicKey; + + external ffi.Pointer subjectPrivateKey; + + external ffi.Pointer challengeString; +} + +enum SecTrustResultType { + kSecTrustResultInvalid(0), + kSecTrustResultProceed(1), + kSecTrustResultConfirm(2), + kSecTrustResultDeny(3), + kSecTrustResultUnspecified(4), + kSecTrustResultRecoverableTrustFailure(5), + kSecTrustResultFatalTrustFailure(6), + kSecTrustResultOtherError(7); final int value; - const NSQualityOfService(this.value); + const SecTrustResultType(this.value); - static NSQualityOfService fromValue(int value) => switch (value) { - 33 => NSQualityOfServiceUserInteractive, - 25 => NSQualityOfServiceUserInitiated, - 17 => NSQualityOfServiceUtility, - 9 => NSQualityOfServiceBackground, - -1 => NSQualityOfServiceDefault, + static SecTrustResultType fromValue(int value) => switch (value) { + 0 => kSecTrustResultInvalid, + 1 => kSecTrustResultProceed, + 2 => kSecTrustResultConfirm, + 3 => kSecTrustResultDeny, + 4 => kSecTrustResultUnspecified, + 5 => kSecTrustResultRecoverableTrustFailure, + 6 => kSecTrustResultFatalTrustFailure, + 7 => kSecTrustResultOtherError, _ => - throw ArgumentError("Unknown value for NSQualityOfService: $value"), + throw ArgumentError("Unknown value for SecTrustResultType: $value"), }; } -late final _sel_qualityOfService = objc.registerName("qualityOfService"); -final _objc_msgSend_17dnyeh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setQualityOfService_ = - objc.registerName("setQualityOfService:"); -final _objc_msgSend_1fcr8u4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_name = objc.registerName("name"); -late final _sel_setName_ = objc.registerName("setName:"); -late final _sel_addOperation_ = objc.registerName("addOperation:"); -late final _sel_addOperations_waitUntilFinished_ = - objc.registerName("addOperations:waitUntilFinished:"); -final _objc_msgSend_1n1qwdd = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_addOperationWithBlock_ = - objc.registerName("addOperationWithBlock:"); -late final _sel_addBarrierBlock_ = objc.registerName("addBarrierBlock:"); -late final _sel_maxConcurrentOperationCount = - objc.registerName("maxConcurrentOperationCount"); -late final _sel_setMaxConcurrentOperationCount_ = - objc.registerName("setMaxConcurrentOperationCount:"); -late final _sel_isSuspended = objc.registerName("isSuspended"); -late final _sel_setSuspended_ = objc.registerName("setSuspended:"); -late final _sel_underlyingQueue = objc.registerName("underlyingQueue"); -late final _sel_setUnderlyingQueue_ = objc.registerName("setUnderlyingQueue:"); -late final _sel_cancelAllOperations = objc.registerName("cancelAllOperations"); -late final _sel_waitUntilAllOperationsAreFinished = - objc.registerName("waitUntilAllOperationsAreFinished"); -late final _sel_currentQueue = objc.registerName("currentQueue"); -late final _sel_mainQueue = objc.registerName("mainQueue"); -late final _sel_operations = objc.registerName("operations"); -late final _sel_operationCount = objc.registerName("operationCount"); -late final _sel_sessionWithConfiguration_delegate_delegateQueue_ = - objc.registerName("sessionWithConfiguration:delegate:delegateQueue:"); -final _objc_msgSend_aud7dn = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_delegateQueue = objc.registerName("delegateQueue"); -late final _sel_configuration = objc.registerName("configuration"); -late final _sel_sessionDescription = objc.registerName("sessionDescription"); -late final _sel_setSessionDescription_ = - objc.registerName("setSessionDescription:"); -late final _sel_finishTasksAndInvalidate = - objc.registerName("finishTasksAndInvalidate"); -late final _sel_invalidateAndCancel = objc.registerName("invalidateAndCancel"); -late final _sel_resetWithCompletionHandler_ = - objc.registerName("resetWithCompletionHandler:"); -late final _sel_flushWithCompletionHandler_ = - objc.registerName("flushWithCompletionHandler:"); -void - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); +final class __SecTrust extends ffi.Opaque {} + +typedef SecTrustRef = ffi.Pointer<__SecTrust>; +void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrTrampoline( + ffi.Pointer block, SecTrustRef arg0, int arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(SecTrustRef arg0, ffi.Uint32 arg1)>>() + .asFunction()(arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrCallable = + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrTrampoline) + ffi.Pointer, SecTrustRef, ffi.Uint32)>( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); +void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline( + ffi.Pointer block, SecTrustRef arg0, int arg1) => + (objc.getBlockClosure(block) as void Function(SecTrustRef, int))( + arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureCallable = + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureTrampoline) + ffi.Pointer, SecTrustRef, ffi.Uint32)>( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); +void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerTrampoline( + ffi.Pointer block, SecTrustRef arg0, int arg1) { + (objc.getBlockClosure(block) as void Function(SecTrustRef, int))(arg0, arg1); objc.objectRelease(block.cast()); } ffi.NativeCallable< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerTrampoline) + ffi.Pointer, SecTrustRef, ffi.Uint32)> + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, SecTrustRef, + ffi.Uint32)>.listener( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. -abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject { +/// Construction methods for `objc.ObjCBlock, ffi.Uint32)>`. +abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> + static objc.ObjCBlock, ffi.Uint32)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(pointer, - retain: retain, release: release); + ffi.Void Function(ffi.Pointer<__SecTrust>, + ffi.Uint32)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -59331,35 +57738,31 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObj /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32)> fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock, ffi.Uint32)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer, ffi.Pointer)> - fromFunction(void Function(objc.ObjCObjectBase, objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => - objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true), - objc.ObjCObjectBase(arg2, retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32)> fromFunction( + void Function(SecTrustRef, SecTrustResultType) fn) => + objc.ObjCBlock, ffi.Uint32)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureCallable, + (SecTrustRef arg0, int arg1) => + fn(arg0, SecTrustResultType.fromValue(arg1))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -59370,139 +57773,135 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObj /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> listener( - void Function( - objc.ObjCObjectBase, objc.ObjCObjectBase, objc.ObjCObjectBase) - fn) { + static objc.ObjCBlock, ffi.Uint32)> + listener(void Function(SecTrustRef, SecTrustResultType) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerCallable + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - objc.ObjCObjectBase(arg0, retain: false, release: true), - objc.ObjCObjectBase(arg1, retain: false, release: true), - objc.ObjCObjectBase(arg2, retain: false, release: true))); - final wrapper = _wrapListenerBlock_tenbla(raw); + (SecTrustRef arg0, int arg1) => + fn(arg0, SecTrustResultType.fromValue(arg1))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_gwxhxt(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(wrapper, + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. -extension ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> { - void call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, - objc.ObjCObjectBase arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); +/// Call operator for `objc.ObjCBlock, ffi.Uint32)>`. +extension ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_CallExtension + on objc.ObjCBlock, ffi.Uint32)> { + void call(SecTrustRef arg0, SecTrustResultType arg1) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + SecTrustRef arg0, ffi.Uint32 arg1)>>() + .asFunction< + void Function(ffi.Pointer, SecTrustRef, + int)>()(ref.pointer, arg0, arg1.value); } -late final _sel_getTasksWithCompletionHandler_ = - objc.registerName("getTasksWithCompletionHandler:"); -void _ObjCBlock_ffiVoid_objcObjCObject_fnPtrTrampoline( +typedef SecTrustCallback = ffi.Pointer; +typedef DartSecTrustCallback + = objc.ObjCBlock, ffi.Uint32)>; +void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrTrampoline( ffi.Pointer block, - ffi.Pointer arg0) => + SecTrustRef arg0, + bool arg1, + CFErrorRef arg2) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_fnPtrCallable = + .cast< + ffi.NativeFunction< + ffi.Void Function( + SecTrustRef arg0, ffi.Bool arg1, CFErrorRef arg2)>>() + .asFunction()( + arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_fnPtrTrampoline) + ffi.Void Function(ffi.Pointer, SecTrustRef, + ffi.Bool, CFErrorRef)>( + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_closureTrampoline( +void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline( ffi.Pointer block, - ffi.Pointer arg0) => + SecTrustRef arg0, + bool arg1, + CFErrorRef arg2) => (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_closureCallable = + SecTrustRef, bool, CFErrorRef))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_closureTrampoline) + ffi.Void Function(ffi.Pointer, SecTrustRef, + ffi.Bool, CFErrorRef)>( + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); +void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerTrampoline( + ffi.Pointer block, + SecTrustRef arg0, + bool arg1, + CFErrorRef arg2) { + (objc.getBlockClosure(block) as void Function(SecTrustRef, bool, CFErrorRef))( + arg0, arg1, arg2); objc.objectRelease(block.cast()); } ffi.NativeCallable< ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject_listenerTrampoline) + ffi.Pointer, SecTrustRef, ffi.Bool, CFErrorRef)> + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, SecTrustRef, + ffi.Bool, CFErrorRef)>.listener( + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_objcObjCObject { +/// Construction methods for `objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)>`. +abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock)>( - pointer, - retain: retain, - release: release); + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, + ffi.Pointer<__CFError>)>(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_objcObjCObject_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + static objc + .ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)> + fromFunctionPointer(ffi.Pointer> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, + ffi.Pointer<__CFError>)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(void Function(objc.ObjCObjectBase) fn) => - objc.ObjCBlock)>( + static objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)> + fromFunction(void Function(SecTrustRef, bool, CFErrorRef) fn) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, + ffi.Pointer<__CFError>)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_closureCallable, - (ffi.Pointer arg0) => fn( - objc.ObjCObjectBase(arg0, retain: true, release: true))), + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureCallable, + (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => + fn(arg0, arg1, arg2)), retain: false, release: true); @@ -59515,160 +57914,342 @@ abstract final class ObjCBlock_ffiVoid_objcObjCObject { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock)> - listener(void Function(objc.ObjCObjectBase) fn) { + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> listener( + void Function(SecTrustRef, bool, CFErrorRef) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable.nativeFunction + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerCallable + .nativeFunction .cast(), - (ffi.Pointer arg0) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true))); - final wrapper = _wrapListenerBlock_ukcdfq(raw); + (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_k73ff5(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock)>( - wrapper, - retain: false, - release: true); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, + ffi.Pointer<__CFError>)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_objcObjCObject_CallExtension - on objc.ObjCBlock)> { - void call(objc.ObjCObjectBase arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0.ref.pointer); +/// Call operator for `objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)>`. +extension ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> { + void call(SecTrustRef arg0, bool arg1, CFErrorRef arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + SecTrustRef arg0, ffi.Bool arg1, CFErrorRef arg2)>>() + .asFunction< + void Function(ffi.Pointer, SecTrustRef, bool, + CFErrorRef)>()(ref.pointer, arg0, arg1, arg2); } -late final _sel_getAllTasksWithCompletionHandler_ = - objc.registerName("getAllTasksWithCompletionHandler:"); -late final _sel_dataTaskWithRequest_ = - objc.registerName("dataTaskWithRequest:"); -late final _sel_dataTaskWithURL_ = objc.registerName("dataTaskWithURL:"); +typedef SecTrustWithErrorCallback = ffi.Pointer; +typedef DartSecTrustWithErrorCallback = objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)>; -/// An NSURLSessionUploadTask does not currently provide any additional -/// functionality over an NSURLSessionDataTask. All delegate messages -/// that may be sent referencing an NSURLSessionDataTask equally apply -/// to NSURLSessionUploadTasks. -class NSURLSessionUploadTask extends NSURLSessionDataTask { - NSURLSessionUploadTask._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); +enum SecTrustOptionFlags { + kSecTrustOptionAllowExpired(1), + kSecTrustOptionLeafIsCA(2), + kSecTrustOptionFetchIssuerFromNet(4), + kSecTrustOptionAllowExpiredRoot(8), + kSecTrustOptionRequireRevPerCert(16), + kSecTrustOptionUseTrustSettings(32), + kSecTrustOptionImplicitAnchors(64); - /// Constructs a [NSURLSessionUploadTask] that points to the same underlying object as [other]. - NSURLSessionUploadTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + final int value; + const SecTrustOptionFlags(this.value); - /// Constructs a [NSURLSessionUploadTask] that wraps the given raw object pointer. - NSURLSessionUploadTask.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); + static SecTrustOptionFlags fromValue(int value) => switch (value) { + 1 => kSecTrustOptionAllowExpired, + 2 => kSecTrustOptionLeafIsCA, + 4 => kSecTrustOptionFetchIssuerFromNet, + 8 => kSecTrustOptionAllowExpiredRoot, + 16 => kSecTrustOptionRequireRevPerCert, + 32 => kSecTrustOptionUseTrustSettings, + 64 => kSecTrustOptionImplicitAnchors, + _ => + throw ArgumentError("Unknown value for SecTrustOptionFlags: $value"), + }; +} - /// Returns whether [obj] is an instance of [NSURLSessionUploadTask]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionUploadTask); - } +typedef SSLCipherSuite = ffi.Uint16; +typedef DartSSLCipherSuite = int; - /// init - NSURLSessionUploadTask init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: false, release: true); - } +enum SSLCiphersuiteGroup { + kSSLCiphersuiteGroupDefault(0), + kSSLCiphersuiteGroupCompatibility(1), + kSSLCiphersuiteGroupLegacy(2), + kSSLCiphersuiteGroupATS(3), + kSSLCiphersuiteGroupATSCompatibility(4); - /// new - static NSURLSessionUploadTask new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionUploadTask, _sel_new); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: false, release: true); - } + final int value; + const SSLCiphersuiteGroup(this.value); - /// Cancels an upload and calls the completion handler with resume data for later use. - /// resumeData will be nil if the server does not support the latest resumable uploads - /// Internet-Draft from the HTTP Working Group, found at - /// https://datatracker.ietf.org/doc/draft-ietf-httpbis-resumable-upload/ - /// - /// - Parameter completionHandler: The completion handler to call when the upload has been successfully canceled. - void cancelByProducingResumeData_( - objc.ObjCBlock completionHandler) { - _objc_msgSend_4daxhl(this.ref.pointer, _sel_cancelByProducingResumeData_, - completionHandler.ref.pointer); + static SSLCiphersuiteGroup fromValue(int value) => switch (value) { + 0 => kSSLCiphersuiteGroupDefault, + 1 => kSSLCiphersuiteGroupCompatibility, + 2 => kSSLCiphersuiteGroupLegacy, + 3 => kSSLCiphersuiteGroupATS, + 4 => kSSLCiphersuiteGroupATSCompatibility, + _ => + throw ArgumentError("Unknown value for SSLCiphersuiteGroup: $value"), + }; +} + +late final _protocol_OS_sec_trust = objc.getProtocol("OS_sec_trust"); + +/// OS_sec_trust +abstract final class OS_sec_trust { + /// Builds an object that implements the OS_sec_trust protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); + + return builder.build(); } - /// allocWithZone: - static NSURLSessionUploadTask allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSURLSessionUploadTask, _sel_allocWithZone_, zone); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: false, release: true); + /// Adds the implementation of the OS_sec_trust protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} + +typedef sec_trust_t = ffi.Pointer; +typedef Dartsec_trust_t = objc.NSObject; +late final _protocol_OS_sec_identity = objc.getProtocol("OS_sec_identity"); + +/// OS_sec_identity +abstract final class OS_sec_identity { + /// Builds an object that implements the OS_sec_identity protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); + + return builder.build(); } - /// alloc - static NSURLSessionUploadTask alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionUploadTask, _sel_alloc); - return NSURLSessionUploadTask.castFromPointer(_ret, - retain: false, release: true); + /// Adds the implementation of the OS_sec_identity protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} + +typedef sec_identity_t = ffi.Pointer; +typedef Dartsec_identity_t = objc.NSObject; +late final _protocol_OS_sec_certificate = + objc.getProtocol("OS_sec_certificate"); + +/// OS_sec_certificate +abstract final class OS_sec_certificate { + /// Builds an object that implements the OS_sec_certificate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); + + return builder.build(); } + + /// Adds the implementation of the OS_sec_certificate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -late final _class_NSURLSessionUploadTask = - objc.getClass("NSURLSessionUploadTask"); -void _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => +typedef sec_certificate_t = ffi.Pointer; +typedef Dartsec_certificate_t = objc.NSObject; + +enum tls_protocol_version_t { + tls_protocol_version_TLSv10(769), + tls_protocol_version_TLSv11(770), + tls_protocol_version_TLSv12(771), + tls_protocol_version_TLSv13(772), + tls_protocol_version_DTLSv10(-257), + tls_protocol_version_DTLSv12(-259); + + final int value; + const tls_protocol_version_t(this.value); + + static tls_protocol_version_t fromValue(int value) => switch (value) { + 769 => tls_protocol_version_TLSv10, + 770 => tls_protocol_version_TLSv11, + 771 => tls_protocol_version_TLSv12, + 772 => tls_protocol_version_TLSv13, + -257 => tls_protocol_version_DTLSv10, + -259 => tls_protocol_version_DTLSv12, + _ => throw ArgumentError( + "Unknown value for tls_protocol_version_t: $value"), + }; +} + +enum tls_ciphersuite_t { + tls_ciphersuite_RSA_WITH_3DES_EDE_CBC_SHA(10), + tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA(47), + tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA(53), + tls_ciphersuite_RSA_WITH_AES_128_GCM_SHA256(156), + tls_ciphersuite_RSA_WITH_AES_256_GCM_SHA384(157), + tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA256(60), + tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA256(61), + tls_ciphersuite_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA(-16376), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(-16375), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA(-16374), + tls_ciphersuite_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA(-16366), + tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA(-16365), + tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA(-16364), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256(-16349), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384(-16348), + tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA256(-16345), + tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA384(-16344), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(-16341), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384(-16340), + tls_ciphersuite_ECDHE_RSA_WITH_AES_128_GCM_SHA256(-16337), + tls_ciphersuite_ECDHE_RSA_WITH_AES_256_GCM_SHA384(-16336), + tls_ciphersuite_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256(-13144), + tls_ciphersuite_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256(-13143), + tls_ciphersuite_AES_128_GCM_SHA256(4865), + tls_ciphersuite_AES_256_GCM_SHA384(4866), + tls_ciphersuite_CHACHA20_POLY1305_SHA256(4867); + + final int value; + const tls_ciphersuite_t(this.value); + + static tls_ciphersuite_t fromValue(int value) => switch (value) { + 10 => tls_ciphersuite_RSA_WITH_3DES_EDE_CBC_SHA, + 47 => tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA, + 53 => tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA, + 156 => tls_ciphersuite_RSA_WITH_AES_128_GCM_SHA256, + 157 => tls_ciphersuite_RSA_WITH_AES_256_GCM_SHA384, + 60 => tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA256, + 61 => tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA256, + -16376 => tls_ciphersuite_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, + -16375 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + -16374 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + -16366 => tls_ciphersuite_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + -16365 => tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA, + -16364 => tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA, + -16349 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + -16348 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, + -16345 => tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + -16344 => tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA384, + -16341 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + -16340 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + -16337 => tls_ciphersuite_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + -16336 => tls_ciphersuite_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + -13144 => tls_ciphersuite_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, + -13143 => tls_ciphersuite_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, + 4865 => tls_ciphersuite_AES_128_GCM_SHA256, + 4866 => tls_ciphersuite_AES_256_GCM_SHA384, + 4867 => tls_ciphersuite_CHACHA20_POLY1305_SHA256, + _ => throw ArgumentError("Unknown value for tls_ciphersuite_t: $value"), + }; +} + +enum tls_ciphersuite_group_t { + tls_ciphersuite_group_default(0), + tls_ciphersuite_group_compatibility(1), + tls_ciphersuite_group_legacy(2), + tls_ciphersuite_group_ats(3), + tls_ciphersuite_group_ats_compatibility(4); + + final int value; + const tls_ciphersuite_group_t(this.value); + + static tls_ciphersuite_group_t fromValue(int value) => switch (value) { + 0 => tls_ciphersuite_group_default, + 1 => tls_ciphersuite_group_compatibility, + 2 => tls_ciphersuite_group_legacy, + 3 => tls_ciphersuite_group_ats, + 4 => tls_ciphersuite_group_ats_compatibility, + _ => throw ArgumentError( + "Unknown value for tls_ciphersuite_group_t: $value"), + }; +} + +enum SSLProtocol { + kSSLProtocolUnknown(0), + kTLSProtocol1(4), + kTLSProtocol11(7), + kTLSProtocol12(8), + kDTLSProtocol1(9), + kTLSProtocol13(10), + kDTLSProtocol12(11), + kTLSProtocolMaxSupported(999), + kSSLProtocol2(1), + kSSLProtocol3(2), + kSSLProtocol3Only(3), + kTLSProtocol1Only(5), + kSSLProtocolAll(6); + + final int value; + const SSLProtocol(this.value); + + static SSLProtocol fromValue(int value) => switch (value) { + 0 => kSSLProtocolUnknown, + 4 => kTLSProtocol1, + 7 => kTLSProtocol11, + 8 => kTLSProtocol12, + 9 => kDTLSProtocol1, + 10 => kTLSProtocol13, + 11 => kDTLSProtocol12, + 999 => kTLSProtocolMaxSupported, + 1 => kSSLProtocol2, + 2 => kSSLProtocol3, + 3 => kSSLProtocol3Only, + 5 => kTLSProtocol1Only, + 6 => kSSLProtocolAll, + _ => throw ArgumentError("Unknown value for SSLProtocol: $value"), + }; +} + +void _ObjCBlock_ffiVoid_seccertificatet_fnPtrTrampoline( + ffi.Pointer block, sec_certificate_t arg0) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_fnPtrCallable = + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_seccertificatet_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline) + ffi.Void Function( + ffi.Pointer, sec_certificate_t)>( + _ObjCBlock_ffiVoid_seccertificatet_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSData_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_closureCallable = +void _ObjCBlock_ffiVoid_seccertificatet_closureTrampoline( + ffi.Pointer block, sec_certificate_t arg0) => + (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_seccertificatet_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_closureTrampoline) + ffi.Void Function( + ffi.Pointer, sec_certificate_t)>( + _ObjCBlock_ffiVoid_seccertificatet_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSData_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); +void _ObjCBlock_ffiVoid_seccertificatet_listenerTrampoline( + ffi.Pointer block, sec_certificate_t arg0) { + (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSData_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_listenerTrampoline) + ffi.Void Function(ffi.Pointer, sec_certificate_t)> + _ObjCBlock_ffiVoid_seccertificatet_listenerCallable = ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, sec_certificate_t)>.listener( + _ObjCBlock_ffiVoid_seccertificatet_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSData { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_seccertificatet { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock castFromPointer( ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock(pointer, + objc.ObjCBlock(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -59676,14 +58257,13 @@ abstract final class ObjCBlock_ffiVoid_NSData { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( + static objc.ObjCBlock fromFunctionPointer( ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi.NativeFunction> ptr) => - objc.ObjCBlock( + objc.ObjCBlock( objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSData_fnPtrCallable, ptr.cast()), + _ObjCBlock_ffiVoid_seccertificatet_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -59692,15 +58272,13 @@ abstract final class ObjCBlock_ffiVoid_NSData { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSData?) fn) => - objc.ObjCBlock( + static objc.ObjCBlock fromFunction( + void Function(Dartsec_certificate_t) fn) => + objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_closureCallable, - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, - retain: true, release: true))), + _ObjCBlock_ffiVoid_seccertificatet_closureCallable, + (sec_certificate_t arg0) => fn(objc.NSObject.castFromPointer(arg0, + retain: true, release: true))), retain: false, release: true); @@ -59713,359 +58291,230 @@ abstract final class ObjCBlock_ffiVoid_NSData { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(objc.NSData?) fn) { + static objc.ObjCBlock listener( + void Function(Dartsec_certificate_t) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, retain: false, release: true))); - final wrapper = _wrapListenerBlock_ukcdfq(raw); + _ObjCBlock_ffiVoid_seccertificatet_listenerCallable.nativeFunction + .cast(), + (sec_certificate_t arg0) => fn( + objc.NSObject.castFromPointer(arg0, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, + return objc.ObjCBlock(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSData_CallExtension - on objc.ObjCBlock { - void call(objc.NSData? arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_seccertificatet_CallExtension + on objc.ObjCBlock { + void call(Dartsec_certificate_t arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + sec_certificate_t arg0)>>() + .asFunction< + void Function(ffi.Pointer, + sec_certificate_t)>()(ref.pointer, arg0.ref.pointer); } -late final _sel_cancelByProducingResumeData_ = - objc.registerName("cancelByProducingResumeData:"); -late final _sel_uploadTaskWithRequest_fromFile_ = - objc.registerName("uploadTaskWithRequest:fromFile:"); -late final _sel_uploadTaskWithRequest_fromData_ = - objc.registerName("uploadTaskWithRequest:fromData:"); -late final _sel_uploadTaskWithResumeData_ = - objc.registerName("uploadTaskWithResumeData:"); -late final _sel_uploadTaskWithStreamedRequest_ = - objc.registerName("uploadTaskWithStreamedRequest:"); - -/// NSURLSessionDownloadTask is a task that represents a download to -/// local storage. -class NSURLSessionDownloadTask extends NSURLSessionTask { - NSURLSessionDownloadTask._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSURLSessionDownloadTask] that points to the same underlying object as [other]. - NSURLSessionDownloadTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionDownloadTask] that wraps the given raw object pointer. - NSURLSessionDownloadTask.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLSessionDownloadTask]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionDownloadTask); - } - - /// Cancel the download (and calls the superclass -cancel). If - /// conditions will allow for resuming the download in the future, the - /// callback will be called with an opaque data blob, which may be used - /// with -downloadTaskWithResumeData: to attempt to resume the download. - /// If resume data cannot be created, the completion handler will be - /// called with nil resumeData. - void cancelByProducingResumeData_( - objc.ObjCBlock completionHandler) { - _objc_msgSend_4daxhl(this.ref.pointer, _sel_cancelByProducingResumeData_, - completionHandler.ref.pointer); - } - - /// init - NSURLSessionDownloadTask init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: false, release: true); - } +late final _protocol_OS_sec_protocol_metadata = + objc.getProtocol("OS_sec_protocol_metadata"); - /// new - static NSURLSessionDownloadTask new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionDownloadTask, _sel_new); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: false, release: true); - } +/// OS_sec_protocol_metadata +abstract final class OS_sec_protocol_metadata { + /// Builds an object that implements the OS_sec_protocol_metadata protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - /// allocWithZone: - static NSURLSessionDownloadTask allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSURLSessionDownloadTask, _sel_allocWithZone_, zone); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: false, release: true); + return builder.build(); } - /// alloc - static NSURLSessionDownloadTask alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionDownloadTask, _sel_alloc); - return NSURLSessionDownloadTask.castFromPointer(_ret, - retain: false, release: true); - } + /// Adds the implementation of the OS_sec_protocol_metadata protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -late final _class_NSURLSessionDownloadTask = - objc.getClass("NSURLSessionDownloadTask"); -late final _sel_downloadTaskWithRequest_ = - objc.registerName("downloadTaskWithRequest:"); -late final _sel_downloadTaskWithURL_ = - objc.registerName("downloadTaskWithURL:"); -late final _sel_downloadTaskWithResumeData_ = - objc.registerName("downloadTaskWithResumeData:"); - -/// An NSURLSessionStreamTask provides an interface to perform reads -/// and writes to a TCP/IP stream created via NSURLSession. This task -/// may be explicitly created from an NSURLSession, or created as a -/// result of the appropriate disposition response to a -/// -URLSession:dataTask:didReceiveResponse: delegate message. -/// -/// NSURLSessionStreamTask can be used to perform asynchronous reads -/// and writes. Reads and writes are enqueued and executed serially, -/// with the completion handler being invoked on the sessions delegate -/// queue. If an error occurs, or the task is canceled, all -/// outstanding read and write calls will have their completion -/// handlers invoked with an appropriate error. -/// -/// It is also possible to create NSInputStream and NSOutputStream -/// instances from an NSURLSessionTask by sending -/// -captureStreams to the task. All outstanding reads and writes are -/// completed before the streams are created. Once the streams are -/// delivered to the session delegate, the task is considered complete -/// and will receive no more messages. These streams are -/// disassociated from the underlying session. -class NSURLSessionStreamTask extends NSURLSessionTask { - NSURLSessionStreamTask._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSURLSessionStreamTask] that points to the same underlying object as [other]. - NSURLSessionStreamTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionStreamTask] that wraps the given raw object pointer. - NSURLSessionStreamTask.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLSessionStreamTask]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionStreamTask); - } - - /// Read minBytes, or at most maxBytes bytes and invoke the completion - /// handler on the sessions delegate queue with the data or an error. - /// If an error occurs, any outstanding reads will also fail, and new - /// read requests will error out immediately. - void readDataOfMinLength_maxLength_timeout_completionHandler_( - DartNSUInteger minBytes, - DartNSUInteger maxBytes, - DartNSTimeInterval timeout, - objc.ObjCBlock - completionHandler) { - _objc_msgSend_15i4521( - this.ref.pointer, - _sel_readDataOfMinLength_maxLength_timeout_completionHandler_, - minBytes, - maxBytes, - timeout, - completionHandler.ref.pointer); - } - - /// Write the data completely to the underlying socket. If all the - /// bytes have not been written by the timeout, a timeout error will - /// occur. Note that invocation of the completion handler does not - /// guarantee that the remote side has received all the bytes, only - /// that they have been written to the kernel. - void writeData_timeout_completionHandler_( - objc.NSData data, - DartNSTimeInterval timeout, - objc.ObjCBlock completionHandler) { - _objc_msgSend_5qmwfe( - this.ref.pointer, - _sel_writeData_timeout_completionHandler_, - data.ref.pointer, - timeout, - completionHandler.ref.pointer); - } - - /// -captureStreams completes any already enqueued reads - /// and writes, and then invokes the - /// URLSession:streamTask:didBecomeInputStream:outputStream: delegate - /// message. When that message is received, the task object is - /// considered completed and will not receive any more delegate - /// messages. - void captureStreams() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_captureStreams); - } - - /// Enqueue a request to close the write end of the underlying socket. - /// All outstanding IO will complete before the write side of the - /// socket is closed. The server, however, may continue to write bytes - /// back to the client, so best practice is to continue reading from - /// the server until you receive EOF. - void closeWrite() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_closeWrite); - } +typedef sec_protocol_metadata_t = ffi.Pointer; +typedef Dartsec_protocol_metadata_t = objc.NSObject; +void _ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline( + ffi.Pointer block, int arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_Uint16_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Uint16)>(_ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_Uint16_closureTrampoline( + ffi.Pointer block, int arg0) => + (objc.getBlockClosure(block) as void Function(int))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_Uint16_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Uint16)>(_ObjCBlock_ffiVoid_Uint16_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_Uint16_listenerTrampoline( + ffi.Pointer block, int arg0) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); +} - /// Enqueue a request to close the read side of the underlying socket. - /// All outstanding IO will complete before the read side is closed. - /// You may continue writing to the server. - void closeRead() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_closeRead); - } +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Uint16)> + _ObjCBlock_ffiVoid_Uint16_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Uint16)>.listener(_ObjCBlock_ffiVoid_Uint16_listenerTrampoline) + ..keepIsolateAlive = false; - /// Begin encrypted handshake. The handshake begins after all pending - /// IO has completed. TLS authentication callbacks are sent to the - /// session's -URLSession:task:didReceiveChallenge:completionHandler: - void startSecureConnection() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_startSecureConnection); - } +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_Uint16 { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - /// Cleanly close a secure connection after all pending secure IO has - /// completed. + /// Creates a block from a C function pointer. /// - /// @warning This API is non-functional. - void stopSecureConnection() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_stopSecureConnection); - } - - /// init - NSURLSessionStreamTask init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSessionStreamTask.castFromPointer(_ret, - retain: false, release: true); - } + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_Uint16_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// new - static NSURLSessionStreamTask new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionStreamTask, _sel_new); - return NSURLSessionStreamTask.castFromPointer(_ret, - retain: false, release: true); - } + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(int) fn) => + objc.ObjCBlock( + objc.newClosureBlock(_ObjCBlock_ffiVoid_Uint16_closureCallable, + (int arg0) => fn(arg0)), + retain: false, + release: true); - /// allocWithZone: - static NSURLSessionStreamTask allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSURLSessionStreamTask, _sel_allocWithZone_, zone); - return NSURLSessionStreamTask.castFromPointer(_ret, + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_Uint16_listenerCallable.nativeFunction.cast(), + (int arg0) => fn(arg0)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_15f11yh(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, retain: false, release: true); } +} - /// alloc - static NSURLSessionStreamTask alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionStreamTask, _sel_alloc); - return NSURLSessionStreamTask.castFromPointer(_ret, - retain: false, release: true); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_Uint16_CallExtension + on objc.ObjCBlock { + void call(int arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Uint16 arg0)>>() + .asFunction, int)>()( + ref.pointer, arg0); } -late final _class_NSURLSessionStreamTask = - objc.getClass("NSURLSessionStreamTask"); -void _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrTrampoline( +void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrTrampoline( ffi.Pointer block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => + dispatch_data_t arg0, + dispatch_data_t arg1) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Bool arg1, ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, bool, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrCallable = + .cast< + ffi.NativeFunction< + ffi.Void Function( + dispatch_data_t arg0, dispatch_data_t arg1)>>() + .asFunction()( + arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrTrampoline) + ffi.Void Function(ffi.Pointer, + dispatch_data_t, dispatch_data_t)>( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline( +void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline( ffi.Pointer block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - bool, ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_bool_NSError_closureCallable = + dispatch_data_t arg0, + dispatch_data_t arg1) => + (objc.getBlockClosure(block) as void Function( + dispatch_data_t, dispatch_data_t))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline) + ffi.Void Function(ffi.Pointer, + dispatch_data_t, dispatch_data_t)>( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSData_bool_NSError_listenerTrampoline( +void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerTrampoline( ffi.Pointer block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - bool, ffi.Pointer))(arg0, arg1, arg2); + dispatch_data_t arg0, + dispatch_data_t arg1) { + (objc.getBlockClosure(block) as void Function( + dispatch_data_t, dispatch_data_t))(arg0, arg1); objc.objectRelease(block.cast()); } ffi.NativeCallable< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSData_bool_NSError_listenerCallable = ffi + ffi.Pointer, dispatch_data_t, dispatch_data_t)> + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerCallable = ffi .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_bool_NSError_listenerTrampoline) + ffi.Void Function(ffi.Pointer, dispatch_data_t, + dispatch_data_t)>.listener( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSData_bool_NSError { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock + static objc.ObjCBlock castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(objc.NSData, ffi.Bool, - objc.NSError?)>(pointer, retain: retain, release: release); + objc.ObjCBlock( + pointer, + retain: retain, + release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Bool arg1, ffi.Pointer arg2)>> + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject)> fromFunctionPointer( + ffi.Pointer> ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrCallable, ptr.cast()), + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrCallable, + ptr.cast()), retain: false, release: true); @@ -60074,19 +58523,17 @@ abstract final class ObjCBlock_ffiVoid_NSData_bool_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock - fromFunction(void Function(objc.NSData, bool, objc.NSError?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_bool_NSError_closureCallable, - (ffi.Pointer arg0, bool arg1, - ffi.Pointer arg2) => - fn( - objc.NSData.castFromPointer(arg0, retain: true, release: true), - arg1, - arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock fromFunction( + void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureCallable, + (dispatch_data_t arg0, dispatch_data_t arg1) => fn( + objc.NSObject.castFromPointer(arg0, + retain: true, release: true), + objc.NSObject.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -60097,118 +58544,103 @@ abstract final class ObjCBlock_ffiVoid_NSData_bool_NSError { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock - listener(void Function(objc.NSData, bool, objc.NSError?) fn) { + static objc.ObjCBlock + listener(void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_bool_NSError_listenerCallable.nativeFunction + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerCallable + .nativeFunction .cast(), - (ffi.Pointer arg0, bool arg1, - ffi.Pointer arg2) => - fn( - objc.NSData.castFromPointer(arg0, retain: false, release: true), - arg1, - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_hfhq9m(raw); + (dispatch_data_t arg0, dispatch_data_t arg1) => fn( + objc.NSObject.castFromPointer(arg0, retain: false, release: true), + objc.NSObject.castFromPointer(arg1, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjvic9(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(objc.NSData, ffi.Bool, objc.NSError?)>(wrapper, - retain: false, release: true); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSData_bool_NSError_CallExtension - on objc.ObjCBlock { - void call(objc.NSData arg0, bool arg1, objc.NSError? arg2) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Bool arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1, arg2?.ref.pointer ?? ffi.nullptr); +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_CallExtension + on objc.ObjCBlock { + void call(Dartdispatch_data_t arg0, Dartdispatch_data_t arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + dispatch_data_t arg0, dispatch_data_t arg1)>>() + .asFunction< + void Function(ffi.Pointer, + dispatch_data_t, dispatch_data_t)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer); } -late final _sel_readDataOfMinLength_maxLength_timeout_completionHandler_ = objc - .registerName("readDataOfMinLength:maxLength:timeout:completionHandler:"); -final _objc_msgSend_15i4521 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSUInteger, - NSTimeInterval, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - double, - ffi.Pointer)>(); -void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => +late final _protocol_OS_sec_protocol_options = + objc.getProtocol("OS_sec_protocol_options"); + +/// OS_sec_protocol_options +abstract final class OS_sec_protocol_options { + /// Builds an object that implements the OS_sec_protocol_options protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); + + return builder.build(); + } + + /// Adds the implementation of the OS_sec_protocol_options protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} + +typedef sec_protocol_options_t = ffi.Pointer; +typedef Dartsec_protocol_options_t = objc.NSObject; +void _ObjCBlock_ffiVoid_dispatchdatat_fnPtrTrampoline( + ffi.Pointer block, dispatch_data_t arg0) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSError_fnPtrCallable = + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline) + ffi.Void Function( + ffi.Pointer, dispatch_data_t)>( + _ObjCBlock_ffiVoid_dispatchdatat_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSError_closureCallable = +void _ObjCBlock_ffiVoid_dispatchdatat_closureTrampoline( + ffi.Pointer block, dispatch_data_t arg0) => + (objc.getBlockClosure(block) as void Function(dispatch_data_t))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSError_closureTrampoline) + ffi.Void Function( + ffi.Pointer, dispatch_data_t)>( + _ObjCBlock_ffiVoid_dispatchdatat_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSError_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); +void _ObjCBlock_ffiVoid_dispatchdatat_listenerTrampoline( + ffi.Pointer block, dispatch_data_t arg0) { + (objc.getBlockClosure(block) as void Function(dispatch_data_t))(arg0); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSError_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSError_listenerTrampoline) + ffi.Void Function(ffi.Pointer, dispatch_data_t)> + _ObjCBlock_ffiVoid_dispatchdatat_listenerCallable = ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, dispatch_data_t)>.listener( + _ObjCBlock_ffiVoid_dispatchdatat_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSError { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_dispatchdatat { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock castFromPointer( ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock(pointer, + objc.ObjCBlock(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -60216,14 +58648,13 @@ abstract final class ObjCBlock_ffiVoid_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( + static objc.ObjCBlock fromFunctionPointer( ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> + ffi.NativeFunction> ptr) => - objc.ObjCBlock( + objc.ObjCBlock( objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSError_fnPtrCallable, ptr.cast()), + _ObjCBlock_ffiVoid_dispatchdatat_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -60232,14 +58663,14 @@ abstract final class ObjCBlock_ffiVoid_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSError?) fn) => - objc.ObjCBlock( + static objc.ObjCBlock fromFunction( + void Function(Dartdispatch_data_t?) fn) => + objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSError_closureCallable, - (ffi.Pointer arg0) => fn(arg0.address == 0 + _ObjCBlock_ffiVoid_dispatchdatat_closureCallable, + (dispatch_data_t arg0) => fn(arg0.address == 0 ? null - : objc.NSError.castFromPointer(arg0, + : objc.NSObject.castFromPointer(arg0, retain: true, release: true))), retain: false, release: true); @@ -60253,463 +58684,162 @@ abstract final class ObjCBlock_ffiVoid_NSError { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(objc.NSError?) fn) { + static objc.ObjCBlock listener( + void Function(Dartdispatch_data_t?) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSError_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn(arg0.address == 0 + _ObjCBlock_ffiVoid_dispatchdatat_listenerCallable.nativeFunction.cast(), + (dispatch_data_t arg0) => fn(arg0.address == 0 ? null - : objc.NSError.castFromPointer(arg0, + : objc.NSObject.castFromPointer(arg0, retain: false, release: true))); - final wrapper = _wrapListenerBlock_ukcdfq(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, + return objc.ObjCBlock(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSError_CallExtension - on objc.ObjCBlock { - void call(objc.NSError? arg0) => ref.pointer.ref.invoke +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_dispatchdatat_CallExtension + on objc.ObjCBlock { + void call(Dartdispatch_data_t? arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() + dispatch_data_t arg0)>>() .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()( + void Function( + ffi.Pointer, dispatch_data_t)>()( ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); } -late final _sel_writeData_timeout_completionHandler_ = - objc.registerName("writeData:timeout:completionHandler:"); -final _objc_msgSend_5qmwfe = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSTimeInterval, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer)>(); -late final _sel_captureStreams = objc.registerName("captureStreams"); -late final _sel_closeWrite = objc.registerName("closeWrite"); -late final _sel_closeRead = objc.registerName("closeRead"); -late final _sel_startSecureConnection = - objc.registerName("startSecureConnection"); -late final _sel_stopSecureConnection = - objc.registerName("stopSecureConnection"); -late final _sel_streamTaskWithHostName_port_ = - objc.registerName("streamTaskWithHostName:port:"); -final _objc_msgSend_spwp90 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - -/// NSNetService -class NSNetService extends objc.ObjCObjectBase { - NSNetService._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super(pointer, retain: retain, release: release); - - /// Constructs a [NSNetService] that points to the same underlying object as [other]. - NSNetService.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSNetService] that wraps the given raw object pointer. - NSNetService.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSNetService]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSNetService); - } -} - -late final _class_NSNetService = objc.getClass("NSNetService"); -late final _sel_streamTaskWithNetService_ = - objc.registerName("streamTaskWithNetService:"); - -/// A WebSocket task can be created with a ws or wss url. A client can also provide -/// a list of protocols it wishes to advertise during the WebSocket handshake phase. -/// Once the handshake is successfully completed the client will be notified through an optional delegate. -/// All reads and writes enqueued before the completion of the handshake will be queued up and -/// executed once the handshake succeeds. Before the handshake completes, the client can be called to handle -/// redirection or authentication using the same delegates as NSURLSessionTask. WebSocket task will also provide -/// support for cookies and will store cookies to the cookie storage on the session and will attach cookies to -/// outgoing HTTP handshake requests. -class NSURLSessionWebSocketTask extends NSURLSessionTask { - NSURLSessionWebSocketTask._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSURLSessionWebSocketTask] that points to the same underlying object as [other]. - NSURLSessionWebSocketTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionWebSocketTask] that wraps the given raw object pointer. - NSURLSessionWebSocketTask.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLSessionWebSocketTask]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionWebSocketTask); - } - - /// Sends a WebSocket message. If an error occurs, any outstanding work will also fail. - /// Note that invocation of the completion handler does not - /// guarantee that the remote side has received all the bytes, only - /// that they have been written to the kernel. - void sendMessage_completionHandler_(NSURLSessionWebSocketMessage message, - objc.ObjCBlock completionHandler) { - _objc_msgSend_cmbt6k(this.ref.pointer, _sel_sendMessage_completionHandler_, - message.ref.pointer, completionHandler.ref.pointer); - } - - /// Reads a WebSocket message once all the frames of the message are available. - /// If the maximumMessage size is hit while buffering the frames, the receiveMessage call will error out - /// and all outstanding work will also fail resulting in the end of the task. - void receiveMessageWithCompletionHandler_( - objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> - completionHandler) { - _objc_msgSend_4daxhl( - this.ref.pointer, - _sel_receiveMessageWithCompletionHandler_, - completionHandler.ref.pointer); - } - - /// Sends a ping frame from the client side. The pongReceiveHandler is invoked when the client - /// receives a pong from the server endpoint. If a connection is lost or an error occurs before receiving - /// the pong from the endpoint, the pongReceiveHandler block will be invoked with an error. - /// Note - the pongReceiveHandler will always be called in the order in which the pings were sent. - void sendPingWithPongReceiveHandler_( - objc.ObjCBlock pongReceiveHandler) { - _objc_msgSend_4daxhl(this.ref.pointer, _sel_sendPingWithPongReceiveHandler_, - pongReceiveHandler.ref.pointer); - } - - /// Sends a close frame with the given closeCode. An optional reason can be provided while sending the close frame. - /// Simply calling cancel on the task will result in a cancellation frame being sent without any reason. - void cancelWithCloseCode_reason_( - DartNSInteger closeCode, objc.NSData? reason) { - _objc_msgSend_18im7ej(this.ref.pointer, _sel_cancelWithCloseCode_reason_, - closeCode, reason?.ref.pointer ?? ffi.nullptr); - } - - /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached - DartNSInteger get maximumMessageSize { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_maximumMessageSize); - } - - /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached - set maximumMessageSize(DartNSInteger value) { - return _objc_msgSend_ke7qz2( - this.ref.pointer, _sel_setMaximumMessageSize_, value); - } - - /// A task can be queried for it's close code at any point. When the task is not closed, it will be set to NSURLSessionWebSocketCloseCodeInvalid - DartNSInteger get closeCode { - return _objc_msgSend_a13zbl(this.ref.pointer, _sel_closeCode); - } - - /// A task can be queried for it's close reason at any point. A nil value indicates no closeReason or that the task is still running - objc.NSData? get closeReason { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_closeReason); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSURLSessionWebSocketTask init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSURLSessionWebSocketTask new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionWebSocketTask, _sel_new); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSURLSessionWebSocketTask allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSURLSessionWebSocketTask, _sel_allocWithZone_, zone); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSURLSessionWebSocketTask alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionWebSocketTask, _sel_alloc); - return NSURLSessionWebSocketTask.castFromPointer(_ret, - retain: false, release: true); - } -} - -late final _class_NSURLSessionWebSocketTask = - objc.getClass("NSURLSessionWebSocketTask"); - -/// The client can create a WebSocket message object that will be passed to the send calls -/// and will be delivered from the receive calls. The message can be initialized with data or string. -/// If initialized with data, the string property will be nil and vice versa. -class NSURLSessionWebSocketMessage extends objc.NSObject { - NSURLSessionWebSocketMessage._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSURLSessionWebSocketMessage] that points to the same underlying object as [other]. - NSURLSessionWebSocketMessage.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionWebSocketMessage] that wraps the given raw object pointer. - NSURLSessionWebSocketMessage.castFromPointer( - ffi.Pointer other, - {bool retain = false, - bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLSessionWebSocketMessage]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg(obj.ref.pointer, _sel_isKindOfClass_, - _class_NSURLSessionWebSocketMessage); - } - - /// Create a message with data type - NSURLSessionWebSocketMessage initWithData_(objc.NSData data) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithData_, data.ref.pointer); - return NSURLSessionWebSocketMessage.castFromPointer(_ret, - retain: false, release: true); - } - - /// Create a message with string type - NSURLSessionWebSocketMessage initWithString_(objc.NSString string) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithString_, string.ref.pointer); - return NSURLSessionWebSocketMessage.castFromPointer(_ret, - retain: false, release: true); - } - - /// type - NSURLSessionWebSocketMessageType get type { - final _ret = _objc_msgSend_1kew1r(this.ref.pointer, _sel_type); - return NSURLSessionWebSocketMessageType.fromValue(_ret); - } - - /// data - objc.NSData? get data { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_data); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// string - objc.NSString? get string { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_string); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSURLSessionWebSocketMessage init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSessionWebSocketMessage.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSURLSessionWebSocketMessage new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionWebSocketMessage, _sel_new); - return NSURLSessionWebSocketMessage.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSURLSessionWebSocketMessage allocWithZone_( - ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSURLSessionWebSocketMessage, _sel_allocWithZone_, zone); - return NSURLSessionWebSocketMessage.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSURLSessionWebSocketMessage alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionWebSocketMessage, _sel_alloc); - return NSURLSessionWebSocketMessage.castFromPointer(_ret, - retain: false, release: true); - } -} - -late final _class_NSURLSessionWebSocketMessage = - objc.getClass("NSURLSessionWebSocketMessage"); -late final _sel_initWithData_ = objc.registerName("initWithData:"); -late final _sel_initWithString_ = objc.registerName("initWithString:"); - -enum NSURLSessionWebSocketMessageType { - NSURLSessionWebSocketMessageTypeData(0), - NSURLSessionWebSocketMessageTypeString(1); - - final int value; - const NSURLSessionWebSocketMessageType(this.value); - - static NSURLSessionWebSocketMessageType fromValue(int value) => - switch (value) { - 0 => NSURLSessionWebSocketMessageTypeData, - 1 => NSURLSessionWebSocketMessageTypeString, - _ => throw ArgumentError( - "Unknown value for NSURLSessionWebSocketMessageType: $value"), - }; -} - -late final _sel_type = objc.registerName("type"); -final _objc_msgSend_1kew1r = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_string = objc.registerName("string"); -late final _sel_sendMessage_completionHandler_ = - objc.registerName("sendMessage:completionHandler:"); -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); +typedef sec_protocol_pre_shared_key_selection_complete_t + = ffi.Pointer; +typedef Dartsec_protocol_pre_shared_key_selection_complete_t + = objc.ObjCBlock; +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t + arg2)>>() + .asFunction< + void Function(sec_protocol_metadata_t, dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)>()( + arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrCallable = + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline) + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2) => + (objc.getBlockClosure(block) as void Function( + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t))( + arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureCallable = + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline) + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t))(arg0, arg1, arg2); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerCallable = + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)> + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerTrampoline) + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)>.listener( + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> + ffi.Void Function( + objc.NSObject, objc.NSObject?, objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, - objc.NSError?)>(pointer, retain: retain, release: release); + ffi.Void Function(objc.NSObject, objc.NSObject?, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject?, + objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer> ptr) => + objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject?, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSURLSessionWebSocketMessage.castFromPointer(arg0, retain: true, release: true), - arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock)> + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartdispatch_data_t?, Dartsec_protocol_pre_shared_key_selection_complete_t) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureCallable, + (sec_protocol_metadata_t arg0, dispatch_data_t arg1, sec_protocol_pre_shared_key_selection_complete_t arg2) => fn( + objc.NSObject.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : objc.NSObject.castFromPointer(arg1, retain: true, release: true), + ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -60721,208 +58851,159 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> - listener(void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn) { + ffi.Void Function(objc.NSObject, objc.NSObject?, + objc.ObjCBlock)> listener( + void Function(Dartsec_protocol_metadata_t, Dartdispatch_data_t?, + Dartsec_protocol_pre_shared_key_selection_complete_t) + fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerCallable + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1) => + (sec_protocol_metadata_t arg0, dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2) => fn( - arg0.address == 0 - ? null - : NSURLSessionWebSocketMessage.castFromPointer(arg0, - retain: false, release: true), + objc.NSObject.castFromPointer(arg0, + retain: false, release: true), arg1.address == 0 ? null - : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_1tjlcwl(raw); + : objc.NSObject.castFromPointer(arg1, + retain: false, release: true), + ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_91c9gi(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, - objc.NSError?)>(wrapper, retain: false, release: true); + ffi.Void Function(objc.NSObject, objc.NSObject?, + objc.ObjCBlock)>(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_CallExtension +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_CallExtension on objc.ObjCBlock< - ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> { - void call(NSURLSessionWebSocketMessage? arg0, objc.NSError? arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_receiveMessageWithCompletionHandler_ = - objc.registerName("receiveMessageWithCompletionHandler:"); -late final _sel_sendPingWithPongReceiveHandler_ = - objc.registerName("sendPingWithPongReceiveHandler:"); - -/// The WebSocket close codes follow the close codes given in the RFC -sealed class NSURLSessionWebSocketCloseCode { - static const NSURLSessionWebSocketCloseCodeInvalid = 0; - static const NSURLSessionWebSocketCloseCodeNormalClosure = 1000; - static const NSURLSessionWebSocketCloseCodeGoingAway = 1001; - static const NSURLSessionWebSocketCloseCodeProtocolError = 1002; - static const NSURLSessionWebSocketCloseCodeUnsupportedData = 1003; - static const NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005; - static const NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006; - static const NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007; - static const NSURLSessionWebSocketCloseCodePolicyViolation = 1008; - static const NSURLSessionWebSocketCloseCodeMessageTooBig = 1009; - static const NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = 1010; - static const NSURLSessionWebSocketCloseCodeInternalServerError = 1011; - static const NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015; + ffi.Void Function(objc.NSObject, objc.NSObject?, + objc.ObjCBlock)> { + void + call(Dartsec_protocol_metadata_t arg0, Dartdispatch_data_t? arg1, + Dartsec_protocol_pre_shared_key_selection_complete_t arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t + arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)>()( + ref.pointer, + arg0.ref.pointer, + arg1?.ref.pointer ?? ffi.nullptr, + arg2.ref.pointer); } -late final _sel_cancelWithCloseCode_reason_ = - objc.registerName("cancelWithCloseCode:reason:"); -final _objc_msgSend_18im7ej = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_maximumMessageSize = objc.registerName("maximumMessageSize"); -late final _sel_setMaximumMessageSize_ = - objc.registerName("setMaximumMessageSize:"); -late final _sel_closeCode = objc.registerName("closeCode"); -final _objc_msgSend_a13zbl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_closeReason = objc.registerName("closeReason"); -late final _sel_webSocketTaskWithURL_ = - objc.registerName("webSocketTaskWithURL:"); -late final _sel_webSocketTaskWithURL_protocols_ = - objc.registerName("webSocketTaskWithURL:protocols:"); -late final _sel_webSocketTaskWithRequest_ = - objc.registerName("webSocketTaskWithRequest:"); -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); +typedef sec_protocol_pre_shared_key_selection_t + = ffi.Pointer; +typedef Dartsec_protocol_pre_shared_key_selection_t = objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject?, + objc.ObjCBlock)>; +typedef sec_protocol_key_update_complete_t = ffi.Pointer; +typedef Dartsec_protocol_key_update_complete_t + = objc.ObjCBlock; +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1)>>() + .asFunction< + void Function(sec_protocol_metadata_t, + sec_protocol_key_update_complete_t)>()(arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrCallable = + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline) + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1) => + (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, + sec_protocol_key_update_complete_t))(arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureCallable = + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline) + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); + sec_protocol_metadata_t, sec_protocol_key_update_complete_t))(arg0, arg1); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerCallable = ffi - .NativeCallable< + ffi.Void Function(ffi.Pointer, + sec_protocol_metadata_t, sec_protocol_key_update_complete_t)> + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerCallable = + ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerTrampoline) + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t)>.listener( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet { /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, - objc.NSError?)>(pointer, retain: retain, release: release); + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)>( + pointer, + retain: retain, + release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( + static objc.ObjCBlock)> fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> + ffi.Void Function(sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1)>> ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrCallable, ptr.cast()), + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -60931,20 +59012,17 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 ? null : objc.NSData.castFromPointer(arg0, retain: true, release: true), - arg1.address == 0 ? null : NSURLResponse.castFromPointer(arg1, retain: true, release: true), - arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock)> + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_key_update_complete_t) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureCallable, + (sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1) => + fn(objc.NSObject.castFromPointer(arg0, retain: true, release: true), + ObjCBlock_ffiVoid.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -60955,208 +59033,167 @@ abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc - .ObjCBlock - listener(void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn) { + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.ObjCBlock)> + listener( + void Function(Dartsec_protocol_metadata_t, + Dartsec_protocol_key_update_complete_t) + fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerCallable + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => + (sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, - retain: false, release: true), - arg1.address == 0 - ? null - : NSURLResponse.castFromPointer(arg1, - retain: false, release: true), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_tenbla(raw); + objc.NSObject.castFromPointer(arg0, + retain: false, release: true), + ObjCBlock_ffiVoid.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_14pxqbs(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(objc.NSData?, NSURLResponse?, - objc.NSError?)>(wrapper, retain: false, release: true); + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)>(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_CallExtension on objc - .ObjCBlock { - void call(objc.NSData? arg0, NSURLResponse? arg1, objc.NSError? arg2) => +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_CallExtension + on objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.ObjCBlock)> { + void call(Dartsec_protocol_metadata_t arg0, + Dartsec_protocol_key_update_complete_t arg1) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1)>>() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, - arg1?.ref.pointer ?? ffi.nullptr, - arg2?.ref.pointer ?? ffi.nullptr); + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer); } -late final _sel_dataTaskWithRequest_completionHandler_ = - objc.registerName("dataTaskWithRequest:completionHandler:"); -late final _sel_dataTaskWithURL_completionHandler_ = - objc.registerName("dataTaskWithURL:completionHandler:"); -late final _sel_uploadTaskWithRequest_fromFile_completionHandler_ = - objc.registerName("uploadTaskWithRequest:fromFile:completionHandler:"); -final _objc_msgSend_37obke = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_uploadTaskWithRequest_fromData_completionHandler_ = - objc.registerName("uploadTaskWithRequest:fromData:completionHandler:"); -late final _sel_uploadTaskWithResumeData_completionHandler_ = - objc.registerName("uploadTaskWithResumeData:completionHandler:"); -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); +typedef sec_protocol_key_update_t = ffi.Pointer; +typedef Dartsec_protocol_key_update_t = objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.ObjCBlock)>; +typedef sec_protocol_challenge_complete_t = ffi.Pointer; +typedef Dartsec_protocol_challenge_complete_t + = objc.ObjCBlock; +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1)>>() + .asFunction< + void Function(sec_protocol_metadata_t, + sec_protocol_challenge_complete_t)>()(arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrCallable = + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline) + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1) => + (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, + sec_protocol_challenge_complete_t))(arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureCallable = + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline) + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); + sec_protocol_metadata_t, sec_protocol_challenge_complete_t))(arg0, arg1); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerCallable = ffi - .NativeCallable< + ffi.Void Function(ffi.Pointer, + sec_protocol_metadata_t, sec_protocol_challenge_complete_t)> + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerCallable = + ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerTrampoline) + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t)>.listener( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet { /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock + static objc.ObjCBlock< + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, - objc.NSError?)>(pointer, retain: retain, release: release); + ffi.Void Function(objc.NSObject, + objc.ObjCBlock)>( + pointer, + retain: retain, + release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + static objc + .ObjCBlock)> + fromFunctionPointer(ffi.Pointer> ptr) => + objc.ObjCBlock< + ffi.Void Function(objc.NSObject, + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 ? null : objc.NSURL.castFromPointer(arg0, retain: true, release: true), - arg1.address == 0 ? null : NSURLResponse.castFromPointer(arg1, retain: true, release: true), - arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); + static objc + .ObjCBlock)> + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_challenge_complete_t) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureCallable, + (sec_protocol_metadata_t arg0, sec_protocol_challenge_complete_t arg1) => fn( + objc.NSObject.castFromPointer(arg0, retain: true, release: true), + ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -61167,369 +59204,259 @@ abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc - .ObjCBlock - listener(void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn) { + static objc.ObjCBlock< + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)> + listener( + void Function(Dartsec_protocol_metadata_t, + Dartsec_protocol_challenge_complete_t) + fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerCallable + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => + (sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1) => fn( - arg0.address == 0 - ? null - : objc.NSURL - .castFromPointer(arg0, retain: false, release: true), - arg1.address == 0 - ? null - : NSURLResponse.castFromPointer(arg1, - retain: false, release: true), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_tenbla(raw); + objc.NSObject.castFromPointer(arg0, + retain: false, release: true), + ObjCBlock_ffiVoid_dispatchdatat.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_14pxqbs(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(objc.NSURL?, NSURLResponse?, - objc.NSError?)>(wrapper, retain: false, release: true); + ffi.Void Function(objc.NSObject, + objc.ObjCBlock)>(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_CallExtension on objc - .ObjCBlock { - void call(objc.NSURL? arg0, NSURLResponse? arg1, objc.NSError? arg2) => +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)> { + void call(Dartsec_protocol_metadata_t arg0, + Dartsec_protocol_challenge_complete_t arg1) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1)>>() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, - arg1?.ref.pointer ?? ffi.nullptr, - arg2?.ref.pointer ?? ffi.nullptr); + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer); } -late final _sel_downloadTaskWithRequest_completionHandler_ = - objc.registerName("downloadTaskWithRequest:completionHandler:"); -late final _sel_downloadTaskWithURL_completionHandler_ = - objc.registerName("downloadTaskWithURL:completionHandler:"); -late final _sel_downloadTaskWithResumeData_completionHandler_ = - objc.registerName("downloadTaskWithResumeData:completionHandler:"); +typedef sec_protocol_challenge_t = ffi.Pointer; +typedef Dartsec_protocol_challenge_t = objc.ObjCBlock< + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)>; +void _ObjCBlock_ffiVoid_bool_fnPtrTrampoline( + ffi.Pointer block, bool arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_bool_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Bool)>(_ObjCBlock_ffiVoid_bool_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_bool_closureTrampoline( + ffi.Pointer block, bool arg0) => + (objc.getBlockClosure(block) as void Function(bool))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_bool_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Bool)>(_ObjCBlock_ffiVoid_bool_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_bool_listenerTrampoline( + ffi.Pointer block, bool arg0) { + (objc.getBlockClosure(block) as void Function(bool))(arg0); + objc.objectRelease(block.cast()); +} -enum NSURLSessionResponseDisposition { - /// Cancel the load, this is the same as -[task cancel] - NSURLSessionResponseCancel(0), +ffi.NativeCallable, ffi.Bool)> + _ObjCBlock_ffiVoid_bool_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Bool)>.listener(_ObjCBlock_ffiVoid_bool_listenerTrampoline) + ..keepIsolateAlive = false; - /// Allow the load to continue - NSURLSessionResponseAllow(1), +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - /// Turn this request into a download - NSURLSessionResponseBecomeDownload(2), - - /// Turn this task into a stream task - NSURLSessionResponseBecomeStream(3); - - final int value; - const NSURLSessionResponseDisposition(this.value); - - static NSURLSessionResponseDisposition fromValue(int value) => - switch (value) { - 0 => NSURLSessionResponseCancel, - 1 => NSURLSessionResponseAllow, - 2 => NSURLSessionResponseBecomeDownload, - 3 => NSURLSessionResponseBecomeStream, - _ => throw ArgumentError( - "Unknown value for NSURLSessionResponseDisposition: $value"), - }; -} - -/// Messages related to the URL session as a whole -abstract final class NSURLSessionDelegate { - /// Builds an object that implements the NSURLSessionDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? - URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } - - /// Adds the implementation of the NSURLSessionDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? - URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_bool_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Builds an object that implements the NSURLSessionDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? - URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(bool) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_bool_closureCallable, (bool arg0) => fn(arg0)), + retain: false, + release: true); - /// Adds the implementation of the NSURLSessionDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? - URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(bool) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_bool_listenerCallable.nativeFunction.cast(), + (bool arg0) => fn(arg0)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1s56lr9(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } +} - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = objc - .ObjCProtocolListenableMethod( - _sel_URLSession_didBecomeInvalidWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - ); - - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - ); - - /// If an application has received an - /// -application:handleEventsForBackgroundURLSession:completionHandler: - /// message, the session delegate will receive this message to indicate - /// that all messages previously enqueued for this session have been - /// delivered. At this time it is safe to invoke the previously stored - /// completion handler, or to begin any internal updates that will - /// result in invoking the completion handler. - static final URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.ObjCProtocolListenableMethod( - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - ); +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_bool_CallExtension + on objc.ObjCBlock { + void call(bool arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, ffi.Bool arg0)>>() + .asFunction, bool)>()( + ref.pointer, arg0); } -late final _protocol_NSURLSessionDelegate = - objc.getProtocol("NSURLSessionDelegate"); -late final _sel_URLSession_didBecomeInvalidWithError_ = - objc.registerName("URLSession:didBecomeInvalidWithError:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); +typedef sec_protocol_verify_complete_t = ffi.Pointer; +typedef Dartsec_protocol_verify_complete_t + = objc.ObjCBlock; +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2)>>() + .asFunction< + void Function(sec_protocol_metadata_t, sec_trust_t, + sec_protocol_verify_complete_t)>()(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable = + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline) + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2) => + (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, + sec_trust_t, sec_protocol_verify_complete_t))(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable = + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline) + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2) { + (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, + sec_trust_t, sec_protocol_verify_complete_t))(arg0, arg1, arg2); objc.objectRelease(block.cast()); } ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable = ffi - .NativeCallable< + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t)> + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerCallable = + ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline) + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t)>.listener( + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - objc.NSError?)>(pointer, retain: retain, release: release); + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock, NSURLSession, objc.NSError?)> - fromFunctionPointer( - ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> - ptr) => - objc.ObjCBlock, NSURLSession, objc.NSError?)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable, - ptr.cast()), + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer> ptr) => + objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -61539,15 +59466,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc - .ObjCBlock, NSURLSession, objc.NSError?)> - fromFunction(void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) => - objc.ObjCBlock, NSURLSession, objc.NSError?)>( + .ObjCBlock)> + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_trust_t, Dartsec_protocol_verify_complete_t) fn) => + objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureCallable, + (sec_protocol_metadata_t arg0, sec_trust_t arg1, sec_protocol_verify_complete_t arg2) => fn( + objc.NSObject.castFromPointer(arg0, retain: true, release: true), + objc.NSObject.castFromPointer(arg1, retain: true, release: true), + ObjCBlock_ffiVoid_bool.castFromPointer(arg2, retain: true, release: true))), retain: false, release: true); @@ -61561,420 +59488,316 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, objc.NSError?)> listener( - void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) { + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> listener( + void Function(Dartsec_protocol_metadata_t, Dartsec_trust_t, + Dartsec_protocol_verify_complete_t) + fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => + (sec_protocol_metadata_t arg0, sec_trust_t arg1, + sec_protocol_verify_complete_t arg2) => fn( - arg0, - NSURLSession.castFromPointer(arg1, + objc.NSObject.castFromPointer(arg0, retain: false, release: true), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_tm2na8(raw); + objc.NSObject.castFromPointer(arg1, + retain: false, release: true), + ObjCBlock_ffiVoid_bool.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_91c9gi(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - objc.NSError?)>(wrapper, retain: false, release: true); + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_CallExtension +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> { - void call( - ffi.Pointer arg0, NSURLSession arg1, objc.NSError? arg2) => + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> { + void call(Dartsec_protocol_metadata_t arg0, Dartsec_trust_t arg1, + Dartsec_protocol_verify_complete_t arg2) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2)>>() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2?.ref.pointer ?? ffi.nullptr); + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); } -/// NSURLAuthenticationChallenge -class NSURLAuthenticationChallenge extends objc.ObjCObjectBase { - NSURLAuthenticationChallenge._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super(pointer, retain: retain, release: release); +typedef sec_protocol_verify_t = ffi.Pointer; +typedef Dartsec_protocol_verify_t = objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>; - /// Constructs a [NSURLAuthenticationChallenge] that points to the same underlying object as [other]. - NSURLAuthenticationChallenge.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); +final class SSLContext extends ffi.Opaque {} - /// Constructs a [NSURLAuthenticationChallenge] that wraps the given raw object pointer. - NSURLAuthenticationChallenge.castFromPointer( - ffi.Pointer other, - {bool retain = false, - bool release = false}) - : this._(other, retain: retain, release: release); +typedef SSLContextRef = ffi.Pointer; +typedef SSLConnectionRef = ffi.Pointer; - /// Returns whether [obj] is an instance of [NSURLAuthenticationChallenge]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg(obj.ref.pointer, _sel_isKindOfClass_, - _class_NSURLAuthenticationChallenge); - } +enum SSLSessionOption { + kSSLSessionOptionBreakOnServerAuth(0), + kSSLSessionOptionBreakOnCertRequested(1), + kSSLSessionOptionBreakOnClientAuth(2), + kSSLSessionOptionFalseStart(3), + kSSLSessionOptionSendOneByteRecord(4), + kSSLSessionOptionAllowServerIdentityChange(5), + kSSLSessionOptionFallback(6), + kSSLSessionOptionBreakOnClientHello(7), + kSSLSessionOptionAllowRenegotiation(8), + kSSLSessionOptionEnableSessionTickets(9); + + final int value; + const SSLSessionOption(this.value); + + static SSLSessionOption fromValue(int value) => switch (value) { + 0 => kSSLSessionOptionBreakOnServerAuth, + 1 => kSSLSessionOptionBreakOnCertRequested, + 2 => kSSLSessionOptionBreakOnClientAuth, + 3 => kSSLSessionOptionFalseStart, + 4 => kSSLSessionOptionSendOneByteRecord, + 5 => kSSLSessionOptionAllowServerIdentityChange, + 6 => kSSLSessionOptionFallback, + 7 => kSSLSessionOptionBreakOnClientHello, + 8 => kSSLSessionOptionAllowRenegotiation, + 9 => kSSLSessionOptionEnableSessionTickets, + _ => throw ArgumentError("Unknown value for SSLSessionOption: $value"), + }; } -late final _class_NSURLAuthenticationChallenge = - objc.getClass("NSURLAuthenticationChallenge"); -void - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(NSInteger arg0, - ffi.Pointer arg1)>>() - .asFunction)>()( - arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} +enum SSLSessionState { + kSSLIdle(0), + kSSLHandshake(1), + kSSLConnected(2), + kSSLClosed(3), + kSSLAborted(4); -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline) - ..keepIsolateAlive = false; + final int value; + const SSLSessionState(this.value); -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock( - pointer, - retain: retain, - release: release); + static SSLSessionState fromValue(int value) => switch (value) { + 0 => kSSLIdle, + 1 => kSSLHandshake, + 2 => kSSLConnected, + 3 => kSSLClosed, + 4 => kSSLAborted, + _ => throw ArgumentError("Unknown value for SSLSessionState: $value"), + }; +} - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> fromFunctionPointer( - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); +enum SSLClientCertificateState { + kSSLClientCertNone(0), + kSSLClientCertRequested(1), + kSSLClientCertSent(2), + kSSLClientCertRejected(3); - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock - fromFunction(void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable, - (int arg0, ffi.Pointer arg1) => fn( - NSURLSessionAuthChallengeDisposition.fromValue(arg0), - arg1.address == 0 - ? null - : NSURLCredential.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); + final int value; + const SSLClientCertificateState(this.value); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock - listener( - void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( - NSURLSessionAuthChallengeDisposition.fromValue(arg0), - arg1.address == 0 - ? null - : NSURLCredential.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_1najo2h(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true); - } + static SSLClientCertificateState fromValue(int value) => switch (value) { + 0 => kSSLClientCertNone, + 1 => kSSLClientCertRequested, + 2 => kSSLClientCertSent, + 3 => kSSLClientCertRejected, + _ => throw ArgumentError( + "Unknown value for SSLClientCertificateState: $value"), + }; } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_CallExtension - on objc.ObjCBlock { - void call(NSURLSessionAuthChallengeDisposition arg0, NSURLCredential? arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - NSInteger arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, int, - ffi.Pointer)>()( - ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); -} +typedef SSLReadFuncFunction = OSStatus Function(SSLConnectionRef connection, + ffi.Pointer data, ffi.Pointer dataLength); +typedef DartSSLReadFuncFunction = DartSInt32 Function( + SSLConnectionRef connection, + ffi.Pointer data, + ffi.Pointer dataLength); +typedef SSLReadFunc = ffi.Pointer>; +typedef SSLWriteFuncFunction = OSStatus Function(SSLConnectionRef connection, + ffi.Pointer data, ffi.Pointer dataLength); +typedef DartSSLWriteFuncFunction = DartSInt32 Function( + SSLConnectionRef connection, + ffi.Pointer data, + ffi.Pointer dataLength); +typedef SSLWriteFunc = ffi.Pointer>; -enum NSURLSessionAuthChallengeDisposition { - /// Use the specified credential, which may be nil - NSURLSessionAuthChallengeUseCredential(0), +enum SSLProtocolSide { + kSSLServerSide(0), + kSSLClientSide(1); - /// Default handling for the challenge - as if this delegate were not implemented; the credential parameter is ignored. - NSURLSessionAuthChallengePerformDefaultHandling(1), + final int value; + const SSLProtocolSide(this.value); - /// The entire request will be canceled; the credential parameter is ignored. - NSURLSessionAuthChallengeCancelAuthenticationChallenge(2), + static SSLProtocolSide fromValue(int value) => switch (value) { + 0 => kSSLServerSide, + 1 => kSSLClientSide, + _ => throw ArgumentError("Unknown value for SSLProtocolSide: $value"), + }; +} - /// This challenge is rejected and the next authentication protection space should be tried; the credential parameter is ignored. - NSURLSessionAuthChallengeRejectProtectionSpace(3); +enum SSLConnectionType { + kSSLStreamType(0), + kSSLDatagramType(1); final int value; - const NSURLSessionAuthChallengeDisposition(this.value); + const SSLConnectionType(this.value); - static NSURLSessionAuthChallengeDisposition fromValue(int value) => - switch (value) { - 0 => NSURLSessionAuthChallengeUseCredential, - 1 => NSURLSessionAuthChallengePerformDefaultHandling, - 2 => NSURLSessionAuthChallengeCancelAuthenticationChallenge, - 3 => NSURLSessionAuthChallengeRejectProtectionSpace, - _ => throw ArgumentError( - "Unknown value for NSURLSessionAuthChallengeDisposition: $value"), + static SSLConnectionType fromValue(int value) => switch (value) { + 0 => kSSLStreamType, + 1 => kSSLDatagramType, + _ => throw ArgumentError("Unknown value for SSLConnectionType: $value"), }; } -/// NSURLCredential -class NSURLCredential extends objc.ObjCObjectBase { - NSURLCredential._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super(pointer, retain: retain, release: release); - - /// Constructs a [NSURLCredential] that points to the same underlying object as [other]. - NSURLCredential.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); +enum SSLAuthenticate { + kNeverAuthenticate(0), + kAlwaysAuthenticate(1), + kTryAuthenticate(2); - /// Constructs a [NSURLCredential] that wraps the given raw object pointer. - NSURLCredential.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); + final int value; + const SSLAuthenticate(this.value); - /// Returns whether [obj] is an instance of [NSURLCredential]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLCredential); - } + static SSLAuthenticate fromValue(int value) => switch (value) { + 0 => kNeverAuthenticate, + 1 => kAlwaysAuthenticate, + 2 => kTryAuthenticate, + _ => throw ArgumentError("Unknown value for SSLAuthenticate: $value"), + }; } -late final _class_NSURLCredential = objc.getClass("NSURLCredential"); -late final _sel_URLSession_didReceiveChallenge_completionHandler_ = - objc.registerName("URLSession:didReceiveChallenge:completionHandler:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); +late final _class_NSURLSession = objc.getClass("NSURLSession"); +void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable = + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); +void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable = + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { +void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + ffi.Pointer))(arg0, arg1, arg2); objc.objectRelease(block.cast()); } ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable = - ffi.NativeCallable< + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerCallable = ffi + .NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline) + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => + static objc + .ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>(pointer, - retain: retain, release: release); + ffi.Void Function(objc.NSData?, NSURLResponse?, + objc.NSError?)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + static objc.ObjCBlock fromFunction( + void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn) => + objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, - (ffi.Pointer arg0, + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => + ffi.Pointer arg2) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLAuthenticationChallenge.castFromPointer(arg2, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg3, retain: true, release: true))), + arg0.address == 0 ? null : objc.NSData.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : NSURLResponse.castFromPointer(arg1, retain: true, release: true), + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), retain: false, release: true); @@ -61987,176 +59810,208 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)>)> listener( - void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock) - fn) { + static objc + .ObjCBlock + listener(void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLAuthenticationChallenge.castFromPointer(arg2, - retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential - .castFromPointer(arg3, retain: false, release: true))); - final wrapper = _wrapListenerBlock_1wmulza(raw); + arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, + retain: false, release: true), + arg1.address == 0 + ? null + : NSURLResponse.castFromPointer(arg1, + retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1hcfngn(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)>)>(wrapper, - retain: false, release: true); + ffi.Void Function(objc.NSData?, NSURLResponse?, + objc.NSError?)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3) => +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_CallExtension on objc + .ObjCBlock { + void call(objc.NSData? arg0, NSURLResponse? arg1, objc.NSError? arg2) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() + ffi.Pointer arg2)>>() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); + ffi.Pointer)>()( + ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, + arg1?.ref.pointer ?? ffi.nullptr, + arg2?.ref.pointer ?? ffi.nullptr); } -late final _sel_URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.registerName("URLSessionDidFinishEventsForBackgroundURLSession:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => +late final _sel_dataTaskWithRequest_completionHandler_ = + objc.registerName("dataTaskWithRequest:completionHandler:"); +final _objc_msgSend_o4sqyk = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_dataTaskWithURL_completionHandler_ = + objc.registerName("dataTaskWithURL:completionHandler:"); + +/// WARNING: NSURLSessionUploadTask is a stub. To generate bindings for this class, include +/// NSURLSessionUploadTask in your config's objc-interfaces list. +/// +/// An NSURLSessionUploadTask does not currently provide any additional +/// functionality over an NSURLSessionDataTask. All delegate messages +/// that may be sent referencing an NSURLSessionDataTask equally apply +/// to NSURLSessionUploadTasks. +class NSURLSessionUploadTask extends NSURLSessionDataTask { + NSURLSessionUploadTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionUploadTask] that points to the same underlying object as [other]. + NSURLSessionUploadTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionUploadTask] that wraps the given raw object pointer. + NSURLSessionUploadTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +late final _sel_uploadTaskWithRequest_fromFile_completionHandler_ = + objc.registerName("uploadTaskWithRequest:fromFile:completionHandler:"); +final _objc_msgSend_but05y = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_uploadTaskWithRequest_fromData_completionHandler_ = + objc.registerName("uploadTaskWithRequest:fromData:completionHandler:"); +late final _sel_uploadTaskWithResumeData_completionHandler_ = + objc.registerName("uploadTaskWithResumeData:completionHandler:"); +late final _class_NSURLSessionDownloadTask = + objc.getClass("NSURLSessionDownloadTask"); +void _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable = + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { +void _ObjCBlock_ffiVoid_NSData_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); + ffi.Pointer))(arg0); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable = ffi - .NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSData_listenerCallable = ffi.NativeCallable< ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline) + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSData_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSData { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock, NSURLSession)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - NSURLSession)>(pointer, retain: retain, release: release); + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, NSURLSession)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSData_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession)> - fromFunction(void Function(ffi.Pointer, NSURLSession) fn) => - objc.ObjCBlock, NSURLSession)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock fromFunction( + void Function(objc.NSData?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -62167,857 +60022,178 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock, NSURLSession)> - listener(void Function(ffi.Pointer, NSURLSession) fn) { + static objc.ObjCBlock listener( + void Function(objc.NSData?) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true))); - final wrapper = _wrapListenerBlock_sjfpmz(raw); + _ObjCBlock_ffiVoid_NSData_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession)>(wrapper, + return objc.ObjCBlock(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_CallExtension - on objc.ObjCBlock, NSURLSession)> { - void call(ffi.Pointer arg0, NSURLSession arg1) => ref - .pointer.ref.invoke +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSData_CallExtension + on objc.ObjCBlock { + void call(objc.NSData? arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() .asFunction< void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer); + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); } -/// Messages related to the operation of a specific task. -abstract final class NSURLSessionTaskDelegate { - /// Builds an object that implements the NSURLSessionTaskDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function( - NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionTaskDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionTaskDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_.implement( - builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionTaskDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionTaskDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); +late final _sel_cancelByProducingResumeData_ = + objc.registerName("cancelByProducingResumeData:"); + +/// NSURLSessionDownloadTask is a task that represents a download to +/// local storage. +class NSURLSessionDownloadTask extends NSURLSessionTask { + NSURLSessionDownloadTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionDownloadTask] that points to the same underlying object as [other]. + NSURLSessionDownloadTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionDownloadTask] that wraps the given raw object pointer. + NSURLSessionDownloadTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionDownloadTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionDownloadTask); } - /// Adds the implementation of the NSURLSessionTaskDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)? - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionTaskDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionTaskDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_.implement( - builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionTaskDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionTaskDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + /// Cancel the download (and calls the superclass -cancel). If + /// conditions will allow for resuming the download in the future, the + /// callback will be called with an opaque data blob, which may be used + /// with -downloadTaskWithResumeData: to attempt to resume the download. + /// If resume data cannot be created, the completion handler will be + /// called with nil resumeData. + void cancelByProducingResumeData_( + objc.ObjCBlock completionHandler) { + _objc_msgSend_f167m6(this.ref.pointer, _sel_cancelByProducingResumeData_, + completionHandler.ref.pointer); } - /// Builds an object that implements the NSURLSessionTaskDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function( - NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionTaskDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionTaskDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionTaskDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionTaskDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); + /// init + NSURLSessionDownloadTask init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: false, release: true); } - /// Adds the implementation of the NSURLSessionTaskDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)? - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionTaskDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionTaskDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionTaskDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionTaskDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); + /// new + static NSURLSessionDownloadTask new1() { + final _ret = + _objc_msgSend_1x359cv(_class_NSURLSessionDownloadTask, _sel_new); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: false, release: true); } - /// Notification that a task has been created. This method is the first message - /// a task sends, providing a place to configure the task before it is resumed. - /// - /// This delegate callback is *NOT* dispatched to the delegate queue. It is - /// invoked synchronously before the task creation method returns. - static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _sel_URLSession_didCreateTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_didCreateTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); - - /// Sent when the system is ready to begin work for a task with a delayed start - /// time set (using the earliestBeginDate property). The completionHandler must - /// be invoked in order for loading to proceed. The disposition provided to the - /// completion handler continues the load with the original request provided to - /// the task, replaces the request with the specified task, or cancels the task. - /// If this delegate is not implemented, loading will proceed with the original - /// request. - /// - /// Recommendation: only implement this delegate if tasks that have the - /// earliestBeginDate property set may become stale and require alteration prior - /// to starting the network load. - /// - /// If a new request is specified, the allowsExpensiveNetworkAccess, - /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties - /// from the new request will not be used; the properties from the - /// original request will continue to be used. - /// - /// Canceling the task is equivalent to calling the task's cancel method; the - /// URLSession:task:didCompleteWithError: task delegate will be called with error - /// NSURLErrorCancelled. - static final URLSession_task_willBeginDelayedRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)>( - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent when a task cannot start the network loading process because the current - /// network connectivity is not available or sufficient for the task's request. - /// - /// This delegate will be called at most one time per task, and is only called if - /// the waitsForConnectivity property in the NSURLSessionConfiguration has been - /// set to YES. - /// - /// This delegate callback will never be called for background sessions, because - /// the waitForConnectivity property is ignored by those sessions. - static final URLSession_taskIsWaitingForConnectivity_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _sel_URLSession_taskIsWaitingForConnectivity_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); - - /// An HTTP request is attempting to perform a redirection to a different - /// URL. You must invoke the completion routine to allow the - /// redirection, allow the redirection with a modified request, or - /// pass nil to the completionHandler to cause the body of the redirection - /// response to be delivered as the payload of this request. The default - /// is to follow redirections. - /// - /// For tasks in background sessions, redirections will always be followed and this method will not be called. - static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)>( - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); - - /// The task has received a request specific authentication challenge. - /// If this delegate is not implemented, the session specific authentication challenge - /// will *NOT* be called and the behavior will be the same as using the default handling - /// disposition. - static final URLSession_task_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent if a task requires a new, unopened body stream. This may be - /// necessary when authentication has failed for any request that - /// involves a body stream. - static final URLSession_task_needNewBodyStream_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)>( - _sel_URLSession_task_needNewBodyStream_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_needNewBodyStream_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - ); - - /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be - /// necessary when resuming a failed upload task. - /// - /// - Parameter session: The session containing the task that needs a new body stream from the given offset. - /// - Parameter task: The task that needs a new body stream. - /// - Parameter offset: The starting offset required for the body stream. - /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)>( - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent periodically to notify the delegate of upload progress. This - /// information is also available as properties of the task. - static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, int, int)>( - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); - - /// Sent for each informational response received except 101 switching protocols. - static final URLSession_task_didReceiveInformationalResponse_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - _sel_URLSession_task_didReceiveInformationalResponse_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - ); - - /// Sent when complete statistics information has been collected for the task. - static final URLSession_task_didFinishCollectingMetrics_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - _sel_URLSession_task_didFinishCollectingMetrics_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - ); + /// allocWithZone: + static NSURLSessionDownloadTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_hzlb60( + _class_NSURLSessionDownloadTask, _sel_allocWithZone_, zone); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: false, release: true); + } - /// Sent as the last message related to a specific task. Error may be - /// nil, which implies that no error occurred and this task is complete. - static final URLSession_task_didCompleteWithError_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( - _sel_URLSession_task_didCompleteWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didCompleteWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - ); + /// alloc + static NSURLSessionDownloadTask alloc() { + final _ret = + _objc_msgSend_1x359cv(_class_NSURLSessionDownloadTask, _sel_alloc); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: false, release: true); + } - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = objc - .ObjCProtocolListenableMethod( - _sel_URLSession_didBecomeInvalidWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - ); + /// self + NSURLSessionDownloadTask self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - ); + /// retain + NSURLSessionDownloadTask retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } - /// If an application has received an - /// -application:handleEventsForBackgroundURLSession:completionHandler: - /// message, the session delegate will receive this message to indicate - /// that all messages previously enqueued for this session have been - /// delivered. At this time it is safe to invoke the previously stored - /// completion handler, or to begin any internal updates that will - /// result in invoking the completion handler. - static final URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.ObjCProtocolListenableMethod( - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - ); + /// autorelease + NSURLSessionDownloadTask autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } } -late final _protocol_NSURLSessionTaskDelegate = - objc.getProtocol("NSURLSessionTaskDelegate"); -late final _sel_URLSession_didCreateTask_ = - objc.registerName("URLSession:didCreateTask:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline( +void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => block.ref.target .cast< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>>() .asFunction< - void Function(ffi.Pointer, ffi.Pointer, + void Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable = + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline) + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline( +void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => (objc.getBlockClosure(block) as void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable = + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline) + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { +void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); objc.objectRelease(block.cast()); @@ -63026,46 +60202,45 @@ void ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable = - ffi.NativeCallable< + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerCallable = ffi + .NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline) + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, NSURLSessionTask)> + static objc + .ObjCBlock castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask)>(pointer, retain: retain, release: release); + ffi.Void Function(objc.NSURL?, NSURLResponse?, + objc.NSError?)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> fromFunctionPointer( + static objc.ObjCBlock fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable, ptr.cast()), + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -63074,20 +60249,20 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock fromFunction( + void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0.address == 0 ? null : objc.NSURL.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : NSURLResponse.castFromPointer(arg1, retain: true, release: true), + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -63098,944 +60273,1378 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, NSURLSessionTask)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) { + static objc + .ObjCBlock + listener(void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_tm2na8(raw); + arg0.address == 0 + ? null + : objc.NSURL + .castFromPointer(arg0, retain: false, release: true), + arg1.address == 0 + ? null + : NSURLResponse.castFromPointer(arg1, + retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1hcfngn(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask)>(wrapper, retain: false, release: true); + ffi.Void Function(objc.NSURL?, NSURLResponse?, + objc.NSError?)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, NSURLSessionTask)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionTask arg2) => +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_CallExtension on objc + .ObjCBlock { + void call(objc.NSURL? arg0, NSURLResponse? arg1, objc.NSError? arg2) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>>() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); + ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, + arg1?.ref.pointer ?? ffi.nullptr, + arg2?.ref.pointer ?? ffi.nullptr); } -void - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(NSInteger arg0, - ffi.Pointer arg1)>>() - .asFunction)>()( - arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} +late final _sel_downloadTaskWithRequest_completionHandler_ = + objc.registerName("downloadTaskWithRequest:completionHandler:"); +late final _sel_downloadTaskWithURL_completionHandler_ = + objc.registerName("downloadTaskWithURL:completionHandler:"); +late final _sel_downloadTaskWithResumeData_completionHandler_ = + objc.registerName("downloadTaskWithResumeData:completionHandler:"); -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable = - ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline) - ..keepIsolateAlive = false; +/// NSURLSession convenience routines deliver results to +/// a completion handler block. These convenience routines +/// are not available to NSURLSessions that are configured +/// as background sessions. +/// +/// Task objects are always created in a suspended state and +/// must be sent the -resume message before they will execute. +extension NSURLSessionAsynchronousConvenience on NSURLSession { + /// data task convenience methods. These methods create tasks that + /// bypass the normal delegate calls for response and data delivery, + /// and provide a simple cancelable asynchronous interface to receiving + /// data. Errors will be returned in the NSURLErrorDomain, + /// see . The delegate, if any, will still be + /// called for authentication challenges. + NSURLSessionDataTask dataTaskWithRequest_completionHandler_( + NSURLRequest request, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_o4sqyk( + this.ref.pointer, + _sel_dataTaskWithRequest_completionHandler_, + request.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: true, release: true); + } -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); + /// dataTaskWithURL:completionHandler: + NSURLSessionDataTask dataTaskWithURL_completionHandler_( + objc.NSURL url, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_o4sqyk( + this.ref.pointer, + _sel_dataTaskWithURL_completionHandler_, + url.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: true, release: true); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLRequest?)> fromFunctionPointer( - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + /// upload convenience method. + NSURLSessionUploadTask uploadTaskWithRequest_fromFile_completionHandler_( + NSURLRequest request, + objc.NSURL fileURL, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_but05y( + this.ref.pointer, + _sel_uploadTaskWithRequest_fromFile_completionHandler_, + request.ref.pointer, + fileURL.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock - fromFunction(void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable, - (int arg0, ffi.Pointer arg1) => fn( - NSURLSessionDelayedRequestDisposition.fromValue(arg0), - arg1.address == 0 - ? null - : NSURLRequest.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); + /// uploadTaskWithRequest:fromData:completionHandler: + NSURLSessionUploadTask uploadTaskWithRequest_fromData_completionHandler_( + NSURLRequest request, + objc.NSData? bodyData, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_but05y( + this.ref.pointer, + _sel_uploadTaskWithRequest_fromData_completionHandler_, + request.ref.pointer, + bodyData?.ref.pointer ?? ffi.nullptr, + completionHandler.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); + } - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. + /// Creates a URLSessionUploadTask from a resume data blob. If resuming from an upload + /// file, the file must still exist and be unmodified. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable - .nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn( - NSURLSessionDelayedRequestDisposition.fromValue(arg0), - arg1.address == 0 - ? null - : NSURLRequest.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_wnmjgj(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); + /// - Parameter resumeData: Resume data blob from an incomplete upload, such as data returned by the cancelByProducingResumeData: method. + /// - Parameter completionHandler: The completion handler to call when the load request is complete. + /// - Returns: A new session upload task, or nil if the resumeData is invalid. + NSURLSessionUploadTask uploadTaskWithResumeData_completionHandler_( + objc.NSData resumeData, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_o4sqyk( + this.ref.pointer, + _sel_uploadTaskWithResumeData_completionHandler_, + resumeData.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_CallExtension - on objc.ObjCBlock { - void call(NSURLSessionDelayedRequestDisposition arg0, NSURLRequest? arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - NSInteger arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, int, - ffi.Pointer)>()( - ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); -} - -/// Disposition options for various delegate messages -enum NSURLSessionDelayedRequestDisposition { - /// Use the original request provided when the task was created; the request parameter is ignored. - NSURLSessionDelayedRequestContinueLoading(0), - /// Use the specified request, which may not be nil. - NSURLSessionDelayedRequestUseNewRequest(1), - - /// Cancel the task; the request parameter is ignored. - NSURLSessionDelayedRequestCancel(2); + /// download task convenience methods. When a download successfully + /// completes, the NSURL will point to a file that must be read or + /// copied during the invocation of the completion routine. The file + /// will be removed automatically. + NSURLSessionDownloadTask downloadTaskWithRequest_completionHandler_( + NSURLRequest request, + objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_o4sqyk( + this.ref.pointer, + _sel_downloadTaskWithRequest_completionHandler_, + request.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } - final int value; - const NSURLSessionDelayedRequestDisposition(this.value); + /// downloadTaskWithURL:completionHandler: + NSURLSessionDownloadTask downloadTaskWithURL_completionHandler_( + objc.NSURL url, + objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_o4sqyk( + this.ref.pointer, + _sel_downloadTaskWithURL_completionHandler_, + url.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } - static NSURLSessionDelayedRequestDisposition fromValue(int value) => - switch (value) { - 0 => NSURLSessionDelayedRequestContinueLoading, - 1 => NSURLSessionDelayedRequestUseNewRequest, - 2 => NSURLSessionDelayedRequestCancel, - _ => throw ArgumentError( - "Unknown value for NSURLSessionDelayedRequestDisposition: $value"), - }; + /// downloadTaskWithResumeData:completionHandler: + NSURLSessionDownloadTask downloadTaskWithResumeData_completionHandler_( + objc.NSData resumeData, + objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_o4sqyk( + this.ref.pointer, + _sel_downloadTaskWithResumeData_completionHandler_, + resumeData.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } } -late final _sel_URLSession_task_willBeginDelayedRequest_completionHandler_ = - objc.registerName( - "URLSession:task:willBeginDelayedRequest:completionHandler:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); +late final _sel_sharedSession = objc.registerName("sharedSession"); +late final _class_NSURLSessionConfiguration = + objc.getClass("NSURLSessionConfiguration"); +late final _sel_backgroundSessionConfiguration_ = + objc.registerName("backgroundSessionConfiguration:"); + +/// NSURLSessionDeprecated +extension NSURLSessionDeprecated on NSURLSessionConfiguration { + /// backgroundSessionConfiguration: + static NSURLSessionConfiguration backgroundSessionConfiguration_( + objc.NSString identifier) { + final _ret = _objc_msgSend_62nh5j(_class_NSURLSessionConfiguration, + _sel_backgroundSessionConfiguration_, identifier.ref.pointer); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); + } } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock)>(pointer, retain: retain, release: release); +late final _sel_defaultSessionConfiguration = + objc.registerName("defaultSessionConfiguration"); +late final _sel_ephemeralSessionConfiguration = + objc.registerName("ephemeralSessionConfiguration"); +late final _sel_backgroundSessionConfigurationWithIdentifier_ = + objc.registerName("backgroundSessionConfigurationWithIdentifier:"); +late final _sel_identifier = objc.registerName("identifier"); +late final _sel_requestCachePolicy = objc.registerName("requestCachePolicy"); +late final _sel_setRequestCachePolicy_ = + objc.registerName("setRequestCachePolicy:"); +late final _sel_timeoutIntervalForRequest = + objc.registerName("timeoutIntervalForRequest"); +late final _sel_setTimeoutIntervalForRequest_ = + objc.registerName("setTimeoutIntervalForRequest:"); +late final _sel_timeoutIntervalForResource = + objc.registerName("timeoutIntervalForResource"); +late final _sel_setTimeoutIntervalForResource_ = + objc.registerName("setTimeoutIntervalForResource:"); +late final _sel_waitsForConnectivity = + objc.registerName("waitsForConnectivity"); +late final _sel_setWaitsForConnectivity_ = + objc.registerName("setWaitsForConnectivity:"); +late final _sel_isDiscretionary = objc.registerName("isDiscretionary"); +late final _sel_setDiscretionary_ = objc.registerName("setDiscretionary:"); +late final _sel_sharedContainerIdentifier = + objc.registerName("sharedContainerIdentifier"); +late final _sel_setSharedContainerIdentifier_ = + objc.registerName("setSharedContainerIdentifier:"); +late final _sel_sessionSendsLaunchEvents = + objc.registerName("sessionSendsLaunchEvents"); +late final _sel_setSessionSendsLaunchEvents_ = + objc.registerName("setSessionSendsLaunchEvents:"); +late final _sel_connectionProxyDictionary = + objc.registerName("connectionProxyDictionary"); +late final _sel_setConnectionProxyDictionary_ = + objc.registerName("setConnectionProxyDictionary:"); +late final _sel_TLSMinimumSupportedProtocol = + objc.registerName("TLSMinimumSupportedProtocol"); +final _objc_msgSend_cbopi9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedInt Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setTLSMinimumSupportedProtocol_ = + objc.registerName("setTLSMinimumSupportedProtocol:"); +final _objc_msgSend_268k8x = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedInt)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_TLSMaximumSupportedProtocol = + objc.registerName("TLSMaximumSupportedProtocol"); +late final _sel_setTLSMaximumSupportedProtocol_ = + objc.registerName("setTLSMaximumSupportedProtocol:"); +late final _sel_TLSMinimumSupportedProtocolVersion = + objc.registerName("TLSMinimumSupportedProtocolVersion"); +final _objc_msgSend_9jpwfb = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Uint16 Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setTLSMinimumSupportedProtocolVersion_ = + objc.registerName("setTLSMinimumSupportedProtocolVersion:"); +final _objc_msgSend_1mvuct7 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Uint16)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_TLSMaximumSupportedProtocolVersion = + objc.registerName("TLSMaximumSupportedProtocolVersion"); +late final _sel_setTLSMaximumSupportedProtocolVersion_ = + objc.registerName("setTLSMaximumSupportedProtocolVersion:"); +late final _sel_HTTPShouldSetCookies = + objc.registerName("HTTPShouldSetCookies"); +late final _sel_setHTTPShouldSetCookies_ = + objc.registerName("setHTTPShouldSetCookies:"); +late final _sel_HTTPCookieAcceptPolicy = + objc.registerName("HTTPCookieAcceptPolicy"); +final _objc_msgSend_104dkoq = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setHTTPCookieAcceptPolicy_ = + objc.registerName("setHTTPCookieAcceptPolicy:"); +final _objc_msgSend_3q55ys = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_HTTPAdditionalHeaders = + objc.registerName("HTTPAdditionalHeaders"); +late final _sel_setHTTPAdditionalHeaders_ = + objc.registerName("setHTTPAdditionalHeaders:"); +late final _sel_HTTPMaximumConnectionsPerHost = + objc.registerName("HTTPMaximumConnectionsPerHost"); +late final _sel_setHTTPMaximumConnectionsPerHost_ = + objc.registerName("setHTTPMaximumConnectionsPerHost:"); +late final _sel_HTTPCookieStorage = objc.registerName("HTTPCookieStorage"); +late final _sel_setHTTPCookieStorage_ = + objc.registerName("setHTTPCookieStorage:"); - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +/// WARNING: NSURLCredentialStorage is a stub. To generate bindings for this class, include +/// NSURLCredentialStorage in your config's objc-interfaces list. +/// +/// NSURLCredentialStorage +class NSURLCredentialStorage extends objc.ObjCObjectBase { + NSURLCredentialStorage._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSURLRequest.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.castFromPointer(arg4, retain: true, release: true))), - retain: false, - release: true); + /// Constructs a [NSURLCredentialStorage] that points to the same underlying object as [other]. + NSURLCredentialStorage.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock)> - listener( - void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - NSURLRequest.castFromPointer(arg3, - retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest - .castFromPointer(arg4, retain: false, release: true))); - final wrapper = _wrapListenerBlock_1nnj9ov(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock)>( - wrapper, - retain: false, - release: true); - } + /// Constructs a [NSURLCredentialStorage] that wraps the given raw object pointer. + NSURLCredentialStorage.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLRequest, - objc.ObjCBlock)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock arg4) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, - arg0, - arg1.ref.pointer, - arg2.ref.pointer, - arg3.ref.pointer, - arg4.ref.pointer); +late final _sel_URLCredentialStorage = + objc.registerName("URLCredentialStorage"); +late final _sel_setURLCredentialStorage_ = + objc.registerName("setURLCredentialStorage:"); +late final _sel_URLCache = objc.registerName("URLCache"); +late final _sel_setURLCache_ = objc.registerName("setURLCache:"); +late final _sel_shouldUseExtendedBackgroundIdleMode = + objc.registerName("shouldUseExtendedBackgroundIdleMode"); +late final _sel_setShouldUseExtendedBackgroundIdleMode_ = + objc.registerName("setShouldUseExtendedBackgroundIdleMode:"); +late final _sel_protocolClasses = objc.registerName("protocolClasses"); +late final _sel_setProtocolClasses_ = objc.registerName("setProtocolClasses:"); + +/// ! +/// @enum NSURLSessionMultipathServiceType +/// +/// @discussion The NSURLSessionMultipathServiceType enum defines constants that +/// can be used to specify the multipath service type to associate an NSURLSession. The +/// multipath service type determines whether multipath TCP should be attempted and the conditions +/// for creating and switching between subflows. Using these service types requires the appropriate entitlement. Any connection attempt will fail if the process does not have the required entitlement. +/// A primary interface is a generally less expensive interface in terms of both cost and power (such as WiFi or ethernet). A secondary interface is more expensive (such as 3G or LTE). +/// +/// @constant NSURLSessionMultipathServiceTypeNone Specifies that multipath tcp should not be used. Connections will use a single flow. +/// This is the default value. No entitlement is required to set this value. +/// +/// @constant NSURLSessionMultipathServiceTypeHandover Specifies that a secondary subflow should only be used +/// when the primary subflow is not performing adequately. Requires the com.apple.developer.networking.multipath entitlement. +/// +/// @constant NSURLSessionMultipathServiceTypeInteractive Specifies that a secondary subflow should be used if the +/// primary subflow is not performing adequately (packet loss, high round trip times, bandwidth issues). The secondary +/// subflow will be created more aggressively than with NSURLSessionMultipathServiceTypeHandover. Requires the com.apple.developer.networking.multipath entitlement. +/// +/// @constant NSURLSessionMultipathServiceTypeAggregate Specifies that multiple subflows across multiple interfaces should be +/// used for better bandwidth. This mode is only available for experimentation on devices configured for development use. +/// It can be enabled in the Developer section of the Settings app. +enum NSURLSessionMultipathServiceType { + /// None - no multipath (default) + NSURLSessionMultipathServiceTypeNone(0), + + /// Handover - secondary flows brought up when primary flow is not performing adequately. + NSURLSessionMultipathServiceTypeHandover(1), + + /// Interactive - secondary flows created more aggressively. + NSURLSessionMultipathServiceTypeInteractive(2), + + /// Aggregate - multiple subflows used for greater bandwidth. + NSURLSessionMultipathServiceTypeAggregate(3); + + final int value; + const NSURLSessionMultipathServiceType(this.value); + + static NSURLSessionMultipathServiceType fromValue(int value) => + switch (value) { + 0 => NSURLSessionMultipathServiceTypeNone, + 1 => NSURLSessionMultipathServiceTypeHandover, + 2 => NSURLSessionMultipathServiceTypeInteractive, + 3 => NSURLSessionMultipathServiceTypeAggregate, + _ => throw ArgumentError( + "Unknown value for NSURLSessionMultipathServiceType: $value"), + }; } -late final _sel_URLSession_taskIsWaitingForConnectivity_ = - objc.registerName("URLSession:taskIsWaitingForConnectivity:"); +late final _sel_multipathServiceType = + objc.registerName("multipathServiceType"); +final _objc_msgSend_1wxwnc0 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setMultipathServiceType_ = + objc.registerName("setMultipathServiceType:"); +final _objc_msgSend_1hx005a = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); -/// NSHTTPURLResponse -class NSHTTPURLResponse extends NSURLResponse { - NSHTTPURLResponse._(ffi.Pointer pointer, +/// Configuration options for an NSURLSession. When a session is +/// created, a copy of the configuration object is made - you cannot +/// modify the configuration of a session after it has been created. +/// +/// The shared session uses the global singleton credential, cache +/// and cookie storage objects. +/// +/// An ephemeral session has no persistent disk storage for cookies, +/// cache or credentials. +/// +/// A background session can be used to perform networking operations +/// on behalf of a suspended application, within certain constraints. +class NSURLSessionConfiguration extends objc.NSObject { + NSURLSessionConfiguration._(ffi.Pointer pointer, {bool retain = false, bool release = false}) : super.castFromPointer(pointer, retain: retain, release: release); - /// Constructs a [NSHTTPURLResponse] that points to the same underlying object as [other]. - NSHTTPURLResponse.castFrom(objc.ObjCObjectBase other) + /// Constructs a [NSURLSessionConfiguration] that points to the same underlying object as [other]. + NSURLSessionConfiguration.castFrom(objc.ObjCObjectBase other) : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSHTTPURLResponse] that wraps the given raw object pointer. - NSHTTPURLResponse.castFromPointer(ffi.Pointer other, + /// Constructs a [NSURLSessionConfiguration] that wraps the given raw object pointer. + NSURLSessionConfiguration.castFromPointer(ffi.Pointer other, {bool retain = false, bool release = false}) : this._(other, retain: retain, release: release); - /// Returns whether [obj] is an instance of [NSHTTPURLResponse]. + /// Returns whether [obj] is an instance of [NSURLSessionConfiguration]. static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSHTTPURLResponse); + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionConfiguration); } - /// ! - /// @method initWithURL:statusCode:HTTPVersion:headerFields: - /// @abstract initializer for NSHTTPURLResponse objects. - /// @param url the URL from which the response was generated. - /// @param statusCode an HTTP status code. - /// @param HTTPVersion The version of the HTTP response as represented by the server. This is typically represented as "HTTP/1.1". - /// @param headerFields A dictionary representing the header keys and values of the server response. - /// @result the instance of the object, or NULL if an error occurred during initialization. - /// @discussion This API was introduced in Mac OS X 10.7.2 and iOS 5.0 and is not available prior to those releases. - NSHTTPURLResponse? initWithURL_statusCode_HTTPVersion_headerFields_( - objc.NSURL url, - DartNSInteger statusCode, - objc.NSString? HTTPVersion, - objc.NSDictionary? headerFields) { - final _ret = _objc_msgSend_1j5aquk( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_statusCode_HTTPVersion_headerFields_, - url.ref.pointer, - statusCode, - HTTPVersion?.ref.pointer ?? ffi.nullptr, - headerFields?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); + /// defaultSessionConfiguration + static NSURLSessionConfiguration getDefaultSessionConfiguration() { + final _ret = _objc_msgSend_1x359cv( + _class_NSURLSessionConfiguration, _sel_defaultSessionConfiguration); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); } - /// ! - /// @abstract Returns the HTTP status code of the receiver. - /// @result The HTTP status code of the receiver. - DartNSInteger get statusCode { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_statusCode); + /// ephemeralSessionConfiguration + static NSURLSessionConfiguration getEphemeralSessionConfiguration() { + final _ret = _objc_msgSend_1x359cv( + _class_NSURLSessionConfiguration, _sel_ephemeralSessionConfiguration); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); } - /// ! - /// @abstract Returns a dictionary containing all the HTTP header fields - /// of the receiver. - /// @discussion By examining this header dictionary, clients can see - /// the "raw" header information which was reported to the protocol - /// implementation by the HTTP server. This may be of use to - /// sophisticated or special-purpose HTTP clients. - /// @result A dictionary containing all the HTTP header fields of the - /// receiver. - objc.NSDictionary get allHeaderFields { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_allHeaderFields); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + /// backgroundSessionConfigurationWithIdentifier: + static NSURLSessionConfiguration + backgroundSessionConfigurationWithIdentifier_(objc.NSString identifier) { + final _ret = _objc_msgSend_62nh5j( + _class_NSURLSessionConfiguration, + _sel_backgroundSessionConfigurationWithIdentifier_, + identifier.ref.pointer); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); } - /// ! - /// @method valueForHTTPHeaderField: - /// @abstract Returns the value which corresponds to the given header - /// field. Note that, in keeping with the HTTP RFC, HTTP header field - /// names are case-insensitive. - /// @param field the header field name to use for the lookup - /// (case-insensitive). - /// @result the value associated with the given header field, or nil if - /// there is no value associated with the given header field. - objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); + /// identifier for the background session configuration + objc.NSString? get identifier { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_identifier); return _ret.address == 0 ? null : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @method localizedStringForStatusCode: - /// @abstract Convenience method which returns a localized string - /// corresponding to the status code for this response. - /// @param statusCode the status code to use to produce a localized string. - /// @result A localized string corresponding to the given status code. - static objc.NSString localizedStringForStatusCode_(DartNSInteger statusCode) { - final _ret = _objc_msgSend_crtxa9(_class_NSHTTPURLResponse, - _sel_localizedStringForStatusCode_, statusCode); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); + /// default cache policy for requests + NSURLRequestCachePolicy get requestCachePolicy { + final _ret = + _objc_msgSend_8jm3uo(this.ref.pointer, _sel_requestCachePolicy); + return NSURLRequestCachePolicy.fromValue(_ret); } - /// ! - /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: - /// @abstract Initialize an NSURLResponse with the provided values. - /// @param URL the URL - /// @param MIMEType the MIME content type of the response - /// @param length the expected content length of the associated data - /// @param name the name of the text encoding for the associated data, if applicable, else nil - /// @result The initialized NSURLResponse. - /// @discussion This is the designated initializer for NSURLResponse. - NSHTTPURLResponse - initWithURL_MIMEType_expectedContentLength_textEncodingName_( - objc.NSURL URL, - objc.NSString? MIMEType, - DartNSInteger length, - objc.NSString? name) { - final _ret = _objc_msgSend_eyseqq( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, - URL.ref.pointer, - MIMEType?.ref.pointer ?? ffi.nullptr, - length, - name?.ref.pointer ?? ffi.nullptr); - return NSHTTPURLResponse.castFromPointer(_ret, - retain: false, release: true); + /// default cache policy for requests + set requestCachePolicy(NSURLRequestCachePolicy value) { + return _objc_msgSend_1yjxuv2( + this.ref.pointer, _sel_setRequestCachePolicy_, value.value); } - /// init - NSHTTPURLResponse init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSHTTPURLResponse.castFromPointer(_ret, - retain: false, release: true); + /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. + DartNSTimeInterval get timeoutIntervalForRequest { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret( + this.ref.pointer, _sel_timeoutIntervalForRequest) + : _objc_msgSend_1ukqyt8( + this.ref.pointer, _sel_timeoutIntervalForRequest); + } + + /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. + set timeoutIntervalForRequest(DartNSTimeInterval value) { + return _objc_msgSend_hwm8nu( + this.ref.pointer, _sel_setTimeoutIntervalForRequest_, value); + } + + /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. + DartNSTimeInterval get timeoutIntervalForResource { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret( + this.ref.pointer, _sel_timeoutIntervalForResource) + : _objc_msgSend_1ukqyt8( + this.ref.pointer, _sel_timeoutIntervalForResource); + } + + /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. + set timeoutIntervalForResource(DartNSTimeInterval value) { + return _objc_msgSend_hwm8nu( + this.ref.pointer, _sel_setTimeoutIntervalForResource_, value); + } + + /// type of service for requests. + NSURLRequestNetworkServiceType get networkServiceType { + final _ret = + _objc_msgSend_t4uaw1(this.ref.pointer, _sel_networkServiceType); + return NSURLRequestNetworkServiceType.fromValue(_ret); + } + + /// type of service for requests. + set networkServiceType(NSURLRequestNetworkServiceType value) { + return _objc_msgSend_1mse4s1( + this.ref.pointer, _sel_setNetworkServiceType_, value.value); + } + + /// allow request to route over cellular. + bool get allowsCellularAccess { + return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); + } + + /// allow request to route over cellular. + set allowsCellularAccess(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setAllowsCellularAccess_, value); + } + + /// allow request to route over expensive networks. Defaults to YES. + bool get allowsExpensiveNetworkAccess { + return _objc_msgSend_91o635( + this.ref.pointer, _sel_allowsExpensiveNetworkAccess); + } + + /// allow request to route over expensive networks. Defaults to YES. + set allowsExpensiveNetworkAccess(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setAllowsExpensiveNetworkAccess_, value); + } + + /// allow request to route over networks in constrained mode. Defaults to YES. + bool get allowsConstrainedNetworkAccess { + return _objc_msgSend_91o635( + this.ref.pointer, _sel_allowsConstrainedNetworkAccess); + } + + /// allow request to route over networks in constrained mode. Defaults to YES. + set allowsConstrainedNetworkAccess(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setAllowsConstrainedNetworkAccess_, value); + } + + /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. + bool get requiresDNSSECValidation { + return _objc_msgSend_91o635( + this.ref.pointer, _sel_requiresDNSSECValidation); + } + + /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. + set requiresDNSSECValidation(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setRequiresDNSSECValidation_, value); + } + + /// Causes tasks to wait for network connectivity to become available, rather + /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) + /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest + /// property does not apply, but the timeoutIntervalForResource property does. + /// + /// Unsatisfactory connectivity (that requires waiting) includes cases where the + /// device has limited or insufficient connectivity for a task (e.g., only has a + /// cellular connection but the allowsCellularAccess property is NO, or requires + /// a VPN connection in order to reach the desired host). + /// + /// Default value is NO. Ignored by background sessions, as background sessions + /// always wait for connectivity. + bool get waitsForConnectivity { + return _objc_msgSend_91o635(this.ref.pointer, _sel_waitsForConnectivity); + } + + /// Causes tasks to wait for network connectivity to become available, rather + /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) + /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest + /// property does not apply, but the timeoutIntervalForResource property does. + /// + /// Unsatisfactory connectivity (that requires waiting) includes cases where the + /// device has limited or insufficient connectivity for a task (e.g., only has a + /// cellular connection but the allowsCellularAccess property is NO, or requires + /// a VPN connection in order to reach the desired host). + /// + /// Default value is NO. Ignored by background sessions, as background sessions + /// always wait for connectivity. + set waitsForConnectivity(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setWaitsForConnectivity_, value); + } + + /// allows background tasks to be scheduled at the discretion of the system for optimal performance. + bool get discretionary { + return _objc_msgSend_91o635(this.ref.pointer, _sel_isDiscretionary); + } + + /// allows background tasks to be scheduled at the discretion of the system for optimal performance. + set discretionary(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setDiscretionary_, value); + } + + /// The identifier of the shared data container into which files in background sessions should be downloaded. + /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or + /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. + objc.NSString? get sharedContainerIdentifier { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_sharedContainerIdentifier); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// The identifier of the shared data container into which files in background sessions should be downloaded. + /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or + /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. + set sharedContainerIdentifier(objc.NSString? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, + _sel_setSharedContainerIdentifier_, value?.ref.pointer ?? ffi.nullptr); + } + + /// Allows the app to be resumed or launched in the background when tasks in background sessions complete + /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: + /// and the default value is YES. + /// + /// NOTE: macOS apps based on AppKit do not support background launch. + bool get sessionSendsLaunchEvents { + return _objc_msgSend_91o635( + this.ref.pointer, _sel_sessionSendsLaunchEvents); + } + + /// Allows the app to be resumed or launched in the background when tasks in background sessions complete + /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: + /// and the default value is YES. + /// + /// NOTE: macOS apps based on AppKit do not support background launch. + set sessionSendsLaunchEvents(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setSessionSendsLaunchEvents_, value); + } + + /// The proxy dictionary, as described by + objc.NSDictionary? get connectionProxyDictionary { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_connectionProxyDictionary); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// The proxy dictionary, as described by + set connectionProxyDictionary(objc.NSDictionary? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, + _sel_setConnectionProxyDictionary_, value?.ref.pointer ?? ffi.nullptr); + } + + /// The minimum allowable versions of the TLS protocol, from + SSLProtocol get TLSMinimumSupportedProtocol { + final _ret = _objc_msgSend_cbopi9( + this.ref.pointer, _sel_TLSMinimumSupportedProtocol); + return SSLProtocol.fromValue(_ret); + } + + /// The minimum allowable versions of the TLS protocol, from + set TLSMinimumSupportedProtocol(SSLProtocol value) { + return _objc_msgSend_268k8x( + this.ref.pointer, _sel_setTLSMinimumSupportedProtocol_, value.value); + } + + /// The maximum allowable versions of the TLS protocol, from + SSLProtocol get TLSMaximumSupportedProtocol { + final _ret = _objc_msgSend_cbopi9( + this.ref.pointer, _sel_TLSMaximumSupportedProtocol); + return SSLProtocol.fromValue(_ret); + } + + /// The maximum allowable versions of the TLS protocol, from + set TLSMaximumSupportedProtocol(SSLProtocol value) { + return _objc_msgSend_268k8x( + this.ref.pointer, _sel_setTLSMaximumSupportedProtocol_, value.value); + } + + /// The minimum allowable versions of the TLS protocol, from + tls_protocol_version_t get TLSMinimumSupportedProtocolVersion { + final _ret = _objc_msgSend_9jpwfb( + this.ref.pointer, _sel_TLSMinimumSupportedProtocolVersion); + return tls_protocol_version_t.fromValue(_ret); + } + + /// The minimum allowable versions of the TLS protocol, from + set TLSMinimumSupportedProtocolVersion(tls_protocol_version_t value) { + return _objc_msgSend_1mvuct7(this.ref.pointer, + _sel_setTLSMinimumSupportedProtocolVersion_, value.value); + } + + /// The maximum allowable versions of the TLS protocol, from + tls_protocol_version_t get TLSMaximumSupportedProtocolVersion { + final _ret = _objc_msgSend_9jpwfb( + this.ref.pointer, _sel_TLSMaximumSupportedProtocolVersion); + return tls_protocol_version_t.fromValue(_ret); + } + + /// The maximum allowable versions of the TLS protocol, from + set TLSMaximumSupportedProtocolVersion(tls_protocol_version_t value) { + return _objc_msgSend_1mvuct7(this.ref.pointer, + _sel_setTLSMaximumSupportedProtocolVersion_, value.value); + } + + /// Allow the use of HTTP pipelining + bool get HTTPShouldUsePipelining { + return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); + } + + /// Allow the use of HTTP pipelining + set HTTPShouldUsePipelining(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setHTTPShouldUsePipelining_, value); + } + + /// Allow the session to set cookies on requests + bool get HTTPShouldSetCookies { + return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldSetCookies); + } + + /// Allow the session to set cookies on requests + set HTTPShouldSetCookies(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setHTTPShouldSetCookies_, value); + } + + /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. + NSHTTPCookieAcceptPolicy get HTTPCookieAcceptPolicy { + final _ret = + _objc_msgSend_104dkoq(this.ref.pointer, _sel_HTTPCookieAcceptPolicy); + return NSHTTPCookieAcceptPolicy.fromValue(_ret); + } + + /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. + set HTTPCookieAcceptPolicy(NSHTTPCookieAcceptPolicy value) { + return _objc_msgSend_3q55ys( + this.ref.pointer, _sel_setHTTPCookieAcceptPolicy_, value.value); + } + + /// Specifies additional headers which will be set on outgoing requests. + /// Note that these headers are added to the request only if not already present. + objc.NSDictionary? get HTTPAdditionalHeaders { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPAdditionalHeaders); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// Specifies additional headers which will be set on outgoing requests. + /// Note that these headers are added to the request only if not already present. + set HTTPAdditionalHeaders(objc.NSDictionary? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, + _sel_setHTTPAdditionalHeaders_, value?.ref.pointer ?? ffi.nullptr); + } + + /// The maximum number of simultaneous persistent connections per host + DartNSInteger get HTTPMaximumConnectionsPerHost { + return _objc_msgSend_1hz7y9r( + this.ref.pointer, _sel_HTTPMaximumConnectionsPerHost); + } + + /// The maximum number of simultaneous persistent connections per host + set HTTPMaximumConnectionsPerHost(DartNSInteger value) { + return _objc_msgSend_4sp4xj( + this.ref.pointer, _sel_setHTTPMaximumConnectionsPerHost_, value); + } + + /// The cookie storage object to use, or nil to indicate that no cookies should be handled + NSHTTPCookieStorage? get HTTPCookieStorage { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPCookieStorage); + return _ret.address == 0 + ? null + : NSHTTPCookieStorage.castFromPointer(_ret, + retain: true, release: true); + } + + /// The cookie storage object to use, or nil to indicate that no cookies should be handled + set HTTPCookieStorage(NSHTTPCookieStorage? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setHTTPCookieStorage_, + value?.ref.pointer ?? ffi.nullptr); + } + + /// The credential storage object, or nil to indicate that no credential storage is to be used + NSURLCredentialStorage? get URLCredentialStorage { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_URLCredentialStorage); + return _ret.address == 0 + ? null + : NSURLCredentialStorage.castFromPointer(_ret, + retain: true, release: true); + } + + /// The credential storage object, or nil to indicate that no credential storage is to be used + set URLCredentialStorage(NSURLCredentialStorage? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, + _sel_setURLCredentialStorage_, value?.ref.pointer ?? ffi.nullptr); + } + + /// The URL resource cache, or nil to indicate that no caching is to be performed + NSURLCache? get URLCache { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_URLCache); + return _ret.address == 0 + ? null + : NSURLCache.castFromPointer(_ret, retain: true, release: true); + } + + /// The URL resource cache, or nil to indicate that no caching is to be performed + set URLCache(NSURLCache? value) { + return _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setURLCache_, value?.ref.pointer ?? ffi.nullptr); + } + + /// Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open + /// and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) + bool get shouldUseExtendedBackgroundIdleMode { + return _objc_msgSend_91o635( + this.ref.pointer, _sel_shouldUseExtendedBackgroundIdleMode); + } + + /// Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open + /// and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) + set shouldUseExtendedBackgroundIdleMode(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setShouldUseExtendedBackgroundIdleMode_, value); + } + + /// An optional array of Class objects which subclass NSURLProtocol. + /// The Class will be sent +canInitWithRequest: when determining if + /// an instance of the class can be used for a given URL scheme. + /// You should not use +[NSURLProtocol registerClass:], as that + /// method will register your class with the default session rather + /// than with an instance of NSURLSession. + /// Custom NSURLProtocol subclasses are not available to background + /// sessions. + objc.ObjCObjectBase? get protocolClasses { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_protocolClasses); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// An optional array of Class objects which subclass NSURLProtocol. + /// The Class will be sent +canInitWithRequest: when determining if + /// an instance of the class can be used for a given URL scheme. + /// You should not use +[NSURLProtocol registerClass:], as that + /// method will register your class with the default session rather + /// than with an instance of NSURLSession. + /// Custom NSURLProtocol subclasses are not available to background + /// sessions. + set protocolClasses(objc.ObjCObjectBase? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setProtocolClasses_, + value?.ref.pointer ?? ffi.nullptr); + } + + /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone + NSURLSessionMultipathServiceType get multipathServiceType { + final _ret = + _objc_msgSend_1wxwnc0(this.ref.pointer, _sel_multipathServiceType); + return NSURLSessionMultipathServiceType.fromValue(_ret); + } + + /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone + set multipathServiceType(NSURLSessionMultipathServiceType value) { + return _objc_msgSend_1hx005a( + this.ref.pointer, _sel_setMultipathServiceType_, value.value); + } + + /// init + NSURLSessionConfiguration init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: false, release: true); } /// new - static NSHTTPURLResponse new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSHTTPURLResponse, _sel_new); - return NSHTTPURLResponse.castFromPointer(_ret, + static NSURLSessionConfiguration new1() { + final _ret = + _objc_msgSend_1x359cv(_class_NSURLSessionConfiguration, _sel_new); + return NSURLSessionConfiguration.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSHTTPURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSHTTPURLResponse, _sel_allocWithZone_, zone); - return NSHTTPURLResponse.castFromPointer(_ret, + static NSURLSessionConfiguration allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_hzlb60( + _class_NSURLSessionConfiguration, _sel_allocWithZone_, zone); + return NSURLSessionConfiguration.castFromPointer(_ret, retain: false, release: true); } /// alloc - static NSHTTPURLResponse alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSHTTPURLResponse, _sel_alloc); - return NSHTTPURLResponse.castFromPointer(_ret, + static NSURLSessionConfiguration alloc() { + final _ret = + _objc_msgSend_1x359cv(_class_NSURLSessionConfiguration, _sel_alloc); + return NSURLSessionConfiguration.castFromPointer(_ret, retain: false, release: true); } - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1( - _class_NSHTTPURLResponse, _sel_supportsSecureCoding); + /// self + NSURLSessionConfiguration self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); } - /// initWithCoder: - NSHTTPURLResponse? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); + /// retain + NSURLSessionConfiguration retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); + } + + /// autorelease + NSURLSessionConfiguration autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); } } -late final _class_NSHTTPURLResponse = objc.getClass("NSHTTPURLResponse"); -late final _sel_initWithURL_statusCode_HTTPVersion_headerFields_ = - objc.registerName("initWithURL:statusCode:HTTPVersion:headerFields:"); -final _objc_msgSend_1j5aquk = objc.msgSendPointer +late final _sel_sessionWithConfiguration_ = + objc.registerName("sessionWithConfiguration:"); +late final _class_NSOperationQueue = objc.getClass("NSOperationQueue"); +late final _sel_operations = objc.registerName("operations"); +late final _sel_operationCount = objc.registerName("operationCount"); + +/// NSDeprecated +extension NSDeprecated1 on NSOperationQueue { + /// These two functions are inherently a race condition and should be avoided if possible + objc.NSArray get operations { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_operations); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// operationCount + DartNSUInteger get operationCount { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_operationCount); + } +} + +/// WARNING: NSOperation is a stub. To generate bindings for this class, include +/// NSOperation in your config's objc-interfaces list. +/// +/// NSOperation +class NSOperation extends objc.NSObject { + NSOperation._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSOperation] that points to the same underlying object as [other]. + NSOperation.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSOperation] that wraps the given raw object pointer. + NSOperation.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +late final _sel_addOperation_ = objc.registerName("addOperation:"); +late final _sel_addOperations_waitUntilFinished_ = + objc.registerName("addOperations:waitUntilFinished:"); +final _objc_msgSend_gk45w7 = objc.msgSendPointer .cast< ffi.NativeFunction< - instancetype Function( + ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - NSInteger, - ffi.Pointer, - ffi.Pointer)>>() + ffi.Bool)>>() .asFunction< - instancetype Function( + void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_statusCode = objc.registerName("statusCode"); -late final _sel_allHeaderFields = objc.registerName("allHeaderFields"); -late final _sel_localizedStringForStatusCode_ = - objc.registerName("localizedStringForStatusCode:"); -final _objc_msgSend_crtxa9 = objc.msgSendPointer + bool)>(); +late final _sel_addOperationWithBlock_ = + objc.registerName("addOperationWithBlock:"); +late final _sel_addBarrierBlock_ = objc.registerName("addBarrierBlock:"); +late final _sel_maxConcurrentOperationCount = + objc.registerName("maxConcurrentOperationCount"); +late final _sel_setMaxConcurrentOperationCount_ = + objc.registerName("setMaxConcurrentOperationCount:"); +late final _sel_isSuspended = objc.registerName("isSuspended"); +late final _sel_setSuspended_ = objc.registerName("setSuspended:"); +late final _sel_name = objc.registerName("name"); +late final _sel_setName_ = objc.registerName("setName:"); +late final _sel_qualityOfService = objc.registerName("qualityOfService"); +final _objc_msgSend_oi8iq9 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setQualityOfService_ = + objc.registerName("setQualityOfService:"); +final _objc_msgSend_n2da1l = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, NSInteger)>>() .asFunction< - ffi.Pointer Function(ffi.Pointer, + void Function(ffi.Pointer, ffi.Pointer, int)>(); -void _ObjCBlock_ffiVoid_NSURLRequest_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSURLRequest_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLRequest_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLRequest_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSURLRequest_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLRequest_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLRequest_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSURLRequest_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLRequest_listenerTrampoline) - ..keepIsolateAlive = false; +late final _sel_underlyingQueue = objc.registerName("underlyingQueue"); +late final _sel_setUnderlyingQueue_ = objc.registerName("setUnderlyingQueue:"); +late final _sel_cancelAllOperations = objc.registerName("cancelAllOperations"); +late final _sel_waitUntilAllOperationsAreFinished = + objc.registerName("waitUntilAllOperationsAreFinished"); +late final _sel_currentQueue = objc.registerName("currentQueue"); +late final _sel_mainQueue = objc.registerName("mainQueue"); -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURLRequest { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); +/// NSOperationQueue +class NSOperationQueue extends objc.NSObject { + NSOperationQueue._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLRequest_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + /// Constructs a [NSOperationQueue] that points to the same underlying object as [other]. + NSOperationQueue.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(NSURLRequest?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLRequest_closureCallable, - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSURLRequest.castFromPointer(arg0, - retain: true, release: true))), - retain: false, - release: true); + /// Constructs a [NSOperationQueue] that wraps the given raw object pointer. + NSOperationQueue.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(NSURLRequest?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLRequest_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSURLRequest.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_ukcdfq(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); + /// Returns whether [obj] is an instance of [NSOperationQueue]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSOperationQueue); } -} -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLRequest_CallExtension - on objc.ObjCBlock { - void call(NSURLRequest? arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); + /// progress + NSProgress get progress { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_progress); + return NSProgress.castFromPointer(_ret, retain: true, release: true); + } + + /// addOperation: + void addOperation_(NSOperation op) { + _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_addOperation_, op.ref.pointer); + } + + /// addOperations:waitUntilFinished: + void addOperations_waitUntilFinished_(objc.NSArray ops, bool wait) { + _objc_msgSend_gk45w7(this.ref.pointer, + _sel_addOperations_waitUntilFinished_, ops.ref.pointer, wait); + } + + /// addOperationWithBlock: + void addOperationWithBlock_(objc.ObjCBlock block) { + _objc_msgSend_f167m6( + this.ref.pointer, _sel_addOperationWithBlock_, block.ref.pointer); + } + + /// @method addBarrierBlock: + /// @param barrier A block to execute + /// @discussion The `addBarrierBlock:` method executes the block when the NSOperationQueue has finished all enqueued operations and + /// prevents any subsequent operations to be executed until the barrier has been completed. This acts similarly to the + /// `dispatch_barrier_async` function. + void addBarrierBlock_(objc.ObjCBlock barrier) { + _objc_msgSend_f167m6( + this.ref.pointer, _sel_addBarrierBlock_, barrier.ref.pointer); + } + + /// maxConcurrentOperationCount + DartNSInteger get maxConcurrentOperationCount { + return _objc_msgSend_1hz7y9r( + this.ref.pointer, _sel_maxConcurrentOperationCount); + } + + /// setMaxConcurrentOperationCount: + set maxConcurrentOperationCount(DartNSInteger value) { + return _objc_msgSend_4sp4xj( + this.ref.pointer, _sel_setMaxConcurrentOperationCount_, value); + } + + /// isSuspended + bool get suspended { + return _objc_msgSend_91o635(this.ref.pointer, _sel_isSuspended); + } + + /// setSuspended: + set suspended(bool value) { + return _objc_msgSend_1s56lr9(this.ref.pointer, _sel_setSuspended_, value); + } + + /// name + objc.NSString? get name { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_name); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setName: + set name(objc.NSString? value) { + return _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); + } + + /// qualityOfService + NSQualityOfService get qualityOfService { + final _ret = _objc_msgSend_oi8iq9(this.ref.pointer, _sel_qualityOfService); + return NSQualityOfService.fromValue(_ret); + } + + /// setQualityOfService: + set qualityOfService(NSQualityOfService value) { + return _objc_msgSend_n2da1l( + this.ref.pointer, _sel_setQualityOfService_, value.value); + } + + /// actually retain + Dartdispatch_queue_t? get underlyingQueue { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_underlyingQueue); + return _ret.address == 0 + ? null + : objc.NSObject.castFromPointer(_ret, retain: true, release: true); + } + + /// actually retain + set underlyingQueue(Dartdispatch_queue_t? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setUnderlyingQueue_, + value?.ref.pointer ?? ffi.nullptr); + } + + /// cancelAllOperations + void cancelAllOperations() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_cancelAllOperations); + } + + /// waitUntilAllOperationsAreFinished + void waitUntilAllOperationsAreFinished() { + _objc_msgSend_1pl9qdv( + this.ref.pointer, _sel_waitUntilAllOperationsAreFinished); + } + + /// currentQueue + static NSOperationQueue? getCurrentQueue() { + final _ret = + _objc_msgSend_1x359cv(_class_NSOperationQueue, _sel_currentQueue); + return _ret.address == 0 + ? null + : NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + } + + /// mainQueue + static NSOperationQueue getMainQueue() { + final _ret = _objc_msgSend_1x359cv(_class_NSOperationQueue, _sel_mainQueue); + return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSOperationQueue init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); + } + + /// new + static NSOperationQueue new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSOperationQueue, _sel_new); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSOperationQueue allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_hzlb60( + _class_NSOperationQueue, _sel_allocWithZone_, zone); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSOperationQueue alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSOperationQueue, _sel_alloc); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); + } + + /// self + NSOperationQueue self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + } + + /// retain + NSOperationQueue retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + } + + /// autorelease + NSOperationQueue autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); + } } -late final _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = - objc.registerName( - "URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:"); +late final _sel_sessionWithConfiguration_delegate_delegateQueue_ = + objc.registerName("sessionWithConfiguration:delegate:delegateQueue:"); +late final _sel_delegateQueue = objc.registerName("delegateQueue"); +late final _sel_configuration = objc.registerName("configuration"); +late final _sel_sessionDescription = objc.registerName("sessionDescription"); +late final _sel_setSessionDescription_ = + objc.registerName("setSessionDescription:"); +late final _sel_finishTasksAndInvalidate = + objc.registerName("finishTasksAndInvalidate"); +late final _sel_invalidateAndCancel = objc.registerName("invalidateAndCancel"); +late final _sel_resetWithCompletionHandler_ = + objc.registerName("resetWithCompletionHandler:"); +late final _sel_flushWithCompletionHandler_ = + objc.registerName("flushWithCompletionHandler:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrTrampoline( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrTrampoline( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5) => + ffi.Pointer arg2) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - arg0, arg1, arg2, arg3, arg4, arg5); + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrCallable = + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureTrampoline( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureTrampoline( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5) => + ffi.Pointer arg2) => (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))( - arg0, arg1, arg2, arg3, arg4, arg5); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureCallable = + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerTrampoline( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerTrampoline( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5) { + ffi.Pointer arg2) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4, arg5); + ffi.Pointer))(arg0, arg1, arg2); objc.objectRelease(block.cast()); } ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerCallable = + ffi.Pointer)> + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerTrampoline) + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest { +/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock)> + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock)>(pointer, retain: retain, release: release); + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -64043,42 +61652,33 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4, ffi.Pointer arg5)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>( + static objc + .ObjCBlock, ffi.Pointer, ffi.Pointer)> + fromFunction(void Function(objc.ObjCObjectBase, objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => + objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4, ffi.Pointer arg5) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSHTTPURLResponse.castFromPointer(arg3, retain: true, release: true), - NSURLRequest.castFromPointer(arg4, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, retain: true, release: true))), + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true), + objc.ObjCObjectBase(arg2, retain: true, release: true))), retain: false, release: true); @@ -64092,245 +61692,123 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSH /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock)> listener( + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> listener( void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock) + objc.ObjCObjectBase, objc.ObjCObjectBase, objc.ObjCObjectBase) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerCallable + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5) => + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - NSHTTPURLResponse.castFromPointer(arg3, - retain: false, release: true), - NSURLRequest.castFromPointer(arg4, - retain: false, release: true), - ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_dmve6(raw); + objc.ObjCObjectBase(arg0, retain: false, release: true), + objc.ObjCObjectBase(arg1, retain: false, release: true), + objc.ObjCObjectBase(arg2, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1hcfngn(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock)>(wrapper, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_CallExtension +/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +extension ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_CallExtension on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSHTTPURLResponse, - NSURLRequest, - objc.ObjCBlock)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> { + void call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, + objc.ObjCObjectBase arg2) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5)>>() + ffi.Pointer arg2)>>() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, - arg0, - arg1.ref.pointer, - arg2.ref.pointer, - arg3.ref.pointer, - arg4.ref.pointer, - arg5.ref.pointer); + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); } -late final _sel_URLSession_task_didReceiveChallenge_completionHandler_ = - objc.registerName("URLSession:task:didReceiveChallenge:completionHandler:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable = +late final _sel_getTasksWithCompletionHandler_ = + objc.registerName("getTasksWithCompletionHandler:"); +void _ObjCBlock_ffiVoid_objcObjCObject1_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject1_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline) + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject1_fnPtrTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable = +void _ObjCBlock_ffiVoid_objcObjCObject1_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject1_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline) + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject1_closureTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) { +void _ObjCBlock_ffiVoid_objcObjCObject1_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + ffi.Pointer))(arg0); objc.objectRelease(block.cast()); } ffi.NativeCallable< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline) + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_objcObjCObject1_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject1_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential { +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObject1 { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)> + static objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>(pointer, retain: retain, release: release); + objc.ObjCBlock)>( + pointer, + retain: retain, + release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable, ptr.cast()), + static objc.ObjCBlock)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_objcObjCObject1_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -64339,17 +61817,13 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + static objc.ObjCBlock)> + fromFunction(void Function(objc.ObjCObjectBase) fn) => + objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSURLAuthenticationChallenge.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg4, retain: true, release: true))), + _ObjCBlock_ffiVoid_objcObjCObject1_closureCallable, + (ffi.Pointer arg0) => fn( + objc.ObjCObjectBase(arg0, retain: true, release: true))), retain: false, release: true); @@ -64362,92 +61836,285 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSU /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)>)> listener( - void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock) - fn) { + static objc.ObjCBlock)> + listener(void Function(objc.ObjCObjectBase) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable - .nativeFunction + _ObjCBlock_ffiVoid_objcObjCObject1_listenerCallable.nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - NSURLAuthenticationChallenge.castFromPointer(arg3, - retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential - .castFromPointer(arg4, retain: false, release: true))); - final wrapper = _wrapListenerBlock_1nnj9ov(raw); + (ffi.Pointer arg0) => + fn(objc.ObjCObjectBase(arg0, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)>)>(wrapper, - retain: false, release: true); + return objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock - arg4) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer, arg4.ref.pointer); +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_objcObjCObject1_CallExtension + on objc.ObjCBlock)> { + void call(objc.ObjCObjectBase arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0.ref.pointer); } -void _ObjCBlock_ffiVoid_NSInputStream_fnPtrTrampoline( +late final _sel_getAllTasksWithCompletionHandler_ = + objc.registerName("getAllTasksWithCompletionHandler:"); +late final _sel_dataTaskWithRequest_ = + objc.registerName("dataTaskWithRequest:"); +late final _sel_dataTaskWithURL_ = objc.registerName("dataTaskWithURL:"); +late final _sel_uploadTaskWithRequest_fromFile_ = + objc.registerName("uploadTaskWithRequest:fromFile:"); +late final _sel_uploadTaskWithRequest_fromData_ = + objc.registerName("uploadTaskWithRequest:fromData:"); +late final _sel_uploadTaskWithResumeData_ = + objc.registerName("uploadTaskWithResumeData:"); +late final _sel_uploadTaskWithStreamedRequest_ = + objc.registerName("uploadTaskWithStreamedRequest:"); +late final _sel_downloadTaskWithRequest_ = + objc.registerName("downloadTaskWithRequest:"); +late final _sel_downloadTaskWithURL_ = + objc.registerName("downloadTaskWithURL:"); +late final _sel_downloadTaskWithResumeData_ = + objc.registerName("downloadTaskWithResumeData:"); + +/// WARNING: NSURLSessionStreamTask is a stub. To generate bindings for this class, include +/// NSURLSessionStreamTask in your config's objc-interfaces list. +/// +/// An NSURLSessionStreamTask provides an interface to perform reads +/// and writes to a TCP/IP stream created via NSURLSession. This task +/// may be explicitly created from an NSURLSession, or created as a +/// result of the appropriate disposition response to a +/// -URLSession:dataTask:didReceiveResponse: delegate message. +/// +/// NSURLSessionStreamTask can be used to perform asynchronous reads +/// and writes. Reads and writes are enqueued and executed serially, +/// with the completion handler being invoked on the sessions delegate +/// queue. If an error occurs, or the task is canceled, all +/// outstanding read and write calls will have their completion +/// handlers invoked with an appropriate error. +/// +/// It is also possible to create NSInputStream and NSOutputStream +/// instances from an NSURLSessionTask by sending +/// -captureStreams to the task. All outstanding reads and writes are +/// completed before the streams are created. Once the streams are +/// delivered to the session delegate, the task is considered complete +/// and will receive no more messages. These streams are +/// disassociated from the underlying session. +class NSURLSessionStreamTask extends NSURLSessionTask { + NSURLSessionStreamTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionStreamTask] that points to the same underlying object as [other]. + NSURLSessionStreamTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionStreamTask] that wraps the given raw object pointer. + NSURLSessionStreamTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +late final _sel_streamTaskWithHostName_port_ = + objc.registerName("streamTaskWithHostName:port:"); +final _objc_msgSend_1i26p99 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + +/// WARNING: NSNetService is a stub. To generate bindings for this class, include +/// NSNetService in your config's objc-interfaces list. +/// +/// NSNetService +class NSNetService extends objc.ObjCObjectBase { + NSNetService._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSNetService] that points to the same underlying object as [other]. + NSNetService.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSNetService] that wraps the given raw object pointer. + NSNetService.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +late final _sel_streamTaskWithNetService_ = + objc.registerName("streamTaskWithNetService:"); +late final _class_NSURLSessionWebSocketTask = + objc.getClass("NSURLSessionWebSocketTask"); +late final _class_NSURLSessionWebSocketMessage = + objc.getClass("NSURLSessionWebSocketMessage"); +late final _sel_initWithData_ = objc.registerName("initWithData:"); +late final _sel_initWithString_ = objc.registerName("initWithString:"); + +enum NSURLSessionWebSocketMessageType { + NSURLSessionWebSocketMessageTypeData(0), + NSURLSessionWebSocketMessageTypeString(1); + + final int value; + const NSURLSessionWebSocketMessageType(this.value); + + static NSURLSessionWebSocketMessageType fromValue(int value) => + switch (value) { + 0 => NSURLSessionWebSocketMessageTypeData, + 1 => NSURLSessionWebSocketMessageTypeString, + _ => throw ArgumentError( + "Unknown value for NSURLSessionWebSocketMessageType: $value"), + }; +} + +late final _sel_type = objc.registerName("type"); +final _objc_msgSend_1qouven = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_data = objc.registerName("data"); +late final _sel_string = objc.registerName("string"); + +/// The client can create a WebSocket message object that will be passed to the send calls +/// and will be delivered from the receive calls. The message can be initialized with data or string. +/// If initialized with data, the string property will be nil and vice versa. +class NSURLSessionWebSocketMessage extends objc.NSObject { + NSURLSessionWebSocketMessage._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionWebSocketMessage] that points to the same underlying object as [other]. + NSURLSessionWebSocketMessage.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionWebSocketMessage] that wraps the given raw object pointer. + NSURLSessionWebSocketMessage.castFromPointer( + ffi.Pointer other, + {bool retain = false, + bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketMessage]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1(obj.ref.pointer, _sel_isKindOfClass_, + _class_NSURLSessionWebSocketMessage); + } + + /// Create a message with data type + NSURLSessionWebSocketMessage initWithData_(objc.NSData data) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithData_, data.ref.pointer); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); + } + + /// Create a message with string type + NSURLSessionWebSocketMessage initWithString_(objc.NSString string) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithString_, string.ref.pointer); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); + } + + /// type + NSURLSessionWebSocketMessageType get type { + final _ret = _objc_msgSend_1qouven(this.ref.pointer, _sel_type); + return NSURLSessionWebSocketMessageType.fromValue(_ret); + } + + /// data + objc.NSData? get data { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_data); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// string + objc.NSString? get string { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_string); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// init + NSURLSessionWebSocketMessage init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); + } + + /// new + static NSURLSessionWebSocketMessage new1() { + final _ret = + _objc_msgSend_1x359cv(_class_NSURLSessionWebSocketMessage, _sel_new); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSURLSessionWebSocketMessage allocWithZone_( + ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_hzlb60( + _class_NSURLSessionWebSocketMessage, _sel_allocWithZone_, zone); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSURLSessionWebSocketMessage alloc() { + final _ret = + _objc_msgSend_1x359cv(_class_NSURLSessionWebSocketMessage, _sel_alloc); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); + } + + /// self + NSURLSessionWebSocketMessage self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: true, release: true); + } + + /// retain + NSURLSessionWebSocketMessage retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: true, release: true); + } + + /// autorelease + NSURLSessionWebSocketMessage autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: true, release: true); + } +} + +void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0) => block.ref.target @@ -64455,24 +62122,24 @@ void _ObjCBlock_ffiVoid_NSInputStream_fnPtrTrampoline( ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>>() .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSInputStream_fnPtrCallable = +ffi.Pointer _ObjCBlock_ffiVoid_NSError_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSInputStream_fnPtrTrampoline) + _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSInputStream_closureTrampoline( +void _ObjCBlock_ffiVoid_NSError_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0) => (objc.getBlockClosure(block) as void Function( ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSInputStream_closureCallable = +ffi.Pointer _ObjCBlock_ffiVoid_NSError_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSInputStream_closureTrampoline) + _ObjCBlock_ffiVoid_NSError_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_NSInputStream_listenerTrampoline( +void _ObjCBlock_ffiVoid_NSError_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0) { (objc.getBlockClosure(block) as void Function( ffi.Pointer))(arg0); @@ -64482,20 +62149,20 @@ void _ObjCBlock_ffiVoid_NSInputStream_listenerTrampoline( ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSInputStream_listenerCallable = ffi.NativeCallable< + _ObjCBlock_ffiVoid_NSError_listenerCallable = ffi.NativeCallable< ffi.Void Function(ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSInputStream_listenerTrampoline) + _ObjCBlock_ffiVoid_NSError_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSInputStream { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSError { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( + static objc.ObjCBlock castFromPointer( ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock(pointer, + objc.ObjCBlock(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -64503,14 +62170,14 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( + static objc.ObjCBlock fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< ffi.Void Function(ffi.Pointer arg0)>> ptr) => - objc.ObjCBlock( + objc.ObjCBlock( objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSInputStream_fnPtrCallable, ptr.cast()), + _ObjCBlock_ffiVoid_NSError_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -64519,14 +62186,14 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSInputStream?) fn) => - objc.ObjCBlock( + static objc.ObjCBlock fromFunction( + void Function(objc.NSError?) fn) => + objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSInputStream_closureCallable, + _ObjCBlock_ffiVoid_NSError_closureCallable, (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.NSInputStream.castFromPointer(arg0, + : objc.NSError.castFromPointer(arg0, retain: true, release: true))), retain: false, release: true); @@ -64540,25 +62207,25 @@ abstract final class ObjCBlock_ffiVoid_NSInputStream { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(objc.NSInputStream?) fn) { + static objc.ObjCBlock listener( + void Function(objc.NSError?) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSInputStream_listenerCallable.nativeFunction.cast(), + _ObjCBlock_ffiVoid_NSError_listenerCallable.nativeFunction.cast(), (ffi.Pointer arg0) => fn(arg0.address == 0 ? null - : objc.NSInputStream.castFromPointer(arg0, + : objc.NSError.castFromPointer(arg0, retain: false, release: true))); - final wrapper = _wrapListenerBlock_ukcdfq(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, + return objc.ObjCBlock(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSInputStream_CallExtension - on objc.ObjCBlock { - void call(objc.NSInputStream? arg0) => ref.pointer.ref.invoke +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSError_CallExtension + on objc.ObjCBlock { + void call(objc.NSError? arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer block, @@ -64569,151 +62236,107 @@ extension ObjCBlock_ffiVoid_NSInputStream_CallExtension ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); } -late final _sel_URLSession_task_needNewBodyStream_ = - objc.registerName("URLSession:task:needNewBodyStream:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); +late final _sel_sendMessage_completionHandler_ = + objc.registerName("sendMessage:completionHandler:"); +void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrCallable = + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); +void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureCallable = + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { +void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + ffi.Pointer, ffi.Pointer))(arg0, arg1); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerCallable = + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerTrampoline) + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - objc.ObjCBlock)>(pointer, - retain: retain, release: release); + ffi.Void Function(NSURLSessionWebSocketMessage?, + objc.NSError?)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>( + static objc.ObjCBlock fromFunction( + void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn) => + objc.ObjCBlock( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, retain: true, release: true))), + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0.address == 0 + ? null + : NSURLSessionWebSocketMessage.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), retain: false, release: true); @@ -64727,1155 +62350,779 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffi /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - objc.ObjCBlock)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - fn) { + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> + listener(void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerCallable + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => + (ffi.Pointer arg0, + ffi.Pointer arg1) => fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_1wmulza(raw); + arg0.address == 0 + ? null + : NSURLSessionWebSocketMessage.castFromPointer(arg0, + retain: false, release: true), + arg1.address == 0 + ? null + : objc.NSError.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjvic9(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - objc.ObjCBlock)>( - wrapper, - retain: false, - release: true); + ffi.Void Function(NSURLSessionWebSocketMessage?, + objc.NSError?)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_CallExtension +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - objc.ObjCBlock)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock arg3) => + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> { + void call(NSURLSessionWebSocketMessage? arg0, objc.NSError? arg1) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() + ffi.Pointer arg0, + ffi.Pointer arg1)>>() .asFunction< void Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); + ffi.Pointer)>()(ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); } -late final _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = - objc.registerName( - "URLSession:task:needNewBodyStreamFromOffset:completionHandler:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>()( - arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); +late final _sel_receiveMessageWithCompletionHandler_ = + objc.registerName("receiveMessageWithCompletionHandler:"); +late final _sel_sendPingWithPongReceiveHandler_ = + objc.registerName("sendPingWithPongReceiveHandler:"); + +/// The WebSocket close codes follow the close codes given in the RFC +sealed class NSURLSessionWebSocketCloseCode { + static const NSURLSessionWebSocketCloseCodeInvalid = 0; + static const NSURLSessionWebSocketCloseCodeNormalClosure = 1000; + static const NSURLSessionWebSocketCloseCodeGoingAway = 1001; + static const NSURLSessionWebSocketCloseCodeProtocolError = 1002; + static const NSURLSessionWebSocketCloseCodeUnsupportedData = 1003; + static const NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005; + static const NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006; + static const NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007; + static const NSURLSessionWebSocketCloseCodePolicyViolation = 1008; + static const NSURLSessionWebSocketCloseCodeMessageTooBig = 1009; + static const NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = 1010; + static const NSURLSessionWebSocketCloseCodeInternalServerError = 1011; + static const NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015; } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerCallable = - ffi.NativeCallable< +late final _sel_cancelWithCloseCode_reason_ = + objc.registerName("cancelWithCloseCode:reason:"); +final _objc_msgSend_xb0psz = objc.msgSendPointer + .cast< + ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerTrampoline) - ..keepIsolateAlive = false; + ffi.Pointer, + NSInteger, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_maximumMessageSize = objc.registerName("maximumMessageSize"); +late final _sel_setMaximumMessageSize_ = + objc.registerName("setMaximumMessageSize:"); +late final _sel_closeCode = objc.registerName("closeCode"); +final _objc_msgSend_1rhk8uh = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_closeReason = objc.registerName("closeReason"); -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - ffi.Int64, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - ffi.Int64, - objc.ObjCBlock)>(pointer, retain: retain, release: release); +/// A WebSocket task can be created with a ws or wss url. A client can also provide +/// a list of protocols it wishes to advertise during the WebSocket handshake phase. +/// Once the handshake is successfully completed the client will be notified through an optional delegate. +/// All reads and writes enqueued before the completion of the handshake will be queued up and +/// executed once the handshake succeeds. Before the handshake completes, the client can be called to handle +/// redirection or authentication using the same delegates as NSURLSessionTask. WebSocket task will also provide +/// support for cookies and will store cookies to the cookie storage on the session and will attach cookies to +/// outgoing HTTP handshake requests. +class NSURLSessionWebSocketTask extends NSURLSessionTask { + NSURLSessionWebSocketTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Pointer arg4)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - ffi.Int64, - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + /// Constructs a [NSURLSessionWebSocketTask] that points to the same underlying object as [other]. + NSURLSessionWebSocketTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, ffi.Pointer arg4) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - arg3, - ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, retain: true, release: true))), - retain: false, - release: true); + /// Constructs a [NSURLSessionWebSocketTask] that wraps the given raw object pointer. + NSURLSessionWebSocketTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - ffi.Int64, - objc.ObjCBlock)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - arg3, - ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_qxeqyf(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - ffi.Int64, - objc.ObjCBlock)>( - wrapper, - retain: false, - release: true); + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionWebSocketTask); } -} -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - ffi.Int64, - objc.ObjCBlock)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock arg4) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3, arg4.ref.pointer); -} + /// Sends a WebSocket message. If an error occurs, any outstanding work will also fail. + /// Note that invocation of the completion handler does not + /// guarantee that the remote side has received all the bytes, only + /// that they have been written to the kernel. + void sendMessage_completionHandler_(NSURLSessionWebSocketMessage message, + objc.ObjCBlock completionHandler) { + _objc_msgSend_14pxqbs(this.ref.pointer, _sel_sendMessage_completionHandler_, + message.ref.pointer, completionHandler.ref.pointer); + } -late final _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.registerName( - "URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4, - ffi.Int64 arg5)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int)>()(arg0, arg1, arg2, arg3, arg4, arg5); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int))(arg0, arg1, arg2, arg3, arg4, arg5); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int))(arg0, arg1, arg2, arg3, arg4, arg5); - objc.objectRelease(block.cast()); -} + /// Reads a WebSocket message once all the frames of the message are available. + /// If the maximumMessage size is hit while buffering the frames, the receiveMessage call will error out + /// and all outstanding work will also fail resulting in the end of the task. + void receiveMessageWithCompletionHandler_( + objc.ObjCBlock< + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> + completionHandler) { + _objc_msgSend_f167m6( + this.ref.pointer, + _sel_receiveMessageWithCompletionHandler_, + completionHandler.ref.pointer); + } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerTrampoline) - ..keepIsolateAlive = false; + /// Sends a ping frame from the client side. The pongReceiveHandler is invoked when the client + /// receives a pong from the server endpoint. If a connection is lost or an error occurs before receiving + /// the pong from the endpoint, the pongReceiveHandler block will be invoked with an error. + /// Note - the pongReceiveHandler will always be called in the order in which the pings were sent. + void sendPingWithPongReceiveHandler_( + objc.ObjCBlock pongReceiveHandler) { + _objc_msgSend_f167m6(this.ref.pointer, _sel_sendPingWithPongReceiveHandler_, + pongReceiveHandler.ref.pointer); + } -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - ffi.Int64, - ffi.Int64, - ffi.Int64)>(pointer, retain: retain, release: release); + /// Sends a close frame with the given closeCode. An optional reason can be provided while sending the close frame. + /// Simply calling cancel on the task will result in a cancellation frame being sent without any reason. + void cancelWithCloseCode_reason_( + DartNSInteger closeCode, objc.NSData? reason) { + _objc_msgSend_xb0psz(this.ref.pointer, _sel_cancelWithCloseCode_reason_, + closeCode, reason?.ref.pointer ?? ffi.nullptr); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - ffi.Int64, - ffi.Int64, - ffi.Int64)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached + DartNSInteger get maximumMessageSize { + return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_maximumMessageSize); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, int, int) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - arg3, - arg4, - arg5)), - retain: false, - release: true); + /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached + set maximumMessageSize(DartNSInteger value) { + return _objc_msgSend_4sp4xj( + this.ref.pointer, _sel_setMaximumMessageSize_, value); + } - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - ffi.Int64, ffi.Int64, ffi.Int64)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, - int, int) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - arg3, - arg4, - arg5)); - final wrapper = _wrapListenerBlock_jzggzf(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - ffi.Int64, - ffi.Int64, - ffi.Int64)>(wrapper, retain: false, release: true); + /// A task can be queried for it's close code at any point. When the task is not closed, it will be set to NSURLSessionWebSocketCloseCodeInvalid + DartNSInteger get closeCode { + return _objc_msgSend_1rhk8uh(this.ref.pointer, _sel_closeCode); } -} -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - ffi.Int64, ffi.Int64, ffi.Int64)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4, - ffi.Int64 arg5)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int)>()(ref.pointer, arg0, arg1.ref.pointer, - arg2.ref.pointer, arg3, arg4, arg5); -} + /// A task can be queried for it's close reason at any point. A nil value indicates no closeReason or that the task is still running + objc.NSData? get closeReason { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_closeReason); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } -late final _sel_URLSession_task_didReceiveInformationalResponse_ = - objc.registerName("URLSession:task:didReceiveInformationalResponse:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} + /// init + NSURLSessionWebSocketTask init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: false, release: true); + } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerTrampoline) - ..keepIsolateAlive = false; + /// new + static NSURLSessionWebSocketTask new1() { + final _ret = + _objc_msgSend_1x359cv(_class_NSURLSessionWebSocketTask, _sel_new); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: false, release: true); + } -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSHTTPURLResponse)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSHTTPURLResponse)>(pointer, - retain: retain, release: release); + /// allocWithZone: + static NSURLSessionWebSocketTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_hzlb60( + _class_NSURLSessionWebSocketTask, _sel_allocWithZone_, zone); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: false, release: true); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSHTTPURLResponse)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + /// alloc + static NSURLSessionWebSocketTask alloc() { + final _ret = + _objc_msgSend_1x359cv(_class_NSURLSessionWebSocketTask, _sel_alloc); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: false, release: true); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSHTTPURLResponse.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + /// self + NSURLSessionWebSocketTask self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: true, release: true); + } - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSHTTPURLResponse)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSHTTPURLResponse) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - NSHTTPURLResponse.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_1a6kixf(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSHTTPURLResponse)>(wrapper, retain: false, release: true); + /// retain + NSURLSessionWebSocketTask retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: true, release: true); } -} -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSHTTPURLResponse)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); + /// autorelease + NSURLSessionWebSocketTask autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: true, release: true); + } } -/// NSURLSessionTaskMetrics -class NSURLSessionTaskMetrics extends objc.NSObject { - NSURLSessionTaskMetrics._(ffi.Pointer pointer, +late final _sel_webSocketTaskWithURL_ = + objc.registerName("webSocketTaskWithURL:"); +late final _sel_webSocketTaskWithURL_protocols_ = + objc.registerName("webSocketTaskWithURL:protocols:"); +late final _sel_webSocketTaskWithRequest_ = + objc.registerName("webSocketTaskWithRequest:"); + +/// NSURLSession is a replacement API for NSURLConnection. It provides +/// options that affect the policy of, and various aspects of the +/// mechanism by which NSURLRequest objects are retrieved from the +/// network. +/// +/// An NSURLSession may be bound to a delegate object. The delegate is +/// invoked for certain events during the lifetime of a session, such as +/// server authentication or determining whether a resource to be loaded +/// should be converted into a download. +/// +/// NSURLSession instances are thread-safe. +/// +/// The default NSURLSession uses a system provided delegate and is +/// appropriate to use in place of existing code that uses +/// +[NSURLConnection sendAsynchronousRequest:queue:completionHandler:] +/// +/// An NSURLSession creates NSURLSessionTask objects which represent the +/// action of a resource being loaded. These are analogous to +/// NSURLConnection objects but provide for more control and a unified +/// delegate model. +/// +/// NSURLSessionTask objects are always created in a suspended state and +/// must be sent the -resume message before they will execute. +/// +/// Subclasses of NSURLSessionTask are used to syntactically +/// differentiate between data and file downloads. +/// +/// An NSURLSessionDataTask receives the resource as a series of calls to +/// the URLSession:dataTask:didReceiveData: delegate method. This is type of +/// task most commonly associated with retrieving objects for immediate parsing +/// by the consumer. +/// +/// An NSURLSessionUploadTask differs from an NSURLSessionDataTask +/// in how its instance is constructed. Upload tasks are explicitly created +/// by referencing a file or data object to upload, or by utilizing the +/// -URLSession:task:needNewBodyStream: delegate message to supply an upload +/// body. +/// +/// An NSURLSessionDownloadTask will directly write the response data to +/// a temporary file. When completed, the delegate is sent +/// URLSession:downloadTask:didFinishDownloadingToURL: and given an opportunity +/// to move this file to a permanent location in its sandboxed container, or to +/// otherwise read the file. If canceled, an NSURLSessionDownloadTask can +/// produce a data blob that can be used to resume a download at a later +/// time. +/// +/// Beginning with iOS 9 and Mac OS X 10.11, NSURLSessionStream is +/// available as a task type. This allows for direct TCP/IP connection +/// to a given host and port with optional secure handshaking and +/// navigation of proxies. Data tasks may also be upgraded to a +/// NSURLSessionStream task via the HTTP Upgrade: header and appropriate +/// use of the pipelining option of NSURLSessionConfiguration. See RFC +/// 2817 and RFC 6455 for information about the Upgrade: header, and +/// comments below on turning data tasks into stream tasks. +/// +/// An NSURLSessionWebSocketTask is a task that allows clients to connect to servers supporting +/// WebSocket. The task will perform the HTTP handshake to upgrade the connection +/// and once the WebSocket handshake is successful, the client can read and write +/// messages that will be framed using the WebSocket protocol by the framework. +class NSURLSession extends objc.NSObject { + NSURLSession._(ffi.Pointer pointer, {bool retain = false, bool release = false}) : super.castFromPointer(pointer, retain: retain, release: release); - /// Constructs a [NSURLSessionTaskMetrics] that points to the same underlying object as [other]. - NSURLSessionTaskMetrics.castFrom(objc.ObjCObjectBase other) + /// Constructs a [NSURLSession] that points to the same underlying object as [other]. + NSURLSession.castFrom(objc.ObjCObjectBase other) : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSURLSessionTaskMetrics] that wraps the given raw object pointer. - NSURLSessionTaskMetrics.castFromPointer(ffi.Pointer other, + /// Constructs a [NSURLSession] that wraps the given raw object pointer. + NSURLSession.castFromPointer(ffi.Pointer other, {bool retain = false, bool release = false}) : this._(other, retain: retain, release: release); - /// Returns whether [obj] is an instance of [NSURLSessionTaskMetrics]. + /// Returns whether [obj] is an instance of [NSURLSession]. static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionTaskMetrics); + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSession); } - /// transactionMetrics array contains the metrics collected for every request/response transaction created during the task execution. - objc.ObjCObjectBase get transactionMetrics { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_transactionMetrics); - return objc.ObjCObjectBase(_ret, retain: true, release: true); + /// The shared session uses the currently set global NSURLCache, + /// NSHTTPCookieStorage and NSURLCredentialStorage objects. + static NSURLSession getSharedSession() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLSession, _sel_sharedSession); + return NSURLSession.castFromPointer(_ret, retain: true, release: true); } - /// Interval from the task creation time to the task completion time. - /// Task creation time is the time when the task was instantiated. - /// Task completion time is the time when the task is about to change its internal state to completed. - NSDateInterval get taskInterval { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_taskInterval); - return NSDateInterval.castFromPointer(_ret, retain: true, release: true); + /// Customization of NSURLSession occurs during creation of a new session. + /// If you only need to use the convenience routines with custom + /// configuration options it is not necessary to specify a delegate. + /// If you do specify a delegate, the delegate will be retained until after + /// the delegate has been sent the URLSession:didBecomeInvalidWithError: message. + static NSURLSession sessionWithConfiguration_( + NSURLSessionConfiguration configuration) { + final _ret = _objc_msgSend_62nh5j(_class_NSURLSession, + _sel_sessionWithConfiguration_, configuration.ref.pointer); + return NSURLSession.castFromPointer(_ret, retain: true, release: true); } - /// redirectCount is the number of redirects that were recorded. - DartNSUInteger get redirectCount { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_redirectCount); + /// sessionWithConfiguration:delegate:delegateQueue: + static NSURLSession sessionWithConfiguration_delegate_delegateQueue_( + NSURLSessionConfiguration configuration, + objc.ObjCObjectBase? delegate, + NSOperationQueue? queue) { + final _ret = _objc_msgSend_582s3n( + _class_NSURLSession, + _sel_sessionWithConfiguration_delegate_delegateQueue_, + configuration.ref.pointer, + delegate?.ref.pointer ?? ffi.nullptr, + queue?.ref.pointer ?? ffi.nullptr); + return NSURLSession.castFromPointer(_ret, retain: true, release: true); } - /// init - NSURLSessionTaskMetrics init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSessionTaskMetrics.castFromPointer(_ret, - retain: false, release: true); + /// delegateQueue + NSOperationQueue get delegateQueue { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_delegateQueue); + return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); } - /// new - static NSURLSessionTaskMetrics new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionTaskMetrics, _sel_new); - return NSURLSessionTaskMetrics.castFromPointer(_ret, - retain: false, release: true); + /// delegate + objc.ObjCObjectBase? get delegate { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_delegate); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// allocWithZone: - static NSURLSessionTaskMetrics allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSURLSessionTaskMetrics, _sel_allocWithZone_, zone); - return NSURLSessionTaskMetrics.castFromPointer(_ret, - retain: false, release: true); + /// configuration + NSURLSessionConfiguration get configuration { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_configuration); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); } - /// alloc - static NSURLSessionTaskMetrics alloc() { + /// The sessionDescription property is available for the developer to + /// provide a descriptive label for the session. + objc.NSString? get sessionDescription { final _ret = - _objc_msgSend_1unuoxw(_class_NSURLSessionTaskMetrics, _sel_alloc); - return NSURLSessionTaskMetrics.castFromPointer(_ret, - retain: false, release: true); + _objc_msgSend_1x359cv(this.ref.pointer, _sel_sessionDescription); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } -} -late final _class_NSURLSessionTaskMetrics = - objc.getClass("NSURLSessionTaskMetrics"); -late final _sel_transactionMetrics = objc.registerName("transactionMetrics"); + /// The sessionDescription property is available for the developer to + /// provide a descriptive label for the session. + set sessionDescription(objc.NSString? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setSessionDescription_, + value?.ref.pointer ?? ffi.nullptr); + } -/// NSDateInterval -class NSDateInterval extends objc.ObjCObjectBase { - NSDateInterval._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super(pointer, retain: retain, release: release); + /// -finishTasksAndInvalidate returns immediately and existing tasks will be allowed + /// to run to completion. New tasks may not be created. The session + /// will continue to make delegate callbacks until URLSession:didBecomeInvalidWithError: + /// has been issued. + /// + /// -finishTasksAndInvalidate and -invalidateAndCancel do not + /// have any effect on the shared session singleton. + /// + /// When invalidating a background session, it is not safe to create another background + /// session with the same identifier until URLSession:didBecomeInvalidWithError: has + /// been issued. + void finishTasksAndInvalidate() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_finishTasksAndInvalidate); + } - /// Constructs a [NSDateInterval] that points to the same underlying object as [other]. - NSDateInterval.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); + /// -invalidateAndCancel acts as -finishTasksAndInvalidate, but issues + /// -cancel to all outstanding tasks for this session. Note task + /// cancellation is subject to the state of the task, and some tasks may + /// have already have completed at the time they are sent -cancel. + void invalidateAndCancel() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_invalidateAndCancel); + } - /// Constructs a [NSDateInterval] that wraps the given raw object pointer. - NSDateInterval.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); + /// empty all cookies, cache and credential stores, removes disk files, issues -flushWithCompletionHandler:. Invokes completionHandler() on the delegate queue. + void resetWithCompletionHandler_( + objc.ObjCBlock completionHandler) { + _objc_msgSend_f167m6(this.ref.pointer, _sel_resetWithCompletionHandler_, + completionHandler.ref.pointer); + } - /// Returns whether [obj] is an instance of [NSDateInterval]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSDateInterval); + /// flush storage to disk and clear transient network caches. Invokes completionHandler() on the delegate queue. + void flushWithCompletionHandler_( + objc.ObjCBlock completionHandler) { + _objc_msgSend_f167m6(this.ref.pointer, _sel_flushWithCompletionHandler_, + completionHandler.ref.pointer); } -} -late final _class_NSDateInterval = objc.getClass("NSDateInterval"); -late final _sel_taskInterval = objc.registerName("taskInterval"); -late final _sel_redirectCount = objc.registerName("redirectCount"); -late final _sel_URLSession_task_didFinishCollectingMetrics_ = - objc.registerName("URLSession:task:didFinishCollectingMetrics:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} + /// invokes completionHandler with outstanding data, upload and download tasks. + void getTasksWithCompletionHandler_( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + completionHandler) { + _objc_msgSend_f167m6(this.ref.pointer, _sel_getTasksWithCompletionHandler_, + completionHandler.ref.pointer); + } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline) - ..keepIsolateAlive = false; + /// invokes completionHandler with all outstanding tasks. + void getAllTasksWithCompletionHandler_( + objc.ObjCBlock)> + completionHandler) { + _objc_msgSend_f167m6(this.ref.pointer, + _sel_getAllTasksWithCompletionHandler_, completionHandler.ref.pointer); + } -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSURLSessionTaskMetrics)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSURLSessionTaskMetrics)>(pointer, - retain: retain, release: release); + /// Creates a data task with the given request. The request may have a body stream. + NSURLSessionDataTask dataTaskWithRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_dataTaskWithRequest_, request.ref.pointer); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: true, release: true); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSURLSessionTaskMetrics)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSURLSessionTaskMetrics)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + /// Creates a data task to retrieve the contents of the given URL. + NSURLSessionDataTask dataTaskWithURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_dataTaskWithURL_, url.ref.pointer); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: true, release: true); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSURLSessionTaskMetrics.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + /// Creates an upload task with the given request. The body of the request will be created from the file referenced by fileURL + NSURLSessionUploadTask uploadTaskWithRequest_fromFile_( + NSURLRequest request, objc.NSURL fileURL) { + final _ret = _objc_msgSend_rsfdlh( + this.ref.pointer, + _sel_uploadTaskWithRequest_fromFile_, + request.ref.pointer, + fileURL.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); + } - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. + /// Creates an upload task with the given request. The body of the request is provided from the bodyData. + NSURLSessionUploadTask uploadTaskWithRequest_fromData_( + NSURLRequest request, objc.NSData bodyData) { + final _ret = _objc_msgSend_rsfdlh( + this.ref.pointer, + _sel_uploadTaskWithRequest_fromData_, + request.ref.pointer, + bodyData.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); + } + + /// Creates an upload task from a resume data blob. Requires the server to support the latest resumable uploads + /// Internet-Draft from the HTTP Working Group, found at + /// https://datatracker.ietf.org/doc/draft-ietf-httpbis-resumable-upload/ + /// If resuming from an upload file, the file must still exist and be unmodified. If the upload cannot be successfully + /// resumed, URLSession:task:didCompleteWithError: will be called. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSURLSessionTaskMetrics)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSURLSessionTaskMetrics) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - NSURLSessionTaskMetrics.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_1a6kixf(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSURLSessionTaskMetrics)>(wrapper, retain: false, release: true); + /// - Parameter resumeData: Resume data blob from an incomplete upload, such as data returned by the cancelByProducingResumeData: method. + /// - Returns: A new session upload task, or nil if the resumeData is invalid. + NSURLSessionUploadTask uploadTaskWithResumeData_(objc.NSData resumeData) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_uploadTaskWithResumeData_, resumeData.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); } -} -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSURLSessionTaskMetrics)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); -} + /// Creates an upload task with the given request. The previously set body stream of the request (if any) is ignored and the URLSession:task:needNewBodyStream: delegate will be called when the body payload is required. + NSURLSessionUploadTask uploadTaskWithStreamedRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_uploadTaskWithStreamedRequest_, request.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); + } -late final _sel_URLSession_task_didCompleteWithError_ = - objc.registerName("URLSession:task:didCompleteWithError:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); + /// Creates a download task with the given request. + NSURLSessionDownloadTask downloadTaskWithRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_downloadTaskWithRequest_, request.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } + + /// Creates a download task to download the contents of the given URL. + NSURLSessionDownloadTask downloadTaskWithURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_downloadTaskWithURL_, url.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } + + /// Creates a download task with the resume data. If the download cannot be successfully resumed, URLSession:task:didCompleteWithError: will be called. + NSURLSessionDownloadTask downloadTaskWithResumeData_(objc.NSData resumeData) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_downloadTaskWithResumeData_, resumeData.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } + + /// Creates a bidirectional stream task to a given host and port. + NSURLSessionStreamTask streamTaskWithHostName_port_( + objc.NSString hostname, DartNSInteger port) { + final _ret = _objc_msgSend_1i26p99(this.ref.pointer, + _sel_streamTaskWithHostName_port_, hostname.ref.pointer, port); + return NSURLSessionStreamTask.castFromPointer(_ret, + retain: true, release: true); + } + + /// Creates a bidirectional stream task with an NSNetService to identify the endpoint. + /// The NSNetService will be resolved before any IO completes. + NSURLSessionStreamTask streamTaskWithNetService_(NSNetService service) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_streamTaskWithNetService_, service.ref.pointer); + return NSURLSessionStreamTask.castFromPointer(_ret, + retain: true, release: true); + } + + /// Creates a WebSocket task given the url. The given url must have a ws or wss scheme. + NSURLSessionWebSocketTask webSocketTaskWithURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_webSocketTaskWithURL_, url.ref.pointer); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: true, release: true); + } + + /// Creates a WebSocket task given the url and an array of protocols. The protocols will be used in the WebSocket handshake to + /// negotiate a preferred protocol with the server + /// Note - The protocol will not affect the WebSocket framing. More details on the protocol can be found by reading the WebSocket RFC + NSURLSessionWebSocketTask webSocketTaskWithURL_protocols_( + objc.NSURL url, objc.ObjCObjectBase protocols) { + final _ret = _objc_msgSend_rsfdlh( + this.ref.pointer, + _sel_webSocketTaskWithURL_protocols_, + url.ref.pointer, + protocols.ref.pointer); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: true, release: true); + } + + /// Creates a WebSocket task given the request. The request properties can be modified and will be used by the task during the HTTP handshake phase. + /// Clients who want to add custom protocols can do so by directly adding headers with the key Sec-WebSocket-Protocol + /// and a comma separated list of protocols they wish to negotiate with the server. The custom HTTP headers provided by the client will remain unchanged for the handshake with the server. + NSURLSessionWebSocketTask webSocketTaskWithRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_webSocketTaskWithRequest_, request.ref.pointer); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: true, release: true); + } + + /// init + NSURLSession init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSession.castFromPointer(_ret, retain: false, release: true); + } + + /// new + static NSURLSession new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLSession, _sel_new); + return NSURLSession.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSURLSession allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_hzlb60(_class_NSURLSession, _sel_allocWithZone_, zone); + return NSURLSession.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSURLSession alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLSession, _sel_alloc); + return NSURLSession.castFromPointer(_ret, retain: false, release: true); + } + + /// self + NSURLSession self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLSession.castFromPointer(_ret, retain: true, release: true); + } + + /// retain + NSURLSession retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLSession.castFromPointer(_ret, retain: true, release: true); + } + + /// autorelease + NSURLSession autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLSession.castFromPointer(_ret, retain: true, release: true); + } +} + +/// Disposition options for various delegate messages +enum NSURLSessionDelayedRequestDisposition { + /// Use the original request provided when the task was created; the request parameter is ignored. + NSURLSessionDelayedRequestContinueLoading(0), + + /// Use the specified request, which may not be nil. + NSURLSessionDelayedRequestUseNewRequest(1), + + /// Cancel the task; the request parameter is ignored. + NSURLSessionDelayedRequestCancel(2); + + final int value; + const NSURLSessionDelayedRequestDisposition(this.value); + + static NSURLSessionDelayedRequestDisposition fromValue(int value) => + switch (value) { + 0 => NSURLSessionDelayedRequestContinueLoading, + 1 => NSURLSessionDelayedRequestUseNewRequest, + 2 => NSURLSessionDelayedRequestCancel, + _ => throw ArgumentError( + "Unknown value for NSURLSessionDelayedRequestDisposition: $value"), + }; +} + +enum NSURLSessionAuthChallengeDisposition { + /// Use the specified credential, which may be nil + NSURLSessionAuthChallengeUseCredential(0), + + /// Default handling for the challenge - as if this delegate were not implemented; the credential parameter is ignored. + NSURLSessionAuthChallengePerformDefaultHandling(1), + + /// The entire request will be canceled; the credential parameter is ignored. + NSURLSessionAuthChallengeCancelAuthenticationChallenge(2), + + /// This challenge is rejected and the next authentication protection space should be tried; the credential parameter is ignored. + NSURLSessionAuthChallengeRejectProtectionSpace(3); + + final int value; + const NSURLSessionAuthChallengeDisposition(this.value); + + static NSURLSessionAuthChallengeDisposition fromValue(int value) => + switch (value) { + 0 => NSURLSessionAuthChallengeUseCredential, + 1 => NSURLSessionAuthChallengePerformDefaultHandling, + 2 => NSURLSessionAuthChallengeCancelAuthenticationChallenge, + 3 => NSURLSessionAuthChallengeRejectProtectionSpace, + _ => throw ArgumentError( + "Unknown value for NSURLSessionAuthChallengeDisposition: $value"), + }; +} + +enum NSURLSessionResponseDisposition { + /// Cancel the load, this is the same as -[task cancel] + NSURLSessionResponseCancel(0), + + /// Allow the load to continue + NSURLSessionResponseAllow(1), + + /// Turn this request into a download + NSURLSessionResponseBecomeDownload(2), + + /// Turn this task into a stream task + NSURLSessionResponseBecomeStream(3); + + final int value; + const NSURLSessionResponseDisposition(this.value); + + static NSURLSessionResponseDisposition fromValue(int value) => + switch (value) { + 0 => NSURLSessionResponseCancel, + 1 => NSURLSessionResponseAllow, + 2 => NSURLSessionResponseBecomeDownload, + 3 => NSURLSessionResponseBecomeStream, + _ => throw ArgumentError( + "Unknown value for NSURLSessionResponseDisposition: $value"), + }; +} + +late final _protocol_NSURLSessionDelegate = + objc.getProtocol("NSURLSessionDelegate"); +late final _sel_URLSession_didBecomeInvalidWithError_ = + objc.registerName("URLSession:didBecomeInvalidWithError:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + ffi.Pointer))(arg0, arg1, arg2); objc.objectRelease(block.cast()); } @@ -65884,32 +63131,26 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable = - ffi.NativeCallable< + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable = ffi + .NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError { +/// Construction methods for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, objc.NSError?)> + ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, + ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -65917,14 +63158,15 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, objc.NSError?)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, objc.NSError?)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable, ptr.cast()), + static objc + .ObjCBlock, NSURLSession, objc.NSError?)> + fromFunctionPointer( + ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock, NSURLSession, objc.NSError?)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable, + ptr.cast()), retain: false, release: true); @@ -65933,21 +63175,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + static objc + .ObjCBlock, NSURLSession, objc.NSError?)> + fromFunction(void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) => + objc.ObjCBlock, NSURLSession, objc.NSError?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - arg3.address == 0 ? null : objc.NSError.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -65959,44 +63198,37 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSE /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - objc.NSError?)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - objc.NSError?) - fn) { + ffi.Void Function( + ffi.Pointer, NSURLSession, objc.NSError?)> listener( + void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - arg3.address == 0 + arg2.address == 0 ? null - : objc.NSError.castFromPointer(arg3, + : objc.NSError.castFromPointer(arg2, retain: false, release: true))); - final wrapper = _wrapListenerBlock_1a6kixf(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - objc.NSError?)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => + ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> { + void call( + ffi.Pointer arg0, NSURLSession arg1, objc.NSError? arg2) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -66004,1092 +63236,153 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_CallEx ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() + ffi.Pointer arg2)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3?.ref.pointer ?? ffi.nullptr); + arg1.ref.pointer, arg2?.ref.pointer ?? ffi.nullptr); } -/// Messages related to the operation of a task that delivers data -/// directly to the delegate. -abstract final class NSURLSessionDataDelegate { - /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? - URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, - void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock)? - URLSession_dataTask_willCacheResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_ - .implement( - builder, URLSession_dataTask_didReceiveResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ - .implement(builder, URLSession_dataTask_didBecomeDownloadTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( - builder, URLSession_dataTask_didBecomeStreamTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( - builder, URLSession_dataTask_didReceiveData_); - NSURLSessionDataDelegate - .URLSession_dataTask_willCacheResponse_completionHandler_ - .implement( - builder, URLSession_dataTask_willCacheResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( - builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } +/// WARNING: NSURLAuthenticationChallenge is a stub. To generate bindings for this class, include +/// NSURLAuthenticationChallenge in your config's objc-interfaces list. +/// +/// NSURLAuthenticationChallenge +class NSURLAuthenticationChallenge extends objc.ObjCObjectBase { + NSURLAuthenticationChallenge._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); - /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? - URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, - void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock)? - URLSession_dataTask_willCacheResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_ - .implement( - builder, URLSession_dataTask_didReceiveResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ - .implement(builder, URLSession_dataTask_didBecomeDownloadTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( - builder, URLSession_dataTask_didBecomeStreamTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( - builder, URLSession_dataTask_didReceiveData_); - NSURLSessionDataDelegate - .URLSession_dataTask_willCacheResponse_completionHandler_ - .implement( - builder, URLSession_dataTask_willCacheResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( - builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } + /// Constructs a [NSURLAuthenticationChallenge] that points to the same underlying object as [other]. + NSURLAuthenticationChallenge.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? - URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, - void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock)? - URLSession_dataTask_willCacheResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_ - .implementAsListener( - builder, URLSession_dataTask_didReceiveResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ - .implementAsListener( - builder, URLSession_dataTask_didBecomeDownloadTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_ - .implementAsListener(builder, URLSession_dataTask_didBecomeStreamTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ - .implementAsListener(builder, URLSession_dataTask_didReceiveData_); - NSURLSessionDataDelegate - .URLSession_dataTask_willCacheResponse_completionHandler_ - .implementAsListener( - builder, URLSession_dataTask_willCacheResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } + /// Constructs a [NSURLAuthenticationChallenge] that wraps the given raw object pointer. + NSURLAuthenticationChallenge.castFromPointer( + ffi.Pointer other, + {bool retain = false, + bool release = false}) + : this._(other, retain: retain, release: release); +} - /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? - URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, - void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock)? - URLSession_dataTask_willCacheResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_ - .implementAsListener( - builder, URLSession_dataTask_didReceiveResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ - .implementAsListener( - builder, URLSession_dataTask_didBecomeDownloadTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_ - .implementAsListener(builder, URLSession_dataTask_didBecomeStreamTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ - .implementAsListener(builder, URLSession_dataTask_didReceiveData_); - NSURLSessionDataDelegate - .URLSession_dataTask_willCacheResponse_completionHandler_ - .implementAsListener( - builder, URLSession_dataTask_willCacheResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } +/// WARNING: NSURLCredential is a stub. To generate bindings for this class, include +/// NSURLCredential in your config's objc-interfaces list. +/// +/// NSURLCredential +class NSURLCredential extends objc.ObjCObjectBase { + NSURLCredential._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); - /// The task has received a response and no further messages will be - /// received until the completion block is called. The disposition - /// allows you to cancel a request or to turn a data task into a - /// download task. This delegate message is optional - if you do not - /// implement it, you can get the response as a property of the task. - /// - /// This method will not be called for background upload tasks (which cannot be converted to download tasks). - static final URLSession_dataTask_didReceiveResponse_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, - objc.ObjCBlock)>( - _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSURLResponse arg3, - objc.ObjCBlock arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSURLResponse arg3, - objc.ObjCBlock arg4) => - func(arg1, arg2, arg3, arg4)), - ); + /// Constructs a [NSURLCredential] that points to the same underlying object as [other]. + NSURLCredential.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Notification that a data task has become a download task. No - /// future messages will be sent to the data task. - static final URLSession_dataTask_didBecomeDownloadTask_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( - _sel_URLSession_dataTask_didBecomeDownloadTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didBecomeDownloadTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => - func(arg1, arg2, arg3)), - ); + /// Constructs a [NSURLCredential] that wraps the given raw object pointer. + NSURLCredential.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} - /// Notification that a data task has become a bidirectional stream - /// task. No future messages will be sent to the data task. The newly - /// created streamTask will carry the original request and response as - /// properties. - /// - /// For requests that were pipelined, the stream object will only allow - /// reading, and the object will immediately issue a - /// -URLSession:writeClosedForStream:. Pipelining can be disabled for - /// all requests in a session, or by the NSURLRequest - /// HTTPShouldUsePipelining property. - /// - /// The underlying connection is no longer considered part of the HTTP - /// connection cache and won't count against the total number of - /// connections per host. - static final URLSession_dataTask_didBecomeStreamTask_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( - _sel_URLSession_dataTask_didBecomeStreamTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didBecomeStreamTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => - func(arg1, arg2, arg3)), - ); +void + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSInteger arg0, + ffi.Pointer arg1)>>() + .asFunction)>()( + arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} - /// Sent when data is available for the delegate to consume. As the - /// data may be discontiguous, you should use - /// [NSData enumerateByteRangesUsingBlock:] to access it. - static final URLSession_dataTask_didReceiveData_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)>( - _sel_URLSession_dataTask_didReceiveData_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didReceiveData_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDataTask, objc.NSData) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, objc.NSData arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionDataTask, objc.NSData) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, objc.NSData arg3) => - func(arg1, arg2, arg3)), - ); +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline) + ..keepIsolateAlive = false; - /// Invoke the completion routine with a valid NSCachedURLResponse to - /// allow the resulting data to be cached, or pass nil to prevent - /// caching. Note that there is no guarantee that caching will be - /// attempted for a given resource, and you should not rely on this - /// message to receive the resource data. - static final URLSession_dataTask_willCacheResponse_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock)>( - _sel_URLSession_dataTask_willCacheResponse_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_willCacheResponse_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSCachedURLResponse arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSCachedURLResponse arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock( + pointer, + retain: retain, + release: release); - /// Notification that a task has been created. This method is the first message - /// a task sends, providing a place to configure the task before it is resumed. + /// Creates a block from a C function pointer. /// - /// This delegate callback is *NOT* dispatched to the delegate queue. It is - /// invoked synchronously before the task creation method returns. - static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _sel_URLSession_didCreateTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didCreateTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> fromFunctionPointer( + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - /// Sent when the system is ready to begin work for a task with a delayed start - /// time set (using the earliestBeginDate property). The completionHandler must - /// be invoked in order for loading to proceed. The disposition provided to the - /// completion handler continues the load with the original request provided to - /// the task, replaces the request with the specified task, or cancels the task. - /// If this delegate is not implemented, loading will proceed with the original - /// request. - /// - /// Recommendation: only implement this delegate if tasks that have the - /// earliestBeginDate property set may become stale and require alteration prior - /// to starting the network load. - /// - /// If a new request is specified, the allowsExpensiveNetworkAccess, - /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties - /// from the new request will not be used; the properties from the - /// original request will continue to be used. - /// - /// Canceling the task is equivalent to calling the task's cancel method; the - /// URLSession:task:didCompleteWithError: task delegate will be called with error - /// NSURLErrorCancelled. - static final URLSession_task_willBeginDelayedRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)>( - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent when a task cannot start the network loading process because the current - /// network connectivity is not available or sufficient for the task's request. - /// - /// This delegate will be called at most one time per task, and is only called if - /// the waitsForConnectivity property in the NSURLSessionConfiguration has been - /// set to YES. - /// - /// This delegate callback will never be called for background sessions, because - /// the waitForConnectivity property is ignored by those sessions. - static final URLSession_taskIsWaitingForConnectivity_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _sel_URLSession_taskIsWaitingForConnectivity_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); - - /// An HTTP request is attempting to perform a redirection to a different - /// URL. You must invoke the completion routine to allow the - /// redirection, allow the redirection with a modified request, or - /// pass nil to the completionHandler to cause the body of the redirection - /// response to be delivered as the payload of this request. The default - /// is to follow redirections. - /// - /// For tasks in background sessions, redirections will always be followed and this method will not be called. - static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)>( - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); - - /// The task has received a request specific authentication challenge. - /// If this delegate is not implemented, the session specific authentication challenge - /// will *NOT* be called and the behavior will be the same as using the default handling - /// disposition. - static final URLSession_task_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent if a task requires a new, unopened body stream. This may be - /// necessary when authentication has failed for any request that - /// involves a body stream. - static final URLSession_task_needNewBodyStream_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)>( - _sel_URLSession_task_needNewBodyStream_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_needNewBodyStream_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - ); - - /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be - /// necessary when resuming a failed upload task. - /// - /// - Parameter session: The session containing the task that needs a new body stream from the given offset. - /// - Parameter task: The task that needs a new body stream. - /// - Parameter offset: The starting offset required for the body stream. - /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)>( - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent periodically to notify the delegate of upload progress. This - /// information is also available as properties of the task. - static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, int, int)>( - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); - - /// Sent for each informational response received except 101 switching protocols. - static final URLSession_task_didReceiveInformationalResponse_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - _sel_URLSession_task_didReceiveInformationalResponse_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - ); - - /// Sent when complete statistics information has been collected for the task. - static final URLSession_task_didFinishCollectingMetrics_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - _sel_URLSession_task_didFinishCollectingMetrics_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - ); - - /// Sent as the last message related to a specific task. Error may be - /// nil, which implies that no error occurred and this task is complete. - static final URLSession_task_didCompleteWithError_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( - _sel_URLSession_task_didCompleteWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didCompleteWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - ); - - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = objc - .ObjCProtocolListenableMethod( - _sel_URLSession_didBecomeInvalidWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - ); - - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - ); - - /// If an application has received an - /// -application:handleEventsForBackgroundURLSession:completionHandler: - /// message, the session delegate will receive this message to indicate - /// that all messages previously enqueued for this session have been - /// delivered. At this time it is safe to invoke the previously stored - /// completion handler, or to begin any internal updates that will - /// result in invoking the completion handler. - static final URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.ObjCProtocolListenableMethod( - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - ); -} - -late final _protocol_NSURLSessionDataDelegate = - objc.getProtocol("NSURLSessionDataDelegate"); -void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline( - ffi.Pointer block, int arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger)>( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline( - ffi.Pointer block, int arg0) => - (objc.getBlockClosure(block) as void Function(int))(arg0); -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger)>( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline( - ffi.Pointer block, int arg0) { - (objc.getBlockClosure(block) as void Function(int))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger)> - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, NSInteger)>.listener( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. + /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(NSURLSessionResponseDisposition) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable, - (int arg0) => - fn(NSURLSessionResponseDisposition.fromValue(arg0))), - retain: false, - release: true); + static objc.ObjCBlock + fromFunction(void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable, + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionAuthChallengeDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLCredential.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -67100,111 +63393,113 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(NSURLSessionResponseDisposition) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable + static objc.ObjCBlock + listener( + void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable .nativeFunction .cast(), - (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0))); - final wrapper = _wrapListenerBlock_ci81hw(raw); + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionAuthChallengeDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLCredential.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_37btrl(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_CallExtension - on objc.ObjCBlock { - void call(NSURLSessionResponseDisposition arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, NSInteger arg0)>>() - .asFunction, int)>()( - ref.pointer, arg0.value); +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_CallExtension + on objc.ObjCBlock { + void call(NSURLSessionAuthChallengeDisposition arg0, NSURLCredential? arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + NSInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, int, + ffi.Pointer)>()( + ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); } -late final _sel_URLSession_dataTask_didReceiveResponse_completionHandler_ = objc - .registerName("URLSession:dataTask:didReceiveResponse:completionHandler:"); +late final _sel_URLSession_didReceiveChallenge_completionHandler_ = + objc.registerName("URLSession:didReceiveChallenge:completionHandler:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => + ffi.Pointer arg3) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - arg0, arg1, arg2, arg3, arg4); + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => + ffi.Pointer arg3) => (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + ffi.Pointer))(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) { + ffi.Pointer arg3) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + ffi.Pointer))(arg0, arg1, arg2, arg3); objc.objectRelease(block.cast()); } @@ -67214,39 +63509,35 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => + NSURLAuthenticationChallenge, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)>(pointer, retain: retain, release: release); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -67254,41 +63545,39 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( + static objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - NSURLResponse.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer(arg4, retain: true, release: true))), - retain: false, - release: true); + NSURLAuthenticationChallenge.castFromPointer(arg2, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -67303,59 +63592,58 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, - NSURLResponse, objc.ObjCBlock) + NSURLAuthenticationChallenge, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)>)> listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable .nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => + ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer(arg2, - retain: false, release: true), - NSURLResponse.castFromPointer(arg3, + NSURLAuthenticationChallenge.castFromPointer(arg2, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionResponseDisposition - .castFromPointer(arg4, retain: false, release: true))); - final wrapper = _wrapListenerBlock_1nnj9ov(raw); + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential + .castFromPointer(arg3, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_12nszru(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)>(wrapper, + NSURLAuthenticationChallenge, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)>)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_CallExtension on objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)> { + NSURLAuthenticationChallenge, + objc.ObjCBlock)> { void call( ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDataTask arg2, - NSURLResponse arg3, - objc.ObjCBlock arg4) => + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -67364,140 +63652,92 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLRespo ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() + ffi.Pointer arg3)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, - arg0, - arg1.ref.pointer, - arg2.ref.pointer, - arg3.ref.pointer, - arg4.ref.pointer); + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); } -late final _sel_URLSession_dataTask_didBecomeDownloadTask_ = - objc.registerName("URLSession:dataTask:didBecomeDownloadTask:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable = +late final _sel_URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.registerName("URLSessionDidFinishEventsForBackgroundURLSession:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline) + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline( +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + ffi.Pointer, ffi.Pointer))(arg0, arg1); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline) + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask { +/// Construction methods for `objc.ObjCBlock, NSURLSession)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)> + static objc.ObjCBlock, NSURLSession)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)>(pointer, - retain: retain, release: release); + ffi.Void Function(ffi.Pointer, + NSURLSession)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable, ptr.cast()), + static objc.ObjCBlock, NSURLSession)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, NSURLSession)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -67506,21 +63746,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock, NSURLSession)> + fromFunction(void Function(ffi.Pointer, NSURLSession) fn) => + objc.ObjCBlock, NSURLSession)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -67531,134 +63768,274 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, - NSURLSessionDownloadTask) - fn) { + static objc.ObjCBlock, NSURLSession)> + listener(void Function(ffi.Pointer, NSURLSession) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable - .nativeFunction + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable.nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionDataTask.castFromPointer(arg2, - retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_1a6kixf(raw); + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjovn7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLSessionDownloadTask)>(wrapper, retain: false, release: true); + ffi.Void Function(ffi.Pointer, NSURLSession)>(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +/// Call operator for `objc.ObjCBlock, NSURLSession)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_CallExtension + on objc.ObjCBlock, NSURLSession)> { + void call(ffi.Pointer arg0, NSURLSession arg1) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer); } -late final _sel_URLSession_dataTask_didBecomeStreamTask_ = - objc.registerName("URLSession:dataTask:didBecomeStreamTask:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); +/// Messages related to the URL session as a whole +abstract final class NSURLSessionDelegate { + /// Builds an object that implements the NSURLSessionDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? + URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? + URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? + URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? + URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _protocol_NSURLSessionDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _protocol_NSURLSessionDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionTaskDelegate = + objc.getProtocol("NSURLSessionTaskDelegate"); +late final _sel_URLSession_didCreateTask_ = + objc.registerName("URLSession:didCreateTask:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { + ffi.Pointer arg2) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + ffi.Pointer))(arg0, arg1, arg2); objc.objectRelease(block.cast()); } @@ -67667,68 +64044,66 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)> + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionTask)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)>(pointer, - retain: retain, release: release); + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - NSURLSessionStreamTask.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -67740,45 +64115,36 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, - NSURLSessionStreamTask) - fn) { + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer(arg2, - retain: false, release: true), - NSURLSessionStreamTask.castFromPointer(arg3, + NSURLSessionTask.castFromPointer(arg2, retain: false, release: true))); - final wrapper = _wrapListenerBlock_1a6kixf(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLSessionStreamTask)>(wrapper, retain: false, release: true); + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)> { + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionTask)> { void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => + NSURLSessionTask arg2) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -67786,122 +64152,77 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessi ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() + ffi.Pointer arg2)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); } -late final _sel_URLSession_dataTask_didReceiveData_ = - objc.registerName("URLSession:dataTask:didReceiveData:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => + int arg0, + ffi.Pointer arg1) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); + .cast< + ffi.NativeFunction< + ffi.Void Function(NSInteger arg0, + ffi.Pointer arg1)>>() + .asFunction)>()( + arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable = + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Void Function(ffi.Pointer, NSInteger, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline) + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => + int arg0, + ffi.Pointer arg1) => (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + int, ffi.Pointer))(arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable = + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Void Function(ffi.Pointer, NSInteger, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline) + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { + int arg0, + ffi.Pointer arg1) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + int, ffi.Pointer))(arg0, arg1); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Void Function(ffi.Pointer, NSInteger, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable = + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable = ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Void Function(ffi.Pointer, NSInteger, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline) + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, objc.NSData)> + static objc.ObjCBlock castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - objc.NSData)>(pointer, retain: retain, release: release); + objc.ObjCBlock(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -67909,36 +64230,33 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, objc.NSData)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, objc.NSData)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + ffi.Void Function(NSInteger, NSURLRequest?)> fromFunctionPointer( + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - objc.NSData.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock + fromFunction(void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable, + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionDelayedRequestDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLRequest.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -67949,69 +64267,45 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, objc.NSData)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, - objc.NSData) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable + static objc.ObjCBlock listener( + void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionDataTask.castFromPointer(arg2, - retain: false, release: true), - objc.NSData.castFromPointer(arg3, + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionDelayedRequestDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLRequest.castFromPointer(arg1, retain: false, release: true))); - final wrapper = _wrapListenerBlock_1a6kixf(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_mn1xu3(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - objc.NSData)>(wrapper, retain: false, release: true); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, objc.NSData)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDataTask arg2, objc.NSData arg3) => +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_CallExtension + on objc.ObjCBlock { + void call(NSURLSessionDelayedRequestDisposition arg0, NSURLRequest? arg1) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() + ffi.Void Function(ffi.Pointer block, + NSInteger arg0, ffi.Pointer arg1)>>() .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); + void Function(ffi.Pointer, int, + ffi.Pointer)>()( + ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); } -late final _sel_URLSession_dataTask_willCacheResponse_completionHandler_ = objc - .registerName("URLSession:dataTask:willCacheResponse:completionHandler:"); +late final _sel_URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.registerName( + "URLSession:task:willBeginDelayedRequest:completionHandler:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, @@ -68036,7 +64330,7 @@ void ffi.Pointer)>()( arg0, arg1, arg2, arg3, arg4); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, @@ -68045,10 +64339,10 @@ ffi.Pointer ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, @@ -68062,7 +64356,7 @@ void ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, @@ -68071,10 +64365,10 @@ ffi.Pointer ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, @@ -68098,7 +64392,7 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, @@ -68107,28 +64401,28 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)> + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)>(pointer, retain: retain, release: release); + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -68139,17 +64433,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable, ptr.cast()), + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -68158,17 +64452,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>( + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable, + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - NSCachedURLResponse.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, retain: true, release: true))), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLRequest.castFromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.castFromPointer(arg4, retain: true, release: true))), retain: false, release: true); @@ -68182,21 +64476,22 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)> listener( - void Function( + ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock) - fn) { + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)> + listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock) + fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerCallable .nativeFunction .cast(), (ffi.Pointer arg0, @@ -68208,42 +64503,42 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDataTask.castFromPointer(arg2, + NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - NSCachedURLResponse.castFromPointer(arg3, + NSURLRequest.castFromPointer(arg3, retain: false, release: true), - ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_1nnj9ov(raw); + ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest + .castFromPointer(arg4, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1f43wec(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)>( + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)>( wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_CallExtension on objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)> { + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)> { void call( ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDataTask arg2, - NSCachedURLResponse arg3, - objc.ObjCBlock arg4) => + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock arg4) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -68270,1001 +64565,441 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedUR arg4.ref.pointer); } -/// Messages related to the operation of a task that writes data to a -/// file and notifies the delegate upon completion. -abstract final class NSURLSessionDownloadDelegate { - /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_ - .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ - .implement(builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ - .implement(builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionDownloadDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ - .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDownloadDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDownloadDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ - .implement(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ - .implement(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } +late final _sel_URLSession_taskIsWaitingForConnectivity_ = + objc.registerName("URLSession:taskIsWaitingForConnectivity:"); +late final _class_NSHTTPURLResponse = objc.getClass("NSHTTPURLResponse"); +late final _sel_initWithURL_statusCode_HTTPVersion_headerFields_ = + objc.registerName("initWithURL:statusCode:HTTPVersion:headerFields:"); +final _objc_msgSend_1pmy6mh = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_statusCode = objc.registerName("statusCode"); +late final _sel_allHeaderFields = objc.registerName("allHeaderFields"); +late final _sel_localizedStringForStatusCode_ = + objc.registerName("localizedStringForStatusCode:"); +final _objc_msgSend_8o14b = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); - /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_ - .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ - .implement(builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ - .implement(builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionDownloadDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ - .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDownloadDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDownloadDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ - .implement(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ - .implement(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } +/// NSHTTPURLResponse +class NSHTTPURLResponse extends NSURLResponse { + NSHTTPURLResponse._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_ - .implementAsListener( - builder, URLSession_downloadTask_didFinishDownloadingToURL_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ - .implementAsListener(builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ - .implementAsListener(builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionDownloadDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDownloadDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDownloadDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); + /// Constructs a [NSHTTPURLResponse] that points to the same underlying object as [other]. + NSHTTPURLResponse.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSHTTPURLResponse] that wraps the given raw object pointer. + NSHTTPURLResponse.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSHTTPURLResponse]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSHTTPURLResponse); } - /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_ - .implementAsListener( - builder, URLSession_downloadTask_didFinishDownloadingToURL_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ - .implementAsListener(builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ - .implementAsListener(builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionDownloadDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDownloadDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionDownloadDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDownloadDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); + /// ! + /// @method initWithURL:statusCode:HTTPVersion:headerFields: + /// @abstract initializer for NSHTTPURLResponse objects. + /// @param url the URL from which the response was generated. + /// @param statusCode an HTTP status code. + /// @param HTTPVersion The version of the HTTP response as represented by the server. This is typically represented as "HTTP/1.1". + /// @param headerFields A dictionary representing the header keys and values of the server response. + /// @result the instance of the object, or NULL if an error occurred during initialization. + /// @discussion This API was introduced in Mac OS X 10.7.2 and iOS 5.0 and is not available prior to those releases. + NSHTTPURLResponse? initWithURL_statusCode_HTTPVersion_headerFields_( + objc.NSURL url, + DartNSInteger statusCode, + objc.NSString? HTTPVersion, + objc.NSDictionary? headerFields) { + final _ret = _objc_msgSend_1pmy6mh( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_statusCode_HTTPVersion_headerFields_, + url.ref.pointer, + statusCode, + HTTPVersion?.ref.pointer ?? ffi.nullptr, + headerFields?.ref.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); } - /// Sent when a download task that has completed a download. The delegate should - /// copy or move the file at the given location to a new location as it will be - /// removed when the delegate message returns. URLSession:task:didCompleteWithError: will - /// still be called. - static final URLSession_downloadTask_didFinishDownloadingToURL_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( - _sel_URLSession_downloadTask_didFinishDownloadingToURL_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didFinishDownloadingToURL_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, objc.NSURL arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, objc.NSURL arg3) => - func(arg1, arg2, arg3)), - ); + /// ! + /// @abstract Returns the HTTP status code of the receiver. + /// @result The HTTP status code of the receiver. + DartNSInteger get statusCode { + return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_statusCode); + } - /// Sent periodically to notify the delegate of download progress. - static final URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)>( - _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDownloadTask arg2, - int arg3, - int arg4, - int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDownloadTask arg2, - int arg3, - int arg4, - int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); + /// ! + /// @abstract Returns a dictionary containing all the HTTP header fields + /// of the receiver. + /// @discussion By examining this header dictionary, clients can see + /// the "raw" header information which was reported to the protocol + /// implementation by the HTTP server. This may be of use to + /// sophisticated or special-purpose HTTP clients. + /// @result A dictionary containing all the HTTP header fields of the + /// receiver. + objc.NSDictionary get allHeaderFields { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allHeaderFields); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } - /// Sent when a download has been resumed. If a download failed with an - /// error, the -userInfo dictionary of the error will contain an - /// NSURLSessionDownloadTaskResumeData key, whose value is the resume - /// data. - static final URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)>( - _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDownloadTask, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, int arg3, int arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionDownloadTask, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, int arg3, int arg4) => - func(arg1, arg2, arg3, arg4)), - ); + /// ! + /// @method valueForHTTPHeaderField: + /// @abstract Returns the value which corresponds to the given header + /// field. Note that, in keeping with the HTTP RFC, HTTP header field + /// names are case-insensitive. + /// @param field the header field name to use for the lookup + /// (case-insensitive). + /// @result the value associated with the given header field, or nil if + /// there is no value associated with the given header field. + objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } - /// Notification that a task has been created. This method is the first message - /// a task sends, providing a place to configure the task before it is resumed. - /// - /// This delegate callback is *NOT* dispatched to the delegate queue. It is - /// invoked synchronously before the task creation method returns. - static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _sel_URLSession_didCreateTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_didCreateTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); + /// ! + /// @method localizedStringForStatusCode: + /// @abstract Convenience method which returns a localized string + /// corresponding to the status code for this response. + /// @param statusCode the status code to use to produce a localized string. + /// @result A localized string corresponding to the given status code. + static objc.NSString localizedStringForStatusCode_(DartNSInteger statusCode) { + final _ret = _objc_msgSend_8o14b(_class_NSHTTPURLResponse, + _sel_localizedStringForStatusCode_, statusCode); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } - /// Sent when the system is ready to begin work for a task with a delayed start - /// time set (using the earliestBeginDate property). The completionHandler must - /// be invoked in order for loading to proceed. The disposition provided to the - /// completion handler continues the load with the original request provided to - /// the task, replaces the request with the specified task, or cancels the task. - /// If this delegate is not implemented, loading will proceed with the original - /// request. - /// - /// Recommendation: only implement this delegate if tasks that have the - /// earliestBeginDate property set may become stale and require alteration prior - /// to starting the network load. + /// ! + /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: + /// @abstract Initialize an NSURLResponse with the provided values. + /// @param URL the URL + /// @param MIMEType the MIME content type of the response + /// @param length the expected content length of the associated data + /// @param name the name of the text encoding for the associated data, if applicable, else nil + /// @result The initialized NSURLResponse. + /// @discussion This is the designated initializer for NSURLResponse. + NSHTTPURLResponse + initWithURL_MIMEType_expectedContentLength_textEncodingName_( + objc.NSURL URL, + objc.NSString? MIMEType, + DartNSInteger length, + objc.NSString? name) { + final _ret = _objc_msgSend_13tl325( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, + URL.ref.pointer, + MIMEType?.ref.pointer ?? ffi.nullptr, + length, + name?.ref.pointer ?? ffi.nullptr); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// init + NSHTTPURLResponse init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// new + static NSHTTPURLResponse new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSHTTPURLResponse, _sel_new); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// allocWithZone: + static NSHTTPURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_hzlb60( + _class_NSHTTPURLResponse, _sel_allocWithZone_, zone); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSHTTPURLResponse alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSHTTPURLResponse, _sel_alloc); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); + } + + /// self + NSHTTPURLResponse self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); + } + + /// retain + NSHTTPURLResponse retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); + } + + /// autorelease + NSHTTPURLResponse autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSHTTPURLResponse.castFromPointer(_ret, retain: true, release: true); + } + + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_91o635( + _class_NSHTTPURLResponse, _sel_supportsSecureCoding); + } + + /// initWithCoder: + NSHTTPURLResponse? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); + } +} + +void _ObjCBlock_ffiVoid_NSURLRequest_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSURLRequest_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLRequest_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLRequest_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSURLRequest_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLRequest_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLRequest_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLRequest_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLRequest_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLRequest { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. /// - /// If a new request is specified, the allowsExpensiveNetworkAccess, - /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties - /// from the new request will not be used; the properties from the - /// original request will continue to be used. + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLRequest_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. /// - /// Canceling the task is equivalent to calling the task's cancel method; the - /// URLSession:task:didCompleteWithError: task delegate will be called with error - /// NSURLErrorCancelled. - static final URLSession_task_willBeginDelayedRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)>( - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(NSURLRequest?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLRequest_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSURLRequest.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); - /// Sent when a task cannot start the network loading process because the current - /// network connectivity is not available or sufficient for the task's request. + /// Creates a listener block from a Dart function. /// - /// This delegate will be called at most one time per task, and is only called if - /// the waitsForConnectivity property in the NSURLSessionConfiguration has been - /// set to YES. + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. /// - /// This delegate callback will never be called for background sessions, because - /// the waitForConnectivity property is ignored by those sessions. - static final URLSession_taskIsWaitingForConnectivity_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _sel_URLSession_taskIsWaitingForConnectivity_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(NSURLRequest?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLRequest_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSURLRequest.castFromPointer(arg0, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } +} - /// An HTTP request is attempting to perform a redirection to a different - /// URL. You must invoke the completion routine to allow the - /// redirection, allow the redirection with a modified request, or - /// pass nil to the completionHandler to cause the body of the redirection - /// response to be delivered as the payload of this request. The default - /// is to follow redirections. - /// - /// For tasks in background sessions, redirections will always be followed and this method will not be called. - static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)>( - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); - - /// The task has received a request specific authentication challenge. - /// If this delegate is not implemented, the session specific authentication challenge - /// will *NOT* be called and the behavior will be the same as using the default handling - /// disposition. - static final URLSession_task_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent if a task requires a new, unopened body stream. This may be - /// necessary when authentication has failed for any request that - /// involves a body stream. - static final URLSession_task_needNewBodyStream_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)>( - _sel_URLSession_task_needNewBodyStream_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_needNewBodyStream_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - ); - - /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be - /// necessary when resuming a failed upload task. - /// - /// - Parameter session: The session containing the task that needs a new body stream from the given offset. - /// - Parameter task: The task that needs a new body stream. - /// - Parameter offset: The starting offset required for the body stream. - /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)>( - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent periodically to notify the delegate of upload progress. This - /// information is also available as properties of the task. - static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, int, int)>( - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); - - /// Sent for each informational response received except 101 switching protocols. - static final URLSession_task_didReceiveInformationalResponse_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - _sel_URLSession_task_didReceiveInformationalResponse_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - ); - - /// Sent when complete statistics information has been collected for the task. - static final URLSession_task_didFinishCollectingMetrics_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - _sel_URLSession_task_didFinishCollectingMetrics_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - ); - - /// Sent as the last message related to a specific task. Error may be - /// nil, which implies that no error occurred and this task is complete. - static final URLSession_task_didCompleteWithError_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( - _sel_URLSession_task_didCompleteWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_task_didCompleteWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - ); - - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = objc - .ObjCProtocolListenableMethod( - _sel_URLSession_didBecomeInvalidWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - ); - - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - ); - - /// If an application has received an - /// -application:handleEventsForBackgroundURLSession:completionHandler: - /// message, the session delegate will receive this message to indicate - /// that all messages previously enqueued for this session have been - /// delivered. At this time it is safe to invoke the previously stored - /// completion handler, or to begin any internal updates that will - /// result in invoking the completion handler. - static final URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.ObjCProtocolListenableMethod( - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - ); +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLRequest_CallExtension + on objc.ObjCBlock { + void call(NSURLRequest? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); } -late final _protocol_NSURLSessionDownloadDelegate = - objc.getProtocol("NSURLSessionDownloadDelegate"); -late final _sel_URLSession_downloadTask_didFinishDownloadingToURL_ = - objc.registerName("URLSession:downloadTask:didFinishDownloadingToURL:"); +late final _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.registerName( + "URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3) => + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4, arg5); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline) + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3) => + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5) => (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))( + arg0, arg1, arg2, arg3, arg4, arg5); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline) + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3) { + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4, arg5); objc.objectRelease(block.cast()); } @@ -69274,32 +65009,43 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable = + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline) + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)> + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, - objc.NSURL)>(pointer, retain: retain, release: release); + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -69307,36 +65053,44 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4, ffi.Pointer arg5)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4, ffi.Pointer arg5) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), - objc.NSURL.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSHTTPURLResponse.castFromPointer(arg3, retain: true, release: true), + NSURLRequest.castFromPointer(arg4, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -69348,45 +65102,74 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)> listener( - void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL) + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)> listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerCallable .nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3) => + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, + NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - objc.NSURL - .castFromPointer(arg3, retain: false, release: true))); - final wrapper = _wrapListenerBlock_1a6kixf(raw); + NSHTTPURLResponse.castFromPointer(arg3, + retain: false, release: true), + NSURLRequest.castFromPointer(arg4, + retain: false, release: true), + ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_13vswqm(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - objc.NSURL)>(wrapper, retain: false, release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)>(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -69395,105 +65178,106 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_ ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3)>>() + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer, + arg5.ref.pointer); } -late final _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = - objc.registerName( - "URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:"); +late final _sel_URLSession_task_didReceiveChallenge_completionHandler_ = + objc.registerName("URLSession:task:didReceiveChallenge:completionHandler:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => + ffi.Pointer arg3, + ffi.Pointer arg4) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4, - ffi.Int64 arg5)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int)>()(arg0, arg1, arg2, arg3, arg4, arg5); + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline) + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => + ffi.Pointer arg3, + ffi.Pointer arg4) => (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - int, - int, - int))(arg0, arg1, arg2, arg3, arg4, arg5); + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline) + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) { + ffi.Pointer arg3, + ffi.Pointer arg4) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - int, - int, - int))(arg0, arg1, arg2, arg3, arg4, arg5); + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); objc.objectRelease(block.cast()); } @@ -69503,38 +65287,39 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable = + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline) + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ffi.Int64)>(pointer, retain: retain, release: release); + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -69545,14 +65330,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ffi.Int64)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5)>> ptr) => + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable, ptr.cast()), + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -69561,25 +65349,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int, int) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => - fn( + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), - arg3, - arg4, - arg5)), - retain: false, - release: true); + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLAuthenticationChallenge.castFromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -69591,50 +65373,69 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> listener( - void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, int, int, int) + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)>)> listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable .nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => + ffi.Pointer arg3, + ffi.Pointer arg4) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, + NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), - arg3, - arg4, - arg5)); - final wrapper = _wrapListenerBlock_jzggzf(raw); + NSURLAuthenticationChallenge.castFromPointer(arg3, + retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential + .castFromPointer(arg4, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1f43wec(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ffi.Int64)>(wrapper, retain: false, release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)>)>(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDownloadTask arg2, int arg3, int arg4, int arg5) => + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock + arg4) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -69643,32 +65444,150 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_ ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4, - ffi.Int64 arg5)>>() + ffi.Pointer arg3, + ffi.Pointer arg4)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - int, - int, - int)>()(ref.pointer, arg0, arg1.ref.pointer, - arg2.ref.pointer, arg3, arg4, arg5); + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer, arg4.ref.pointer); } -late final _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = - objc.registerName( - "URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:"); +void _ObjCBlock_ffiVoid_NSInputStream_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSInputStream_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSInputStream_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSInputStream_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSInputStream_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSInputStream_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSInputStream_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSInputStream_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSInputStream_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSInputStream { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSInputStream_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(objc.NSInputStream?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSInputStream_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSInputStream.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(objc.NSInputStream?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSInputStream_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSInputStream.castFromPointer(arg0, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSInputStream_CallExtension + on objc.ObjCBlock { + void call(objc.NSInputStream? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_URLSession_task_needNewBodyStream_ = + objc.registerName("URLSession:task:needNewBodyStream:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4) => + ffi.Pointer arg3) => block.ref.target .cast< ffi.NativeFunction< @@ -69676,67 +65595,292 @@ void ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4)>>() + ffi.Pointer arg3)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - int, - int)>()(arg0, arg1, arg2, arg3, arg4); + ffi.Pointer)>()(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Int64)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4) => + ffi.Pointer arg3) => (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - int, - int))(arg0, arg1, arg2, arg3, arg4); + ffi.Pointer))(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Int64)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.ObjCBlock)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_12nszru(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} + +late final _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.registerName( + "URLSession:task:needNewBodyStreamFromOffset:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, - int arg4) { + ffi.Pointer arg4) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, int, - int))(arg0, arg1, arg2, arg3, arg4); + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); objc.objectRelease(block.cast()); } @@ -69747,8 +65891,8 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Int64, - ffi.Int64)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable = + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, @@ -69756,39 +65900,47 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Int64, - ffi.Int64)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline) + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, + NSURLSessionTask, ffi.Int64, - ffi.Int64)>(pointer, retain: retain, release: release); + objc.ObjCBlock)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4)>> ptr) => + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Pointer arg4)>> ptr) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable, ptr.cast()), + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrCallable, + ptr.cast()), retain: false, release: true); @@ -69797,17 +65949,17 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, int arg4) => fn( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, ffi.Pointer arg4) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), arg3, - arg4)), + ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, retain: true, release: true))), retain: false, release: true); @@ -69821,44 +65973,63 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> listener( - void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, int, int) + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, int arg3, int arg4) => + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, + NSURLSessionTask.castFromPointer(arg2, retain: false, release: true), arg3, - arg4)); - final wrapper = _wrapListenerBlock_1wl7fts(raw); + ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_qm01og(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64)>(wrapper, retain: false, release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDownloadTask arg2, int arg3, int arg4) => + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock arg4) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -69868,7 +66039,7 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_ ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, - ffi.Int64 arg4)>>() + ffi.Pointer arg4)>>() .asFunction< void Function( ffi.Pointer, @@ -69876,9546 +66047,26226 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_ ffi.Pointer, ffi.Pointer, int, - int)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3, arg4); + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3, arg4.ref.pointer); } -/// NSURLSessionStreamDelegate -abstract final class NSURLSessionStreamDelegate { - /// Builds an object that implements the NSURLSessionStreamDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_readClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_writeClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_betterRouteDiscoveredForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? - URLSession_streamTask_didBecomeInputStream_outputStream_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_.implement( - builder, URLSession_readClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_.implement( - builder, URLSession_writeClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ - .implement(builder, URLSession_betterRouteDiscoveredForStreamTask_); - NSURLSessionStreamDelegate - .URLSession_streamTask_didBecomeInputStream_outputStream_ - .implement( - builder, URLSession_streamTask_didBecomeInputStream_outputStream_); - NSURLSessionStreamDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionStreamDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ - .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionStreamDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionStreamDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionStreamDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionStreamDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } - - /// Adds the implementation of the NSURLSessionStreamDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_readClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_writeClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_betterRouteDiscoveredForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? - URLSession_streamTask_didBecomeInputStream_outputStream_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_.implement( - builder, URLSession_readClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_.implement( - builder, URLSession_writeClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ - .implement(builder, URLSession_betterRouteDiscoveredForStreamTask_); - NSURLSessionStreamDelegate - .URLSession_streamTask_didBecomeInputStream_outputStream_ - .implement( - builder, URLSession_streamTask_didBecomeInputStream_outputStream_); - NSURLSessionStreamDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionStreamDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ - .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionStreamDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionStreamDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionStreamDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionStreamDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } +late final _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.registerName( + "URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int)>()(arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int))(arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int))(arg0, arg1, arg2, arg3, arg4, arg5); + objc.objectRelease(block.cast()); +} - /// Builds an object that implements the NSURLSessionStreamDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_readClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_writeClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_betterRouteDiscoveredForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? - URLSession_streamTask_didBecomeInputStream_outputStream_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_ - .implementAsListener(builder, URLSession_readClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_ - .implementAsListener(builder, URLSession_writeClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ - .implementAsListener( - builder, URLSession_betterRouteDiscoveredForStreamTask_); - NSURLSessionStreamDelegate - .URLSession_streamTask_didBecomeInputStream_outputStream_ - .implementAsListener( - builder, URLSession_streamTask_didBecomeInputStream_outputStream_); - NSURLSessionStreamDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionStreamDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionStreamDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionStreamDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionStreamDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionStreamDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerTrampoline) + ..keepIsolateAlive = false; - /// Adds the implementation of the NSURLSessionStreamDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_readClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_writeClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_betterRouteDiscoveredForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? - URLSession_streamTask_didBecomeInputStream_outputStream_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_ - .implementAsListener(builder, URLSession_readClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_ - .implementAsListener(builder, URLSession_writeClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ - .implementAsListener( - builder, URLSession_betterRouteDiscoveredForStreamTask_); - NSURLSessionStreamDelegate - .URLSession_streamTask_didBecomeInputStream_outputStream_ - .implementAsListener( - builder, URLSession_streamTask_didBecomeInputStream_outputStream_); - NSURLSessionStreamDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionStreamDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionStreamDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionStreamDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionStreamDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionStreamDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, int, int) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + arg3, + arg4, + arg5)), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + ffi.Int64, ffi.Int64, ffi.Int64)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, + int, int) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + arg3, + arg4, + arg5)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1uuez7b(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)>(wrapper, retain: false, release: true); } +} - /// Indicates that the read side of a connection has been closed. Any - /// outstanding reads complete, but future reads will immediately fail. - /// This may be sent even when no reads are in progress. However, when - /// this delegate message is received, there may still be bytes - /// available. You only know that no more bytes are available when you - /// are able to read until EOF. - static final URLSession_readClosedForStreamTask_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionStreamTask)>( - _sel_URLSession_readClosedForStreamTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_readClosedForStreamTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), - ); +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + ffi.Int64, ffi.Int64, ffi.Int64)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int)>()(ref.pointer, arg0, arg1.ref.pointer, + arg2.ref.pointer, arg3, arg4, arg5); +} + +late final _sel_URLSession_task_didReceiveInformationalResponse_ = + objc.registerName("URLSession:task:didReceiveInformationalResponse:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSHTTPURLResponse)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSHTTPURLResponse)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSHTTPURLResponse)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSHTTPURLResponse.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSHTTPURLResponse)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSHTTPURLResponse) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + NSHTTPURLResponse.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSHTTPURLResponse)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSHTTPURLResponse)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} + +/// WARNING: NSURLSessionTaskMetrics is a stub. To generate bindings for this class, include +/// NSURLSessionTaskMetrics in your config's objc-interfaces list. +/// +/// NSURLSessionTaskMetrics +class NSURLSessionTaskMetrics extends objc.NSObject { + NSURLSessionTaskMetrics._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionTaskMetrics] that points to the same underlying object as [other]. + NSURLSessionTaskMetrics.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionTaskMetrics] that wraps the given raw object pointer. + NSURLSessionTaskMetrics.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +late final _sel_URLSession_task_didFinishCollectingMetrics_ = + objc.registerName("URLSession:task:didFinishCollectingMetrics:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLSessionTaskMetrics.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + NSURLSessionTaskMetrics.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} + +late final _sel_URLSession_task_didCompleteWithError_ = + objc.registerName("URLSession:task:didCompleteWithError:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, objc.NSError?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.NSError?)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, objc.NSError?)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, objc.NSError?)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + arg3.address == 0 ? null : objc.NSError.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + arg3.address == 0 + ? null + : objc.NSError.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3?.ref.pointer ?? ffi.nullptr); +} + +/// Messages related to the operation of a specific task. +abstract final class NSURLSessionTaskDelegate { + /// Builds an object that implements the NSURLSessionTaskDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function( + NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionTaskDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionTaskDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionTaskDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionTaskDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionTaskDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)? + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionTaskDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionTaskDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionTaskDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionTaskDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionTaskDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function( + NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionTaskDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionTaskDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionTaskDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionTaskDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionTaskDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)? + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionTaskDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionTaskDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionTaskDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionTaskDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_didCreateTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + static final URLSession_task_needNewBodyStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_needNewBodyStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_needNewBodyStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + ); + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didCompleteWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didCompleteWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + ); + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionDataDelegate = + objc.getProtocol("NSURLSessionDataDelegate"); +void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline( + ffi.Pointer block, int arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger)>( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline( + ffi.Pointer block, int arg0) => + (objc.getBlockClosure(block) as void Function(int))(arg0); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger)>( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline( + ffi.Pointer block, int arg0) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger)> + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, NSInteger)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(NSURLSessionResponseDisposition) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable, + (int arg0) => + fn(NSURLSessionResponseDisposition.fromValue(arg0))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(NSURLSessionResponseDisposition) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable + .nativeFunction + .cast(), + (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_16sve1d(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_CallExtension + on objc.ObjCBlock { + void call(NSURLSessionResponseDisposition arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, NSInteger arg0)>>() + .asFunction, int)>()( + ref.pointer, arg0.value); +} + +late final _sel_URLSession_dataTask_didReceiveResponse_completionHandler_ = objc + .registerName("URLSession:dataTask:didReceiveResponse:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSURLResponse.castFromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + NSURLResponse, objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSURLResponse.castFromPointer(arg3, + retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition + .castFromPointer(arg4, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1f43wec(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)>(wrapper, + retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer); +} + +late final _sel_URLSession_dataTask_didBecomeDownloadTask_ = + objc.registerName("URLSession:dataTask:didBecomeDownloadTask:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + NSURLSessionDownloadTask) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLSessionDownloadTask)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} + +late final _sel_URLSession_dataTask_didBecomeStreamTask_ = + objc.registerName("URLSession:dataTask:didBecomeStreamTask:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSURLSessionStreamTask.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + NSURLSessionStreamTask) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSURLSessionStreamTask.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLSessionStreamTask)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} + +late final _sel_URLSession_dataTask_didReceiveData_ = + objc.registerName("URLSession:dataTask:didReceiveData:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + objc.NSData)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + objc.NSData.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + objc.NSData) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + objc.NSData.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + objc.NSData)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDataTask arg2, objc.NSData arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} + +late final _sel_URLSession_dataTask_willCacheResponse_completionHandler_ = objc + .registerName("URLSession:dataTask:willCacheResponse:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSCachedURLResponse.castFromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSCachedURLResponse.castFromPointer(arg3, + retain: false, release: true), + ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1f43wec(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSCachedURLResponse arg3, + objc.ObjCBlock arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer); +} + +/// Messages related to the operation of a task that delivers data +/// directly to the delegate. +abstract final class NSURLSessionDataDelegate { + /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implement(builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( + builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( + builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionDataDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDataDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionDataDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implement(builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( + builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( + builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionDataDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDataDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionDataDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ + .implementAsListener( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implementAsListener( + builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_ + .implementAsListener(builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ + .implementAsListener(builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implementAsListener( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionDataDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDataDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionDataDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ + .implementAsListener( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implementAsListener( + builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_ + .implementAsListener(builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ + .implementAsListener(builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implementAsListener( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionDataDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDataDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionDataDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// The task has received a response and no further messages will be + /// received until the completion block is called. The disposition + /// allows you to cancel a request or to turn a data task into a + /// download task. This delegate message is optional - if you do not + /// implement it, you can get the response as a property of the task. + /// + /// This method will not be called for background upload tasks (which cannot be converted to download tasks). + static final URLSession_dataTask_didReceiveResponse_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, + objc.ObjCBlock)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a data task has become a download task. No + /// future messages will be sent to the data task. + static final URLSession_dataTask_didBecomeDownloadTask_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didBecomeDownloadTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didBecomeDownloadTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => + func(arg1, arg2, arg3)), + ); + + /// Notification that a data task has become a bidirectional stream + /// task. No future messages will be sent to the data task. The newly + /// created streamTask will carry the original request and response as + /// properties. + /// + /// For requests that were pipelined, the stream object will only allow + /// reading, and the object will immediately issue a + /// -URLSession:writeClosedForStream:. Pipelining can be disabled for + /// all requests in a session, or by the NSURLRequest + /// HTTPShouldUsePipelining property. + /// + /// The underlying connection is no longer considered part of the HTTP + /// connection cache and won't count against the total number of + /// connections per host. + static final URLSession_dataTask_didBecomeStreamTask_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didBecomeStreamTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didBecomeStreamTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when data is available for the delegate to consume. As the + /// data may be discontiguous, you should use + /// [NSData enumerateByteRangesUsingBlock:] to access it. + static final URLSession_dataTask_didReceiveData_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveData_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveData_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, objc.NSData) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, objc.NSData arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDataTask, objc.NSData) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, objc.NSData arg3) => + func(arg1, arg2, arg3)), + ); + + /// Invoke the completion routine with a valid NSCachedURLResponse to + /// allow the resulting data to be cached, or pass nil to prevent + /// caching. Note that there is no guarantee that caching will be + /// attempted for a given resource, and you should not rely on this + /// message to receive the resource data. + static final URLSession_dataTask_willCacheResponse_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_willCacheResponse_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_willCacheResponse_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSCachedURLResponse arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSCachedURLResponse arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didCreateTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + static final URLSession_task_needNewBodyStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_needNewBodyStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_needNewBodyStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + ); + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didCompleteWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didCompleteWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + ); + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _protocol_NSURLSessionDataDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionDownloadDelegate = + objc.getProtocol("NSURLSessionDownloadDelegate"); +late final _sel_URLSession_downloadTask_didFinishDownloadingToURL_ = + objc.registerName("URLSession:downloadTask:didFinishDownloadingToURL:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + objc.NSURL)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + objc.NSURL.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, + retain: false, release: true), + objc.NSURL + .castFromPointer(arg3, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + objc.NSURL)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} + +late final _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = + objc.registerName( + "URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int)>()(arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int))(arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int))(arg0, arg1, arg2, arg3, arg4, arg5); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int, int) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + arg3, + arg4, + arg5)), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, int, int, int) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, + retain: false, release: true), + arg3, + arg4, + arg5)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1uuez7b(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDownloadTask arg2, int arg3, int arg4, int arg5) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int)>()(ref.pointer, arg0, arg1.ref.pointer, + arg2.ref.pointer, arg3, arg4, arg5); +} + +late final _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = + objc.registerName( + "URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int)>()(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, int arg4) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + arg3, + arg4)), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, int, int) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, + retain: false, release: true), + arg3, + arg4)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_9qxjkl(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDownloadTask arg2, int arg3, int arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3, arg4); +} + +/// Messages related to the operation of a task that writes data to a +/// file and notifies the delegate upon completion. +abstract final class NSURLSessionDownloadDelegate { + /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ + .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implement(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implement(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionDownloadDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDownloadDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionDownloadDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ + .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implement(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implement(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionDownloadDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDownloadDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionDownloadDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ + .implementAsListener( + builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implementAsListener(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implementAsListener(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionDownloadDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDownloadDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionDownloadDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ + .implementAsListener( + builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implementAsListener(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implementAsListener(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionDownloadDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDownloadDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionDownloadDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Sent when a download task that has completed a download. The delegate should + /// copy or move the file at the given location to a new location as it will be + /// removed when the delegate message returns. URLSession:task:didCompleteWithError: will + /// still be called. + static final URLSession_downloadTask_didFinishDownloadingToURL_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didFinishDownloadingToURL_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didFinishDownloadingToURL_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent periodically to notify the delegate of download progress. + static final URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDownloadTask arg2, + int arg3, + int arg4, + int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDownloadTask arg2, + int arg3, + int arg4, + int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent when a download has been resumed. If a download failed with an + /// error, the -userInfo dictionary of the error will contain an + /// NSURLSessionDownloadTaskResumeData key, whose value is the resume + /// data. + static final URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDownloadTask arg2, int arg3, int arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDownloadTask arg2, int arg3, int arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didCreateTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + static final URLSession_task_needNewBodyStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_needNewBodyStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_needNewBodyStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + ); + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didCompleteWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didCompleteWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + ); + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionStreamDelegate = + objc.getProtocol("NSURLSessionStreamDelegate"); +late final _sel_URLSession_readClosedForStreamTask_ = + objc.registerName("URLSession:readClosedForStreamTask:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionStreamTask)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionStreamTask.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionStreamTask.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionStreamTask)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); +} + +late final _sel_URLSession_writeClosedForStreamTask_ = + objc.registerName("URLSession:writeClosedForStreamTask:"); +late final _sel_URLSession_betterRouteDiscoveredForStreamTask_ = + objc.registerName("URLSession:betterRouteDiscoveredForStreamTask:"); +late final _sel_URLSession_streamTask_didBecomeInputStream_outputStream_ = objc + .registerName("URLSession:streamTask:didBecomeInputStream:outputStream:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionStreamTask, + objc.NSInputStream, + objc.NSOutputStream)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionStreamTask, + objc.NSInputStream, + objc.NSOutputStream)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionStreamTask.castFromPointer(arg2, retain: true, release: true), + objc.NSInputStream.castFromPointer(arg3, retain: true, release: true), + objc.NSOutputStream.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionStreamTask, + objc.NSInputStream, + objc.NSOutputStream)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask, + objc.NSInputStream, objc.NSOutputStream) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionStreamTask.castFromPointer(arg2, + retain: false, release: true), + objc.NSInputStream.castFromPointer(arg3, + retain: false, release: true), + objc.NSOutputStream.castFromPointer(arg4, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_62mtml(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionStreamTask, + objc.NSInputStream, + objc.NSOutputStream)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionStreamTask arg2, + objc.NSInputStream arg3, + objc.NSOutputStream arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer); +} + +/// NSURLSessionStreamDelegate +abstract final class NSURLSessionStreamDelegate { + /// Builds an object that implements the NSURLSessionStreamDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_readClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_writeClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_betterRouteDiscoveredForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? + URLSession_streamTask_didBecomeInputStream_outputStream_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_.implement( + builder, URLSession_readClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_.implement( + builder, URLSession_writeClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ + .implement(builder, URLSession_betterRouteDiscoveredForStreamTask_); + NSURLSessionStreamDelegate + .URLSession_streamTask_didBecomeInputStream_outputStream_ + .implement( + builder, URLSession_streamTask_didBecomeInputStream_outputStream_); + NSURLSessionStreamDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionStreamDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionStreamDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionStreamDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionStreamDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_readClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_writeClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_betterRouteDiscoveredForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? + URLSession_streamTask_didBecomeInputStream_outputStream_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_.implement( + builder, URLSession_readClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_.implement( + builder, URLSession_writeClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ + .implement(builder, URLSession_betterRouteDiscoveredForStreamTask_); + NSURLSessionStreamDelegate + .URLSession_streamTask_didBecomeInputStream_outputStream_ + .implement( + builder, URLSession_streamTask_didBecomeInputStream_outputStream_); + NSURLSessionStreamDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionStreamDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionStreamDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionStreamDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionStreamDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_readClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_writeClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_betterRouteDiscoveredForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? + URLSession_streamTask_didBecomeInputStream_outputStream_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_ + .implementAsListener(builder, URLSession_readClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_ + .implementAsListener(builder, URLSession_writeClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ + .implementAsListener( + builder, URLSession_betterRouteDiscoveredForStreamTask_); + NSURLSessionStreamDelegate + .URLSession_streamTask_didBecomeInputStream_outputStream_ + .implementAsListener( + builder, URLSession_streamTask_didBecomeInputStream_outputStream_); + NSURLSessionStreamDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionStreamDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionStreamDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionStreamDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionStreamDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_readClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_writeClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_betterRouteDiscoveredForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? + URLSession_streamTask_didBecomeInputStream_outputStream_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_ + .implementAsListener(builder, URLSession_readClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_ + .implementAsListener(builder, URLSession_writeClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ + .implementAsListener( + builder, URLSession_betterRouteDiscoveredForStreamTask_); + NSURLSessionStreamDelegate + .URLSession_streamTask_didBecomeInputStream_outputStream_ + .implementAsListener( + builder, URLSession_streamTask_didBecomeInputStream_outputStream_); + NSURLSessionStreamDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionStreamDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionStreamDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionStreamDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Indicates that the read side of a connection has been closed. Any + /// outstanding reads complete, but future reads will immediately fail. + /// This may be sent even when no reads are in progress. However, when + /// this delegate message is received, there may still be bytes + /// available. You only know that no more bytes are available when you + /// are able to read until EOF. + static final URLSession_readClosedForStreamTask_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionStreamTask)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_readClosedForStreamTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_readClosedForStreamTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + ); + + /// Indicates that the write side of a connection has been closed. + /// Any outstanding writes complete, but future writes will immediately + /// fail. + static final URLSession_writeClosedForStreamTask_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionStreamTask)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_writeClosedForStreamTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_writeClosedForStreamTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + ); + + /// A notification that the system has determined that a better route + /// to the host has been detected (eg, a wi-fi interface becoming + /// available.) This is a hint to the delegate that it may be + /// desirable to create a new task for subsequent work. Note that + /// there is no guarantee that the future task will be able to connect + /// to the host, so callers should should be prepared for failure of + /// reads and writes over any new interface. + static final URLSession_betterRouteDiscoveredForStreamTask_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionStreamTask)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_betterRouteDiscoveredForStreamTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_betterRouteDiscoveredForStreamTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + ); + + /// The given task has been completed, and unopened NSInputStream and + /// NSOutputStream objects are created from the underlying network + /// connection. This will only be invoked after all enqueued IO has + /// completed (including any necessary handshakes.) The streamTask + /// will not receive any further delegate messages. + static final URLSession_streamTask_didBecomeInputStream_outputStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionStreamTask, + objc.NSInputStream, objc.NSOutputStream)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_streamTask_didBecomeInputStream_outputStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_streamTask_didBecomeInputStream_outputStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, + objc.NSOutputStream) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionStreamTask arg2, + objc.NSInputStream arg3, + objc.NSOutputStream arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, + objc.NSOutputStream) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionStreamTask arg2, + objc.NSInputStream arg3, + objc.NSOutputStream arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_didCreateTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + static final URLSession_task_needNewBodyStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_needNewBodyStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_needNewBodyStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + ); + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didCompleteWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didCompleteWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + ); + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionWebSocketDelegate = + objc.getProtocol("NSURLSessionWebSocketDelegate"); +late final _sel_URLSession_webSocketTask_didOpenWithProtocol_ = + objc.registerName("URLSession:webSocketTask:didOpenWithProtocol:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionWebSocketTask, + objc.NSString?)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionWebSocketTask.castFromPointer(arg2, retain: true, release: true), + arg3.address == 0 ? null : objc.NSString.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionWebSocketTask.castFromPointer(arg2, + retain: false, release: true), + arg3.address == 0 + ? null + : objc.NSString.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionWebSocketTask, + objc.NSString?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionWebSocketTask arg2, objc.NSString? arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_URLSession_webSocketTask_didCloseWithCode_reason_ = + objc.registerName("URLSession:webSocketTask:didCloseWithCode:reason:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + NSInteger arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionWebSocketTask, + NSInteger, + objc.NSData?)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, NSInteger arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionWebSocketTask.castFromPointer(arg2, retain: true, release: true), + arg3, + arg4.address == 0 ? null : objc.NSData.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionWebSocketTask.castFromPointer(arg2, + retain: false, release: true), + arg3, + arg4.address == 0 + ? null + : objc.NSData.castFromPointer(arg4, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_3lo3bb(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionWebSocketTask, + NSInteger, + objc.NSData?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionWebSocketTask arg2, + DartNSInteger arg3, + objc.NSData? arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + NSInteger arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3, + arg4?.ref.pointer ?? ffi.nullptr); +} + +/// NSURLSessionWebSocketDelegate +abstract final class NSURLSessionWebSocketDelegate { + /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ + .implement(builder, URLSession_webSocketTask_didOpenWithProtocol_); + NSURLSessionWebSocketDelegate + .URLSession_webSocketTask_didCloseWithCode_reason_ + .implement(builder, URLSession_webSocketTask_didCloseWithCode_reason_); + NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionWebSocketDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionWebSocketDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionWebSocketDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionWebSocketDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionWebSocketDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ + .implement(builder, URLSession_webSocketTask_didOpenWithProtocol_); + NSURLSessionWebSocketDelegate + .URLSession_webSocketTask_didCloseWithCode_reason_ + .implement(builder, URLSession_webSocketTask_didCloseWithCode_reason_); + NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionWebSocketDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionWebSocketDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionWebSocketDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionWebSocketDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ + .implementAsListener( + builder, URLSession_webSocketTask_didOpenWithProtocol_); + NSURLSessionWebSocketDelegate + .URLSession_webSocketTask_didCloseWithCode_reason_ + .implementAsListener( + builder, URLSession_webSocketTask_didCloseWithCode_reason_); + NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionWebSocketDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionWebSocketDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionWebSocketDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionWebSocketDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionWebSocketDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ + .implementAsListener( + builder, URLSession_webSocketTask_didOpenWithProtocol_); + NSURLSessionWebSocketDelegate + .URLSession_webSocketTask_didCloseWithCode_reason_ + .implementAsListener( + builder, URLSession_webSocketTask_didCloseWithCode_reason_); + NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionWebSocketDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionWebSocketDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionWebSocketDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionWebSocketDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Indicates that the WebSocket handshake was successful and the connection has been upgraded to webSockets. + /// It will also provide the protocol that is picked in the handshake. If the handshake fails, this delegate will not be invoked. + static final URLSession_webSocketTask_didOpenWithProtocol_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_webSocketTask_didOpenWithProtocol_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_webSocketTask_didOpenWithProtocol_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionWebSocketTask arg2, objc.NSString? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionWebSocketTask arg2, objc.NSString? arg3) => + func(arg1, arg2, arg3)), + ); + + /// Indicates that the WebSocket has received a close frame from the server endpoint. + /// The close code and the close reason may be provided by the delegate if the server elects to send + /// this information in the close frame + static final URLSession_webSocketTask_didCloseWithCode_reason_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, + objc.NSData?)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_webSocketTask_didCloseWithCode_reason_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_webSocketTask_didCloseWithCode_reason_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, + objc.NSData?) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionWebSocketTask arg2, + DartNSInteger arg3, + objc.NSData? arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, + objc.NSData?) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionWebSocketTask arg2, + DartNSInteger arg3, + objc.NSData? arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didCreateTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + static final URLSession_task_needNewBodyStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_needNewBodyStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_needNewBodyStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + ); + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didCompleteWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didCompleteWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + ); + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +typedef unichar = ffi.UnsignedShort; +typedef Dartunichar = int; +late final _class_NSValue = objc.getClass("NSValue"); +late final _sel_valueWithBytes_objCType_ = + objc.registerName("valueWithBytes:objCType:"); +final _objc_msgSend_qtxoq7 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_value_withObjCType_ = objc.registerName("value:withObjCType:"); + +/// NSValueCreation +extension NSValueCreation on objc.NSValue { + /// valueWithBytes:objCType: + static objc.NSValue valueWithBytes_objCType_( + ffi.Pointer value, ffi.Pointer type) { + final _ret = _objc_msgSend_qtxoq7( + _class_NSValue, _sel_valueWithBytes_objCType_, value, type); + return objc.NSValue.castFromPointer(_ret, retain: true, release: true); + } + + /// value:withObjCType: + static objc.NSValue value_withObjCType_( + ffi.Pointer value, ffi.Pointer type) { + final _ret = _objc_msgSend_qtxoq7( + _class_NSValue, _sel_value_withObjCType_, value, type); + return objc.NSValue.castFromPointer(_ret, retain: true, release: true); + } +} + +late final _sel_valueWithNonretainedObject_ = + objc.registerName("valueWithNonretainedObject:"); +late final _sel_nonretainedObjectValue = + objc.registerName("nonretainedObjectValue"); +late final _sel_valueWithPointer_ = objc.registerName("valueWithPointer:"); +final _objc_msgSend_1yesha9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_pointerValue = objc.registerName("pointerValue"); +final _objc_msgSend_6ex6p5 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_isEqualToValue_ = objc.registerName("isEqualToValue:"); + +/// NSValueExtensionMethods +extension NSValueExtensionMethods on objc.NSValue { + /// valueWithNonretainedObject: + static objc.NSValue valueWithNonretainedObject_( + objc.ObjCObjectBase? anObject) { + final _ret = _objc_msgSend_62nh5j(_class_NSValue, + _sel_valueWithNonretainedObject_, anObject?.ref.pointer ?? ffi.nullptr); + return objc.NSValue.castFromPointer(_ret, retain: true, release: true); + } + + /// nonretainedObjectValue + objc.ObjCObjectBase? get nonretainedObjectValue { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_nonretainedObjectValue); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// valueWithPointer: + static objc.NSValue valueWithPointer_(ffi.Pointer pointer) { + final _ret = + _objc_msgSend_1yesha9(_class_NSValue, _sel_valueWithPointer_, pointer); + return objc.NSValue.castFromPointer(_ret, retain: true, release: true); + } + + /// pointerValue + ffi.Pointer get pointerValue { + return _objc_msgSend_6ex6p5(this.ref.pointer, _sel_pointerValue); + } + + /// isEqualToValue: + bool isEqualToValue_(objc.NSValue value) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_isEqualToValue_, value.ref.pointer); + } +} + +late final _class_NSNumber = objc.getClass("NSNumber"); +late final _sel_numberWithChar_ = objc.registerName("numberWithChar:"); +final _objc_msgSend_vx1f2d = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Char)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_numberWithUnsignedChar_ = + objc.registerName("numberWithUnsignedChar:"); +final _objc_msgSend_uzucl8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedChar)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_numberWithShort_ = objc.registerName("numberWithShort:"); +final _objc_msgSend_cvzqr9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Short)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_numberWithUnsignedShort_ = + objc.registerName("numberWithUnsignedShort:"); +final _objc_msgSend_onx6bi = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedShort)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_numberWithInt_ = objc.registerName("numberWithInt:"); +final _objc_msgSend_1a0iyvk = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_numberWithUnsignedInt_ = + objc.registerName("numberWithUnsignedInt:"); +final _objc_msgSend_12mhqtk = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedInt)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_numberWithLong_ = objc.registerName("numberWithLong:"); +late final _sel_numberWithUnsignedLong_ = + objc.registerName("numberWithUnsignedLong:"); +late final _sel_numberWithLongLong_ = objc.registerName("numberWithLongLong:"); +final _objc_msgSend_94zdgv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.LongLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_numberWithUnsignedLongLong_ = + objc.registerName("numberWithUnsignedLongLong:"); +final _objc_msgSend_98pnic = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLongLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_numberWithFloat_ = objc.registerName("numberWithFloat:"); +final _objc_msgSend_1f4qa0h = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, double)>(); +late final _sel_numberWithDouble_ = objc.registerName("numberWithDouble:"); +late final _sel_numberWithBool_ = objc.registerName("numberWithBool:"); +final _objc_msgSend_1l3kbc1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, bool)>(); +late final _sel_numberWithInteger_ = objc.registerName("numberWithInteger:"); +late final _sel_numberWithUnsignedInteger_ = + objc.registerName("numberWithUnsignedInteger:"); + +/// NSNumberCreation +extension NSNumberCreation on objc.NSNumber { + /// numberWithChar: + static objc.NSNumber numberWithChar_(int value) { + final _ret = + _objc_msgSend_vx1f2d(_class_NSNumber, _sel_numberWithChar_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithUnsignedChar: + static objc.NSNumber numberWithUnsignedChar_(int value) { + final _ret = _objc_msgSend_uzucl8( + _class_NSNumber, _sel_numberWithUnsignedChar_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithShort: + static objc.NSNumber numberWithShort_(int value) { + final _ret = + _objc_msgSend_cvzqr9(_class_NSNumber, _sel_numberWithShort_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithUnsignedShort: + static objc.NSNumber numberWithUnsignedShort_(int value) { + final _ret = _objc_msgSend_onx6bi( + _class_NSNumber, _sel_numberWithUnsignedShort_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithInt: + static objc.NSNumber numberWithInt_(int value) { + final _ret = + _objc_msgSend_1a0iyvk(_class_NSNumber, _sel_numberWithInt_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithUnsignedInt: + static objc.NSNumber numberWithUnsignedInt_(int value) { + final _ret = _objc_msgSend_12mhqtk( + _class_NSNumber, _sel_numberWithUnsignedInt_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithLong: + static objc.NSNumber numberWithLong_(int value) { + final _ret = + _objc_msgSend_8o14b(_class_NSNumber, _sel_numberWithLong_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithUnsignedLong: + static objc.NSNumber numberWithUnsignedLong_(int value) { + final _ret = _objc_msgSend_1qrcblu( + _class_NSNumber, _sel_numberWithUnsignedLong_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithLongLong: + static objc.NSNumber numberWithLongLong_(int value) { + final _ret = + _objc_msgSend_94zdgv(_class_NSNumber, _sel_numberWithLongLong_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithUnsignedLongLong: + static objc.NSNumber numberWithUnsignedLongLong_(int value) { + final _ret = _objc_msgSend_98pnic( + _class_NSNumber, _sel_numberWithUnsignedLongLong_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithFloat: + static objc.NSNumber numberWithFloat_(double value) { + final _ret = + _objc_msgSend_1f4qa0h(_class_NSNumber, _sel_numberWithFloat_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithDouble: + static objc.NSNumber numberWithDouble_(double value) { + final _ret = + _objc_msgSend_1x911p2(_class_NSNumber, _sel_numberWithDouble_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithBool: + static objc.NSNumber numberWithBool_(bool value) { + final _ret = + _objc_msgSend_1l3kbc1(_class_NSNumber, _sel_numberWithBool_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithInteger: + static objc.NSNumber numberWithInteger_(DartNSInteger value) { + final _ret = + _objc_msgSend_8o14b(_class_NSNumber, _sel_numberWithInteger_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } + + /// numberWithUnsignedInteger: + static objc.NSNumber numberWithUnsignedInteger_(DartNSUInteger value) { + final _ret = _objc_msgSend_1qrcblu( + _class_NSNumber, _sel_numberWithUnsignedInteger_, value); + return objc.NSNumber.castFromPointer(_ret, retain: true, release: true); + } +} + +late final _sel_getValue_ = objc.registerName("getValue:"); +final _objc_msgSend_ovsamd = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + +/// NSDeprecated +extension NSDeprecated2 on objc.NSValue { + /// getValue: + void getValue_(ffi.Pointer value) { + _objc_msgSend_ovsamd(this.ref.pointer, _sel_getValue_, value); + } +} + +typedef NSRange = objc.NSRange; +typedef NSRangePointer = ffi.Pointer; +late final _sel_valueWithRange_ = objc.registerName("valueWithRange:"); +final _objc_msgSend_83z673 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, objc.NSRange)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, objc.NSRange)>(); +late final _sel_rangeValue = objc.registerName("rangeValue"); +final _objc_msgSend_1u11dbb = objc.msgSendPointer + .cast< + ffi.NativeFunction< + objc.NSRange Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + objc.NSRange Function( + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_1u11dbbStret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + +/// NSValueRangeExtensions +extension NSValueRangeExtensions on objc.NSValue { + /// valueWithRange: + static objc.NSValue valueWithRange_(NSRange range) { + final _ret = + _objc_msgSend_83z673(_class_NSValue, _sel_valueWithRange_, range); + return objc.NSValue.castFromPointer(_ret, retain: true, release: true); + } + + /// rangeValue + NSRange get rangeValue { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_1u11dbbStret(_ptr, this.ref.pointer, _sel_rangeValue) + : _ptr.ref = _objc_msgSend_1u11dbb(this.ref.pointer, _sel_rangeValue); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } +} + +late final _class_NSArray = objc.getClass("NSArray"); +late final _sel_arrayByAddingObject_ = + objc.registerName("arrayByAddingObject:"); +late final _sel_arrayByAddingObjectsFromArray_ = + objc.registerName("arrayByAddingObjectsFromArray:"); +late final _sel_componentsJoinedByString_ = + objc.registerName("componentsJoinedByString:"); +late final _sel_containsObject_ = objc.registerName("containsObject:"); +late final _sel_firstObjectCommonWithArray_ = + objc.registerName("firstObjectCommonWithArray:"); +late final _sel_getObjects_range_ = objc.registerName("getObjects:range:"); +final _objc_msgSend_o16d3k = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + objc.NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + objc.NSRange)>(); +late final _sel_indexOfObject_ = objc.registerName("indexOfObject:"); +final _objc_msgSend_1p4b7x4 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_indexOfObject_inRange_ = + objc.registerName("indexOfObject:inRange:"); +final _objc_msgSend_1c913oo = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange)>(); +late final _sel_indexOfObjectIdenticalTo_ = + objc.registerName("indexOfObjectIdenticalTo:"); +late final _sel_indexOfObjectIdenticalTo_inRange_ = + objc.registerName("indexOfObjectIdenticalTo:inRange:"); +late final _sel_isEqualToArray_ = objc.registerName("isEqualToArray:"); +late final _sel_firstObject = objc.registerName("firstObject"); +late final _sel_lastObject = objc.registerName("lastObject"); +late final _sel_reverseObjectEnumerator = + objc.registerName("reverseObjectEnumerator"); +late final _sel_sortedArrayHint = objc.registerName("sortedArrayHint"); +late final _sel_sortedArrayUsingFunction_context_ = + objc.registerName("sortedArrayUsingFunction:context:"); +final _objc_msgSend_1iiv4px = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); +late final _sel_sortedArrayUsingFunction_context_hint_ = + objc.registerName("sortedArrayUsingFunction:context:hint:"); +final _objc_msgSend_iqbzrn = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_sortedArrayUsingSelector_ = + objc.registerName("sortedArrayUsingSelector:"); +late final _sel_subarrayWithRange_ = objc.registerName("subarrayWithRange:"); +late final _sel_makeObjectsPerformSelector_ = + objc.registerName("makeObjectsPerformSelector:"); +final _objc_msgSend_1d9e4oe = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_makeObjectsPerformSelector_withObject_ = + objc.registerName("makeObjectsPerformSelector:withObject:"); +final _objc_msgSend_1c03bya = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_objectsAtIndexes_ = objc.registerName("objectsAtIndexes:"); +late final _sel_objectAtIndexedSubscript_ = + objc.registerName("objectAtIndexedSubscript:"); +void _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + NSUInteger arg1, ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, int, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + int, ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + int, ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger, ffi.Pointer)> + _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.UnsignedLong, ffi.Pointer)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.UnsignedLong, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, NSUInteger arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.UnsignedLong, ffi.Pointer)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)> + fromFunction(void Function(objc.ObjCObjectBase, DartNSUInteger, ffi.Pointer) fn) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.UnsignedLong, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_closureCallable, + (ffi.Pointer arg0, int arg1, ffi.Pointer arg2) => + fn(objc.ObjCObjectBase(arg0, retain: true, release: true), arg1, arg2)), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> listener( + void Function(objc.ObjCObjectBase, DartNSUInteger, ffi.Pointer) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, int arg1, + ffi.Pointer arg2) => + fn(objc.ObjCObjectBase(arg0, retain: false, release: true), arg1, + arg2)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_16ko9u(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)>`. +extension ObjCBlock_ffiVoid_objcObjCObject_NSUInteger_bool_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> { + void call(objc.ObjCObjectBase arg0, DartNSUInteger arg1, + ffi.Pointer arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1, arg2); +} + +late final _sel_enumerateObjectsUsingBlock_ = + objc.registerName("enumerateObjectsUsingBlock:"); +late final _sel_enumerateObjectsWithOptions_usingBlock_ = + objc.registerName("enumerateObjectsWithOptions:usingBlock:"); +late final _sel_enumerateObjectsAtIndexes_options_usingBlock_ = + objc.registerName("enumerateObjectsAtIndexes:options:usingBlock:"); +final _objc_msgSend_p1bhs = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +bool _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + NSUInteger arg1, ffi.Pointer arg2)>>() + .asFunction< + bool Function(ffi.Pointer, int, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>( + _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_fnPtrTrampoline, + false) + .cast(); +bool _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as bool Function(ffi.Pointer, + int, ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>( + _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_closureTrampoline, + false) + .cast(); + +/// Construction methods for `objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)>`. +abstract final class ObjCBlock_bool_objcObjCObject_NSUInteger_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.UnsignedLong, ffi.Pointer)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.UnsignedLong, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, NSUInteger arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.UnsignedLong, ffi.Pointer)>( + objc.newPointerBlock( + _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)> + fromFunction(bool Function(objc.ObjCObjectBase, DartNSUInteger, ffi.Pointer) fn) => + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.UnsignedLong, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_bool_objcObjCObject_NSUInteger_bool_closureCallable, + (ffi.Pointer arg0, int arg1, ffi.Pointer arg2) => + fn(objc.ObjCObjectBase(arg0, retain: true, release: true), arg1, arg2)), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)>`. +extension ObjCBlock_bool_objcObjCObject_NSUInteger_bool_CallExtension + on objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> { + bool call(objc.ObjCObjectBase arg0, DartNSUInteger arg1, + ffi.Pointer arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + ffi.Pointer arg0, + NSUInteger arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1, arg2); +} + +late final _sel_indexOfObjectPassingTest_ = + objc.registerName("indexOfObjectPassingTest:"); +final _objc_msgSend_10mlopr = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_indexOfObjectWithOptions_passingTest_ = + objc.registerName("indexOfObjectWithOptions:passingTest:"); +final _objc_msgSend_1698hqz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_indexOfObjectAtIndexes_options_passingTest_ = + objc.registerName("indexOfObjectAtIndexes:options:passingTest:"); +final _objc_msgSend_viax9j = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_indexesOfObjectsPassingTest_ = + objc.registerName("indexesOfObjectsPassingTest:"); +late final _sel_indexesOfObjectsWithOptions_passingTest_ = + objc.registerName("indexesOfObjectsWithOptions:passingTest:"); +late final _sel_indexesOfObjectsAtIndexes_options_passingTest_ = + objc.registerName("indexesOfObjectsAtIndexes:options:passingTest:"); +final _objc_msgSend_1bj2f0k = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_sortedArrayUsingComparator_ = + objc.registerName("sortedArrayUsingComparator:"); +late final _sel_sortedArrayWithOptions_usingComparator_ = + objc.registerName("sortedArrayWithOptions:usingComparator:"); +late final _sel_indexOfObject_inSortedRange_options_usingComparator_ = + objc.registerName("indexOfObject:inSortedRange:options:usingComparator:"); +final _objc_msgSend_9efhbf = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange, + int, + ffi.Pointer)>(); + +/// NSExtendedArray +extension NSExtendedArray on objc.NSArray { + /// arrayByAddingObject: + objc.NSArray arrayByAddingObject_(objc.ObjCObjectBase anObject) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_arrayByAddingObject_, anObject.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// arrayByAddingObjectsFromArray: + objc.NSArray arrayByAddingObjectsFromArray_(objc.NSArray otherArray) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_arrayByAddingObjectsFromArray_, otherArray.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// componentsJoinedByString: + objc.NSString componentsJoinedByString_(objc.NSString separator) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_componentsJoinedByString_, separator.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// containsObject: + bool containsObject_(objc.ObjCObjectBase anObject) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_containsObject_, anObject.ref.pointer); + } + + /// description + objc.NSString get description { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_description); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// descriptionWithLocale: + objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// descriptionWithLocale:indent: + objc.NSString descriptionWithLocale_indent_( + objc.ObjCObjectBase? locale, DartNSUInteger level) { + final _ret = _objc_msgSend_dcd68g( + this.ref.pointer, + _sel_descriptionWithLocale_indent_, + locale?.ref.pointer ?? ffi.nullptr, + level); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// firstObjectCommonWithArray: + objc.ObjCObjectBase? firstObjectCommonWithArray_(objc.NSArray otherArray) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_firstObjectCommonWithArray_, otherArray.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// getObjects:range: + void getObjects_range_( + ffi.Pointer> objects, NSRange range) { + _objc_msgSend_o16d3k( + this.ref.pointer, _sel_getObjects_range_, objects, range); + } + + /// indexOfObject: + DartNSUInteger indexOfObject_(objc.ObjCObjectBase anObject) { + return _objc_msgSend_1p4b7x4( + this.ref.pointer, _sel_indexOfObject_, anObject.ref.pointer); + } + + /// indexOfObject:inRange: + DartNSUInteger indexOfObject_inRange_( + objc.ObjCObjectBase anObject, NSRange range) { + return _objc_msgSend_1c913oo(this.ref.pointer, _sel_indexOfObject_inRange_, + anObject.ref.pointer, range); + } + + /// indexOfObjectIdenticalTo: + DartNSUInteger indexOfObjectIdenticalTo_(objc.ObjCObjectBase anObject) { + return _objc_msgSend_1p4b7x4( + this.ref.pointer, _sel_indexOfObjectIdenticalTo_, anObject.ref.pointer); + } + + /// indexOfObjectIdenticalTo:inRange: + DartNSUInteger indexOfObjectIdenticalTo_inRange_( + objc.ObjCObjectBase anObject, NSRange range) { + return _objc_msgSend_1c913oo(this.ref.pointer, + _sel_indexOfObjectIdenticalTo_inRange_, anObject.ref.pointer, range); + } + + /// isEqualToArray: + bool isEqualToArray_(objc.NSArray otherArray) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_isEqualToArray_, otherArray.ref.pointer); + } + + /// firstObject + objc.ObjCObjectBase? get firstObject { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_firstObject); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// lastObject + objc.ObjCObjectBase? get lastObject { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_lastObject); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// objectEnumerator + objc.NSEnumerator objectEnumerator() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_objectEnumerator); + return objc.NSEnumerator.castFromPointer(_ret, retain: true, release: true); + } + + /// reverseObjectEnumerator + objc.NSEnumerator reverseObjectEnumerator() { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_reverseObjectEnumerator); + return objc.NSEnumerator.castFromPointer(_ret, retain: true, release: true); + } + + /// sortedArrayHint + objc.NSData get sortedArrayHint { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_sortedArrayHint); + return objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// sortedArrayUsingFunction:context: + objc.NSArray sortedArrayUsingFunction_context_( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context) { + final _ret = _objc_msgSend_1iiv4px(this.ref.pointer, + _sel_sortedArrayUsingFunction_context_, comparator, context); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// sortedArrayUsingFunction:context:hint: + objc.NSArray sortedArrayUsingFunction_context_hint_( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + comparator, + ffi.Pointer context, + objc.NSData? hint) { + final _ret = _objc_msgSend_iqbzrn( + this.ref.pointer, + _sel_sortedArrayUsingFunction_context_hint_, + comparator, + context, + hint?.ref.pointer ?? ffi.nullptr); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// sortedArrayUsingSelector: + objc.NSArray sortedArrayUsingSelector_( + ffi.Pointer comparator) { + final _ret = _objc_msgSend_19hbqky( + this.ref.pointer, _sel_sortedArrayUsingSelector_, comparator); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// subarrayWithRange: + objc.NSArray subarrayWithRange_(NSRange range) { + final _ret = + _objc_msgSend_83z673(this.ref.pointer, _sel_subarrayWithRange_, range); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// writeToURL:error: + bool writeToURL_error_( + objc.NSURL url, ffi.Pointer> error) { + return _objc_msgSend_blqzg8( + this.ref.pointer, _sel_writeToURL_error_, url.ref.pointer, error); + } + + /// makeObjectsPerformSelector: + void makeObjectsPerformSelector_(ffi.Pointer aSelector) { + _objc_msgSend_1d9e4oe( + this.ref.pointer, _sel_makeObjectsPerformSelector_, aSelector); + } + + /// makeObjectsPerformSelector:withObject: + void makeObjectsPerformSelector_withObject_( + ffi.Pointer aSelector, objc.ObjCObjectBase? argument) { + _objc_msgSend_1c03bya( + this.ref.pointer, + _sel_makeObjectsPerformSelector_withObject_, + aSelector, + argument?.ref.pointer ?? ffi.nullptr); + } + + /// objectsAtIndexes: + objc.NSArray objectsAtIndexes_(objc.NSIndexSet indexes) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_objectsAtIndexes_, indexes.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// objectAtIndexedSubscript: + objc.ObjCObjectBase objectAtIndexedSubscript_(DartNSUInteger idx) { + final _ret = _objc_msgSend_1qrcblu( + this.ref.pointer, _sel_objectAtIndexedSubscript_, idx); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// enumerateObjectsUsingBlock: + void enumerateObjectsUsingBlock_( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + block) { + _objc_msgSend_f167m6( + this.ref.pointer, _sel_enumerateObjectsUsingBlock_, block.ref.pointer); + } + + /// enumerateObjectsWithOptions:usingBlock: + void enumerateObjectsWithOptions_usingBlock_( + objc.NSEnumerationOptions opts, + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + block) { + _objc_msgSend_yx8yc6( + this.ref.pointer, + _sel_enumerateObjectsWithOptions_usingBlock_, + opts.value, + block.ref.pointer); + } + + /// enumerateObjectsAtIndexes:options:usingBlock: + void enumerateObjectsAtIndexes_options_usingBlock_( + objc.NSIndexSet s, + objc.NSEnumerationOptions opts, + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + block) { + _objc_msgSend_p1bhs( + this.ref.pointer, + _sel_enumerateObjectsAtIndexes_options_usingBlock_, + s.ref.pointer, + opts.value, + block.ref.pointer); + } + + /// indexOfObjectPassingTest: + DartNSUInteger indexOfObjectPassingTest_( + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + predicate) { + return _objc_msgSend_10mlopr(this.ref.pointer, + _sel_indexOfObjectPassingTest_, predicate.ref.pointer); + } + + /// indexOfObjectWithOptions:passingTest: + DartNSUInteger indexOfObjectWithOptions_passingTest_( + objc.NSEnumerationOptions opts, + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + predicate) { + return _objc_msgSend_1698hqz( + this.ref.pointer, + _sel_indexOfObjectWithOptions_passingTest_, + opts.value, + predicate.ref.pointer); + } + + /// indexOfObjectAtIndexes:options:passingTest: + DartNSUInteger indexOfObjectAtIndexes_options_passingTest_( + objc.NSIndexSet s, + objc.NSEnumerationOptions opts, + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + predicate) { + return _objc_msgSend_viax9j( + this.ref.pointer, + _sel_indexOfObjectAtIndexes_options_passingTest_, + s.ref.pointer, + opts.value, + predicate.ref.pointer); + } + + /// indexesOfObjectsPassingTest: + objc.NSIndexSet indexesOfObjectsPassingTest_( + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + predicate) { + final _ret = _objc_msgSend_cy99le(this.ref.pointer, + _sel_indexesOfObjectsPassingTest_, predicate.ref.pointer); + return objc.NSIndexSet.castFromPointer(_ret, retain: true, release: true); + } + + /// indexesOfObjectsWithOptions:passingTest: + objc.NSIndexSet indexesOfObjectsWithOptions_passingTest_( + objc.NSEnumerationOptions opts, + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + predicate) { + final _ret = _objc_msgSend_hd4f96( + this.ref.pointer, + _sel_indexesOfObjectsWithOptions_passingTest_, + opts.value, + predicate.ref.pointer); + return objc.NSIndexSet.castFromPointer(_ret, retain: true, release: true); + } + + /// indexesOfObjectsAtIndexes:options:passingTest: + objc.NSIndexSet indexesOfObjectsAtIndexes_options_passingTest_( + objc.NSIndexSet s, + objc.NSEnumerationOptions opts, + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer)> + predicate) { + final _ret = _objc_msgSend_1bj2f0k( + this.ref.pointer, + _sel_indexesOfObjectsAtIndexes_options_passingTest_, + s.ref.pointer, + opts.value, + predicate.ref.pointer); + return objc.NSIndexSet.castFromPointer(_ret, retain: true, release: true); + } + + /// sortedArrayUsingComparator: + objc.NSArray sortedArrayUsingComparator_(DartNSComparator cmptr) { + final _ret = _objc_msgSend_cy99le( + this.ref.pointer, _sel_sortedArrayUsingComparator_, cmptr.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// sortedArrayWithOptions:usingComparator: + objc.NSArray sortedArrayWithOptions_usingComparator_( + objc.NSSortOptions opts, DartNSComparator cmptr) { + final _ret = _objc_msgSend_1u2b7ut( + this.ref.pointer, + _sel_sortedArrayWithOptions_usingComparator_, + opts.value, + cmptr.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// indexOfObject:inSortedRange:options:usingComparator: + DartNSUInteger indexOfObject_inSortedRange_options_usingComparator_( + objc.ObjCObjectBase obj, + NSRange r, + objc.NSBinarySearchingOptions opts, + DartNSComparator cmp) { + return _objc_msgSend_9efhbf( + this.ref.pointer, + _sel_indexOfObject_inSortedRange_options_usingComparator_, + obj.ref.pointer, + r, + opts.value, + cmp.ref.pointer); + } +} + +late final _sel_array = objc.registerName("array"); +late final _sel_arrayWithObject_ = objc.registerName("arrayWithObject:"); +late final _sel_arrayWithObjects_count_ = + objc.registerName("arrayWithObjects:count:"); +final _objc_msgSend_1lqqdvl = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + int)>(); +late final _sel_arrayWithObjects_ = objc.registerName("arrayWithObjects:"); +late final _sel_arrayWithArray_ = objc.registerName("arrayWithArray:"); +late final _sel_initWithObjects_ = objc.registerName("initWithObjects:"); +late final _sel_initWithArray_ = objc.registerName("initWithArray:"); +late final _sel_initWithArray_copyItems_ = + objc.registerName("initWithArray:copyItems:"); +late final _sel_arrayWithContentsOfURL_error_ = + objc.registerName("arrayWithContentsOfURL:error:"); + +/// NSArrayCreation +extension NSArrayCreation on objc.NSArray { + /// array + static objc.NSArray array() { + final _ret = _objc_msgSend_1x359cv(_class_NSArray, _sel_array); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// arrayWithObject: + static objc.NSArray arrayWithObject_(objc.ObjCObjectBase anObject) { + final _ret = _objc_msgSend_62nh5j( + _class_NSArray, _sel_arrayWithObject_, anObject.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// arrayWithObjects:count: + static objc.NSArray arrayWithObjects_count_( + ffi.Pointer> objects, DartNSUInteger cnt) { + final _ret = _objc_msgSend_1lqqdvl( + _class_NSArray, _sel_arrayWithObjects_count_, objects, cnt); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// arrayWithObjects: + static objc.NSArray arrayWithObjects_(objc.ObjCObjectBase firstObj) { + final _ret = _objc_msgSend_62nh5j( + _class_NSArray, _sel_arrayWithObjects_, firstObj.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// arrayWithArray: + static objc.NSArray arrayWithArray_(objc.NSArray array) { + final _ret = _objc_msgSend_62nh5j( + _class_NSArray, _sel_arrayWithArray_, array.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithObjects: + objc.NSArray initWithObjects_(objc.ObjCObjectBase firstObj) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithObjects_, firstObj.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithArray: + objc.NSArray initWithArray_(objc.NSArray array) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithArray_, array.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithArray:copyItems: + objc.NSArray initWithArray_copyItems_(objc.NSArray array, bool flag) { + final _ret = _objc_msgSend_1bdmr5f(this.ref.retainAndReturnPointer(), + _sel_initWithArray_copyItems_, array.ref.pointer, flag); + return objc.NSArray.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithContentsOfURL:error: + objc.NSArray? initWithContentsOfURL_error_( + objc.NSURL url, ffi.Pointer> error) { + final _ret = _objc_msgSend_1705co6(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_error_, url.ref.pointer, error); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: false, release: true); + } + + /// arrayWithContentsOfURL:error: + static objc.NSArray? arrayWithContentsOfURL_error_( + objc.NSURL url, ffi.Pointer> error) { + final _ret = _objc_msgSend_1705co6(_class_NSArray, + _sel_arrayWithContentsOfURL_error_, url.ref.pointer, error); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } +} + +bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer + _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrTrampoline, + false) + .cast(); +bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as bool Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureTrampoline, + false) + .cast(); + +/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. +abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer)>( + objc.newPointerBlock( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.Pointer)> + fromFunction(bool Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => + objc.ObjCBlock, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true))), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. +extension ObjCBlock_bool_objcObjCObject_objcObjCObject_CallExtension + on objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)> { + bool call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer); +} + +late final _sel_differenceFromArray_withOptions_usingEquivalenceTest_ = + objc.registerName("differenceFromArray:withOptions:usingEquivalenceTest:"); +final _objc_msgSend_1jy28v8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_differenceFromArray_withOptions_ = + objc.registerName("differenceFromArray:withOptions:"); +final _objc_msgSend_4yz83j = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_differenceFromArray_ = + objc.registerName("differenceFromArray:"); +late final _sel_arrayByApplyingDifference_ = + objc.registerName("arrayByApplyingDifference:"); + +/// NSArrayDiffing +extension NSArrayDiffing on objc.NSArray { + /// differenceFromArray:withOptions:usingEquivalenceTest: + objc.NSOrderedCollectionDifference + differenceFromArray_withOptions_usingEquivalenceTest_( + objc.NSArray other, + objc.NSOrderedCollectionDifferenceCalculationOptions options, + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer)> + block) { + final _ret = _objc_msgSend_1jy28v8( + this.ref.pointer, + _sel_differenceFromArray_withOptions_usingEquivalenceTest_, + other.ref.pointer, + options.value, + block.ref.pointer); + return objc.NSOrderedCollectionDifference.castFromPointer(_ret, + retain: true, release: true); + } + + /// differenceFromArray:withOptions: + objc.NSOrderedCollectionDifference differenceFromArray_withOptions_( + objc.NSArray other, + objc.NSOrderedCollectionDifferenceCalculationOptions options) { + final _ret = _objc_msgSend_4yz83j( + this.ref.pointer, + _sel_differenceFromArray_withOptions_, + other.ref.pointer, + options.value); + return objc.NSOrderedCollectionDifference.castFromPointer(_ret, + retain: true, release: true); + } + + /// differenceFromArray: + objc.NSOrderedCollectionDifference differenceFromArray_(objc.NSArray other) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_differenceFromArray_, other.ref.pointer); + return objc.NSOrderedCollectionDifference.castFromPointer(_ret, + retain: true, release: true); + } + + /// arrayByApplyingDifference: + objc.NSArray? arrayByApplyingDifference_( + objc.NSOrderedCollectionDifference difference) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_arrayByApplyingDifference_, difference.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } +} + +late final _sel_getObjects_ = objc.registerName("getObjects:"); +final _objc_msgSend_1dau4w = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_arrayWithContentsOfFile_ = + objc.registerName("arrayWithContentsOfFile:"); +late final _sel_arrayWithContentsOfURL_ = + objc.registerName("arrayWithContentsOfURL:"); + +/// NSDeprecated +extension NSDeprecated3 on objc.NSArray { + /// getObjects: + void getObjects_(ffi.Pointer> objects) { + _objc_msgSend_1dau4w(this.ref.pointer, _sel_getObjects_, objects); + } + + /// arrayWithContentsOfFile: + static objc.NSArray? arrayWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j( + _class_NSArray, _sel_arrayWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// arrayWithContentsOfURL: + static objc.NSArray? arrayWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j( + _class_NSArray, _sel_arrayWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithContentsOfFile: + objc.NSArray? initWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithContentsOfURL: + objc.NSArray? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: false, release: true); + } + + /// writeToFile:atomically: + bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { + return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToFile_atomically_, + path.ref.pointer, useAuxiliaryFile); + } + + /// writeToURL:atomically: + bool writeToURL_atomically_(objc.NSURL url, bool atomically) { + return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToURL_atomically_, + url.ref.pointer, atomically); + } +} + +late final _class_NSMutableArray = objc.getClass("NSMutableArray"); +late final _sel_addObjectsFromArray_ = + objc.registerName("addObjectsFromArray:"); +late final _sel_exchangeObjectAtIndex_withObjectAtIndex_ = + objc.registerName("exchangeObjectAtIndex:withObjectAtIndex:"); +final _objc_msgSend_bfp043 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int, int)>(); +late final _sel_removeObject_inRange_ = + objc.registerName("removeObject:inRange:"); +final _objc_msgSend_16f6m81 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange)>(); +late final _sel_removeObject_ = objc.registerName("removeObject:"); +late final _sel_removeObjectIdenticalTo_inRange_ = + objc.registerName("removeObjectIdenticalTo:inRange:"); +late final _sel_removeObjectIdenticalTo_ = + objc.registerName("removeObjectIdenticalTo:"); +late final _sel_removeObjectsFromIndices_numIndices_ = + objc.registerName("removeObjectsFromIndices:numIndices:"); +final _objc_msgSend_swohtd = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_removeObjectsInArray_ = + objc.registerName("removeObjectsInArray:"); +late final _sel_removeObjectsInRange_ = + objc.registerName("removeObjectsInRange:"); +final _objc_msgSend_1e3pm0z = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, objc.NSRange)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, objc.NSRange)>(); +late final _sel_replaceObjectsInRange_withObjectsFromArray_range_ = + objc.registerName("replaceObjectsInRange:withObjectsFromArray:range:"); +final _objc_msgSend_169h6dj = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + objc.NSRange, + ffi.Pointer, + objc.NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + objc.NSRange, + ffi.Pointer, + objc.NSRange)>(); +late final _sel_replaceObjectsInRange_withObjectsFromArray_ = + objc.registerName("replaceObjectsInRange:withObjectsFromArray:"); +final _objc_msgSend_i4ny2p = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + objc.NSRange, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + objc.NSRange, + ffi.Pointer)>(); +late final _sel_setArray_ = objc.registerName("setArray:"); +late final _sel_sortUsingFunction_context_ = + objc.registerName("sortUsingFunction:context:"); +final _objc_msgSend_1bvics1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); +late final _sel_sortUsingSelector_ = objc.registerName("sortUsingSelector:"); +late final _sel_insertObjects_atIndexes_ = + objc.registerName("insertObjects:atIndexes:"); +late final _sel_removeObjectsAtIndexes_ = + objc.registerName("removeObjectsAtIndexes:"); +late final _sel_replaceObjectsAtIndexes_withObjects_ = + objc.registerName("replaceObjectsAtIndexes:withObjects:"); +late final _sel_setObject_atIndexedSubscript_ = + objc.registerName("setObject:atIndexedSubscript:"); +final _objc_msgSend_10i1axw = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_sortUsingComparator_ = + objc.registerName("sortUsingComparator:"); +late final _sel_sortWithOptions_usingComparator_ = + objc.registerName("sortWithOptions:usingComparator:"); +final _objc_msgSend_jjgvjt = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + +/// NSExtendedMutableArray +extension NSExtendedMutableArray on objc.NSMutableArray { + /// addObjectsFromArray: + void addObjectsFromArray_(objc.NSArray otherArray) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_addObjectsFromArray_, otherArray.ref.pointer); + } + + /// exchangeObjectAtIndex:withObjectAtIndex: + void exchangeObjectAtIndex_withObjectAtIndex_( + DartNSUInteger idx1, DartNSUInteger idx2) { + _objc_msgSend_bfp043(this.ref.pointer, + _sel_exchangeObjectAtIndex_withObjectAtIndex_, idx1, idx2); + } + + /// removeAllObjects + void removeAllObjects() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllObjects); + } + + /// removeObject:inRange: + void removeObject_inRange_(objc.ObjCObjectBase anObject, NSRange range) { + _objc_msgSend_16f6m81(this.ref.pointer, _sel_removeObject_inRange_, + anObject.ref.pointer, range); + } + + /// removeObject: + void removeObject_(objc.ObjCObjectBase anObject) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_removeObject_, anObject.ref.pointer); + } + + /// removeObjectIdenticalTo:inRange: + void removeObjectIdenticalTo_inRange_( + objc.ObjCObjectBase anObject, NSRange range) { + _objc_msgSend_16f6m81(this.ref.pointer, + _sel_removeObjectIdenticalTo_inRange_, anObject.ref.pointer, range); + } + + /// removeObjectIdenticalTo: + void removeObjectIdenticalTo_(objc.ObjCObjectBase anObject) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_removeObjectIdenticalTo_, anObject.ref.pointer); + } + + /// removeObjectsFromIndices:numIndices: + void removeObjectsFromIndices_numIndices_( + ffi.Pointer indices, DartNSUInteger cnt) { + _objc_msgSend_swohtd(this.ref.pointer, + _sel_removeObjectsFromIndices_numIndices_, indices, cnt); + } + + /// removeObjectsInArray: + void removeObjectsInArray_(objc.NSArray otherArray) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_removeObjectsInArray_, otherArray.ref.pointer); + } + + /// removeObjectsInRange: + void removeObjectsInRange_(NSRange range) { + _objc_msgSend_1e3pm0z(this.ref.pointer, _sel_removeObjectsInRange_, range); + } + + /// replaceObjectsInRange:withObjectsFromArray:range: + void replaceObjectsInRange_withObjectsFromArray_range_( + NSRange range, objc.NSArray otherArray, NSRange otherRange) { + _objc_msgSend_169h6dj( + this.ref.pointer, + _sel_replaceObjectsInRange_withObjectsFromArray_range_, + range, + otherArray.ref.pointer, + otherRange); + } + + /// replaceObjectsInRange:withObjectsFromArray: + void replaceObjectsInRange_withObjectsFromArray_( + NSRange range, objc.NSArray otherArray) { + _objc_msgSend_i4ny2p( + this.ref.pointer, + _sel_replaceObjectsInRange_withObjectsFromArray_, + range, + otherArray.ref.pointer); + } + + /// setArray: + void setArray_(objc.NSArray otherArray) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setArray_, otherArray.ref.pointer); + } + + /// sortUsingFunction:context: + void sortUsingFunction_context_( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context) { + _objc_msgSend_1bvics1( + this.ref.pointer, _sel_sortUsingFunction_context_, compare, context); + } + + /// sortUsingSelector: + void sortUsingSelector_(ffi.Pointer comparator) { + _objc_msgSend_1d9e4oe( + this.ref.pointer, _sel_sortUsingSelector_, comparator); + } + + /// insertObjects:atIndexes: + void insertObjects_atIndexes_(objc.NSArray objects, objc.NSIndexSet indexes) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_insertObjects_atIndexes_, + objects.ref.pointer, indexes.ref.pointer); + } + + /// removeObjectsAtIndexes: + void removeObjectsAtIndexes_(objc.NSIndexSet indexes) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_removeObjectsAtIndexes_, indexes.ref.pointer); + } + + /// replaceObjectsAtIndexes:withObjects: + void replaceObjectsAtIndexes_withObjects_( + objc.NSIndexSet indexes, objc.NSArray objects) { + _objc_msgSend_wjvic9( + this.ref.pointer, + _sel_replaceObjectsAtIndexes_withObjects_, + indexes.ref.pointer, + objects.ref.pointer); + } + + /// setObject:atIndexedSubscript: + void setObject_atIndexedSubscript_( + objc.ObjCObjectBase obj, DartNSUInteger idx) { + _objc_msgSend_10i1axw(this.ref.pointer, _sel_setObject_atIndexedSubscript_, + obj.ref.pointer, idx); + } + + /// sortUsingComparator: + void sortUsingComparator_(DartNSComparator cmptr) { + _objc_msgSend_f167m6( + this.ref.pointer, _sel_sortUsingComparator_, cmptr.ref.pointer); + } + + /// sortWithOptions:usingComparator: + void sortWithOptions_usingComparator_( + objc.NSSortOptions opts, DartNSComparator cmptr) { + _objc_msgSend_jjgvjt(this.ref.pointer, + _sel_sortWithOptions_usingComparator_, opts.value, cmptr.ref.pointer); + } +} + +late final _sel_arrayWithCapacity_ = objc.registerName("arrayWithCapacity:"); + +/// NSMutableArrayCreation +extension NSMutableArrayCreation on objc.NSMutableArray { + /// arrayWithCapacity: + static objc.NSMutableArray arrayWithCapacity_(DartNSUInteger numItems) { + final _ret = _objc_msgSend_1qrcblu( + _class_NSMutableArray, _sel_arrayWithCapacity_, numItems); + return objc.NSMutableArray.castFromPointer(_ret, + retain: true, release: true); + } + + /// arrayWithContentsOfFile: + static objc.NSMutableArray? arrayWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j( + _class_NSMutableArray, _sel_arrayWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: true, release: true); + } + + /// arrayWithContentsOfURL: + static objc.NSMutableArray? arrayWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j( + _class_NSMutableArray, _sel_arrayWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: true, release: true); + } + + /// initWithContentsOfFile: + objc.NSMutableArray? initWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: false, release: true); + } + + /// initWithContentsOfURL: + objc.NSMutableArray? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: false, release: true); + } +} + +late final _sel_applyDifference_ = objc.registerName("applyDifference:"); + +/// NSMutableArrayDiffing +extension NSMutableArrayDiffing on objc.NSMutableArray { + /// applyDifference: + void applyDifference_(objc.NSOrderedCollectionDifference difference) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_applyDifference_, difference.ref.pointer); + } +} + +late final _protocol_NSItemProviderWriting = + objc.getProtocol("NSItemProviderWriting"); +late final _sel_writableTypeIdentifiersForItemProvider = + objc.registerName("writableTypeIdentifiersForItemProvider"); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSArray_ffiVoid_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSArray_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_NSArray_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> + fromFunction(objc.NSArray Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSArray_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_NSArray_ffiVoid_CallExtension + on objc.ObjCBlock)> { + objc.NSArray call(ffi.Pointer arg0) => objc.NSArray.castFromPointer( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); +} + +late final _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_ = + objc.registerName( + "itemProviderVisibilityForRepresentationWithTypeIdentifier:"); +final _objc_msgSend_96wwe1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +int _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable = + ffi.Pointer.fromFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline, + 0) + .cast(); +int _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as int Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable = + ffi.Pointer.fromFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline, + 0) + .cast(); + +/// Construction methods for `objc.ObjCBlock, objc.NSString)>`. +abstract final class ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + NSInteger Function(ffi.Pointer, objc.NSString)> castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock, objc.NSString)>( + pointer, + retain: retain, + release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, objc.NSString)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, objc.NSString)>( + objc.newPointerBlock(_ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, objc.NSString)> fromFunction( + objc.NSItemProviderRepresentationVisibility Function( + ffi.Pointer, objc.NSString) + fn) => + objc.ObjCBlock, objc.NSString)>( + objc.newClosureBlock( + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true)) + .value), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, objc.NSString)>`. +extension ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_CallExtension + on objc + .ObjCBlock, objc.NSString)> { + objc.NSItemProviderRepresentationVisibility call( + ffi.Pointer arg0, objc.NSString arg1) => + objc.NSItemProviderRepresentationVisibility.fromValue(ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction, ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer)); +} + +void _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable = ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSData_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock( + pointer, + retain: retain, + release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(objc.NSData?, objc.NSError?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, + retain: true, release: true), + arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock + listener(void Function(objc.NSData?, objc.NSError?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1) => + fn( + arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, + retain: false, release: true), + arg1.address == 0 + ? null + : objc.NSError.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjvic9(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSData_NSError_CallExtension + on objc.ObjCBlock { + void call(objc.NSData? arg0, objc.NSError? arg1) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = + objc.registerName( + "loadDataWithTypeIdentifier:forItemProviderCompletionHandler:"); +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline) + .cast(); +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, objc.NSString, objc.ObjCBlock)> + fromFunction(NSProgress? Function(ffi.Pointer, objc.NSString, objc.ObjCBlock) fn) => + objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true), ObjCBlock_ffiVoid_NSData_NSError.castFromPointer(arg2, retain: true, release: true)) + ?.ref + .retainAndAutorelease() ?? + ffi.nullptr), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. +extension ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_CallExtension + on objc.ObjCBlock< + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)> { + NSProgress? call(ffi.Pointer arg0, objc.NSString arg1, objc.ObjCBlock arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>() + (ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer) + .address == + 0 + ? null + : NSProgress.castFromPointer( + ref.pointer.ref.invoke.cast Function(ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>>().asFunction Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer), + retain: true, + release: true); +} + +/// NSItemProviderWriting +abstract final class NSItemProviderWriting { + /// Builds an object that implements the NSItemProviderWriting protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {objc.NSArray Function()? writableTypeIdentifiersForItemProvider, + objc.NSItemProviderRepresentationVisibility Function(objc.NSString)? + itemProviderVisibilityForRepresentationWithTypeIdentifier_, + required NSProgress? Function(objc.NSString, + objc.ObjCBlock) + loadDataWithTypeIdentifier_forItemProviderCompletionHandler_}) { + final builder = objc.ObjCProtocolBuilder(); + NSItemProviderWriting.writableTypeIdentifiersForItemProvider + .implement(builder, writableTypeIdentifiersForItemProvider); + NSItemProviderWriting + .itemProviderVisibilityForRepresentationWithTypeIdentifier_ + .implement(builder, + itemProviderVisibilityForRepresentationWithTypeIdentifier_); + NSItemProviderWriting + .loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ + .implement(builder, + loadDataWithTypeIdentifier_forItemProviderCompletionHandler_); + return builder.build(); + } + + /// Adds the implementation of the NSItemProviderWriting protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {objc.NSArray Function()? writableTypeIdentifiersForItemProvider, + objc.NSItemProviderRepresentationVisibility Function(objc.NSString)? + itemProviderVisibilityForRepresentationWithTypeIdentifier_, + required NSProgress? Function(objc.NSString, + objc.ObjCBlock) + loadDataWithTypeIdentifier_forItemProviderCompletionHandler_}) { + NSItemProviderWriting.writableTypeIdentifiersForItemProvider + .implement(builder, writableTypeIdentifiersForItemProvider); + NSItemProviderWriting + .itemProviderVisibilityForRepresentationWithTypeIdentifier_ + .implement(builder, + itemProviderVisibilityForRepresentationWithTypeIdentifier_); + NSItemProviderWriting + .loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ + .implement(builder, + loadDataWithTypeIdentifier_forItemProviderCompletionHandler_); + } + + /// writableTypeIdentifiersForItemProvider + static final writableTypeIdentifiersForItemProvider = + objc.ObjCProtocolMethod( + _protocol_NSItemProviderWriting, + _sel_writableTypeIdentifiersForItemProvider, + objc.getProtocolMethodSignature( + _protocol_NSItemProviderWriting, + _sel_writableTypeIdentifiersForItemProvider, + isRequired: false, + isInstanceMethod: true, + ), + (objc.NSArray Function() func) => ObjCBlock_NSArray_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// itemProviderVisibilityForRepresentationWithTypeIdentifier: + static final itemProviderVisibilityForRepresentationWithTypeIdentifier_ = + objc.ObjCProtocolMethod< + objc.NSItemProviderRepresentationVisibility Function(objc.NSString)>( + _protocol_NSItemProviderWriting, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + objc.getProtocolMethodSignature( + _protocol_NSItemProviderWriting, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + isRequired: false, + isInstanceMethod: true, + ), + (objc.NSItemProviderRepresentationVisibility Function(objc.NSString) + func) => + ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString + .fromFunction( + (ffi.Pointer _, objc.NSString arg1) => func(arg1)), + ); + + /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: + static final loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = + objc.ObjCProtocolMethod< + NSProgress? Function(objc.NSString, + objc.ObjCBlock)>( + _protocol_NSItemProviderWriting, + _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSItemProviderWriting, + _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, + isRequired: true, + isInstanceMethod: true, + ), + (NSProgress? Function(objc.NSString, + objc.ObjCBlock) + func) => + ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError.fromFunction( + (ffi.Pointer _, + objc.NSString arg1, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, objc.NSError?)> + arg2) => + func(arg1, arg2)), + ); +} + +late final _protocol_NSItemProviderReading = + objc.getProtocol("NSItemProviderReading"); + +/// NSItemProviderReading +abstract final class NSItemProviderReading { + /// Builds an object that implements the NSItemProviderReading protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); + + return builder.build(); + } + + /// Adds the implementation of the NSItemProviderReading protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} + +void _ObjCBlock_ffiVoid_objcObjCObject_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_objcObjCObject_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_objcObjCObject_NSError_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock?, objc.NSError)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObject_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock?, objc.NSError)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, + objc.NSError)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock?, objc.NSError)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock?, objc.NSError)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_objcObjCObject_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock?, objc.NSError)> fromFunction( + void Function(objc.ObjCObjectBase?, objc.NSError) fn) => + objc.ObjCBlock?, objc.NSError)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0.address == 0 + ? null + : objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.NSError.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc + .ObjCBlock?, objc.NSError)> + listener(void Function(objc.ObjCObjectBase?, objc.NSError) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_NSError_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1) => + fn( + arg0.address == 0 + ? null + : objc.ObjCObjectBase(arg0, retain: false, release: true), + objc.NSError.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjvic9(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, + objc.NSError)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock?, objc.NSError)>`. +extension ObjCBlock_ffiVoid_objcObjCObject_NSError_CallExtension on objc + .ObjCBlock?, objc.NSError)> { + void call(objc.ObjCObjectBase? arg0, objc.NSError arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr, arg1.ref.pointer); +} + +typedef NSItemProviderCompletionHandler = ffi.Pointer; +typedef DartNSItemProviderCompletionHandler = objc + .ObjCBlock?, objc.NSError)>; +void + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_fnPtrTrampoline( + ffi.Pointer block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_closureTrampoline( + ffi.Pointer block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_listenerTrampoline( + ffi.Pointer block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>`. +abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)> + castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)> + fromFunctionPointer(ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)>(objc.newPointerBlock(_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_fnPtrCallable, ptr.cast()), retain: false, release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)> + fromFunction(void Function(DartNSItemProviderCompletionHandler, objc.ObjCObjectBase, objc.NSDictionary) fn) => + objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_closureCallable, + (NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + ObjCBlock_ffiVoid_objcObjCObject_NSError.castFromPointer(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true), + objc.NSDictionary.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)> listener( + void Function(DartNSItemProviderCompletionHandler, objc.ObjCObjectBase, + objc.NSDictionary) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_listenerCallable + .nativeFunction + .cast(), + (NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + ObjCBlock_ffiVoid_objcObjCObject_NSError.castFromPointer(arg0, + retain: false, release: true), + objc.ObjCObjectBase(arg1, retain: false, release: true), + objc.NSDictionary.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1j2nt86(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock?, objc.NSError)>, ffi.Pointer, objc.NSDictionary)>`. +extension ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)> { + void call(DartNSItemProviderCompletionHandler arg0, objc.ObjCObjectBase arg1, + objc.NSDictionary arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + NSItemProviderCompletionHandler arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + NSItemProviderCompletionHandler, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); +} + +typedef NSItemProviderLoadHandler = ffi.Pointer; +typedef DartNSItemProviderLoadHandler = objc.ObjCBlock< + ffi.Void Function( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer?, objc.NSError)>, + ffi.Pointer, + objc.NSDictionary)>; +late final _class_NSItemProvider = objc.getClass("NSItemProvider"); +late final _sel_previewImageHandler = objc.registerName("previewImageHandler"); +final _objc_msgSend_uwvaik = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setPreviewImageHandler_ = + objc.registerName("setPreviewImageHandler:"); +late final _sel_loadPreviewImageWithOptions_completionHandler_ = + objc.registerName("loadPreviewImageWithOptions:completionHandler:"); + +/// NSPreviewSupport +extension NSPreviewSupport on objc.NSItemProvider { + /// previewImageHandler + DartNSItemProviderLoadHandler? get previewImageHandler { + final _ret = + _objc_msgSend_uwvaik(this.ref.pointer, _sel_previewImageHandler); + return _ret.address == 0 + ? null + : ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObject_NSDictionary + .castFromPointer(_ret, retain: true, release: true); + } + + /// setPreviewImageHandler: + set previewImageHandler(DartNSItemProviderLoadHandler? value) { + return _objc_msgSend_f167m6(this.ref.pointer, _sel_setPreviewImageHandler_, + value?.ref.pointer ?? ffi.nullptr); + } + + /// loadPreviewImageWithOptions:completionHandler: + void loadPreviewImageWithOptions_completionHandler_(objc.NSDictionary options, + DartNSItemProviderCompletionHandler completionHandler) { + _objc_msgSend_14pxqbs( + this.ref.pointer, + _sel_loadPreviewImageWithOptions_completionHandler_, + options.ref.pointer, + completionHandler.ref.pointer); + } +} + +typedef NSStringEncoding = NSUInteger; +late final _class_NSString = objc.getClass("NSString"); +late final _sel_substringFromIndex_ = objc.registerName("substringFromIndex:"); +late final _sel_substringToIndex_ = objc.registerName("substringToIndex:"); +late final _sel_substringWithRange_ = objc.registerName("substringWithRange:"); +late final _sel_getCharacters_range_ = + objc.registerName("getCharacters:range:"); +final _objc_msgSend_898fog = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange)>(); +late final _sel_compare_options_ = objc.registerName("compare:options:"); +final _objc_msgSend_16ydezh = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_compare_options_range_ = + objc.registerName("compare:options:range:"); +final _objc_msgSend_eeuxub = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + objc.NSRange)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + objc.NSRange)>(); +late final _sel_compare_options_range_locale_ = + objc.registerName("compare:options:range:locale:"); +final _objc_msgSend_i4hdht = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + objc.NSRange, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + objc.NSRange, + ffi.Pointer)>(); +late final _sel_caseInsensitiveCompare_ = + objc.registerName("caseInsensitiveCompare:"); +late final _sel_localizedCompare_ = objc.registerName("localizedCompare:"); +late final _sel_localizedCaseInsensitiveCompare_ = + objc.registerName("localizedCaseInsensitiveCompare:"); +late final _sel_localizedStandardCompare_ = + objc.registerName("localizedStandardCompare:"); +late final _sel_isEqualToString_ = objc.registerName("isEqualToString:"); +late final _sel_hasPrefix_ = objc.registerName("hasPrefix:"); +late final _sel_hasSuffix_ = objc.registerName("hasSuffix:"); +late final _sel_commonPrefixWithString_options_ = + objc.registerName("commonPrefixWithString:options:"); +final _objc_msgSend_fcs5vo = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_containsString_ = objc.registerName("containsString:"); +late final _sel_localizedCaseInsensitiveContainsString_ = + objc.registerName("localizedCaseInsensitiveContainsString:"); +late final _sel_localizedStandardContainsString_ = + objc.registerName("localizedStandardContainsString:"); +late final _sel_localizedStandardRangeOfString_ = + objc.registerName("localizedStandardRangeOfString:"); +final _objc_msgSend_x4muu7 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + objc.NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + objc.NSRange Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_x4muu7Stret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_rangeOfString_ = objc.registerName("rangeOfString:"); +late final _sel_rangeOfString_options_ = + objc.registerName("rangeOfString:options:"); +final _objc_msgSend_1kwndnw = objc.msgSendPointer + .cast< + ffi.NativeFunction< + objc.NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>() + .asFunction< + objc.NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +final _objc_msgSend_1kwndnwStret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_rangeOfString_options_range_ = + objc.registerName("rangeOfString:options:range:"); +final _objc_msgSend_ackzik = objc.msgSendPointer + .cast< + ffi.NativeFunction< + objc.NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + objc.NSRange)>>() + .asFunction< + objc.NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + objc.NSRange)>(); +final _objc_msgSend_ackzikStret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + objc.NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + objc.NSRange)>(); +late final _sel_rangeOfString_options_range_locale_ = + objc.registerName("rangeOfString:options:range:locale:"); +final _objc_msgSend_198mga8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + objc.NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + objc.NSRange, + ffi.Pointer)>>() + .asFunction< + objc.NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + objc.NSRange, + ffi.Pointer)>(); +final _objc_msgSend_198mga8Stret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + objc.NSRange, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + objc.NSRange, + ffi.Pointer)>(); +late final _sel_rangeOfCharacterFromSet_ = + objc.registerName("rangeOfCharacterFromSet:"); +late final _sel_rangeOfCharacterFromSet_options_ = + objc.registerName("rangeOfCharacterFromSet:options:"); +late final _sel_rangeOfCharacterFromSet_options_range_ = + objc.registerName("rangeOfCharacterFromSet:options:range:"); +late final _sel_rangeOfComposedCharacterSequenceAtIndex_ = + objc.registerName("rangeOfComposedCharacterSequenceAtIndex:"); +final _objc_msgSend_d3i1uy = objc.msgSendPointer + .cast< + ffi.NativeFunction< + objc.NSRange Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + objc.NSRange Function(ffi.Pointer, + ffi.Pointer, int)>(); +final _objc_msgSend_d3i1uyStret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_rangeOfComposedCharacterSequencesForRange_ = + objc.registerName("rangeOfComposedCharacterSequencesForRange:"); +final _objc_msgSend_uimyc7 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + objc.NSRange Function(ffi.Pointer, + ffi.Pointer, objc.NSRange)>>() + .asFunction< + objc.NSRange Function(ffi.Pointer, + ffi.Pointer, objc.NSRange)>(); +final _objc_msgSend_uimyc7Stret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, objc.NSRange)>(); +late final _sel_stringByAppendingString_ = + objc.registerName("stringByAppendingString:"); +late final _sel_stringByAppendingFormat_ = + objc.registerName("stringByAppendingFormat:"); +late final _sel_doubleValue = objc.registerName("doubleValue"); +late final _sel_floatValue = objc.registerName("floatValue"); +late final _sel_intValue = objc.registerName("intValue"); +final _objc_msgSend_13yqbb6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_integerValue = objc.registerName("integerValue"); +late final _sel_longLongValue = objc.registerName("longLongValue"); +late final _sel_boolValue = objc.registerName("boolValue"); +late final _sel_uppercaseString = objc.registerName("uppercaseString"); +late final _sel_lowercaseString = objc.registerName("lowercaseString"); +late final _sel_capitalizedString = objc.registerName("capitalizedString"); +late final _sel_localizedUppercaseString = + objc.registerName("localizedUppercaseString"); +late final _sel_localizedLowercaseString = + objc.registerName("localizedLowercaseString"); +late final _sel_localizedCapitalizedString = + objc.registerName("localizedCapitalizedString"); +late final _sel_uppercaseStringWithLocale_ = + objc.registerName("uppercaseStringWithLocale:"); +late final _sel_lowercaseStringWithLocale_ = + objc.registerName("lowercaseStringWithLocale:"); +late final _sel_capitalizedStringWithLocale_ = + objc.registerName("capitalizedStringWithLocale:"); +late final _sel_getLineStart_end_contentsEnd_forRange_ = + objc.registerName("getLineStart:end:contentsEnd:forRange:"); +final _objc_msgSend_ourvf2 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + objc.NSRange)>(); +late final _sel_lineRangeForRange_ = objc.registerName("lineRangeForRange:"); +late final _sel_getParagraphStart_end_contentsEnd_forRange_ = + objc.registerName("getParagraphStart:end:contentsEnd:forRange:"); +late final _sel_paragraphRangeForRange_ = + objc.registerName("paragraphRangeForRange:"); +void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + NSRange arg1, NSRange arg2, ffi.Pointer arg3)>>() + .asFunction< + void Function(ffi.Pointer, NSRange, NSRange, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSRange, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + NSRange, NSRange, ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSRange, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + NSRange, NSRange, ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSRange, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSRange, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + objc.NSString?, objc.NSRange, objc.NSRange, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, + ffi.Pointer)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer arg0, NSRange arg1, NSRange arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, + ffi.Pointer)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> fromFunction( + void Function(objc.NSString?, NSRange, NSRange, ffi.Pointer) + fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureCallable, + (ffi.Pointer arg0, NSRange arg1, NSRange arg2, + ffi.Pointer arg3) => + fn(arg0.address == 0 ? null : objc.NSString.castFromPointer(arg0, retain: true, release: true), arg1, arg2, arg3)), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, + ffi.Pointer)> listener( + void Function(objc.NSString?, NSRange, NSRange, ffi.Pointer) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, NSRange arg1, NSRange arg2, + ffi.Pointer arg3) => + fn( + arg0.address == 0 + ? null + : objc.NSString.castFromPointer(arg0, + retain: false, release: true), + arg1, + arg2, + arg3)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_8wbg7l(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, + ffi.Pointer)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_CallExtension + on objc.ObjCBlock< + ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, + ffi.Pointer)> { + void call(objc.NSString? arg0, NSRange arg1, NSRange arg2, + ffi.Pointer arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + NSRange arg1, + NSRange arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSRange, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr, arg1, arg2, arg3); +} + +late final _sel_enumerateSubstringsInRange_options_usingBlock_ = + objc.registerName("enumerateSubstringsInRange:options:usingBlock:"); +final _objc_msgSend_14ew8zr = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + objc.NSRange, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + objc.NSRange, + int, + ffi.Pointer)>(); +void _ObjCBlock_ffiVoid_NSString_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_NSString_bool_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSString_bool_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_NSString_bool_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSString_bool_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSString_bool_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSString_bool_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_NSString_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(objc.NSString, ffi.Pointer)>( + pointer, + retain: retain, + release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSString_bool_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> + fromFunction(void Function(objc.NSString, ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSString_bool_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + objc.NSString.castFromPointer(arg0, + retain: true, release: true), + arg1)), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock)> + listener(void Function(objc.NSString, ffi.Pointer) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSString_bool_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + objc.NSString.castFromPointer(arg0, retain: false, release: true), + arg1)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_148br51(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(objc.NSString, ffi.Pointer)>(wrapper, + retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_NSString_bool_CallExtension + on objc.ObjCBlock)> { + void call(objc.NSString arg0, ffi.Pointer arg1) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0.ref.pointer, arg1); +} + +late final _sel_enumerateLinesUsingBlock_ = + objc.registerName("enumerateLinesUsingBlock:"); +late final _sel_UTF8String = objc.registerName("UTF8String"); +final _objc_msgSend_1fuqfwb = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_fastestEncoding = objc.registerName("fastestEncoding"); +late final _sel_smallestEncoding = objc.registerName("smallestEncoding"); +late final _sel_dataUsingEncoding_allowLossyConversion_ = + objc.registerName("dataUsingEncoding:allowLossyConversion:"); +final _objc_msgSend_rubz6a = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong, ffi.Bool)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int, bool)>(); +late final _sel_dataUsingEncoding_ = objc.registerName("dataUsingEncoding:"); +late final _sel_canBeConvertedToEncoding_ = + objc.registerName("canBeConvertedToEncoding:"); +final _objc_msgSend_6peh6o = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_cStringUsingEncoding_ = + objc.registerName("cStringUsingEncoding:"); +final _objc_msgSend_1jtxufi = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_getCString_maxLength_encoding_ = + objc.registerName("getCString:maxLength:encoding:"); +final _objc_msgSend_1lv8yz3 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int)>(); +late final _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_ = + objc.registerName( + "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:"); +final _objc_msgSend_i30zh3 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.UnsignedLong, + NSUInteger, + objc.NSRange, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int, + int, + objc.NSRange, + ffi.Pointer)>(); +late final _sel_maximumLengthOfBytesUsingEncoding_ = + objc.registerName("maximumLengthOfBytesUsingEncoding:"); +final _objc_msgSend_12py2ux = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_lengthOfBytesUsingEncoding_ = + objc.registerName("lengthOfBytesUsingEncoding:"); +late final _sel_availableStringEncodings = + objc.registerName("availableStringEncodings"); +final _objc_msgSend_1h2q612 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_localizedNameOfStringEncoding_ = + objc.registerName("localizedNameOfStringEncoding:"); +late final _sel_defaultCStringEncoding = + objc.registerName("defaultCStringEncoding"); +late final _sel_decomposedStringWithCanonicalMapping = + objc.registerName("decomposedStringWithCanonicalMapping"); +late final _sel_precomposedStringWithCanonicalMapping = + objc.registerName("precomposedStringWithCanonicalMapping"); +late final _sel_decomposedStringWithCompatibilityMapping = + objc.registerName("decomposedStringWithCompatibilityMapping"); +late final _sel_precomposedStringWithCompatibilityMapping = + objc.registerName("precomposedStringWithCompatibilityMapping"); +late final _sel_componentsSeparatedByString_ = + objc.registerName("componentsSeparatedByString:"); +late final _sel_componentsSeparatedByCharactersInSet_ = + objc.registerName("componentsSeparatedByCharactersInSet:"); +late final _sel_stringByTrimmingCharactersInSet_ = + objc.registerName("stringByTrimmingCharactersInSet:"); +late final _sel_stringByPaddingToLength_withString_startingAtIndex_ = + objc.registerName("stringByPaddingToLength:withString:startingAtIndex:"); +final _objc_msgSend_exgdqb = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); +late final _sel_stringByFoldingWithOptions_locale_ = + objc.registerName("stringByFoldingWithOptions:locale:"); +final _objc_msgSend_146986e = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_stringByReplacingOccurrencesOfString_withString_options_range_ = + objc.registerName( + "stringByReplacingOccurrencesOfString:withString:options:range:"); +final _objc_msgSend_1wrs2o6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + objc.NSRange)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + objc.NSRange)>(); +late final _sel_stringByReplacingOccurrencesOfString_withString_ = + objc.registerName("stringByReplacingOccurrencesOfString:withString:"); +late final _sel_stringByReplacingCharactersInRange_withString_ = + objc.registerName("stringByReplacingCharactersInRange:withString:"); +final _objc_msgSend_197wcu5 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + objc.NSRange, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + objc.NSRange, + ffi.Pointer)>(); +typedef NSStringTransform = ffi.Pointer; +typedef DartNSStringTransform = objc.NSString; +late final _sel_stringByApplyingTransform_reverse_ = + objc.registerName("stringByApplyingTransform:reverse:"); +late final _sel_writeToURL_atomically_encoding_error_ = + objc.registerName("writeToURL:atomically:encoding:error:"); +final _objc_msgSend_1140663 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.UnsignedLong, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + int, + ffi.Pointer>)>(); +late final _sel_writeToFile_atomically_encoding_error_ = + objc.registerName("writeToFile:atomically:encoding:error:"); +late final _sel_initWithCharactersNoCopy_length_freeWhenDone_ = + objc.registerName("initWithCharactersNoCopy:length:freeWhenDone:"); +final _objc_msgSend_zsd8q9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Bool)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + bool)>(); +void _ObjCBlock_ffiVoid_unichar_NSUInteger_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction, int)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_unichar_NSUInteger_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>( + _ObjCBlock_ffiVoid_unichar_NSUInteger_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_unichar_NSUInteger_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, int))( + arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_unichar_NSUInteger_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>( + _ObjCBlock_ffiVoid_unichar_NSUInteger_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_unichar_NSUInteger_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer, int))( + arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer, NSUInteger)> + _ObjCBlock_ffiVoid_unichar_NSUInteger_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>.listener( + _ObjCBlock_ffiVoid_unichar_NSUInteger_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, ffi.UnsignedLong)>`. +abstract final class ObjCBlock_ffiVoid_unichar_NSUInteger { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock, ffi.UnsignedLong)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.UnsignedLong)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)> fromFunctionPointer( + ffi.Pointer arg0, NSUInteger arg1)>> + ptr) => + objc.ObjCBlock, ffi.UnsignedLong)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_unichar_NSUInteger_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)> fromFunction( + void Function(ffi.Pointer, DartNSUInteger) fn) => + objc.ObjCBlock, ffi.UnsignedLong)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_unichar_NSUInteger_closureCallable, + (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc + .ObjCBlock, ffi.UnsignedLong)> + listener(void Function(ffi.Pointer, DartNSUInteger) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_unichar_NSUInteger_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_vhbh5h(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)>(wrapper, + retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, ffi.UnsignedLong)>`. +extension ObjCBlock_ffiVoid_unichar_NSUInteger_CallExtension on objc + .ObjCBlock, ffi.UnsignedLong)> { + void call(ffi.Pointer arg0, DartNSUInteger arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>()(ref.pointer, arg0, arg1); +} + +late final _sel_initWithCharactersNoCopy_length_deallocator_ = + objc.registerName("initWithCharactersNoCopy:length:deallocator:"); +final _objc_msgSend_1pr13r6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_initWithCharacters_length_ = + objc.registerName("initWithCharacters:length:"); +final _objc_msgSend_13z9dkp = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_initWithUTF8String_ = objc.registerName("initWithUTF8String:"); +final _objc_msgSend_rqwdif = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithFormat_ = objc.registerName("initWithFormat:"); +late final _sel_initWithFormat_locale_ = + objc.registerName("initWithFormat:locale:"); +late final _sel_initWithValidatedFormat_validFormatSpecifiers_error_ = + objc.registerName("initWithValidatedFormat:validFormatSpecifiers:error:"); +final _objc_msgSend_bo6ep4 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_ = + objc.registerName( + "initWithValidatedFormat:validFormatSpecifiers:locale:error:"); +final _objc_msgSend_2izev6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_initWithData_encoding_ = + objc.registerName("initWithData:encoding:"); +late final _sel_initWithBytes_length_encoding_ = + objc.registerName("initWithBytes:length:encoding:"); +final _objc_msgSend_i38ton = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, int)>(); +late final _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_ = + objc.registerName("initWithBytesNoCopy:length:encoding:freeWhenDone:"); +final _objc_msgSend_o2ktnn = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Bool)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + bool)>(); +void _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction, int)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>( + _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, int))( + arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>( + _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + int arg1) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer, int))( + arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer, NSUInteger)> + _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, ffi.UnsignedLong)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSUInteger { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock, ffi.UnsignedLong)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.UnsignedLong)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)> fromFunctionPointer( + ffi.Pointer arg0, NSUInteger arg1)>> + ptr) => + objc.ObjCBlock, ffi.UnsignedLong)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.UnsignedLong)> + fromFunction(void Function(ffi.Pointer, DartNSUInteger) fn) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureCallable, + (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc + .ObjCBlock, ffi.UnsignedLong)> + listener(void Function(ffi.Pointer, DartNSUInteger) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, int arg1) => fn(arg0, arg1)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_zuf90e(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)>(wrapper, + retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, ffi.UnsignedLong)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSUInteger_CallExtension on objc + .ObjCBlock, ffi.UnsignedLong)> { + void call(ffi.Pointer arg0, DartNSUInteger arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0, NSUInteger arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>()(ref.pointer, arg0, arg1); +} + +late final _sel_initWithBytesNoCopy_length_encoding_deallocator_ = + objc.registerName("initWithBytesNoCopy:length:encoding:deallocator:"); +final _objc_msgSend_1nnfqvg = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); +late final _sel_stringWithString_ = objc.registerName("stringWithString:"); +late final _sel_stringWithCharacters_length_ = + objc.registerName("stringWithCharacters:length:"); +late final _sel_stringWithUTF8String_ = + objc.registerName("stringWithUTF8String:"); +late final _sel_stringWithFormat_ = objc.registerName("stringWithFormat:"); +late final _sel_localizedStringWithFormat_ = + objc.registerName("localizedStringWithFormat:"); +late final _sel_stringWithValidatedFormat_validFormatSpecifiers_error_ = + objc.registerName("stringWithValidatedFormat:validFormatSpecifiers:error:"); +late final _sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_ = + objc.registerName( + "localizedStringWithValidatedFormat:validFormatSpecifiers:error:"); +late final _sel_initWithCString_encoding_ = + objc.registerName("initWithCString:encoding:"); +final _objc_msgSend_a15xhc = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); +late final _sel_stringWithCString_encoding_ = + objc.registerName("stringWithCString:encoding:"); +late final _sel_initWithContentsOfURL_encoding_error_ = + objc.registerName("initWithContentsOfURL:encoding:error:"); +final _objc_msgSend_94cet5 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); +late final _sel_initWithContentsOfFile_encoding_error_ = + objc.registerName("initWithContentsOfFile:encoding:error:"); +late final _sel_stringWithContentsOfURL_encoding_error_ = + objc.registerName("stringWithContentsOfURL:encoding:error:"); +late final _sel_stringWithContentsOfFile_encoding_error_ = + objc.registerName("stringWithContentsOfFile:encoding:error:"); +late final _sel_initWithContentsOfURL_usedEncoding_error_ = + objc.registerName("initWithContentsOfURL:usedEncoding:error:"); +final _objc_msgSend_1gxo8gv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_initWithContentsOfFile_usedEncoding_error_ = + objc.registerName("initWithContentsOfFile:usedEncoding:error:"); +late final _sel_stringWithContentsOfURL_usedEncoding_error_ = + objc.registerName("stringWithContentsOfURL:usedEncoding:error:"); +late final _sel_stringWithContentsOfFile_usedEncoding_error_ = + objc.registerName("stringWithContentsOfFile:usedEncoding:error:"); + +/// NSStringExtensionMethods +extension NSStringExtensionMethods on objc.NSString { + /// substringFromIndex: + objc.NSString substringFromIndex_(DartNSUInteger from) { + final _ret = + _objc_msgSend_1qrcblu(this.ref.pointer, _sel_substringFromIndex_, from); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// substringToIndex: + objc.NSString substringToIndex_(DartNSUInteger to) { + final _ret = + _objc_msgSend_1qrcblu(this.ref.pointer, _sel_substringToIndex_, to); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// substringWithRange: + objc.NSString substringWithRange_(NSRange range) { + final _ret = + _objc_msgSend_83z673(this.ref.pointer, _sel_substringWithRange_, range); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// getCharacters:range: + void getCharacters_range_(ffi.Pointer buffer, NSRange range) { + _objc_msgSend_898fog( + this.ref.pointer, _sel_getCharacters_range_, buffer, range); + } + + /// compare: + objc.NSComparisonResult compare_(objc.NSString string) { + final _ret = _objc_msgSend_1wpduvy( + this.ref.pointer, _sel_compare_, string.ref.pointer); + return objc.NSComparisonResult.fromValue(_ret); + } + + /// compare:options: + objc.NSComparisonResult compare_options_( + objc.NSString string, objc.NSStringCompareOptions mask) { + final _ret = _objc_msgSend_16ydezh(this.ref.pointer, _sel_compare_options_, + string.ref.pointer, mask.value); + return objc.NSComparisonResult.fromValue(_ret); + } + + /// compare:options:range: + objc.NSComparisonResult compare_options_range_(objc.NSString string, + objc.NSStringCompareOptions mask, NSRange rangeOfReceiverToCompare) { + final _ret = _objc_msgSend_eeuxub( + this.ref.pointer, + _sel_compare_options_range_, + string.ref.pointer, + mask.value, + rangeOfReceiverToCompare); + return objc.NSComparisonResult.fromValue(_ret); + } + + /// compare:options:range:locale: + objc.NSComparisonResult compare_options_range_locale_( + objc.NSString string, + objc.NSStringCompareOptions mask, + NSRange rangeOfReceiverToCompare, + objc.ObjCObjectBase? locale) { + final _ret = _objc_msgSend_i4hdht( + this.ref.pointer, + _sel_compare_options_range_locale_, + string.ref.pointer, + mask.value, + rangeOfReceiverToCompare, + locale?.ref.pointer ?? ffi.nullptr); + return objc.NSComparisonResult.fromValue(_ret); + } + + /// caseInsensitiveCompare: + objc.NSComparisonResult caseInsensitiveCompare_(objc.NSString string) { + final _ret = _objc_msgSend_1wpduvy( + this.ref.pointer, _sel_caseInsensitiveCompare_, string.ref.pointer); + return objc.NSComparisonResult.fromValue(_ret); + } + + /// localizedCompare: + objc.NSComparisonResult localizedCompare_(objc.NSString string) { + final _ret = _objc_msgSend_1wpduvy( + this.ref.pointer, _sel_localizedCompare_, string.ref.pointer); + return objc.NSComparisonResult.fromValue(_ret); + } + + /// localizedCaseInsensitiveCompare: + objc.NSComparisonResult localizedCaseInsensitiveCompare_( + objc.NSString string) { + final _ret = _objc_msgSend_1wpduvy(this.ref.pointer, + _sel_localizedCaseInsensitiveCompare_, string.ref.pointer); + return objc.NSComparisonResult.fromValue(_ret); + } + + /// localizedStandardCompare: + objc.NSComparisonResult localizedStandardCompare_(objc.NSString string) { + final _ret = _objc_msgSend_1wpduvy( + this.ref.pointer, _sel_localizedStandardCompare_, string.ref.pointer); + return objc.NSComparisonResult.fromValue(_ret); + } + + /// isEqualToString: + bool isEqualToString_(objc.NSString aString) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_isEqualToString_, aString.ref.pointer); + } + + /// hasPrefix: + bool hasPrefix_(objc.NSString str) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_hasPrefix_, str.ref.pointer); + } + + /// hasSuffix: + bool hasSuffix_(objc.NSString str) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_hasSuffix_, str.ref.pointer); + } + + /// commonPrefixWithString:options: + objc.NSString commonPrefixWithString_options_( + objc.NSString str, objc.NSStringCompareOptions mask) { + final _ret = _objc_msgSend_fcs5vo(this.ref.pointer, + _sel_commonPrefixWithString_options_, str.ref.pointer, mask.value); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// containsString: + bool containsString_(objc.NSString str) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_containsString_, str.ref.pointer); + } + + /// localizedCaseInsensitiveContainsString: + bool localizedCaseInsensitiveContainsString_(objc.NSString str) { + return _objc_msgSend_69e0x1(this.ref.pointer, + _sel_localizedCaseInsensitiveContainsString_, str.ref.pointer); + } + + /// localizedStandardContainsString: + bool localizedStandardContainsString_(objc.NSString str) { + return _objc_msgSend_69e0x1(this.ref.pointer, + _sel_localizedStandardContainsString_, str.ref.pointer); + } + + /// localizedStandardRangeOfString: + NSRange localizedStandardRangeOfString_(objc.NSString str) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_x4muu7Stret(_ptr, this.ref.pointer, + _sel_localizedStandardRangeOfString_, str.ref.pointer) + : _ptr.ref = _objc_msgSend_x4muu7(this.ref.pointer, + _sel_localizedStandardRangeOfString_, str.ref.pointer); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// rangeOfString: + NSRange rangeOfString_(objc.NSString searchString) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_x4muu7Stret(_ptr, this.ref.pointer, _sel_rangeOfString_, + searchString.ref.pointer) + : _ptr.ref = _objc_msgSend_x4muu7( + this.ref.pointer, _sel_rangeOfString_, searchString.ref.pointer); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// rangeOfString:options: + NSRange rangeOfString_options_( + objc.NSString searchString, objc.NSStringCompareOptions mask) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_1kwndnwStret(_ptr, this.ref.pointer, + _sel_rangeOfString_options_, searchString.ref.pointer, mask.value) + : _ptr.ref = _objc_msgSend_1kwndnw(this.ref.pointer, + _sel_rangeOfString_options_, searchString.ref.pointer, mask.value); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// rangeOfString:options:range: + NSRange rangeOfString_options_range_(objc.NSString searchString, + objc.NSStringCompareOptions mask, NSRange rangeOfReceiverToSearch) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_ackzikStret( + _ptr, + this.ref.pointer, + _sel_rangeOfString_options_range_, + searchString.ref.pointer, + mask.value, + rangeOfReceiverToSearch) + : _ptr.ref = _objc_msgSend_ackzik( + this.ref.pointer, + _sel_rangeOfString_options_range_, + searchString.ref.pointer, + mask.value, + rangeOfReceiverToSearch); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// rangeOfString:options:range:locale: + NSRange rangeOfString_options_range_locale_( + objc.NSString searchString, + objc.NSStringCompareOptions mask, + NSRange rangeOfReceiverToSearch, + objc.NSLocale? locale) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_198mga8Stret( + _ptr, + this.ref.pointer, + _sel_rangeOfString_options_range_locale_, + searchString.ref.pointer, + mask.value, + rangeOfReceiverToSearch, + locale?.ref.pointer ?? ffi.nullptr) + : _ptr.ref = _objc_msgSend_198mga8( + this.ref.pointer, + _sel_rangeOfString_options_range_locale_, + searchString.ref.pointer, + mask.value, + rangeOfReceiverToSearch, + locale?.ref.pointer ?? ffi.nullptr); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// rangeOfCharacterFromSet: + NSRange rangeOfCharacterFromSet_(objc.NSCharacterSet searchSet) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_x4muu7Stret(_ptr, this.ref.pointer, + _sel_rangeOfCharacterFromSet_, searchSet.ref.pointer) + : _ptr.ref = _objc_msgSend_x4muu7(this.ref.pointer, + _sel_rangeOfCharacterFromSet_, searchSet.ref.pointer); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// rangeOfCharacterFromSet:options: + NSRange rangeOfCharacterFromSet_options_( + objc.NSCharacterSet searchSet, objc.NSStringCompareOptions mask) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_1kwndnwStret( + _ptr, + this.ref.pointer, + _sel_rangeOfCharacterFromSet_options_, + searchSet.ref.pointer, + mask.value) + : _ptr.ref = _objc_msgSend_1kwndnw( + this.ref.pointer, + _sel_rangeOfCharacterFromSet_options_, + searchSet.ref.pointer, + mask.value); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// rangeOfCharacterFromSet:options:range: + NSRange rangeOfCharacterFromSet_options_range_(objc.NSCharacterSet searchSet, + objc.NSStringCompareOptions mask, NSRange rangeOfReceiverToSearch) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_ackzikStret( + _ptr, + this.ref.pointer, + _sel_rangeOfCharacterFromSet_options_range_, + searchSet.ref.pointer, + mask.value, + rangeOfReceiverToSearch) + : _ptr.ref = _objc_msgSend_ackzik( + this.ref.pointer, + _sel_rangeOfCharacterFromSet_options_range_, + searchSet.ref.pointer, + mask.value, + rangeOfReceiverToSearch); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// rangeOfComposedCharacterSequenceAtIndex: + NSRange rangeOfComposedCharacterSequenceAtIndex_(DartNSUInteger index) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_d3i1uyStret(_ptr, this.ref.pointer, + _sel_rangeOfComposedCharacterSequenceAtIndex_, index) + : _ptr.ref = _objc_msgSend_d3i1uy(this.ref.pointer, + _sel_rangeOfComposedCharacterSequenceAtIndex_, index); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// rangeOfComposedCharacterSequencesForRange: + NSRange rangeOfComposedCharacterSequencesForRange_(NSRange range) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_uimyc7Stret(_ptr, this.ref.pointer, + _sel_rangeOfComposedCharacterSequencesForRange_, range) + : _ptr.ref = _objc_msgSend_uimyc7(this.ref.pointer, + _sel_rangeOfComposedCharacterSequencesForRange_, range); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// stringByAppendingString: + objc.NSString stringByAppendingString_(objc.NSString aString) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_stringByAppendingString_, aString.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringByAppendingFormat: + objc.NSString stringByAppendingFormat_(objc.NSString format) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_stringByAppendingFormat_, format.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// doubleValue + double get doubleValue { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_doubleValue) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_doubleValue); + } + + /// floatValue + double get floatValue { + return objc.useMsgSendVariants + ? _objc_msgSend_2cgrxlFpret(this.ref.pointer, _sel_floatValue) + : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_floatValue); + } + + /// intValue + int get intValue { + return _objc_msgSend_13yqbb6(this.ref.pointer, _sel_intValue); + } + + /// integerValue + DartNSInteger get integerValue { + return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_integerValue); + } + + /// longLongValue + int get longLongValue { + return _objc_msgSend_1k101e3(this.ref.pointer, _sel_longLongValue); + } + + /// boolValue + bool get boolValue { + return _objc_msgSend_91o635(this.ref.pointer, _sel_boolValue); + } + + /// uppercaseString + objc.NSString get uppercaseString { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_uppercaseString); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// lowercaseString + objc.NSString get lowercaseString { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_lowercaseString); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// capitalizedString + objc.NSString get capitalizedString { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_capitalizedString); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// localizedUppercaseString + objc.NSString get localizedUppercaseString { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_localizedUppercaseString); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// localizedLowercaseString + objc.NSString get localizedLowercaseString { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_localizedLowercaseString); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// localizedCapitalizedString + objc.NSString get localizedCapitalizedString { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_localizedCapitalizedString); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// uppercaseStringWithLocale: + objc.NSString uppercaseStringWithLocale_(objc.NSLocale? locale) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_uppercaseStringWithLocale_, locale?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// lowercaseStringWithLocale: + objc.NSString lowercaseStringWithLocale_(objc.NSLocale? locale) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_lowercaseStringWithLocale_, locale?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// capitalizedStringWithLocale: + objc.NSString capitalizedStringWithLocale_(objc.NSLocale? locale) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_capitalizedStringWithLocale_, locale?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// getLineStart:end:contentsEnd:forRange: + void getLineStart_end_contentsEnd_forRange_( + ffi.Pointer startPtr, + ffi.Pointer lineEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range) { + _objc_msgSend_ourvf2( + this.ref.pointer, + _sel_getLineStart_end_contentsEnd_forRange_, + startPtr, + lineEndPtr, + contentsEndPtr, + range); + } + + /// lineRangeForRange: + NSRange lineRangeForRange_(NSRange range) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_uimyc7Stret( + _ptr, this.ref.pointer, _sel_lineRangeForRange_, range) + : _ptr.ref = _objc_msgSend_uimyc7( + this.ref.pointer, _sel_lineRangeForRange_, range); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// getParagraphStart:end:contentsEnd:forRange: + void getParagraphStart_end_contentsEnd_forRange_( + ffi.Pointer startPtr, + ffi.Pointer parEndPtr, + ffi.Pointer contentsEndPtr, + NSRange range) { + _objc_msgSend_ourvf2( + this.ref.pointer, + _sel_getParagraphStart_end_contentsEnd_forRange_, + startPtr, + parEndPtr, + contentsEndPtr, + range); + } + + /// paragraphRangeForRange: + NSRange paragraphRangeForRange_(NSRange range) { + final _ptr = pkg_ffi.calloc(); + objc.useMsgSendVariants + ? _objc_msgSend_uimyc7Stret( + _ptr, this.ref.pointer, _sel_paragraphRangeForRange_, range) + : _ptr.ref = _objc_msgSend_uimyc7( + this.ref.pointer, _sel_paragraphRangeForRange_, range); + final _finalizable = _ptr.cast().asTypedList( + ffi.sizeOf(), + finalizer: pkg_ffi.calloc.nativeFree); + return ffi.Struct.create(_finalizable); + } + + /// enumerateSubstringsInRange:options:usingBlock: + void enumerateSubstringsInRange_options_usingBlock_( + NSRange range, + objc.NSStringEnumerationOptions opts, + objc.ObjCBlock< + ffi.Void Function(objc.NSString?, objc.NSRange, objc.NSRange, + ffi.Pointer)> + block) { + _objc_msgSend_14ew8zr( + this.ref.pointer, + _sel_enumerateSubstringsInRange_options_usingBlock_, + range, + opts.value, + block.ref.pointer); + } + + /// enumerateLinesUsingBlock: + void enumerateLinesUsingBlock_( + objc.ObjCBlock)> + block) { + _objc_msgSend_f167m6( + this.ref.pointer, _sel_enumerateLinesUsingBlock_, block.ref.pointer); + } + + /// UTF8String + ffi.Pointer get UTF8String { + return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_UTF8String); + } + + /// fastestEncoding + DartNSUInteger get fastestEncoding { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_fastestEncoding); + } + + /// smallestEncoding + DartNSUInteger get smallestEncoding { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_smallestEncoding); + } + + /// dataUsingEncoding:allowLossyConversion: + objc.NSData? dataUsingEncoding_allowLossyConversion_( + DartNSUInteger encoding, bool lossy) { + final _ret = _objc_msgSend_rubz6a(this.ref.pointer, + _sel_dataUsingEncoding_allowLossyConversion_, encoding, lossy); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// dataUsingEncoding: + objc.NSData? dataUsingEncoding_(DartNSUInteger encoding) { + final _ret = _objc_msgSend_1qrcblu( + this.ref.pointer, _sel_dataUsingEncoding_, encoding); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// canBeConvertedToEncoding: + bool canBeConvertedToEncoding_(DartNSUInteger encoding) { + return _objc_msgSend_6peh6o( + this.ref.pointer, _sel_canBeConvertedToEncoding_, encoding); + } + + /// cStringUsingEncoding: + ffi.Pointer cStringUsingEncoding_(DartNSUInteger encoding) { + return _objc_msgSend_1jtxufi( + this.ref.pointer, _sel_cStringUsingEncoding_, encoding); + } + + /// getCString:maxLength:encoding: + bool getCString_maxLength_encoding_(ffi.Pointer buffer, + DartNSUInteger maxBufferCount, DartNSUInteger encoding) { + return _objc_msgSend_1lv8yz3(this.ref.pointer, + _sel_getCString_maxLength_encoding_, buffer, maxBufferCount, encoding); + } + + /// getBytes:maxLength:usedLength:encoding:options:range:remainingRange: + bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( + ffi.Pointer buffer, + DartNSUInteger maxBufferCount, + ffi.Pointer usedBufferCount, + DartNSUInteger encoding, + objc.NSStringEncodingConversionOptions options, + NSRange range, + NSRangePointer leftover) { + return _objc_msgSend_i30zh3( + this.ref.pointer, + _sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_, + buffer, + maxBufferCount, + usedBufferCount, + encoding, + options.value, + range, + leftover); + } + + /// maximumLengthOfBytesUsingEncoding: + DartNSUInteger maximumLengthOfBytesUsingEncoding_(DartNSUInteger enc) { + return _objc_msgSend_12py2ux( + this.ref.pointer, _sel_maximumLengthOfBytesUsingEncoding_, enc); + } + + /// lengthOfBytesUsingEncoding: + DartNSUInteger lengthOfBytesUsingEncoding_(DartNSUInteger enc) { + return _objc_msgSend_12py2ux( + this.ref.pointer, _sel_lengthOfBytesUsingEncoding_, enc); + } + + /// availableStringEncodings + static ffi.Pointer getAvailableStringEncodings() { + return _objc_msgSend_1h2q612( + _class_NSString, _sel_availableStringEncodings); + } + + /// localizedNameOfStringEncoding: + static objc.NSString localizedNameOfStringEncoding_(DartNSUInteger encoding) { + final _ret = _objc_msgSend_1qrcblu( + _class_NSString, _sel_localizedNameOfStringEncoding_, encoding); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// defaultCStringEncoding + static DartNSUInteger getDefaultCStringEncoding() { + return _objc_msgSend_xw2lbc(_class_NSString, _sel_defaultCStringEncoding); + } + + /// decomposedStringWithCanonicalMapping + objc.NSString get decomposedStringWithCanonicalMapping { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_decomposedStringWithCanonicalMapping); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// precomposedStringWithCanonicalMapping + objc.NSString get precomposedStringWithCanonicalMapping { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_precomposedStringWithCanonicalMapping); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// decomposedStringWithCompatibilityMapping + objc.NSString get decomposedStringWithCompatibilityMapping { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_decomposedStringWithCompatibilityMapping); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// precomposedStringWithCompatibilityMapping + objc.NSString get precomposedStringWithCompatibilityMapping { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_precomposedStringWithCompatibilityMapping); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// componentsSeparatedByString: + objc.NSArray componentsSeparatedByString_(objc.NSString separator) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_componentsSeparatedByString_, separator.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// componentsSeparatedByCharactersInSet: + objc.NSArray componentsSeparatedByCharactersInSet_( + objc.NSCharacterSet separator) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_componentsSeparatedByCharactersInSet_, separator.ref.pointer); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// stringByTrimmingCharactersInSet: + objc.NSString stringByTrimmingCharactersInSet_(objc.NSCharacterSet set) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_stringByTrimmingCharactersInSet_, set.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringByPaddingToLength:withString:startingAtIndex: + objc.NSString stringByPaddingToLength_withString_startingAtIndex_( + DartNSUInteger newLength, + objc.NSString padString, + DartNSUInteger padIndex) { + final _ret = _objc_msgSend_exgdqb( + this.ref.pointer, + _sel_stringByPaddingToLength_withString_startingAtIndex_, + newLength, + padString.ref.pointer, + padIndex); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringByFoldingWithOptions:locale: + objc.NSString stringByFoldingWithOptions_locale_( + objc.NSStringCompareOptions options, objc.NSLocale? locale) { + final _ret = _objc_msgSend_146986e( + this.ref.pointer, + _sel_stringByFoldingWithOptions_locale_, + options.value, + locale?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringByReplacingOccurrencesOfString:withString:options:range: + objc.NSString stringByReplacingOccurrencesOfString_withString_options_range_( + objc.NSString target, + objc.NSString replacement, + objc.NSStringCompareOptions options, + NSRange searchRange) { + final _ret = _objc_msgSend_1wrs2o6( + this.ref.pointer, + _sel_stringByReplacingOccurrencesOfString_withString_options_range_, + target.ref.pointer, + replacement.ref.pointer, + options.value, + searchRange); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringByReplacingOccurrencesOfString:withString: + objc.NSString stringByReplacingOccurrencesOfString_withString_( + objc.NSString target, objc.NSString replacement) { + final _ret = _objc_msgSend_rsfdlh( + this.ref.pointer, + _sel_stringByReplacingOccurrencesOfString_withString_, + target.ref.pointer, + replacement.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringByReplacingCharactersInRange:withString: + objc.NSString stringByReplacingCharactersInRange_withString_( + NSRange range, objc.NSString replacement) { + final _ret = _objc_msgSend_197wcu5( + this.ref.pointer, + _sel_stringByReplacingCharactersInRange_withString_, + range, + replacement.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringByApplyingTransform:reverse: + objc.NSString? stringByApplyingTransform_reverse_( + DartNSStringTransform transform, bool reverse) { + final _ret = _objc_msgSend_1bdmr5f( + this.ref.pointer, + _sel_stringByApplyingTransform_reverse_, + transform.ref.pointer, + reverse); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// writeToURL:atomically:encoding:error: + bool writeToURL_atomically_encoding_error_( + objc.NSURL url, + bool useAuxiliaryFile, + DartNSUInteger enc, + ffi.Pointer> error) { + return _objc_msgSend_1140663( + this.ref.pointer, + _sel_writeToURL_atomically_encoding_error_, + url.ref.pointer, + useAuxiliaryFile, + enc, + error); + } + + /// writeToFile:atomically:encoding:error: + bool writeToFile_atomically_encoding_error_( + objc.NSString path, + bool useAuxiliaryFile, + DartNSUInteger enc, + ffi.Pointer> error) { + return _objc_msgSend_1140663( + this.ref.pointer, + _sel_writeToFile_atomically_encoding_error_, + path.ref.pointer, + useAuxiliaryFile, + enc, + error); + } + + /// description + objc.NSString get description { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_description); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// hash + DartNSUInteger get hash { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_hash); + } + + /// initWithCharactersNoCopy:length:freeWhenDone: + objc.NSString initWithCharactersNoCopy_length_freeWhenDone_( + ffi.Pointer characters, DartNSUInteger length, bool freeBuffer) { + final _ret = _objc_msgSend_zsd8q9( + this.ref.retainAndReturnPointer(), + _sel_initWithCharactersNoCopy_length_freeWhenDone_, + characters, + length, + freeBuffer); + return objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithCharactersNoCopy:length:deallocator: + objc.NSString initWithCharactersNoCopy_length_deallocator_( + ffi.Pointer chars, + DartNSUInteger len, + objc.ObjCBlock, ffi.UnsignedLong)>? + deallocator) { + final _ret = _objc_msgSend_1pr13r6( + this.ref.retainAndReturnPointer(), + _sel_initWithCharactersNoCopy_length_deallocator_, + chars, + len, + deallocator?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithCharacters:length: + objc.NSString initWithCharacters_length_( + ffi.Pointer characters, DartNSUInteger length) { + final _ret = _objc_msgSend_13z9dkp(this.ref.retainAndReturnPointer(), + _sel_initWithCharacters_length_, characters, length); + return objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithUTF8String: + objc.NSString? initWithUTF8String_( + ffi.Pointer nullTerminatedCString) { + final _ret = _objc_msgSend_rqwdif(this.ref.retainAndReturnPointer(), + _sel_initWithUTF8String_, nullTerminatedCString); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithString: + objc.NSString initWithString_(objc.NSString aString) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithString_, aString.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithFormat: + objc.NSString initWithFormat_(objc.NSString format) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithFormat_, format.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithFormat:locale: + objc.NSString initWithFormat_locale_( + objc.NSString format, objc.ObjCObjectBase? locale) { + final _ret = _objc_msgSend_rsfdlh( + this.ref.retainAndReturnPointer(), + _sel_initWithFormat_locale_, + format.ref.pointer, + locale?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithValidatedFormat:validFormatSpecifiers:error: + objc.NSString? initWithValidatedFormat_validFormatSpecifiers_error_( + objc.NSString format, + objc.NSString validFormatSpecifiers, + ffi.Pointer> error) { + final _ret = _objc_msgSend_bo6ep4( + this.ref.retainAndReturnPointer(), + _sel_initWithValidatedFormat_validFormatSpecifiers_error_, + format.ref.pointer, + validFormatSpecifiers.ref.pointer, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithValidatedFormat:validFormatSpecifiers:locale:error: + objc.NSString? initWithValidatedFormat_validFormatSpecifiers_locale_error_( + objc.NSString format, + objc.NSString validFormatSpecifiers, + objc.ObjCObjectBase? locale, + ffi.Pointer> error) { + final _ret = _objc_msgSend_2izev6( + this.ref.retainAndReturnPointer(), + _sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_, + format.ref.pointer, + validFormatSpecifiers.ref.pointer, + locale?.ref.pointer ?? ffi.nullptr, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithData:encoding: + objc.NSString? initWithData_encoding_( + objc.NSData data, DartNSUInteger encoding) { + final _ret = _objc_msgSend_dcd68g(this.ref.retainAndReturnPointer(), + _sel_initWithData_encoding_, data.ref.pointer, encoding); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithBytes:length:encoding: + objc.NSString? initWithBytes_length_encoding_(ffi.Pointer bytes, + DartNSUInteger len, DartNSUInteger encoding) { + final _ret = _objc_msgSend_i38ton(this.ref.retainAndReturnPointer(), + _sel_initWithBytes_length_encoding_, bytes, len, encoding); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithBytesNoCopy:length:encoding:freeWhenDone: + objc.NSString? initWithBytesNoCopy_length_encoding_freeWhenDone_( + ffi.Pointer bytes, + DartNSUInteger len, + DartNSUInteger encoding, + bool freeBuffer) { + final _ret = _objc_msgSend_o2ktnn( + this.ref.retainAndReturnPointer(), + _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_, + bytes, + len, + encoding, + freeBuffer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithBytesNoCopy:length:encoding:deallocator: + objc.NSString? initWithBytesNoCopy_length_encoding_deallocator_( + ffi.Pointer bytes, + DartNSUInteger len, + DartNSUInteger encoding, + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, ffi.UnsignedLong)>? + deallocator) { + final _ret = _objc_msgSend_1nnfqvg( + this.ref.retainAndReturnPointer(), + _sel_initWithBytesNoCopy_length_encoding_deallocator_, + bytes, + len, + encoding, + deallocator?.ref.pointer ?? ffi.nullptr); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// string + static objc.NSString string() { + final _ret = _objc_msgSend_1x359cv(_class_NSString, _sel_string); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringWithString: + static objc.NSString stringWithString_(objc.NSString string) { + final _ret = _objc_msgSend_62nh5j( + _class_NSString, _sel_stringWithString_, string.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringWithCharacters:length: + static objc.NSString stringWithCharacters_length_( + ffi.Pointer characters, DartNSUInteger length) { + final _ret = _objc_msgSend_13z9dkp( + _class_NSString, _sel_stringWithCharacters_length_, characters, length); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringWithUTF8String: + static objc.NSString? stringWithUTF8String_( + ffi.Pointer nullTerminatedCString) { + final _ret = _objc_msgSend_rqwdif( + _class_NSString, _sel_stringWithUTF8String_, nullTerminatedCString); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringWithFormat: + static objc.NSString stringWithFormat_(objc.NSString format) { + final _ret = _objc_msgSend_62nh5j( + _class_NSString, _sel_stringWithFormat_, format.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// localizedStringWithFormat: + static objc.NSString localizedStringWithFormat_(objc.NSString format) { + final _ret = _objc_msgSend_62nh5j( + _class_NSString, _sel_localizedStringWithFormat_, format.ref.pointer); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringWithValidatedFormat:validFormatSpecifiers:error: + static objc.NSString? stringWithValidatedFormat_validFormatSpecifiers_error_( + objc.NSString format, + objc.NSString validFormatSpecifiers, + ffi.Pointer> error) { + final _ret = _objc_msgSend_bo6ep4( + _class_NSString, + _sel_stringWithValidatedFormat_validFormatSpecifiers_error_, + format.ref.pointer, + validFormatSpecifiers.ref.pointer, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// localizedStringWithValidatedFormat:validFormatSpecifiers:error: + static objc.NSString? + localizedStringWithValidatedFormat_validFormatSpecifiers_error_( + objc.NSString format, + objc.NSString validFormatSpecifiers, + ffi.Pointer> error) { + final _ret = _objc_msgSend_bo6ep4( + _class_NSString, + _sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_, + format.ref.pointer, + validFormatSpecifiers.ref.pointer, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithCString:encoding: + objc.NSString? initWithCString_encoding_( + ffi.Pointer nullTerminatedCString, DartNSUInteger encoding) { + final _ret = _objc_msgSend_a15xhc(this.ref.retainAndReturnPointer(), + _sel_initWithCString_encoding_, nullTerminatedCString, encoding); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// stringWithCString:encoding: + static objc.NSString? stringWithCString_encoding_( + ffi.Pointer cString, DartNSUInteger enc) { + final _ret = _objc_msgSend_a15xhc( + _class_NSString, _sel_stringWithCString_encoding_, cString, enc); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithContentsOfURL:encoding:error: + objc.NSString? initWithContentsOfURL_encoding_error_(objc.NSURL url, + DartNSUInteger enc, ffi.Pointer> error) { + final _ret = _objc_msgSend_94cet5( + this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_encoding_error_, + url.ref.pointer, + enc, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithContentsOfFile:encoding:error: + objc.NSString? initWithContentsOfFile_encoding_error_(objc.NSString path, + DartNSUInteger enc, ffi.Pointer> error) { + final _ret = _objc_msgSend_94cet5( + this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_encoding_error_, + path.ref.pointer, + enc, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// stringWithContentsOfURL:encoding:error: + static objc.NSString? stringWithContentsOfURL_encoding_error_(objc.NSURL url, + DartNSUInteger enc, ffi.Pointer> error) { + final _ret = _objc_msgSend_94cet5( + _class_NSString, + _sel_stringWithContentsOfURL_encoding_error_, + url.ref.pointer, + enc, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringWithContentsOfFile:encoding:error: + static objc.NSString? stringWithContentsOfFile_encoding_error_( + objc.NSString path, + DartNSUInteger enc, + ffi.Pointer> error) { + final _ret = _objc_msgSend_94cet5( + _class_NSString, + _sel_stringWithContentsOfFile_encoding_error_, + path.ref.pointer, + enc, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithContentsOfURL:usedEncoding:error: + objc.NSString? initWithContentsOfURL_usedEncoding_error_( + objc.NSURL url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _objc_msgSend_1gxo8gv( + this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_usedEncoding_error_, + url.ref.pointer, + enc, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// initWithContentsOfFile:usedEncoding:error: + objc.NSString? initWithContentsOfFile_usedEncoding_error_( + objc.NSString path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _objc_msgSend_1gxo8gv( + this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_usedEncoding_error_, + path.ref.pointer, + enc, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: false, release: true); + } + + /// stringWithContentsOfURL:usedEncoding:error: + static objc.NSString? stringWithContentsOfURL_usedEncoding_error_( + objc.NSURL url, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _objc_msgSend_1gxo8gv( + _class_NSString, + _sel_stringWithContentsOfURL_usedEncoding_error_, + url.ref.pointer, + enc, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringWithContentsOfFile:usedEncoding:error: + static objc.NSString? stringWithContentsOfFile_usedEncoding_error_( + objc.NSString path, + ffi.Pointer enc, + ffi.Pointer> error) { + final _ret = _objc_msgSend_1gxo8gv( + _class_NSString, + _sel_stringWithContentsOfFile_usedEncoding_error_, + path.ref.pointer, + enc, + error); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } +} + +typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; +typedef DartNSStringEncodingDetectionOptionsKey = objc.NSString; +late final _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_ = + objc.registerName( + "stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:"); +final _objc_msgSend_pi68en = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>(); + +/// NSStringEncodingDetection +extension NSStringEncodingDetection on objc.NSString { + /// stringEncodingForData:encodingOptions:convertedString:usedLossyConversion: + static DartNSUInteger + stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( + objc.NSData data, + objc.NSDictionary? opts, + ffi.Pointer> string, + ffi.Pointer usedLossyConversion) { + return _objc_msgSend_pi68en( + _class_NSString, + _sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_, + data.ref.pointer, + opts?.ref.pointer ?? ffi.nullptr, + string, + usedLossyConversion); + } +} + +late final _sel_readableTypeIdentifiersForItemProvider = + objc.registerName("readableTypeIdentifiersForItemProvider"); +late final _sel_objectWithItemProviderData_typeIdentifier_error_ = + objc.registerName("objectWithItemProviderData:typeIdentifier:error:"); +instancetype + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>()( + arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>( + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline) + .cast(); +instancetype + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3) => + (objc.getBlockClosure(block) as instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>( + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. +abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3)>> ptr) => + objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)>( + objc.newPointerBlock(_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> + fromFunction(Dartinstancetype? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>) fn) => + objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>( + objc.newClosureBlock( + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3) => + fn(arg0, objc.NSData.castFromPointer(arg1, retain: true, release: true), objc.NSString.castFromPointer(arg2, retain: true, release: true), arg3)?.ref.retainAndAutorelease() ?? + ffi.nullptr), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. +extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_CallExtension + on objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)> { + Dartinstancetype? call(ffi.Pointer arg0, objc.NSData arg1, objc.NSString arg2, ffi.Pointer> arg3) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>() + (ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3) + .address == + 0 + ? null + : objc.ObjCObjectBase( + ref.pointer.ref.invoke.cast block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3)>>().asFunction, ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3), + retain: true, + release: true); +} + +/// NSItemProvider +extension NSItemProvider on objc.NSString { + /// readableTypeIdentifiersForItemProvider + static objc.NSArray getReadableTypeIdentifiersForItemProvider() { + final _ret = _objc_msgSend_1x359cv( + _class_NSString, _sel_readableTypeIdentifiersForItemProvider); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// objectWithItemProviderData:typeIdentifier:error: + static objc.NSString? objectWithItemProviderData_typeIdentifier_error_( + objc.NSData data, + objc.NSString typeIdentifier, + ffi.Pointer> outError) { + final _ret = _objc_msgSend_bo6ep4( + _class_NSString, + _sel_objectWithItemProviderData_typeIdentifier_error_, + data.ref.pointer, + typeIdentifier.ref.pointer, + outError); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// writableTypeIdentifiersForItemProvider + static objc.NSArray getWritableTypeIdentifiersForItemProvider() { + final _ret = _objc_msgSend_1x359cv( + _class_NSString, _sel_writableTypeIdentifiersForItemProvider); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// writableTypeIdentifiersForItemProvider + objc.NSArray get writableTypeIdentifiersForItemProvider { + if (!objc.respondsToSelector( + this.ref.pointer, _sel_writableTypeIdentifiersForItemProvider)) { + throw objc.UnimplementedOptionalMethodException( + 'NSString', 'writableTypeIdentifiersForItemProvider'); + } + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_writableTypeIdentifiersForItemProvider); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// itemProviderVisibilityForRepresentationWithTypeIdentifier: + static objc.NSItemProviderRepresentationVisibility + itemProviderVisibilityForRepresentationWithTypeIdentifier_( + objc.NSString typeIdentifier) { + if (!objc.respondsToSelector(_class_NSString, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_)) { + throw objc.UnimplementedOptionalMethodException('NSString', + 'itemProviderVisibilityForRepresentationWithTypeIdentifier:'); + } + final _ret = _objc_msgSend_96wwe1( + _class_NSString, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + typeIdentifier.ref.pointer); + return objc.NSItemProviderRepresentationVisibility.fromValue(_ret); + } + + /// itemProviderVisibilityForRepresentationWithTypeIdentifier: + objc.NSItemProviderRepresentationVisibility + itemProviderVisibilityForRepresentationWithTypeIdentifier_1( + objc.NSString typeIdentifier) { + if (!objc.respondsToSelector(this.ref.pointer, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_)) { + throw objc.UnimplementedOptionalMethodException('NSString', + 'itemProviderVisibilityForRepresentationWithTypeIdentifier:'); + } + final _ret = _objc_msgSend_96wwe1( + this.ref.pointer, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + typeIdentifier.ref.pointer); + return objc.NSItemProviderRepresentationVisibility.fromValue(_ret); + } + + /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: + NSProgress? loadDataWithTypeIdentifier_forItemProviderCompletionHandler_( + objc.NSString typeIdentifier, + objc.ObjCBlock + completionHandler) { + final _ret = _objc_msgSend_o4sqyk( + this.ref.pointer, + _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, + typeIdentifier.ref.pointer, + completionHandler.ref.pointer); + return _ret.address == 0 + ? null + : NSProgress.castFromPointer(_ret, retain: true, release: true); + } +} + +late final _class_NSMutableString = objc.getClass("NSMutableString"); +late final _sel_insertString_atIndex_ = + objc.registerName("insertString:atIndex:"); +late final _sel_deleteCharactersInRange_ = + objc.registerName("deleteCharactersInRange:"); +late final _sel_appendString_ = objc.registerName("appendString:"); +late final _sel_appendFormat_ = objc.registerName("appendFormat:"); +late final _sel_setString_ = objc.registerName("setString:"); +late final _sel_replaceOccurrencesOfString_withString_options_range_ = + objc.registerName("replaceOccurrencesOfString:withString:options:range:"); +final _objc_msgSend_19rhlmt = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + objc.NSRange)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + objc.NSRange)>(); +late final _sel_applyTransform_reverse_range_updatedRange_ = + objc.registerName("applyTransform:reverse:range:updatedRange:"); +final _objc_msgSend_1wfeihn = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + objc.NSRange, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + objc.NSRange, + ffi.Pointer)>(); +late final _sel_initWithCapacity_ = objc.registerName("initWithCapacity:"); +late final _sel_stringWithCapacity_ = objc.registerName("stringWithCapacity:"); + +/// NSMutableStringExtensionMethods +extension NSMutableStringExtensionMethods on objc.NSMutableString { + /// insertString:atIndex: + void insertString_atIndex_(objc.NSString aString, DartNSUInteger loc) { + _objc_msgSend_10i1axw( + this.ref.pointer, _sel_insertString_atIndex_, aString.ref.pointer, loc); + } + + /// deleteCharactersInRange: + void deleteCharactersInRange_(NSRange range) { + _objc_msgSend_1e3pm0z( + this.ref.pointer, _sel_deleteCharactersInRange_, range); + } + + /// appendString: + void appendString_(objc.NSString aString) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_appendString_, aString.ref.pointer); + } + + /// appendFormat: + void appendFormat_(objc.NSString format) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_appendFormat_, format.ref.pointer); + } + + /// setString: + void setString_(objc.NSString aString) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setString_, aString.ref.pointer); + } + + /// replaceOccurrencesOfString:withString:options:range: + DartNSUInteger replaceOccurrencesOfString_withString_options_range_( + objc.NSString target, + objc.NSString replacement, + objc.NSStringCompareOptions options, + NSRange searchRange) { + return _objc_msgSend_19rhlmt( + this.ref.pointer, + _sel_replaceOccurrencesOfString_withString_options_range_, + target.ref.pointer, + replacement.ref.pointer, + options.value, + searchRange); + } + + /// applyTransform:reverse:range:updatedRange: + bool applyTransform_reverse_range_updatedRange_( + DartNSStringTransform transform, + bool reverse, + NSRange range, + NSRangePointer resultingRange) { + return _objc_msgSend_1wfeihn( + this.ref.pointer, + _sel_applyTransform_reverse_range_updatedRange_, + transform.ref.pointer, + reverse, + range, + resultingRange); + } + + /// initWithCapacity: + objc.NSMutableString initWithCapacity_(DartNSUInteger capacity) { + final _ret = _objc_msgSend_1qrcblu( + this.ref.retainAndReturnPointer(), _sel_initWithCapacity_, capacity); + return objc.NSMutableString.castFromPointer(_ret, + retain: false, release: true); + } + + /// stringWithCapacity: + static objc.NSMutableString stringWithCapacity_(DartNSUInteger capacity) { + final _ret = _objc_msgSend_1qrcblu( + _class_NSMutableString, _sel_stringWithCapacity_, capacity); + return objc.NSMutableString.castFromPointer(_ret, + retain: true, release: true); + } +} + +late final _sel_propertyList = objc.registerName("propertyList"); +late final _sel_propertyListFromStringsFileFormat = + objc.registerName("propertyListFromStringsFileFormat"); + +/// NSExtendedStringPropertyListParsing +extension NSExtendedStringPropertyListParsing on objc.NSString { + /// propertyList + objc.ObjCObjectBase propertyList() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_propertyList); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// propertyListFromStringsFileFormat + objc.NSDictionary? propertyListFromStringsFileFormat() { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_propertyListFromStringsFileFormat); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } +} + +late final _sel_cString = objc.registerName("cString"); +late final _sel_lossyCString = objc.registerName("lossyCString"); +late final _sel_cStringLength = objc.registerName("cStringLength"); +late final _sel_getCString_ = objc.registerName("getCString:"); +final _objc_msgSend_1r7ue5f = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_getCString_maxLength_ = + objc.registerName("getCString:maxLength:"); +final _objc_msgSend_1h3mito = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); +late final _sel_getCString_maxLength_range_remainingRange_ = + objc.registerName("getCString:maxLength:range:remainingRange:"); +final _objc_msgSend_3gpdva = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + objc.NSRange, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + objc.NSRange, + ffi.Pointer)>(); +late final _sel_stringWithContentsOfFile_ = + objc.registerName("stringWithContentsOfFile:"); +late final _sel_stringWithContentsOfURL_ = + objc.registerName("stringWithContentsOfURL:"); +late final _sel_initWithCStringNoCopy_length_freeWhenDone_ = + objc.registerName("initWithCStringNoCopy:length:freeWhenDone:"); +final _objc_msgSend_fjj4b8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Bool)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + bool)>(); +late final _sel_initWithCString_length_ = + objc.registerName("initWithCString:length:"); +late final _sel_initWithCString_ = objc.registerName("initWithCString:"); +late final _sel_stringWithCString_length_ = + objc.registerName("stringWithCString:length:"); +late final _sel_stringWithCString_ = objc.registerName("stringWithCString:"); +late final _sel_getCharacters_ = objc.registerName("getCharacters:"); +final _objc_msgSend_g3kdhc = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + +/// NSStringDeprecated +extension NSStringDeprecated on objc.NSString { + /// cString + ffi.Pointer cString() { + return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_cString); + } + + /// lossyCString + ffi.Pointer lossyCString() { + return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_lossyCString); + } + + /// cStringLength + DartNSUInteger cStringLength() { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_cStringLength); + } + + /// getCString: + void getCString_(ffi.Pointer bytes) { + _objc_msgSend_1r7ue5f(this.ref.pointer, _sel_getCString_, bytes); + } + + /// getCString:maxLength: + void getCString_maxLength_( + ffi.Pointer bytes, DartNSUInteger maxLength) { + _objc_msgSend_1h3mito( + this.ref.pointer, _sel_getCString_maxLength_, bytes, maxLength); + } + + /// getCString:maxLength:range:remainingRange: + void getCString_maxLength_range_remainingRange_(ffi.Pointer bytes, + DartNSUInteger maxLength, NSRange aRange, NSRangePointer leftoverRange) { + _objc_msgSend_3gpdva( + this.ref.pointer, + _sel_getCString_maxLength_range_remainingRange_, + bytes, + maxLength, + aRange, + leftoverRange); + } + + /// writeToFile:atomically: + bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { + return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToFile_atomically_, + path.ref.pointer, useAuxiliaryFile); + } + + /// writeToURL:atomically: + bool writeToURL_atomically_(objc.NSURL url, bool atomically) { + return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToURL_atomically_, + url.ref.pointer, atomically); + } + + /// initWithContentsOfFile: + objc.ObjCObjectBase? initWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } + + /// initWithContentsOfURL: + objc.ObjCObjectBase? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } + + /// stringWithContentsOfFile: + static objc.ObjCObjectBase? stringWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j( + _class_NSString, _sel_stringWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// stringWithContentsOfURL: + static objc.ObjCObjectBase? stringWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j( + _class_NSString, _sel_stringWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// initWithCStringNoCopy:length:freeWhenDone: + objc.ObjCObjectBase? initWithCStringNoCopy_length_freeWhenDone_( + ffi.Pointer bytes, DartNSUInteger length, bool freeBuffer) { + final _ret = _objc_msgSend_fjj4b8( + this.ref.retainAndReturnPointer(), + _sel_initWithCStringNoCopy_length_freeWhenDone_, + bytes, + length, + freeBuffer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } + + /// initWithCString:length: + objc.ObjCObjectBase? initWithCString_length_( + ffi.Pointer bytes, DartNSUInteger length) { + final _ret = _objc_msgSend_a15xhc(this.ref.retainAndReturnPointer(), + _sel_initWithCString_length_, bytes, length); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } + + /// initWithCString: + objc.ObjCObjectBase? initWithCString_(ffi.Pointer bytes) { + final _ret = _objc_msgSend_rqwdif( + this.ref.retainAndReturnPointer(), _sel_initWithCString_, bytes); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } + + /// stringWithCString:length: + static objc.ObjCObjectBase? stringWithCString_length_( + ffi.Pointer bytes, DartNSUInteger length) { + final _ret = _objc_msgSend_a15xhc( + _class_NSString, _sel_stringWithCString_length_, bytes, length); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// stringWithCString: + static objc.ObjCObjectBase? stringWithCString_(ffi.Pointer bytes) { + final _ret = + _objc_msgSend_rqwdif(_class_NSString, _sel_stringWithCString_, bytes); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// getCharacters: + void getCharacters_(ffi.Pointer buffer) { + _objc_msgSend_g3kdhc(this.ref.pointer, _sel_getCharacters_, buffer); + } +} + +late final _protocol_NSURLHandleClient = objc.getProtocol("NSURLHandleClient"); +late final _sel_URLHandle_resourceDataDidBecomeAvailable_ = + objc.registerName("URLHandle:resourceDataDidBecomeAvailable:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSData)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSURLHandle, + objc.NSData)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, objc.NSURLHandle, objc.NSData)> + fromFunctionPointer( + ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, objc.NSURLHandle, objc.NSData)> + fromFunction(void Function(ffi.Pointer, objc.NSURLHandle, objc.NSData) fn) => + objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, retain: true, release: true), + objc.NSData.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSData)> listener( + void Function(ffi.Pointer, objc.NSURLHandle, objc.NSData) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, + retain: false, release: true), + objc.NSData.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSURLHandle, + objc.NSData)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSData)> { + void call(ffi.Pointer arg0, objc.NSURLHandle arg1, + objc.NSData arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); +} + +late final _sel_URLHandleResourceDidBeginLoading_ = + objc.registerName("URLHandleResourceDidBeginLoading:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock, objc.NSURLHandle)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + objc.NSURLHandle)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, objc.NSURLHandle)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, objc.NSURLHandle)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, objc.NSURLHandle)> + fromFunction(void Function(ffi.Pointer, objc.NSURLHandle) fn) => + objc.ObjCBlock, objc.NSURLHandle)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, + retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc + .ObjCBlock, objc.NSURLHandle)> + listener(void Function(ffi.Pointer, objc.NSURLHandle) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjovn7(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSURLHandle)>(wrapper, + retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, objc.NSURLHandle)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_CallExtension on objc + .ObjCBlock, objc.NSURLHandle)> { + void call(ffi.Pointer arg0, objc.NSURLHandle arg1) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer); +} + +late final _sel_URLHandleResourceDidFinishLoading_ = + objc.registerName("URLHandleResourceDidFinishLoading:"); +late final _sel_URLHandleResourceDidCancelLoading_ = + objc.registerName("URLHandleResourceDidCancelLoading:"); +late final _sel_URLHandle_resourceDidFailLoadingWithReason_ = + objc.registerName("URLHandle:resourceDidFailLoadingWithReason:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSString)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSURLHandle, + objc.NSString)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, objc.NSURLHandle, objc.NSString)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSString)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, objc.NSURLHandle, objc.NSString)> + fromFunction(void Function(ffi.Pointer, objc.NSURLHandle, objc.NSString) fn) => + objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, retain: true, release: true), + objc.NSString.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSString)> listener( + void Function(ffi.Pointer, objc.NSURLHandle, objc.NSString) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, + retain: false, release: true), + objc.NSString.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSURLHandle, + objc.NSString)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSString)> { + void call(ffi.Pointer arg0, objc.NSURLHandle arg1, + objc.NSString arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); +} + +/// NSURLHandleClient +abstract final class NSURLHandleClient { + /// Builds an object that implements the NSURLHandleClient protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required void Function(objc.NSURLHandle, objc.NSData) + URLHandle_resourceDataDidBecomeAvailable_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidBeginLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidFinishLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidCancelLoading_, + required void Function(objc.NSURLHandle, objc.NSString) + URLHandle_resourceDidFailLoadingWithReason_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_.implement( + builder, URLHandle_resourceDataDidBecomeAvailable_); + NSURLHandleClient.URLHandleResourceDidBeginLoading_.implement( + builder, URLHandleResourceDidBeginLoading_); + NSURLHandleClient.URLHandleResourceDidFinishLoading_.implement( + builder, URLHandleResourceDidFinishLoading_); + NSURLHandleClient.URLHandleResourceDidCancelLoading_.implement( + builder, URLHandleResourceDidCancelLoading_); + NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_.implement( + builder, URLHandle_resourceDidFailLoadingWithReason_); + return builder.build(); + } + + /// Adds the implementation of the NSURLHandleClient protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required void Function(objc.NSURLHandle, objc.NSData) + URLHandle_resourceDataDidBecomeAvailable_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidBeginLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidFinishLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidCancelLoading_, + required void Function(objc.NSURLHandle, objc.NSString) + URLHandle_resourceDidFailLoadingWithReason_}) { + NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_.implement( + builder, URLHandle_resourceDataDidBecomeAvailable_); + NSURLHandleClient.URLHandleResourceDidBeginLoading_.implement( + builder, URLHandleResourceDidBeginLoading_); + NSURLHandleClient.URLHandleResourceDidFinishLoading_.implement( + builder, URLHandleResourceDidFinishLoading_); + NSURLHandleClient.URLHandleResourceDidCancelLoading_.implement( + builder, URLHandleResourceDidCancelLoading_); + NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_.implement( + builder, URLHandle_resourceDidFailLoadingWithReason_); + } + + /// Builds an object that implements the NSURLHandleClient protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required void Function(objc.NSURLHandle, objc.NSData) + URLHandle_resourceDataDidBecomeAvailable_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidBeginLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidFinishLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidCancelLoading_, + required void Function(objc.NSURLHandle, objc.NSString) + URLHandle_resourceDidFailLoadingWithReason_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_ + .implementAsListener( + builder, URLHandle_resourceDataDidBecomeAvailable_); + NSURLHandleClient.URLHandleResourceDidBeginLoading_.implementAsListener( + builder, URLHandleResourceDidBeginLoading_); + NSURLHandleClient.URLHandleResourceDidFinishLoading_.implementAsListener( + builder, URLHandleResourceDidFinishLoading_); + NSURLHandleClient.URLHandleResourceDidCancelLoading_.implementAsListener( + builder, URLHandleResourceDidCancelLoading_); + NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_ + .implementAsListener( + builder, URLHandle_resourceDidFailLoadingWithReason_); + return builder.build(); + } + + /// Adds the implementation of the NSURLHandleClient protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required void Function(objc.NSURLHandle, objc.NSData) + URLHandle_resourceDataDidBecomeAvailable_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidBeginLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidFinishLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidCancelLoading_, + required void Function(objc.NSURLHandle, objc.NSString) + URLHandle_resourceDidFailLoadingWithReason_}) { + NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_ + .implementAsListener( + builder, URLHandle_resourceDataDidBecomeAvailable_); + NSURLHandleClient.URLHandleResourceDidBeginLoading_.implementAsListener( + builder, URLHandleResourceDidBeginLoading_); + NSURLHandleClient.URLHandleResourceDidFinishLoading_.implementAsListener( + builder, URLHandleResourceDidFinishLoading_); + NSURLHandleClient.URLHandleResourceDidCancelLoading_.implementAsListener( + builder, URLHandleResourceDidCancelLoading_); + NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_ + .implementAsListener( + builder, URLHandle_resourceDidFailLoadingWithReason_); + } + + /// URLHandle:resourceDataDidBecomeAvailable: + static final URLHandle_resourceDataDidBecomeAvailable_ = + objc.ObjCProtocolListenableMethod< + void Function(objc.NSURLHandle, objc.NSData)>( + _protocol_NSURLHandleClient, + _sel_URLHandle_resourceDataDidBecomeAvailable_, + objc.getProtocolMethodSignature( + _protocol_NSURLHandleClient, + _sel_URLHandle_resourceDataDidBecomeAvailable_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSURLHandle, objc.NSData) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData.fromFunction( + (ffi.Pointer _, objc.NSURLHandle arg1, + objc.NSData arg2) => + func(arg1, arg2)), + (void Function(objc.NSURLHandle, objc.NSData) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData.listener( + (ffi.Pointer _, objc.NSURLHandle arg1, + objc.NSData arg2) => + func(arg1, arg2)), + ); + + /// URLHandleResourceDidBeginLoading: + static final URLHandleResourceDidBeginLoading_ = + objc.ObjCProtocolListenableMethod( + _protocol_NSURLHandleClient, + _sel_URLHandleResourceDidBeginLoading_, + objc.getProtocolMethodSignature( + _protocol_NSURLHandleClient, + _sel_URLHandleResourceDidBeginLoading_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + ); + + /// URLHandleResourceDidFinishLoading: + static final URLHandleResourceDidFinishLoading_ = + objc.ObjCProtocolListenableMethod( + _protocol_NSURLHandleClient, + _sel_URLHandleResourceDidFinishLoading_, + objc.getProtocolMethodSignature( + _protocol_NSURLHandleClient, + _sel_URLHandleResourceDidFinishLoading_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + ); + + /// URLHandleResourceDidCancelLoading: + static final URLHandleResourceDidCancelLoading_ = + objc.ObjCProtocolListenableMethod( + _protocol_NSURLHandleClient, + _sel_URLHandleResourceDidCancelLoading_, + objc.getProtocolMethodSignature( + _protocol_NSURLHandleClient, + _sel_URLHandleResourceDidCancelLoading_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + ); + + /// URLHandle:resourceDidFailLoadingWithReason: + static final URLHandle_resourceDidFailLoadingWithReason_ = + objc.ObjCProtocolListenableMethod< + void Function(objc.NSURLHandle, objc.NSString)>( + _protocol_NSURLHandleClient, + _sel_URLHandle_resourceDidFailLoadingWithReason_, + objc.getProtocolMethodSignature( + _protocol_NSURLHandleClient, + _sel_URLHandle_resourceDidFailLoadingWithReason_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSURLHandle, objc.NSString) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString.fromFunction( + (ffi.Pointer _, objc.NSURLHandle arg1, + objc.NSString arg2) => + func(arg1, arg2)), + (void Function(objc.NSURLHandle, objc.NSString) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString.listener( + (ffi.Pointer _, objc.NSURLHandle arg1, + objc.NSString arg2) => + func(arg1, arg2)), + ); +} + +typedef NSURLResourceKey = ffi.Pointer; +typedef DartNSURLResourceKey = objc.NSString; +typedef NSURLFileResourceType = ffi.Pointer; +typedef DartNSURLFileResourceType = objc.NSString; +typedef NSURLThumbnailDictionaryItem = ffi.Pointer; +typedef DartNSURLThumbnailDictionaryItem = objc.NSString; +typedef NSURLFileProtectionType = ffi.Pointer; +typedef DartNSURLFileProtectionType = objc.NSString; +typedef NSURLUbiquitousItemDownloadingStatus = ffi.Pointer; +typedef DartNSURLUbiquitousItemDownloadingStatus = objc.NSString; +typedef NSURLUbiquitousSharedItemRole = ffi.Pointer; +typedef DartNSURLUbiquitousSharedItemRole = objc.NSString; +typedef NSURLUbiquitousSharedItemPermissions = ffi.Pointer; +typedef DartNSURLUbiquitousSharedItemPermissions = objc.NSString; +typedef NSURLBookmarkFileCreationOptions = NSUInteger; +late final _class_NSURL = objc.getClass("NSURL"); +late final _sel_getPromisedItemResourceValue_forKey_error_ = + objc.registerName("getPromisedItemResourceValue:forKey:error:"); +final _objc_msgSend_7iv28v = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_promisedItemResourceValuesForKeys_error_ = + objc.registerName("promisedItemResourceValuesForKeys:error:"); +late final _sel_checkPromisedItemIsReachableAndReturnError_ = + objc.registerName("checkPromisedItemIsReachableAndReturnError:"); +final _objc_msgSend_1dom33q = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); + +/// NSPromisedItems +extension NSPromisedItems on objc.NSURL { + /// Get resource values from URLs of 'promised' items. A promised item is not guaranteed to have its contents in the file system until you use NSFileCoordinator to perform a coordinated read on its URL, which causes the contents to be downloaded or otherwise generated. Promised item URLs are returned by various APIs, including currently: + /// - NSMetadataQueryUbiquitousDataScope + /// - NSMetadataQueryUbiquitousDocumentsScope + /// - An NSFilePresenter presenting the contents of the directory located by -URLForUbiquitousContainerIdentifier: or a subdirectory thereof + /// + /// The following methods behave identically to their similarly named methods above (-getResourceValue:forKey:error:, etc.), except that they allow you to get resource values and check for presence regardless of whether the promised item's contents currently exist at the URL. You must use these APIs instead of the normal NSURL resource value APIs if and only if any of the following are true: + /// - You are using a URL that you know came directly from one of the above APIs + /// - You are inside the accessor block of a coordinated read or write that used NSFileCoordinatorReadingImmediatelyAvailableMetadataOnly, NSFileCoordinatorWritingForDeleting, NSFileCoordinatorWritingForMoving, or NSFileCoordinatorWritingContentIndependentMetadataOnly + /// + /// Most of the NSURL resource value keys will work with these APIs. However, there are some that are tied to the item's contents that will not work, such as NSURLContentAccessDateKey or NSURLGenerationIdentifierKey. If one of these keys is used, the method will return YES, but the value for the key will be nil. + bool getPromisedItemResourceValue_forKey_error_( + ffi.Pointer> value, + DartNSURLResourceKey key, + ffi.Pointer> error) { + return _objc_msgSend_7iv28v( + this.ref.pointer, + _sel_getPromisedItemResourceValue_forKey_error_, + value, + key.ref.pointer, + error); + } + + /// promisedItemResourceValuesForKeys:error: + objc.NSDictionary? promisedItemResourceValuesForKeys_error_( + objc.NSArray keys, ffi.Pointer> error) { + final _ret = _objc_msgSend_1705co6(this.ref.pointer, + _sel_promisedItemResourceValuesForKeys_error_, keys.ref.pointer, error); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// checkPromisedItemIsReachableAndReturnError: + bool checkPromisedItemIsReachableAndReturnError_( + ffi.Pointer> error) { + return _objc_msgSend_1dom33q(this.ref.pointer, + _sel_checkPromisedItemIsReachableAndReturnError_, error); + } +} + +/// NSItemProvider +extension NSItemProvider1 on objc.NSURL { + /// readableTypeIdentifiersForItemProvider + static objc.NSArray getReadableTypeIdentifiersForItemProvider() { + final _ret = _objc_msgSend_1x359cv( + _class_NSURL, _sel_readableTypeIdentifiersForItemProvider); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// objectWithItemProviderData:typeIdentifier:error: + static objc.NSURL? objectWithItemProviderData_typeIdentifier_error_( + objc.NSData data, + objc.NSString typeIdentifier, + ffi.Pointer> outError) { + final _ret = _objc_msgSend_bo6ep4( + _class_NSURL, + _sel_objectWithItemProviderData_typeIdentifier_error_, + data.ref.pointer, + typeIdentifier.ref.pointer, + outError); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// writableTypeIdentifiersForItemProvider + static objc.NSArray getWritableTypeIdentifiersForItemProvider() { + final _ret = _objc_msgSend_1x359cv( + _class_NSURL, _sel_writableTypeIdentifiersForItemProvider); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// writableTypeIdentifiersForItemProvider + objc.NSArray get writableTypeIdentifiersForItemProvider { + if (!objc.respondsToSelector( + this.ref.pointer, _sel_writableTypeIdentifiersForItemProvider)) { + throw objc.UnimplementedOptionalMethodException( + 'NSURL', 'writableTypeIdentifiersForItemProvider'); + } + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_writableTypeIdentifiersForItemProvider); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// itemProviderVisibilityForRepresentationWithTypeIdentifier: + static objc.NSItemProviderRepresentationVisibility + itemProviderVisibilityForRepresentationWithTypeIdentifier_( + objc.NSString typeIdentifier) { + if (!objc.respondsToSelector(_class_NSURL, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_)) { + throw objc.UnimplementedOptionalMethodException('NSURL', + 'itemProviderVisibilityForRepresentationWithTypeIdentifier:'); + } + final _ret = _objc_msgSend_96wwe1( + _class_NSURL, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + typeIdentifier.ref.pointer); + return objc.NSItemProviderRepresentationVisibility.fromValue(_ret); + } + + /// itemProviderVisibilityForRepresentationWithTypeIdentifier: + objc.NSItemProviderRepresentationVisibility + itemProviderVisibilityForRepresentationWithTypeIdentifier_1( + objc.NSString typeIdentifier) { + if (!objc.respondsToSelector(this.ref.pointer, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_)) { + throw objc.UnimplementedOptionalMethodException('NSURL', + 'itemProviderVisibilityForRepresentationWithTypeIdentifier:'); + } + final _ret = _objc_msgSend_96wwe1( + this.ref.pointer, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + typeIdentifier.ref.pointer); + return objc.NSItemProviderRepresentationVisibility.fromValue(_ret); + } + + /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: + NSProgress? loadDataWithTypeIdentifier_forItemProviderCompletionHandler_( + objc.NSString typeIdentifier, + objc.ObjCBlock + completionHandler) { + final _ret = _objc_msgSend_o4sqyk( + this.ref.pointer, + _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, + typeIdentifier.ref.pointer, + completionHandler.ref.pointer); + return _ret.address == 0 + ? null + : NSProgress.castFromPointer(_ret, retain: true, release: true); + } +} + +late final _class_NSCharacterSet = objc.getClass("NSCharacterSet"); +late final _sel_URLUserAllowedCharacterSet = + objc.registerName("URLUserAllowedCharacterSet"); +late final _sel_URLPasswordAllowedCharacterSet = + objc.registerName("URLPasswordAllowedCharacterSet"); +late final _sel_URLHostAllowedCharacterSet = + objc.registerName("URLHostAllowedCharacterSet"); +late final _sel_URLPathAllowedCharacterSet = + objc.registerName("URLPathAllowedCharacterSet"); +late final _sel_URLQueryAllowedCharacterSet = + objc.registerName("URLQueryAllowedCharacterSet"); +late final _sel_URLFragmentAllowedCharacterSet = + objc.registerName("URLFragmentAllowedCharacterSet"); + +/// NSURLUtilities +extension NSURLUtilities on objc.NSCharacterSet { + /// Returns a character set containing the characters allowed in a URL's user subcomponent. + static objc.NSCharacterSet getURLUserAllowedCharacterSet() { + final _ret = _objc_msgSend_1x359cv( + _class_NSCharacterSet, _sel_URLUserAllowedCharacterSet); + return objc.NSCharacterSet.castFromPointer(_ret, + retain: true, release: true); + } + + /// Returns a character set containing the characters allowed in a URL's password subcomponent. + static objc.NSCharacterSet getURLPasswordAllowedCharacterSet() { + final _ret = _objc_msgSend_1x359cv( + _class_NSCharacterSet, _sel_URLPasswordAllowedCharacterSet); + return objc.NSCharacterSet.castFromPointer(_ret, + retain: true, release: true); + } + + /// Returns a character set containing the characters allowed in a URL's host subcomponent. + static objc.NSCharacterSet getURLHostAllowedCharacterSet() { + final _ret = _objc_msgSend_1x359cv( + _class_NSCharacterSet, _sel_URLHostAllowedCharacterSet); + return objc.NSCharacterSet.castFromPointer(_ret, + retain: true, release: true); + } + + /// Returns a character set containing the characters allowed in a URL's path component. ';' is a legal path character, but it is recommended that it be percent-encoded for best compatibility with NSURL (-stringByAddingPercentEncodingWithAllowedCharacters: will percent-encode any ';' characters if you pass the URLPathAllowedCharacterSet). + static objc.NSCharacterSet getURLPathAllowedCharacterSet() { + final _ret = _objc_msgSend_1x359cv( + _class_NSCharacterSet, _sel_URLPathAllowedCharacterSet); + return objc.NSCharacterSet.castFromPointer(_ret, + retain: true, release: true); + } + + /// Returns a character set containing the characters allowed in a URL's query component. + static objc.NSCharacterSet getURLQueryAllowedCharacterSet() { + final _ret = _objc_msgSend_1x359cv( + _class_NSCharacterSet, _sel_URLQueryAllowedCharacterSet); + return objc.NSCharacterSet.castFromPointer(_ret, + retain: true, release: true); + } + + /// Returns a character set containing the characters allowed in a URL's fragment component. + static objc.NSCharacterSet getURLFragmentAllowedCharacterSet() { + final _ret = _objc_msgSend_1x359cv( + _class_NSCharacterSet, _sel_URLFragmentAllowedCharacterSet); + return objc.NSCharacterSet.castFromPointer(_ret, + retain: true, release: true); + } +} + +late final _sel_stringByAddingPercentEncodingWithAllowedCharacters_ = + objc.registerName("stringByAddingPercentEncodingWithAllowedCharacters:"); +late final _sel_stringByRemovingPercentEncoding = + objc.registerName("stringByRemovingPercentEncoding"); +late final _sel_stringByAddingPercentEscapesUsingEncoding_ = + objc.registerName("stringByAddingPercentEscapesUsingEncoding:"); +late final _sel_stringByReplacingPercentEscapesUsingEncoding_ = + objc.registerName("stringByReplacingPercentEscapesUsingEncoding:"); + +/// NSURLUtilities +extension NSURLUtilities1 on objc.NSString { + /// Returns a new string made from the receiver by replacing all characters not in the allowedCharacters set with percent encoded characters. UTF-8 encoding is used to determine the correct percent encoded characters. Entire URL strings cannot be percent-encoded. This method is intended to percent-encode a URL component or subcomponent string, NOT the entire URL string. Any characters in allowedCharacters outside of the 7-bit ASCII range are ignored. + objc.NSString? stringByAddingPercentEncodingWithAllowedCharacters_( + objc.NSCharacterSet allowedCharacters) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, + _sel_stringByAddingPercentEncodingWithAllowedCharacters_, + allowedCharacters.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// Returns a new string made from the receiver by replacing all percent encoded sequences with the matching UTF-8 characters. + objc.NSString? get stringByRemovingPercentEncoding { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_stringByRemovingPercentEncoding); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringByAddingPercentEscapesUsingEncoding: + objc.NSString? stringByAddingPercentEscapesUsingEncoding_( + DartNSUInteger enc) { + final _ret = _objc_msgSend_1qrcblu( + this.ref.pointer, _sel_stringByAddingPercentEscapesUsingEncoding_, enc); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// stringByReplacingPercentEscapesUsingEncoding: + objc.NSString? stringByReplacingPercentEscapesUsingEncoding_( + DartNSUInteger enc) { + final _ret = _objc_msgSend_1qrcblu(this.ref.pointer, + _sel_stringByReplacingPercentEscapesUsingEncoding_, enc); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } +} + +late final _sel_fileURLWithPathComponents_ = + objc.registerName("fileURLWithPathComponents:"); +late final _sel_pathComponents = objc.registerName("pathComponents"); +late final _sel_lastPathComponent = objc.registerName("lastPathComponent"); +late final _sel_pathExtension = objc.registerName("pathExtension"); +late final _sel_URLByAppendingPathComponent_ = + objc.registerName("URLByAppendingPathComponent:"); +late final _sel_URLByAppendingPathComponent_isDirectory_ = + objc.registerName("URLByAppendingPathComponent:isDirectory:"); +late final _sel_URLByDeletingLastPathComponent = + objc.registerName("URLByDeletingLastPathComponent"); +late final _sel_URLByAppendingPathExtension_ = + objc.registerName("URLByAppendingPathExtension:"); +late final _sel_URLByDeletingPathExtension = + objc.registerName("URLByDeletingPathExtension"); +late final _sel_checkResourceIsReachableAndReturnError_ = + objc.registerName("checkResourceIsReachableAndReturnError:"); +late final _sel_URLByStandardizingPath = + objc.registerName("URLByStandardizingPath"); +late final _sel_URLByResolvingSymlinksInPath = + objc.registerName("URLByResolvingSymlinksInPath"); + +/// NSURLPathUtilities +extension NSURLPathUtilities on objc.NSURL { + /// The following methods work on the path portion of a URL in the same manner that the NSPathUtilities methods on NSString do. + static objc.NSURL? fileURLWithPathComponents_(objc.NSArray components) { + final _ret = _objc_msgSend_62nh5j( + _class_NSURL, _sel_fileURLWithPathComponents_, components.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// pathComponents + objc.NSArray? get pathComponents { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_pathComponents); + return _ret.address == 0 + ? null + : objc.NSArray.castFromPointer(_ret, retain: true, release: true); + } + + /// lastPathComponent + objc.NSString? get lastPathComponent { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_lastPathComponent); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// pathExtension + objc.NSString? get pathExtension { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_pathExtension); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// URLByAppendingPathComponent: + objc.NSURL? URLByAppendingPathComponent_(objc.NSString pathComponent) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_URLByAppendingPathComponent_, pathComponent.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLByAppendingPathComponent:isDirectory: + objc.NSURL? URLByAppendingPathComponent_isDirectory_( + objc.NSString pathComponent, bool isDirectory) { + final _ret = _objc_msgSend_1bdmr5f( + this.ref.pointer, + _sel_URLByAppendingPathComponent_isDirectory_, + pathComponent.ref.pointer, + isDirectory); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLByDeletingLastPathComponent + objc.NSURL? get URLByDeletingLastPathComponent { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_URLByDeletingLastPathComponent); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLByAppendingPathExtension: + objc.NSURL? URLByAppendingPathExtension_(objc.NSString pathExtension) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_URLByAppendingPathExtension_, pathExtension.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLByDeletingPathExtension + objc.NSURL? get URLByDeletingPathExtension { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_URLByDeletingPathExtension); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// Returns whether the URL's resource exists and is reachable. This method synchronously checks if the resource's backing store is reachable. Checking reachability is appropriate when making decisions that do not require other immediate operations on the resource, e.g. periodic maintenance of UI state that depends on the existence of a specific document. When performing operations such as opening a file or copying resource properties, it is more efficient to simply try the operation and handle failures. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. For other URL types, NO is returned. Symbol is present in iOS 4, but performs no operation. + bool checkResourceIsReachableAndReturnError_( + ffi.Pointer> error) { + return _objc_msgSend_1dom33q( + this.ref.pointer, _sel_checkResourceIsReachableAndReturnError_, error); + } + + /// URLByStandardizingPath + objc.NSURL? get URLByStandardizingPath { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_URLByStandardizingPath); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } + + /// URLByResolvingSymlinksInPath + objc.NSURL? get URLByResolvingSymlinksInPath { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_URLByResolvingSymlinksInPath); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } +} + +late final _sel_URL_resourceDataDidBecomeAvailable_ = + objc.registerName("URL:resourceDataDidBecomeAvailable:"); +late final _sel_URLResourceDidFinishLoading_ = + objc.registerName("URLResourceDidFinishLoading:"); +late final _sel_URLResourceDidCancelLoading_ = + objc.registerName("URLResourceDidCancelLoading:"); +late final _sel_URL_resourceDidFailLoadingWithReason_ = + objc.registerName("URL:resourceDidFailLoadingWithReason:"); + +/// NSURLClient +extension NSURLClient on objc.NSObject { + /// URL:resourceDataDidBecomeAvailable: + void URL_resourceDataDidBecomeAvailable_( + objc.NSURL sender, objc.NSData newBytes) { + _objc_msgSend_wjvic9( + this.ref.pointer, + _sel_URL_resourceDataDidBecomeAvailable_, + sender.ref.pointer, + newBytes.ref.pointer); + } + + /// URLResourceDidFinishLoading: + void URLResourceDidFinishLoading_(objc.NSURL sender) { + _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_URLResourceDidFinishLoading_, + sender.ref.pointer); + } + + /// URLResourceDidCancelLoading: + void URLResourceDidCancelLoading_(objc.NSURL sender) { + _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_URLResourceDidCancelLoading_, + sender.ref.pointer); + } + + /// URL:resourceDidFailLoadingWithReason: + void URL_resourceDidFailLoadingWithReason_( + objc.NSURL sender, objc.NSString reason) { + _objc_msgSend_wjvic9( + this.ref.pointer, + _sel_URL_resourceDidFailLoadingWithReason_, + sender.ref.pointer, + reason.ref.pointer); + } +} + +late final _sel_resourceDataUsingCache_ = + objc.registerName("resourceDataUsingCache:"); +late final _sel_loadResourceDataNotifyingClient_usingCache_ = + objc.registerName("loadResourceDataNotifyingClient:usingCache:"); +late final _sel_propertyForKey_ = objc.registerName("propertyForKey:"); +late final _sel_setResourceData_ = objc.registerName("setResourceData:"); +late final _sel_setProperty_forKey_ = objc.registerName("setProperty:forKey:"); +final _objc_msgSend_1lqxdg3 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_URLHandleUsingCache_ = + objc.registerName("URLHandleUsingCache:"); + +/// NSURLLoading +extension NSURLLoading on objc.NSURL { + /// Blocks to load the data if necessary. If shouldUseCache is YES, then if an equivalent URL has already been loaded and cached, its resource data will be returned immediately. If shouldUseCache is NO, a new load will be started + objc.NSData? resourceDataUsingCache_(bool shouldUseCache) { + final _ret = _objc_msgSend_1l3kbc1( + this.ref.pointer, _sel_resourceDataUsingCache_, shouldUseCache); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// Starts an asynchronous load of the data, registering delegate to receive notification. Only one such background load can proceed at a time. + void loadResourceDataNotifyingClient_usingCache_( + objc.ObjCObjectBase client, bool shouldUseCache) { + _objc_msgSend_gk45w7( + this.ref.pointer, + _sel_loadResourceDataNotifyingClient_usingCache_, + client.ref.pointer, + shouldUseCache); + } + + /// propertyForKey: + objc.ObjCObjectBase? propertyForKey_(objc.NSString propertyKey) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_propertyForKey_, propertyKey.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// These attempt to write the given arguments for the resource specified by the URL; they return success or failure + bool setResourceData_(objc.NSData data) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_setResourceData_, data.ref.pointer); + } + + /// setProperty:forKey: + bool setProperty_forKey_( + objc.ObjCObjectBase property, objc.NSString propertyKey) { + return _objc_msgSend_1lqxdg3(this.ref.pointer, _sel_setProperty_forKey_, + property.ref.pointer, propertyKey.ref.pointer); + } + + /// Sophisticated clients will want to ask for this, then message the handle directly. If shouldUseCache is NO, a newly instantiated handle is returned, even if an equivalent URL has been loaded + objc.NSURLHandle? URLHandleUsingCache_(bool shouldUseCache) { + final _ret = _objc_msgSend_1l3kbc1( + this.ref.pointer, _sel_URLHandleUsingCache_, shouldUseCache); + return _ret.address == 0 + ? null + : objc.NSURLHandle.castFromPointer(_ret, retain: true, release: true); + } +} + +late final _protocol_NSLocking = objc.getProtocol("NSLocking"); +late final _sel_lock = objc.registerName("lock"); +late final _sel_unlock = objc.registerName("unlock"); + +/// NSLocking +abstract final class NSLocking { + /// Builds an object that implements the NSLocking protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required void Function() lock, required void Function() unlock}) { + final builder = objc.ObjCProtocolBuilder(); + NSLocking.lock.implement(builder, lock); + NSLocking.unlock.implement(builder, unlock); + return builder.build(); + } + + /// Adds the implementation of the NSLocking protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required void Function() lock, required void Function() unlock}) { + NSLocking.lock.implement(builder, lock); + NSLocking.unlock.implement(builder, unlock); + } + + /// Builds an object that implements the NSLocking protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required void Function() lock, required void Function() unlock}) { + final builder = objc.ObjCProtocolBuilder(); + NSLocking.lock.implementAsListener(builder, lock); + NSLocking.unlock.implementAsListener(builder, unlock); + return builder.build(); + } + + /// Adds the implementation of the NSLocking protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required void Function() lock, required void Function() unlock}) { + NSLocking.lock.implementAsListener(builder, lock); + NSLocking.unlock.implementAsListener(builder, unlock); + } + + /// lock + static final lock = objc.ObjCProtocolListenableMethod( + _protocol_NSLocking, + _sel_lock, + objc.getProtocolMethodSignature( + _protocol_NSLocking, + _sel_lock, + isRequired: true, + isInstanceMethod: true, + ), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( + ffi.Pointer _, + ) => + func()), + ); + + /// unlock + static final unlock = objc.ObjCProtocolListenableMethod( + _protocol_NSLocking, + _sel_unlock, + objc.getProtocolMethodSignature( + _protocol_NSLocking, + _sel_unlock, + isRequired: true, + isInstanceMethod: true, + ), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( + ffi.Pointer _, + ) => + func()), + ); +} + +/// WARNING: NSCondition is a stub. To generate bindings for this class, include +/// NSCondition in your config's objc-interfaces list. +/// +/// NSCondition +class NSCondition extends objc.NSObject { + NSCondition._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSCondition] that points to the same underlying object as [other]. + NSCondition.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSCondition] that wraps the given raw object pointer. + NSCondition.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +typedef NSProgressKind1 = ffi.Pointer; +typedef DartNSProgressKind1 = objc.NSString; +typedef NSProgressUserInfoKey1 = ffi.Pointer; +typedef DartNSProgressUserInfoKey1 = objc.NSString; +typedef NSProgressFileOperationKind1 = ffi.Pointer; +typedef DartNSProgressFileOperationKind1 = objc.NSString; +typedef NSProgressUnpublishingHandler1 = ffi.Pointer; +typedef DartNSProgressUnpublishingHandler1 + = objc.ObjCBlock; +typedef NSProgressPublishingHandler1 = ffi.Pointer; +typedef DartNSProgressPublishingHandler1 + = objc.ObjCBlock? Function(NSProgress)>; + +/// WARNING: NSException is a stub. To generate bindings for this class, include +/// NSException in your config's objc-interfaces list. +/// +/// NSException +class NSException extends objc.NSObject { + NSException._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSException] that points to the same underlying object as [other]. + NSException.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSException] that wraps the given raw object pointer. + NSException.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +late final _class_NSException = objc.getClass("NSException"); +late final _sel_raise_format_ = objc.registerName("raise:format:"); + +/// NSExceptionRaisingConveniences +extension NSExceptionRaisingConveniences on NSException { + /// raise:format: + static void raise_format_(DartNSExceptionName name, objc.NSString format) { + _objc_msgSend_wjvic9(_class_NSException, _sel_raise_format_, + name.ref.pointer, format.ref.pointer); + } +} + +typedef NSUncaughtExceptionHandler = ffi + .NativeFunction exception)>; + +enum NSOperationQueuePriority { + NSOperationQueuePriorityVeryLow(-8), + NSOperationQueuePriorityLow(-4), + NSOperationQueuePriorityNormal(0), + NSOperationQueuePriorityHigh(4), + NSOperationQueuePriorityVeryHigh(8); + + final int value; + const NSOperationQueuePriority(this.value); + + static NSOperationQueuePriority fromValue(int value) => switch (value) { + -8 => NSOperationQueuePriorityVeryLow, + -4 => NSOperationQueuePriorityLow, + 0 => NSOperationQueuePriorityNormal, + 4 => NSOperationQueuePriorityHigh, + 8 => NSOperationQueuePriorityVeryHigh, + _ => throw ArgumentError( + "Unknown value for NSOperationQueuePriority: $value"), + }; +} + +typedef NSErrorDomain = ffi.Pointer; +typedef DartNSErrorDomain = objc.NSString; +typedef NSErrorUserInfoKey = ffi.Pointer; +typedef DartNSErrorUserInfoKey = objc.NSString; +late final _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_ = + objc.registerName( + "attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:"); +final _objc_msgSend_3kga1r = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_attemptRecoveryFromError_optionIndex_ = + objc.registerName("attemptRecoveryFromError:optionIndex:"); +final _objc_msgSend_1yvrem6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + +/// NSErrorRecoveryAttempting +extension NSErrorRecoveryAttempting on objc.NSObject { + /// Given that an error alert has been presented document-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and send the selected message to the specified delegate. The option index is an index into the error's array of localized recovery options. The method selected by didRecoverSelector must have the same signature as: + /// + /// - (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo; + /// + /// The value passed for didRecover must be YES if error recovery was completely successful, NO otherwise. + void + attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_( + objc.NSError error, + DartNSUInteger recoveryOptionIndex, + objc.ObjCObjectBase? delegate, + ffi.Pointer didRecoverSelector, + ffi.Pointer contextInfo) { + _objc_msgSend_3kga1r( + this.ref.pointer, + _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_, + error.ref.pointer, + recoveryOptionIndex, + delegate?.ref.pointer ?? ffi.nullptr, + didRecoverSelector, + contextInfo); + } + + /// Given that an error alert has been presented applicaton-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and return YES if error recovery was completely successful, NO otherwise. The recovery option index is an index into the error's array of localized recovery options. + bool attemptRecoveryFromError_optionIndex_( + objc.NSError error, DartNSUInteger recoveryOptionIndex) { + return _objc_msgSend_1yvrem6( + this.ref.pointer, + _sel_attemptRecoveryFromError_optionIndex_, + error.ref.pointer, + recoveryOptionIndex); + } +} + +typedef NSURLResourceKey1 = ffi.Pointer; +typedef DartNSURLResourceKey1 = objc.NSString; +typedef NSURLFileResourceType1 = ffi.Pointer; +typedef DartNSURLFileResourceType1 = objc.NSString; +typedef NSURLThumbnailDictionaryItem1 = ffi.Pointer; +typedef DartNSURLThumbnailDictionaryItem1 = objc.NSString; +typedef NSURLFileProtectionType1 = ffi.Pointer; +typedef DartNSURLFileProtectionType1 = objc.NSString; +typedef NSURLUbiquitousItemDownloadingStatus1 = ffi.Pointer; +typedef DartNSURLUbiquitousItemDownloadingStatus1 = objc.NSString; +typedef NSURLUbiquitousSharedItemRole1 = ffi.Pointer; +typedef DartNSURLUbiquitousSharedItemRole1 = objc.NSString; +typedef NSURLUbiquitousSharedItemPermissions1 = ffi.Pointer; +typedef DartNSURLUbiquitousSharedItemPermissions1 = objc.NSString; +typedef NSURLBookmarkFileCreationOptions1 = NSUInteger; +typedef _DidFinish = ffi.Pointer; +typedef Dart_DidFinish = objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)>; +void + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + NSCondition, + NSURLSession, + NSURLSessionDownloadTask, + objc.NSURL)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(NSCondition, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction(void Function(NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + NSCondition.castFromPointer(arg0, retain: true, release: true), + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + objc.NSURL.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(NSCondition, NSURLSession, NSURLSessionDownloadTask, + objc.NSURL)> listener( + void Function( + NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + NSCondition.castFromPointer(arg0, retain: false, release: true), + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, + retain: false, release: true), + objc.NSURL + .castFromPointer(arg3, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_4ya7yd(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(NSCondition, NSURLSession, NSURLSessionDownloadTask, + objc.NSURL)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> { + void call(NSCondition arg0, NSURLSession arg1, NSURLSessionDownloadTask arg2, + objc.NSURL arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0.ref.pointer, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer); +} + +typedef _DidFinishWithLock = ffi.Pointer; +typedef Dart_DidFinishWithLock = objc.ObjCBlock< + ffi.Void Function( + NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>; + +const int noErr = 0; + +const int kNilOptions = 0; + +const int kVariableLengthArray = 1; + +const int kUnknownType = 1061109567; + +const int normal = 0; + +const int bold = 1; + +const int italic = 2; + +const int underline = 4; + +const int outline = 8; + +const int shadow = 16; + +const int condense = 32; + +const int extend = 64; + +const int developStage = 32; + +const int alphaStage = 64; + +const int betaStage = 96; + +const int finalStage = 128; + +const int NSScannedOption = 1; + +const int NSCollectorDisabledOption = 2; + +const int noErr1 = 0; + +const int kNilOptions1 = 0; + +const int kVariableLengthArray1 = 1; + +const int kUnknownType1 = 1061109567; + +const int normal1 = 0; + +const int bold1 = 1; + +const int italic1 = 2; + +const int underline1 = 4; + +const int outline1 = 8; + +const int shadow1 = 16; + +const int condense1 = 32; + +const int extend1 = 64; + +const int developStage1 = 32; + +const int alphaStage1 = 64; + +const int betaStage1 = 96; + +const int finalStage1 = 128; + +const int NSScannedOption1 = 1; + +const int NSCollectorDisabledOption1 = 2; + +const int noErr2 = 0; + +const int kNilOptions2 = 0; + +const int kVariableLengthArray2 = 1; + +const int kUnknownType2 = 1061109567; + +const int normal2 = 0; + +const int bold2 = 1; + +const int italic2 = 2; + +const int underline2 = 4; + +const int outline2 = 8; + +const int shadow2 = 16; + +const int condense2 = 32; + +const int extend2 = 64; + +const int developStage2 = 32; + +const int alphaStage2 = 64; + +const int betaStage2 = 96; + +const int finalStage2 = 128; + +const int NSScannedOption2 = 1; + +const int NSCollectorDisabledOption2 = 2; + +const int errSecSuccess = 0; + +const int errSecUnimplemented = -4; + +const int errSecDiskFull = -34; + +const int errSecDskFull = -34; + +const int errSecIO = -36; + +const int errSecOpWr = -49; + +const int errSecParam = -50; + +const int errSecWrPerm = -61; + +const int errSecAllocate = -108; + +const int errSecUserCanceled = -128; + +const int errSecBadReq = -909; + +const int errSecInternalComponent = -2070; + +const int errSecCoreFoundationUnknown = -4960; + +const int errSecMissingEntitlement = -34018; + +const int errSecRestrictedAPI = -34020; + +const int errSecNotAvailable = -25291; + +const int errSecReadOnly = -25292; + +const int errSecAuthFailed = -25293; + +const int errSecNoSuchKeychain = -25294; + +const int errSecInvalidKeychain = -25295; + +const int errSecDuplicateKeychain = -25296; + +const int errSecDuplicateCallback = -25297; + +const int errSecInvalidCallback = -25298; + +const int errSecDuplicateItem = -25299; + +const int errSecItemNotFound = -25300; + +const int errSecBufferTooSmall = -25301; + +const int errSecDataTooLarge = -25302; + +const int errSecNoSuchAttr = -25303; + +const int errSecInvalidItemRef = -25304; + +const int errSecInvalidSearchRef = -25305; + +const int errSecNoSuchClass = -25306; + +const int errSecNoDefaultKeychain = -25307; + +const int errSecInteractionNotAllowed = -25308; + +const int errSecReadOnlyAttr = -25309; + +const int errSecWrongSecVersion = -25310; + +const int errSecKeySizeNotAllowed = -25311; + +const int errSecNoStorageModule = -25312; + +const int errSecNoCertificateModule = -25313; + +const int errSecNoPolicyModule = -25314; + +const int errSecInteractionRequired = -25315; + +const int errSecDataNotAvailable = -25316; + +const int errSecDataNotModifiable = -25317; + +const int errSecCreateChainFailed = -25318; + +const int errSecInvalidPrefsDomain = -25319; + +const int errSecInDarkWake = -25320; + +const int errSecACLNotSimple = -25240; + +const int errSecPolicyNotFound = -25241; + +const int errSecInvalidTrustSetting = -25242; + +const int errSecNoAccessForItem = -25243; + +const int errSecInvalidOwnerEdit = -25244; + +const int errSecTrustNotAvailable = -25245; + +const int errSecUnsupportedFormat = -25256; + +const int errSecUnknownFormat = -25257; + +const int errSecKeyIsSensitive = -25258; + +const int errSecMultiplePrivKeys = -25259; + +const int errSecPassphraseRequired = -25260; + +const int errSecInvalidPasswordRef = -25261; + +const int errSecInvalidTrustSettings = -25262; + +const int errSecNoTrustSettings = -25263; + +const int errSecPkcs12VerifyFailure = -25264; + +const int errSecNotSigner = -26267; + +const int errSecDecode = -26275; + +const int errSecServiceNotAvailable = -67585; + +const int errSecInsufficientClientID = -67586; + +const int errSecDeviceReset = -67587; + +const int errSecDeviceFailed = -67588; + +const int errSecAppleAddAppACLSubject = -67589; + +const int errSecApplePublicKeyIncomplete = -67590; + +const int errSecAppleSignatureMismatch = -67591; + +const int errSecAppleInvalidKeyStartDate = -67592; + +const int errSecAppleInvalidKeyEndDate = -67593; + +const int errSecConversionError = -67594; + +const int errSecAppleSSLv2Rollback = -67595; + +const int errSecQuotaExceeded = -67596; + +const int errSecFileTooBig = -67597; + +const int errSecInvalidDatabaseBlob = -67598; + +const int errSecInvalidKeyBlob = -67599; + +const int errSecIncompatibleDatabaseBlob = -67600; + +const int errSecIncompatibleKeyBlob = -67601; + +const int errSecHostNameMismatch = -67602; + +const int errSecUnknownCriticalExtensionFlag = -67603; + +const int errSecNoBasicConstraints = -67604; + +const int errSecNoBasicConstraintsCA = -67605; + +const int errSecInvalidAuthorityKeyID = -67606; + +const int errSecInvalidSubjectKeyID = -67607; + +const int errSecInvalidKeyUsageForPolicy = -67608; + +const int errSecInvalidExtendedKeyUsage = -67609; + +const int errSecInvalidIDLinkage = -67610; + +const int errSecPathLengthConstraintExceeded = -67611; + +const int errSecInvalidRoot = -67612; + +const int errSecCRLExpired = -67613; + +const int errSecCRLNotValidYet = -67614; + +const int errSecCRLNotFound = -67615; + +const int errSecCRLServerDown = -67616; + +const int errSecCRLBadURI = -67617; + +const int errSecUnknownCertExtension = -67618; + +const int errSecUnknownCRLExtension = -67619; + +const int errSecCRLNotTrusted = -67620; + +const int errSecCRLPolicyFailed = -67621; + +const int errSecIDPFailure = -67622; + +const int errSecSMIMEEmailAddressesNotFound = -67623; + +const int errSecSMIMEBadExtendedKeyUsage = -67624; + +const int errSecSMIMEBadKeyUsage = -67625; + +const int errSecSMIMEKeyUsageNotCritical = -67626; + +const int errSecSMIMENoEmailAddress = -67627; + +const int errSecSMIMESubjAltNameNotCritical = -67628; + +const int errSecSSLBadExtendedKeyUsage = -67629; + +const int errSecOCSPBadResponse = -67630; + +const int errSecOCSPBadRequest = -67631; + +const int errSecOCSPUnavailable = -67632; + +const int errSecOCSPStatusUnrecognized = -67633; + +const int errSecEndOfData = -67634; + +const int errSecIncompleteCertRevocationCheck = -67635; + +const int errSecNetworkFailure = -67636; + +const int errSecOCSPNotTrustedToAnchor = -67637; + +const int errSecRecordModified = -67638; + +const int errSecOCSPSignatureError = -67639; + +const int errSecOCSPNoSigner = -67640; + +const int errSecOCSPResponderMalformedReq = -67641; + +const int errSecOCSPResponderInternalError = -67642; + +const int errSecOCSPResponderTryLater = -67643; + +const int errSecOCSPResponderSignatureRequired = -67644; + +const int errSecOCSPResponderUnauthorized = -67645; + +const int errSecOCSPResponseNonceMismatch = -67646; + +const int errSecCodeSigningBadCertChainLength = -67647; + +const int errSecCodeSigningNoBasicConstraints = -67648; + +const int errSecCodeSigningBadPathLengthConstraint = -67649; + +const int errSecCodeSigningNoExtendedKeyUsage = -67650; + +const int errSecCodeSigningDevelopment = -67651; + +const int errSecResourceSignBadCertChainLength = -67652; + +const int errSecResourceSignBadExtKeyUsage = -67653; + +const int errSecTrustSettingDeny = -67654; + +const int errSecInvalidSubjectName = -67655; + +const int errSecUnknownQualifiedCertStatement = -67656; + +const int errSecMobileMeRequestQueued = -67657; + +const int errSecMobileMeRequestRedirected = -67658; + +const int errSecMobileMeServerError = -67659; + +const int errSecMobileMeServerNotAvailable = -67660; + +const int errSecMobileMeServerAlreadyExists = -67661; + +const int errSecMobileMeServerServiceErr = -67662; + +const int errSecMobileMeRequestAlreadyPending = -67663; + +const int errSecMobileMeNoRequestPending = -67664; + +const int errSecMobileMeCSRVerifyFailure = -67665; + +const int errSecMobileMeFailedConsistencyCheck = -67666; + +const int errSecNotInitialized = -67667; + +const int errSecInvalidHandleUsage = -67668; + +const int errSecPVCReferentNotFound = -67669; + +const int errSecFunctionIntegrityFail = -67670; + +const int errSecInternalError = -67671; + +const int errSecMemoryError = -67672; + +const int errSecInvalidData = -67673; + +const int errSecMDSError = -67674; + +const int errSecInvalidPointer = -67675; + +const int errSecSelfCheckFailed = -67676; + +const int errSecFunctionFailed = -67677; + +const int errSecModuleManifestVerifyFailed = -67678; + +const int errSecInvalidGUID = -67679; + +const int errSecInvalidHandle = -67680; + +const int errSecInvalidDBList = -67681; + +const int errSecInvalidPassthroughID = -67682; + +const int errSecInvalidNetworkAddress = -67683; + +const int errSecCRLAlreadySigned = -67684; + +const int errSecInvalidNumberOfFields = -67685; + +const int errSecVerificationFailure = -67686; + +const int errSecUnknownTag = -67687; + +const int errSecInvalidSignature = -67688; + +const int errSecInvalidName = -67689; + +const int errSecInvalidCertificateRef = -67690; + +const int errSecInvalidCertificateGroup = -67691; + +const int errSecTagNotFound = -67692; + +const int errSecInvalidQuery = -67693; + +const int errSecInvalidValue = -67694; + +const int errSecCallbackFailed = -67695; + +const int errSecACLDeleteFailed = -67696; + +const int errSecACLReplaceFailed = -67697; + +const int errSecACLAddFailed = -67698; + +const int errSecACLChangeFailed = -67699; + +const int errSecInvalidAccessCredentials = -67700; + +const int errSecInvalidRecord = -67701; + +const int errSecInvalidACL = -67702; + +const int errSecInvalidSampleValue = -67703; + +const int errSecIncompatibleVersion = -67704; + +const int errSecPrivilegeNotGranted = -67705; + +const int errSecInvalidScope = -67706; + +const int errSecPVCAlreadyConfigured = -67707; + +const int errSecInvalidPVC = -67708; + +const int errSecEMMLoadFailed = -67709; + +const int errSecEMMUnloadFailed = -67710; + +const int errSecAddinLoadFailed = -67711; + +const int errSecInvalidKeyRef = -67712; + +const int errSecInvalidKeyHierarchy = -67713; + +const int errSecAddinUnloadFailed = -67714; + +const int errSecLibraryReferenceNotFound = -67715; + +const int errSecInvalidAddinFunctionTable = -67716; + +const int errSecInvalidServiceMask = -67717; + +const int errSecModuleNotLoaded = -67718; + +const int errSecInvalidSubServiceID = -67719; + +const int errSecAttributeNotInContext = -67720; + +const int errSecModuleManagerInitializeFailed = -67721; + +const int errSecModuleManagerNotFound = -67722; + +const int errSecEventNotificationCallbackNotFound = -67723; + +const int errSecInputLengthError = -67724; + +const int errSecOutputLengthError = -67725; + +const int errSecPrivilegeNotSupported = -67726; + +const int errSecDeviceError = -67727; + +const int errSecAttachHandleBusy = -67728; + +const int errSecNotLoggedIn = -67729; + +const int errSecAlgorithmMismatch = -67730; + +const int errSecKeyUsageIncorrect = -67731; + +const int errSecKeyBlobTypeIncorrect = -67732; + +const int errSecKeyHeaderInconsistent = -67733; + +const int errSecUnsupportedKeyFormat = -67734; + +const int errSecUnsupportedKeySize = -67735; + +const int errSecInvalidKeyUsageMask = -67736; + +const int errSecUnsupportedKeyUsageMask = -67737; + +const int errSecInvalidKeyAttributeMask = -67738; + +const int errSecUnsupportedKeyAttributeMask = -67739; + +const int errSecInvalidKeyLabel = -67740; + +const int errSecUnsupportedKeyLabel = -67741; + +const int errSecInvalidKeyFormat = -67742; + +const int errSecUnsupportedVectorOfBuffers = -67743; + +const int errSecInvalidInputVector = -67744; + +const int errSecInvalidOutputVector = -67745; + +const int errSecInvalidContext = -67746; + +const int errSecInvalidAlgorithm = -67747; + +const int errSecInvalidAttributeKey = -67748; + +const int errSecMissingAttributeKey = -67749; + +const int errSecInvalidAttributeInitVector = -67750; + +const int errSecMissingAttributeInitVector = -67751; + +const int errSecInvalidAttributeSalt = -67752; + +const int errSecMissingAttributeSalt = -67753; + +const int errSecInvalidAttributePadding = -67754; + +const int errSecMissingAttributePadding = -67755; + +const int errSecInvalidAttributeRandom = -67756; + +const int errSecMissingAttributeRandom = -67757; + +const int errSecInvalidAttributeSeed = -67758; + +const int errSecMissingAttributeSeed = -67759; + +const int errSecInvalidAttributePassphrase = -67760; + +const int errSecMissingAttributePassphrase = -67761; + +const int errSecInvalidAttributeKeyLength = -67762; + +const int errSecMissingAttributeKeyLength = -67763; + +const int errSecInvalidAttributeBlockSize = -67764; + +const int errSecMissingAttributeBlockSize = -67765; + +const int errSecInvalidAttributeOutputSize = -67766; + +const int errSecMissingAttributeOutputSize = -67767; + +const int errSecInvalidAttributeRounds = -67768; + +const int errSecMissingAttributeRounds = -67769; + +const int errSecInvalidAlgorithmParms = -67770; + +const int errSecMissingAlgorithmParms = -67771; + +const int errSecInvalidAttributeLabel = -67772; + +const int errSecMissingAttributeLabel = -67773; + +const int errSecInvalidAttributeKeyType = -67774; + +const int errSecMissingAttributeKeyType = -67775; + +const int errSecInvalidAttributeMode = -67776; + +const int errSecMissingAttributeMode = -67777; + +const int errSecInvalidAttributeEffectiveBits = -67778; + +const int errSecMissingAttributeEffectiveBits = -67779; + +const int errSecInvalidAttributeStartDate = -67780; + +const int errSecMissingAttributeStartDate = -67781; + +const int errSecInvalidAttributeEndDate = -67782; + +const int errSecMissingAttributeEndDate = -67783; + +const int errSecInvalidAttributeVersion = -67784; + +const int errSecMissingAttributeVersion = -67785; + +const int errSecInvalidAttributePrime = -67786; + +const int errSecMissingAttributePrime = -67787; + +const int errSecInvalidAttributeBase = -67788; + +const int errSecMissingAttributeBase = -67789; + +const int errSecInvalidAttributeSubprime = -67790; + +const int errSecMissingAttributeSubprime = -67791; + +const int errSecInvalidAttributeIterationCount = -67792; + +const int errSecMissingAttributeIterationCount = -67793; + +const int errSecInvalidAttributeDLDBHandle = -67794; + +const int errSecMissingAttributeDLDBHandle = -67795; + +const int errSecInvalidAttributeAccessCredentials = -67796; + +const int errSecMissingAttributeAccessCredentials = -67797; + +const int errSecInvalidAttributePublicKeyFormat = -67798; + +const int errSecMissingAttributePublicKeyFormat = -67799; + +const int errSecInvalidAttributePrivateKeyFormat = -67800; + +const int errSecMissingAttributePrivateKeyFormat = -67801; + +const int errSecInvalidAttributeSymmetricKeyFormat = -67802; + +const int errSecMissingAttributeSymmetricKeyFormat = -67803; + +const int errSecInvalidAttributeWrappedKeyFormat = -67804; + +const int errSecMissingAttributeWrappedKeyFormat = -67805; + +const int errSecStagedOperationInProgress = -67806; + +const int errSecStagedOperationNotStarted = -67807; + +const int errSecVerifyFailed = -67808; + +const int errSecQuerySizeUnknown = -67809; + +const int errSecBlockSizeMismatch = -67810; + +const int errSecPublicKeyInconsistent = -67811; + +const int errSecDeviceVerifyFailed = -67812; + +const int errSecInvalidLoginName = -67813; + +const int errSecAlreadyLoggedIn = -67814; + +const int errSecInvalidDigestAlgorithm = -67815; + +const int errSecInvalidCRLGroup = -67816; + +const int errSecCertificateCannotOperate = -67817; + +const int errSecCertificateExpired = -67818; + +const int errSecCertificateNotValidYet = -67819; + +const int errSecCertificateRevoked = -67820; + +const int errSecCertificateSuspended = -67821; + +const int errSecInsufficientCredentials = -67822; + +const int errSecInvalidAction = -67823; + +const int errSecInvalidAuthority = -67824; + +const int errSecVerifyActionFailed = -67825; + +const int errSecInvalidCertAuthority = -67826; + +const int errSecInvalidCRLAuthority = -67827; + +const int errSecInvaldCRLAuthority = -67827; + +const int errSecInvalidCRLEncoding = -67828; + +const int errSecInvalidCRLType = -67829; + +const int errSecInvalidCRL = -67830; + +const int errSecInvalidFormType = -67831; + +const int errSecInvalidID = -67832; + +const int errSecInvalidIdentifier = -67833; + +const int errSecInvalidIndex = -67834; + +const int errSecInvalidPolicyIdentifiers = -67835; + +const int errSecInvalidTimeString = -67836; + +const int errSecInvalidReason = -67837; + +const int errSecInvalidRequestInputs = -67838; + +const int errSecInvalidResponseVector = -67839; + +const int errSecInvalidStopOnPolicy = -67840; + +const int errSecInvalidTuple = -67841; + +const int errSecMultipleValuesUnsupported = -67842; + +const int errSecNotTrusted = -67843; + +const int errSecNoDefaultAuthority = -67844; + +const int errSecRejectedForm = -67845; + +const int errSecRequestLost = -67846; + +const int errSecRequestRejected = -67847; + +const int errSecUnsupportedAddressType = -67848; + +const int errSecUnsupportedService = -67849; + +const int errSecInvalidTupleGroup = -67850; + +const int errSecInvalidBaseACLs = -67851; + +const int errSecInvalidTupleCredentials = -67852; + +const int errSecInvalidTupleCredendtials = -67852; + +const int errSecInvalidEncoding = -67853; + +const int errSecInvalidValidityPeriod = -67854; + +const int errSecInvalidRequestor = -67855; + +const int errSecRequestDescriptor = -67856; + +const int errSecInvalidBundleInfo = -67857; + +const int errSecInvalidCRLIndex = -67858; + +const int errSecNoFieldValues = -67859; + +const int errSecUnsupportedFieldFormat = -67860; + +const int errSecUnsupportedIndexInfo = -67861; + +const int errSecUnsupportedLocality = -67862; + +const int errSecUnsupportedNumAttributes = -67863; + +const int errSecUnsupportedNumIndexes = -67864; + +const int errSecUnsupportedNumRecordTypes = -67865; + +const int errSecFieldSpecifiedMultiple = -67866; + +const int errSecIncompatibleFieldFormat = -67867; + +const int errSecInvalidParsingModule = -67868; + +const int errSecDatabaseLocked = -67869; + +const int errSecDatastoreIsOpen = -67870; + +const int errSecMissingValue = -67871; + +const int errSecUnsupportedQueryLimits = -67872; + +const int errSecUnsupportedNumSelectionPreds = -67873; + +const int errSecUnsupportedOperator = -67874; + +const int errSecInvalidDBLocation = -67875; + +const int errSecInvalidAccessRequest = -67876; + +const int errSecInvalidIndexInfo = -67877; + +const int errSecInvalidNewOwner = -67878; + +const int errSecInvalidModifyMode = -67879; + +const int errSecMissingRequiredExtension = -67880; + +const int errSecExtendedKeyUsageNotCritical = -67881; + +const int errSecTimestampMissing = -67882; + +const int errSecTimestampInvalid = -67883; + +const int errSecTimestampNotTrusted = -67884; + +const int errSecTimestampServiceNotAvailable = -67885; + +const int errSecTimestampBadAlg = -67886; + +const int errSecTimestampBadRequest = -67887; + +const int errSecTimestampBadDataFormat = -67888; + +const int errSecTimestampTimeNotAvailable = -67889; + +const int errSecTimestampUnacceptedPolicy = -67890; + +const int errSecTimestampUnacceptedExtension = -67891; + +const int errSecTimestampAddInfoNotAvailable = -67892; + +const int errSecTimestampSystemFailure = -67893; + +const int errSecSigningTimeMissing = -67894; + +const int errSecTimestampRejection = -67895; + +const int errSecTimestampWaiting = -67896; + +const int errSecTimestampRevocationWarning = -67897; + +const int errSecTimestampRevocationNotification = -67898; + +const int errSecCertificatePolicyNotAllowed = -67899; + +const int errSecCertificateNameNotAllowed = -67900; + +const int errSecCertificateValidityPeriodTooLong = -67901; + +const int errSecCertificateIsCA = -67902; + +const int errSecCertificateDuplicateExtension = -67903; + +const int errSSLProtocol = -9800; + +const int errSSLNegotiation = -9801; + +const int errSSLFatalAlert = -9802; + +const int errSSLWouldBlock = -9803; + +const int errSSLSessionNotFound = -9804; + +const int errSSLClosedGraceful = -9805; + +const int errSSLClosedAbort = -9806; + +const int errSSLXCertChainInvalid = -9807; + +const int errSSLBadCert = -9808; + +const int errSSLCrypto = -9809; + +const int errSSLInternal = -9810; + +const int errSSLModuleAttach = -9811; + +const int errSSLUnknownRootCert = -9812; + +const int errSSLNoRootCert = -9813; + +const int errSSLCertExpired = -9814; + +const int errSSLCertNotYetValid = -9815; + +const int errSSLClosedNoNotify = -9816; + +const int errSSLBufferOverflow = -9817; + +const int errSSLBadCipherSuite = -9818; + +const int errSSLPeerUnexpectedMsg = -9819; + +const int errSSLPeerBadRecordMac = -9820; + +const int errSSLPeerDecryptionFail = -9821; + +const int errSSLPeerRecordOverflow = -9822; + +const int errSSLPeerDecompressFail = -9823; + +const int errSSLPeerHandshakeFail = -9824; + +const int errSSLPeerBadCert = -9825; + +const int errSSLPeerUnsupportedCert = -9826; + +const int errSSLPeerCertRevoked = -9827; + +const int errSSLPeerCertExpired = -9828; + +const int errSSLPeerCertUnknown = -9829; + +const int errSSLIllegalParam = -9830; + +const int errSSLPeerUnknownCA = -9831; + +const int errSSLPeerAccessDenied = -9832; + +const int errSSLPeerDecodeError = -9833; + +const int errSSLPeerDecryptError = -9834; + +const int errSSLPeerExportRestriction = -9835; + +const int errSSLPeerProtocolVersion = -9836; + +const int errSSLPeerInsufficientSecurity = -9837; + +const int errSSLPeerInternalError = -9838; + +const int errSSLPeerUserCancelled = -9839; + +const int errSSLPeerNoRenegotiation = -9840; + +const int errSSLPeerAuthCompleted = -9841; + +const int errSSLClientCertRequested = -9842; + +const int errSSLHostNameMismatch = -9843; + +const int errSSLConnectionRefused = -9844; + +const int errSSLDecryptionFail = -9845; + +const int errSSLBadRecordMac = -9846; + +const int errSSLRecordOverflow = -9847; + +const int errSSLBadConfiguration = -9848; + +const int errSSLUnexpectedRecord = -9849; + +const int errSSLWeakPeerEphemeralDHKey = -9850; + +const int errSSLClientHelloReceived = -9851; + +const int errSSLTransportReset = -9852; + +const int errSSLNetworkTimeout = -9853; + +const int errSSLConfigurationFailed = -9854; + +const int errSSLUnsupportedExtension = -9855; + +const int errSSLUnexpectedMessage = -9856; + +const int errSSLDecompressFail = -9857; + +const int errSSLHandshakeFail = -9858; + +const int errSSLDecodeError = -9859; + +const int errSSLInappropriateFallback = -9860; + +const int errSSLMissingExtension = -9861; + +const int errSSLBadCertificateStatusResponse = -9862; + +const int errSSLCertificateRequired = -9863; + +const int errSSLUnknownPSKIdentity = -9864; + +const int errSSLUnrecognizedName = -9865; + +const int errSSLATSViolation = -9880; + +const int errSSLATSMinimumVersionViolation = -9881; + +const int errSSLATSCiphersuiteViolation = -9882; + +const int errSSLATSMinimumKeySizeViolation = -9883; + +const int errSSLATSLeafCertificateHashAlgorithmViolation = -9884; + +const int errSSLATSCertificateHashAlgorithmViolation = -9885; + +const int errSSLATSCertificateTrustViolation = -9886; + +const int errSSLEarlyDataRejected = -9890; + +const int OSUnknownByteOrder = 0; + +const int OSLittleEndian = 1; + +const int OSBigEndian = 2; + +const int kCFNotificationDeliverImmediately = 1; + +const int kCFNotificationPostToAllSessions = 2; + +const int kCFCalendarComponentsWrap = 1; + +const int kCFSocketAutomaticallyReenableReadCallBack = 1; + +const int kCFSocketAutomaticallyReenableAcceptCallBack = 2; + +const int kCFSocketAutomaticallyReenableDataCallBack = 3; + +const int kCFSocketAutomaticallyReenableWriteCallBack = 8; + +const int kCFSocketLeaveErrors = 64; + +const int kCFSocketCloseOnInvalidate = 128; + +const int DISPATCH_WALLTIME_NOW = -2; + +const int kCFPropertyListReadCorruptError = 3840; + +const int kCFPropertyListReadUnknownVersionError = 3841; + +const int kCFPropertyListReadStreamError = 3842; + +const int kCFPropertyListWriteStreamError = 3851; + +const int kCFBundleExecutableArchitectureI386 = 7; + +const int kCFBundleExecutableArchitecturePPC = 18; + +const int kCFBundleExecutableArchitectureX86_64 = 16777223; + +const int kCFBundleExecutableArchitecturePPC64 = 16777234; + +const int kCFBundleExecutableArchitectureARM64 = 16777228; + +const int kCFMessagePortSuccess = 0; + +const int kCFMessagePortSendTimeout = -1; + +const int kCFMessagePortReceiveTimeout = -2; + +const int kCFMessagePortIsInvalid = -3; + +const int kCFMessagePortTransportError = -4; + +const int kCFMessagePortBecameInvalidError = -5; + +const int kCFStringTokenizerUnitWord = 0; + +const int kCFStringTokenizerUnitSentence = 1; + +const int kCFStringTokenizerUnitParagraph = 2; + +const int kCFStringTokenizerUnitLineBreak = 3; + +const int kCFStringTokenizerUnitWordBoundary = 4; + +const int kCFStringTokenizerAttributeLatinTranscription = 65536; + +const int kCFStringTokenizerAttributeLanguage = 131072; + +const int kCFFileDescriptorReadCallBack = 1; + +const int kCFFileDescriptorWriteCallBack = 2; + +const int kCFUserNotificationStopAlertLevel = 0; + +const int kCFUserNotificationNoteAlertLevel = 1; + +const int kCFUserNotificationCautionAlertLevel = 2; + +const int kCFUserNotificationPlainAlertLevel = 3; + +const int kCFUserNotificationDefaultResponse = 0; + +const int kCFUserNotificationAlternateResponse = 1; + +const int kCFUserNotificationOtherResponse = 2; + +const int kCFUserNotificationCancelResponse = 3; + +const int kCFUserNotificationNoDefaultButtonFlag = 32; + +const int kCFUserNotificationUseRadioButtonsFlag = 64; + +const int kCFXMLNodeCurrentVersion = 1; + +const int CSSM_INVALID_HANDLE = 0; + +const int CSSM_FALSE = 0; + +const int CSSM_TRUE = 1; + +const int CSSM_OK = 0; + +const int CSSM_MODULE_STRING_SIZE = 64; + +const int CSSM_KEY_HIERARCHY_NONE = 0; + +const int CSSM_KEY_HIERARCHY_INTEG = 1; + +const int CSSM_KEY_HIERARCHY_EXPORT = 2; + +const int CSSM_PVC_NONE = 0; + +const int CSSM_PVC_APP = 1; + +const int CSSM_PVC_SP = 2; + +const int CSSM_PRIVILEGE_SCOPE_NONE = 0; + +const int CSSM_PRIVILEGE_SCOPE_PROCESS = 1; + +const int CSSM_PRIVILEGE_SCOPE_THREAD = 2; + +const int CSSM_SERVICE_CSSM = 1; + +const int CSSM_SERVICE_CSP = 2; + +const int CSSM_SERVICE_DL = 4; + +const int CSSM_SERVICE_CL = 8; + +const int CSSM_SERVICE_TP = 16; + +const int CSSM_SERVICE_AC = 32; + +const int CSSM_SERVICE_KR = 64; + +const int CSSM_NOTIFY_INSERT = 1; + +const int CSSM_NOTIFY_REMOVE = 2; + +const int CSSM_NOTIFY_FAULT = 3; + +const int CSSM_ATTACH_READ_ONLY = 1; + +const int CSSM_USEE_LAST = 255; + +const int CSSM_USEE_NONE = 0; + +const int CSSM_USEE_DOMESTIC = 1; + +const int CSSM_USEE_FINANCIAL = 2; + +const int CSSM_USEE_KRLE = 3; + +const int CSSM_USEE_KRENT = 4; + +const int CSSM_USEE_SSL = 5; + +const int CSSM_USEE_AUTHENTICATION = 6; + +const int CSSM_USEE_KEYEXCH = 7; + +const int CSSM_USEE_MEDICAL = 8; + +const int CSSM_USEE_INSURANCE = 9; + +const int CSSM_USEE_WEAK = 10; + +const int CSSM_ADDR_NONE = 0; + +const int CSSM_ADDR_CUSTOM = 1; + +const int CSSM_ADDR_URL = 2; + +const int CSSM_ADDR_SOCKADDR = 3; + +const int CSSM_ADDR_NAME = 4; + +const int CSSM_NET_PROTO_NONE = 0; + +const int CSSM_NET_PROTO_CUSTOM = 1; + +const int CSSM_NET_PROTO_UNSPECIFIED = 2; + +const int CSSM_NET_PROTO_LDAP = 3; + +const int CSSM_NET_PROTO_LDAPS = 4; + +const int CSSM_NET_PROTO_LDAPNS = 5; + +const int CSSM_NET_PROTO_X500DAP = 6; + +const int CSSM_NET_PROTO_FTP = 7; + +const int CSSM_NET_PROTO_FTPS = 8; + +const int CSSM_NET_PROTO_OCSP = 9; + +const int CSSM_NET_PROTO_CMP = 10; + +const int CSSM_NET_PROTO_CMPS = 11; + +const int CSSM_WORDID__UNK_ = -1; + +const int CSSM_WORDID__NLU_ = 0; + +const int CSSM_WORDID__STAR_ = 1; + +const int CSSM_WORDID_A = 2; + +const int CSSM_WORDID_ACL = 3; + +const int CSSM_WORDID_ALPHA = 4; + +const int CSSM_WORDID_B = 5; + +const int CSSM_WORDID_BER = 6; + +const int CSSM_WORDID_BINARY = 7; + +const int CSSM_WORDID_BIOMETRIC = 8; + +const int CSSM_WORDID_C = 9; + +const int CSSM_WORDID_CANCELED = 10; + +const int CSSM_WORDID_CERT = 11; + +const int CSSM_WORDID_COMMENT = 12; + +const int CSSM_WORDID_CRL = 13; + +const int CSSM_WORDID_CUSTOM = 14; + +const int CSSM_WORDID_D = 15; + +const int CSSM_WORDID_DATE = 16; + +const int CSSM_WORDID_DB_DELETE = 17; + +const int CSSM_WORDID_DB_EXEC_STORED_QUERY = 18; + +const int CSSM_WORDID_DB_INSERT = 19; + +const int CSSM_WORDID_DB_MODIFY = 20; + +const int CSSM_WORDID_DB_READ = 21; + +const int CSSM_WORDID_DBS_CREATE = 22; + +const int CSSM_WORDID_DBS_DELETE = 23; + +const int CSSM_WORDID_DECRYPT = 24; + +const int CSSM_WORDID_DELETE = 25; + +const int CSSM_WORDID_DELTA_CRL = 26; + +const int CSSM_WORDID_DER = 27; + +const int CSSM_WORDID_DERIVE = 28; + +const int CSSM_WORDID_DISPLAY = 29; + +const int CSSM_WORDID_DO = 30; + +const int CSSM_WORDID_DSA = 31; + +const int CSSM_WORDID_DSA_SHA1 = 32; + +const int CSSM_WORDID_E = 33; + +const int CSSM_WORDID_ELGAMAL = 34; + +const int CSSM_WORDID_ENCRYPT = 35; + +const int CSSM_WORDID_ENTRY = 36; + +const int CSSM_WORDID_EXPORT_CLEAR = 37; + +const int CSSM_WORDID_EXPORT_WRAPPED = 38; + +const int CSSM_WORDID_G = 39; + +const int CSSM_WORDID_GE = 40; + +const int CSSM_WORDID_GENKEY = 41; + +const int CSSM_WORDID_HASH = 42; + +const int CSSM_WORDID_HASHED_PASSWORD = 43; + +const int CSSM_WORDID_HASHED_SUBJECT = 44; + +const int CSSM_WORDID_HAVAL = 45; + +const int CSSM_WORDID_IBCHASH = 46; + +const int CSSM_WORDID_IMPORT_CLEAR = 47; + +const int CSSM_WORDID_IMPORT_WRAPPED = 48; + +const int CSSM_WORDID_INTEL = 49; + +const int CSSM_WORDID_ISSUER = 50; + +const int CSSM_WORDID_ISSUER_INFO = 51; + +const int CSSM_WORDID_K_OF_N = 52; + +const int CSSM_WORDID_KEA = 53; + +const int CSSM_WORDID_KEYHOLDER = 54; + +const int CSSM_WORDID_L = 55; + +const int CSSM_WORDID_LE = 56; + +const int CSSM_WORDID_LOGIN = 57; + +const int CSSM_WORDID_LOGIN_NAME = 58; + +const int CSSM_WORDID_MAC = 59; + +const int CSSM_WORDID_MD2 = 60; + +const int CSSM_WORDID_MD2WITHRSA = 61; + +const int CSSM_WORDID_MD4 = 62; + +const int CSSM_WORDID_MD5 = 63; + +const int CSSM_WORDID_MD5WITHRSA = 64; + +const int CSSM_WORDID_N = 65; + +const int CSSM_WORDID_NAME = 66; + +const int CSSM_WORDID_NDR = 67; + +const int CSSM_WORDID_NHASH = 68; + +const int CSSM_WORDID_NOT_AFTER = 69; + +const int CSSM_WORDID_NOT_BEFORE = 70; + +const int CSSM_WORDID_NULL = 71; + +const int CSSM_WORDID_NUMERIC = 72; + +const int CSSM_WORDID_OBJECT_HASH = 73; + +const int CSSM_WORDID_ONE_TIME = 74; + +const int CSSM_WORDID_ONLINE = 75; + +const int CSSM_WORDID_OWNER = 76; + +const int CSSM_WORDID_P = 77; + +const int CSSM_WORDID_PAM_NAME = 78; + +const int CSSM_WORDID_PASSWORD = 79; + +const int CSSM_WORDID_PGP = 80; + +const int CSSM_WORDID_PREFIX = 81; + +const int CSSM_WORDID_PRIVATE_KEY = 82; + +const int CSSM_WORDID_PROMPTED_BIOMETRIC = 83; + +const int CSSM_WORDID_PROMPTED_PASSWORD = 84; + +const int CSSM_WORDID_PROPAGATE = 85; + +const int CSSM_WORDID_PROTECTED_BIOMETRIC = 86; + +const int CSSM_WORDID_PROTECTED_PASSWORD = 87; + +const int CSSM_WORDID_PROTECTED_PIN = 88; + +const int CSSM_WORDID_PUBLIC_KEY = 89; + +const int CSSM_WORDID_PUBLIC_KEY_FROM_CERT = 90; + +const int CSSM_WORDID_Q = 91; + +const int CSSM_WORDID_RANGE = 92; + +const int CSSM_WORDID_REVAL = 93; + +const int CSSM_WORDID_RIPEMAC = 94; + +const int CSSM_WORDID_RIPEMD = 95; + +const int CSSM_WORDID_RIPEMD160 = 96; + +const int CSSM_WORDID_RSA = 97; + +const int CSSM_WORDID_RSA_ISO9796 = 98; + +const int CSSM_WORDID_RSA_PKCS = 99; + +const int CSSM_WORDID_RSA_PKCS_MD5 = 100; + +const int CSSM_WORDID_RSA_PKCS_SHA1 = 101; + +const int CSSM_WORDID_RSA_PKCS1 = 102; + +const int CSSM_WORDID_RSA_PKCS1_MD5 = 103; + +const int CSSM_WORDID_RSA_PKCS1_SHA1 = 104; + +const int CSSM_WORDID_RSA_PKCS1_SIG = 105; + +const int CSSM_WORDID_RSA_RAW = 106; + +const int CSSM_WORDID_SDSIV1 = 107; + +const int CSSM_WORDID_SEQUENCE = 108; + +const int CSSM_WORDID_SET = 109; + +const int CSSM_WORDID_SEXPR = 110; + +const int CSSM_WORDID_SHA1 = 111; + +const int CSSM_WORDID_SHA1WITHDSA = 112; + +const int CSSM_WORDID_SHA1WITHECDSA = 113; + +const int CSSM_WORDID_SHA1WITHRSA = 114; + +const int CSSM_WORDID_SIGN = 115; + +const int CSSM_WORDID_SIGNATURE = 116; + +const int CSSM_WORDID_SIGNED_NONCE = 117; + +const int CSSM_WORDID_SIGNED_SECRET = 118; + +const int CSSM_WORDID_SPKI = 119; + +const int CSSM_WORDID_SUBJECT = 120; + +const int CSSM_WORDID_SUBJECT_INFO = 121; + +const int CSSM_WORDID_TAG = 122; + +const int CSSM_WORDID_THRESHOLD = 123; + +const int CSSM_WORDID_TIME = 124; + +const int CSSM_WORDID_URI = 125; + +const int CSSM_WORDID_VERSION = 126; + +const int CSSM_WORDID_X509_ATTRIBUTE = 127; + +const int CSSM_WORDID_X509V1 = 128; + +const int CSSM_WORDID_X509V2 = 129; + +const int CSSM_WORDID_X509V3 = 130; + +const int CSSM_WORDID_X9_ATTRIBUTE = 131; + +const int CSSM_WORDID_VENDOR_START = 65536; + +const int CSSM_WORDID_VENDOR_END = 2147418112; + +const int CSSM_LIST_ELEMENT_DATUM = 0; + +const int CSSM_LIST_ELEMENT_SUBLIST = 1; + +const int CSSM_LIST_ELEMENT_WORDID = 2; + +const int CSSM_LIST_TYPE_UNKNOWN = 0; + +const int CSSM_LIST_TYPE_CUSTOM = 1; + +const int CSSM_LIST_TYPE_SEXPR = 2; + +const int CSSM_SAMPLE_TYPE_PASSWORD = 79; + +const int CSSM_SAMPLE_TYPE_HASHED_PASSWORD = 43; + +const int CSSM_SAMPLE_TYPE_PROTECTED_PASSWORD = 87; + +const int CSSM_SAMPLE_TYPE_PROMPTED_PASSWORD = 84; + +const int CSSM_SAMPLE_TYPE_SIGNED_NONCE = 117; + +const int CSSM_SAMPLE_TYPE_SIGNED_SECRET = 118; + +const int CSSM_SAMPLE_TYPE_BIOMETRIC = 8; + +const int CSSM_SAMPLE_TYPE_PROTECTED_BIOMETRIC = 86; + +const int CSSM_SAMPLE_TYPE_PROMPTED_BIOMETRIC = 83; + +const int CSSM_SAMPLE_TYPE_THRESHOLD = 123; + +const int CSSM_CERT_UNKNOWN = 0; + +const int CSSM_CERT_X_509v1 = 1; + +const int CSSM_CERT_X_509v2 = 2; + +const int CSSM_CERT_X_509v3 = 3; + +const int CSSM_CERT_PGP = 4; + +const int CSSM_CERT_SPKI = 5; + +const int CSSM_CERT_SDSIv1 = 6; + +const int CSSM_CERT_Intel = 8; + +const int CSSM_CERT_X_509_ATTRIBUTE = 9; + +const int CSSM_CERT_X9_ATTRIBUTE = 10; + +const int CSSM_CERT_TUPLE = 11; + +const int CSSM_CERT_ACL_ENTRY = 12; + +const int CSSM_CERT_MULTIPLE = 32766; + +const int CSSM_CERT_LAST = 32767; + +const int CSSM_CL_CUSTOM_CERT_TYPE = 32768; + +const int CSSM_CERT_ENCODING_UNKNOWN = 0; + +const int CSSM_CERT_ENCODING_CUSTOM = 1; + +const int CSSM_CERT_ENCODING_BER = 2; + +const int CSSM_CERT_ENCODING_DER = 3; + +const int CSSM_CERT_ENCODING_NDR = 4; + +const int CSSM_CERT_ENCODING_SEXPR = 5; + +const int CSSM_CERT_ENCODING_PGP = 6; + +const int CSSM_CERT_ENCODING_MULTIPLE = 32766; + +const int CSSM_CERT_ENCODING_LAST = 32767; + +const int CSSM_CL_CUSTOM_CERT_ENCODING = 32768; + +const int CSSM_CERT_PARSE_FORMAT_NONE = 0; + +const int CSSM_CERT_PARSE_FORMAT_CUSTOM = 1; + +const int CSSM_CERT_PARSE_FORMAT_SEXPR = 2; + +const int CSSM_CERT_PARSE_FORMAT_COMPLEX = 3; + +const int CSSM_CERT_PARSE_FORMAT_OID_NAMED = 4; + +const int CSSM_CERT_PARSE_FORMAT_TUPLE = 5; + +const int CSSM_CERT_PARSE_FORMAT_MULTIPLE = 32766; + +const int CSSM_CERT_PARSE_FORMAT_LAST = 32767; + +const int CSSM_CL_CUSTOM_CERT_PARSE_FORMAT = 32768; + +const int CSSM_CERTGROUP_DATA = 0; + +const int CSSM_CERTGROUP_ENCODED_CERT = 1; + +const int CSSM_CERTGROUP_PARSED_CERT = 2; + +const int CSSM_CERTGROUP_CERT_PAIR = 3; + +const int CSSM_ACL_SUBJECT_TYPE_ANY = 1; + +const int CSSM_ACL_SUBJECT_TYPE_THRESHOLD = 123; + +const int CSSM_ACL_SUBJECT_TYPE_PASSWORD = 79; + +const int CSSM_ACL_SUBJECT_TYPE_PROTECTED_PASSWORD = 87; + +const int CSSM_ACL_SUBJECT_TYPE_PROMPTED_PASSWORD = 84; + +const int CSSM_ACL_SUBJECT_TYPE_PUBLIC_KEY = 89; + +const int CSSM_ACL_SUBJECT_TYPE_HASHED_SUBJECT = 44; + +const int CSSM_ACL_SUBJECT_TYPE_BIOMETRIC = 8; + +const int CSSM_ACL_SUBJECT_TYPE_PROTECTED_BIOMETRIC = 86; + +const int CSSM_ACL_SUBJECT_TYPE_PROMPTED_BIOMETRIC = 83; + +const int CSSM_ACL_SUBJECT_TYPE_LOGIN_NAME = 58; + +const int CSSM_ACL_SUBJECT_TYPE_EXT_PAM_NAME = 78; + +const int CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START = 65536; + +const int CSSM_ACL_AUTHORIZATION_ANY = 1; + +const int CSSM_ACL_AUTHORIZATION_LOGIN = 57; + +const int CSSM_ACL_AUTHORIZATION_GENKEY = 41; + +const int CSSM_ACL_AUTHORIZATION_DELETE = 25; + +const int CSSM_ACL_AUTHORIZATION_EXPORT_WRAPPED = 38; + +const int CSSM_ACL_AUTHORIZATION_EXPORT_CLEAR = 37; + +const int CSSM_ACL_AUTHORIZATION_IMPORT_WRAPPED = 48; + +const int CSSM_ACL_AUTHORIZATION_IMPORT_CLEAR = 47; + +const int CSSM_ACL_AUTHORIZATION_SIGN = 115; + +const int CSSM_ACL_AUTHORIZATION_ENCRYPT = 35; + +const int CSSM_ACL_AUTHORIZATION_DECRYPT = 24; + +const int CSSM_ACL_AUTHORIZATION_MAC = 59; + +const int CSSM_ACL_AUTHORIZATION_DERIVE = 28; + +const int CSSM_ACL_AUTHORIZATION_DBS_CREATE = 22; + +const int CSSM_ACL_AUTHORIZATION_DBS_DELETE = 23; + +const int CSSM_ACL_AUTHORIZATION_DB_READ = 21; + +const int CSSM_ACL_AUTHORIZATION_DB_INSERT = 19; + +const int CSSM_ACL_AUTHORIZATION_DB_MODIFY = 20; + +const int CSSM_ACL_AUTHORIZATION_DB_DELETE = 17; + +const int CSSM_ACL_EDIT_MODE_ADD = 1; + +const int CSSM_ACL_EDIT_MODE_DELETE = 2; + +const int CSSM_ACL_EDIT_MODE_REPLACE = 3; + +const int CSSM_KEYHEADER_VERSION = 2; + +const int CSSM_KEYBLOB_RAW = 0; + +const int CSSM_KEYBLOB_REFERENCE = 2; + +const int CSSM_KEYBLOB_WRAPPED = 3; + +const int CSSM_KEYBLOB_OTHER = -1; + +const int CSSM_KEYBLOB_RAW_FORMAT_NONE = 0; + +const int CSSM_KEYBLOB_RAW_FORMAT_PKCS1 = 1; + +const int CSSM_KEYBLOB_RAW_FORMAT_PKCS3 = 2; + +const int CSSM_KEYBLOB_RAW_FORMAT_MSCAPI = 3; + +const int CSSM_KEYBLOB_RAW_FORMAT_PGP = 4; + +const int CSSM_KEYBLOB_RAW_FORMAT_FIPS186 = 5; + +const int CSSM_KEYBLOB_RAW_FORMAT_BSAFE = 6; + +const int CSSM_KEYBLOB_RAW_FORMAT_CCA = 9; + +const int CSSM_KEYBLOB_RAW_FORMAT_PKCS8 = 10; + +const int CSSM_KEYBLOB_RAW_FORMAT_SPKI = 11; + +const int CSSM_KEYBLOB_RAW_FORMAT_OCTET_STRING = 12; + +const int CSSM_KEYBLOB_RAW_FORMAT_OTHER = -1; + +const int CSSM_KEYBLOB_WRAPPED_FORMAT_NONE = 0; + +const int CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS8 = 1; + +const int CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS7 = 2; + +const int CSSM_KEYBLOB_WRAPPED_FORMAT_MSCAPI = 3; + +const int CSSM_KEYBLOB_WRAPPED_FORMAT_OTHER = -1; + +const int CSSM_KEYBLOB_REF_FORMAT_INTEGER = 0; + +const int CSSM_KEYBLOB_REF_FORMAT_STRING = 1; + +const int CSSM_KEYBLOB_REF_FORMAT_SPKI = 2; + +const int CSSM_KEYBLOB_REF_FORMAT_OTHER = -1; + +const int CSSM_KEYCLASS_PUBLIC_KEY = 0; + +const int CSSM_KEYCLASS_PRIVATE_KEY = 1; + +const int CSSM_KEYCLASS_SESSION_KEY = 2; + +const int CSSM_KEYCLASS_SECRET_PART = 3; + +const int CSSM_KEYCLASS_OTHER = -1; + +const int CSSM_KEYATTR_RETURN_DEFAULT = 0; + +const int CSSM_KEYATTR_RETURN_DATA = 268435456; + +const int CSSM_KEYATTR_RETURN_REF = 536870912; + +const int CSSM_KEYATTR_RETURN_NONE = 1073741824; + +const int CSSM_KEYATTR_PERMANENT = 1; + +const int CSSM_KEYATTR_PRIVATE = 2; + +const int CSSM_KEYATTR_MODIFIABLE = 4; + +const int CSSM_KEYATTR_SENSITIVE = 8; + +const int CSSM_KEYATTR_EXTRACTABLE = 32; + +const int CSSM_KEYATTR_ALWAYS_SENSITIVE = 16; + +const int CSSM_KEYATTR_NEVER_EXTRACTABLE = 64; + +const int CSSM_KEYUSE_ANY = -2147483648; + +const int CSSM_KEYUSE_ENCRYPT = 1; + +const int CSSM_KEYUSE_DECRYPT = 2; + +const int CSSM_KEYUSE_SIGN = 4; + +const int CSSM_KEYUSE_VERIFY = 8; + +const int CSSM_KEYUSE_SIGN_RECOVER = 16; + +const int CSSM_KEYUSE_VERIFY_RECOVER = 32; + +const int CSSM_KEYUSE_WRAP = 64; + +const int CSSM_KEYUSE_UNWRAP = 128; + +const int CSSM_KEYUSE_DERIVE = 256; + +const int CSSM_ALGID_NONE = 0; + +const int CSSM_ALGID_CUSTOM = 1; + +const int CSSM_ALGID_DH = 2; + +const int CSSM_ALGID_PH = 3; + +const int CSSM_ALGID_KEA = 4; + +const int CSSM_ALGID_MD2 = 5; + +const int CSSM_ALGID_MD4 = 6; + +const int CSSM_ALGID_MD5 = 7; + +const int CSSM_ALGID_SHA1 = 8; + +const int CSSM_ALGID_NHASH = 9; + +const int CSSM_ALGID_HAVAL = 10; + +const int CSSM_ALGID_RIPEMD = 11; + +const int CSSM_ALGID_IBCHASH = 12; + +const int CSSM_ALGID_RIPEMAC = 13; + +const int CSSM_ALGID_DES = 14; + +const int CSSM_ALGID_DESX = 15; + +const int CSSM_ALGID_RDES = 16; + +const int CSSM_ALGID_3DES_3KEY_EDE = 17; + +const int CSSM_ALGID_3DES_2KEY_EDE = 18; + +const int CSSM_ALGID_3DES_1KEY_EEE = 19; + +const int CSSM_ALGID_3DES_3KEY = 17; + +const int CSSM_ALGID_3DES_3KEY_EEE = 20; + +const int CSSM_ALGID_3DES_2KEY = 18; + +const int CSSM_ALGID_3DES_2KEY_EEE = 21; + +const int CSSM_ALGID_3DES_1KEY = 20; + +const int CSSM_ALGID_IDEA = 22; + +const int CSSM_ALGID_RC2 = 23; + +const int CSSM_ALGID_RC5 = 24; + +const int CSSM_ALGID_RC4 = 25; + +const int CSSM_ALGID_SEAL = 26; + +const int CSSM_ALGID_CAST = 27; + +const int CSSM_ALGID_BLOWFISH = 28; + +const int CSSM_ALGID_SKIPJACK = 29; + +const int CSSM_ALGID_LUCIFER = 30; + +const int CSSM_ALGID_MADRYGA = 31; + +const int CSSM_ALGID_FEAL = 32; + +const int CSSM_ALGID_REDOC = 33; + +const int CSSM_ALGID_REDOC3 = 34; + +const int CSSM_ALGID_LOKI = 35; + +const int CSSM_ALGID_KHUFU = 36; + +const int CSSM_ALGID_KHAFRE = 37; + +const int CSSM_ALGID_MMB = 38; + +const int CSSM_ALGID_GOST = 39; + +const int CSSM_ALGID_SAFER = 40; + +const int CSSM_ALGID_CRAB = 41; + +const int CSSM_ALGID_RSA = 42; + +const int CSSM_ALGID_DSA = 43; + +const int CSSM_ALGID_MD5WithRSA = 44; + +const int CSSM_ALGID_MD2WithRSA = 45; + +const int CSSM_ALGID_ElGamal = 46; + +const int CSSM_ALGID_MD2Random = 47; + +const int CSSM_ALGID_MD5Random = 48; + +const int CSSM_ALGID_SHARandom = 49; + +const int CSSM_ALGID_DESRandom = 50; + +const int CSSM_ALGID_SHA1WithRSA = 51; + +const int CSSM_ALGID_CDMF = 52; + +const int CSSM_ALGID_CAST3 = 53; + +const int CSSM_ALGID_CAST5 = 54; + +const int CSSM_ALGID_GenericSecret = 55; + +const int CSSM_ALGID_ConcatBaseAndKey = 56; + +const int CSSM_ALGID_ConcatKeyAndBase = 57; + +const int CSSM_ALGID_ConcatBaseAndData = 58; + +const int CSSM_ALGID_ConcatDataAndBase = 59; + +const int CSSM_ALGID_XORBaseAndData = 60; + +const int CSSM_ALGID_ExtractFromKey = 61; + +const int CSSM_ALGID_SSL3PrePrimaryGen = 62; + +const int CSSM_ALGID_SSL3PreMasterGen = 62; + +const int CSSM_ALGID_SSL3PrimaryDerive = 63; + +const int CSSM_ALGID_SSL3MasterDerive = 63; + +const int CSSM_ALGID_SSL3KeyAndMacDerive = 64; + +const int CSSM_ALGID_SSL3MD5_MAC = 65; + +const int CSSM_ALGID_SSL3SHA1_MAC = 66; + +const int CSSM_ALGID_PKCS5_PBKDF1_MD5 = 67; + +const int CSSM_ALGID_PKCS5_PBKDF1_MD2 = 68; + +const int CSSM_ALGID_PKCS5_PBKDF1_SHA1 = 69; + +const int CSSM_ALGID_WrapLynks = 70; + +const int CSSM_ALGID_WrapSET_OAEP = 71; + +const int CSSM_ALGID_BATON = 72; + +const int CSSM_ALGID_ECDSA = 73; + +const int CSSM_ALGID_MAYFLY = 74; + +const int CSSM_ALGID_JUNIPER = 75; + +const int CSSM_ALGID_FASTHASH = 76; + +const int CSSM_ALGID_3DES = 77; + +const int CSSM_ALGID_SSL3MD5 = 78; + +const int CSSM_ALGID_SSL3SHA1 = 79; + +const int CSSM_ALGID_FortezzaTimestamp = 80; + +const int CSSM_ALGID_SHA1WithDSA = 81; + +const int CSSM_ALGID_SHA1WithECDSA = 82; + +const int CSSM_ALGID_DSA_BSAFE = 83; + +const int CSSM_ALGID_ECDH = 84; + +const int CSSM_ALGID_ECMQV = 85; + +const int CSSM_ALGID_PKCS12_SHA1_PBE = 86; + +const int CSSM_ALGID_ECNRA = 87; + +const int CSSM_ALGID_SHA1WithECNRA = 88; + +const int CSSM_ALGID_ECES = 89; + +const int CSSM_ALGID_ECAES = 90; + +const int CSSM_ALGID_SHA1HMAC = 91; + +const int CSSM_ALGID_FIPS186Random = 92; + +const int CSSM_ALGID_ECC = 93; + +const int CSSM_ALGID_MQV = 94; + +const int CSSM_ALGID_NRA = 95; + +const int CSSM_ALGID_IntelPlatformRandom = 96; + +const int CSSM_ALGID_UTC = 97; + +const int CSSM_ALGID_HAVAL3 = 98; + +const int CSSM_ALGID_HAVAL4 = 99; + +const int CSSM_ALGID_HAVAL5 = 100; + +const int CSSM_ALGID_TIGER = 101; + +const int CSSM_ALGID_MD5HMAC = 102; + +const int CSSM_ALGID_PKCS5_PBKDF2 = 103; + +const int CSSM_ALGID_RUNNING_COUNTER = 104; + +const int CSSM_ALGID_LAST = 2147483647; + +const int CSSM_ALGID_VENDOR_DEFINED = -2147483648; + +const int CSSM_ALGMODE_NONE = 0; + +const int CSSM_ALGMODE_CUSTOM = 1; + +const int CSSM_ALGMODE_ECB = 2; + +const int CSSM_ALGMODE_ECBPad = 3; + +const int CSSM_ALGMODE_CBC = 4; + +const int CSSM_ALGMODE_CBC_IV8 = 5; + +const int CSSM_ALGMODE_CBCPadIV8 = 6; + +const int CSSM_ALGMODE_CFB = 7; + +const int CSSM_ALGMODE_CFB_IV8 = 8; + +const int CSSM_ALGMODE_CFBPadIV8 = 9; + +const int CSSM_ALGMODE_OFB = 10; + +const int CSSM_ALGMODE_OFB_IV8 = 11; + +const int CSSM_ALGMODE_OFBPadIV8 = 12; + +const int CSSM_ALGMODE_COUNTER = 13; + +const int CSSM_ALGMODE_BC = 14; + +const int CSSM_ALGMODE_PCBC = 15; + +const int CSSM_ALGMODE_CBCC = 16; + +const int CSSM_ALGMODE_OFBNLF = 17; + +const int CSSM_ALGMODE_PBC = 18; + +const int CSSM_ALGMODE_PFB = 19; + +const int CSSM_ALGMODE_CBCPD = 20; + +const int CSSM_ALGMODE_PUBLIC_KEY = 21; + +const int CSSM_ALGMODE_PRIVATE_KEY = 22; + +const int CSSM_ALGMODE_SHUFFLE = 23; + +const int CSSM_ALGMODE_ECB64 = 24; + +const int CSSM_ALGMODE_CBC64 = 25; + +const int CSSM_ALGMODE_OFB64 = 26; + +const int CSSM_ALGMODE_CFB32 = 28; + +const int CSSM_ALGMODE_CFB16 = 29; + +const int CSSM_ALGMODE_CFB8 = 30; + +const int CSSM_ALGMODE_WRAP = 31; + +const int CSSM_ALGMODE_PRIVATE_WRAP = 32; + +const int CSSM_ALGMODE_RELAYX = 33; + +const int CSSM_ALGMODE_ECB128 = 34; + +const int CSSM_ALGMODE_ECB96 = 35; + +const int CSSM_ALGMODE_CBC128 = 36; + +const int CSSM_ALGMODE_OAEP_HASH = 37; + +const int CSSM_ALGMODE_PKCS1_EME_V15 = 38; + +const int CSSM_ALGMODE_PKCS1_EME_OAEP = 39; + +const int CSSM_ALGMODE_PKCS1_EMSA_V15 = 40; + +const int CSSM_ALGMODE_ISO_9796 = 41; + +const int CSSM_ALGMODE_X9_31 = 42; + +const int CSSM_ALGMODE_LAST = 2147483647; + +const int CSSM_ALGMODE_VENDOR_DEFINED = -2147483648; + +const int CSSM_CSP_SOFTWARE = 1; + +const int CSSM_CSP_HARDWARE = 2; + +const int CSSM_CSP_HYBRID = 3; + +const int CSSM_ALGCLASS_NONE = 0; + +const int CSSM_ALGCLASS_CUSTOM = 1; + +const int CSSM_ALGCLASS_SIGNATURE = 2; + +const int CSSM_ALGCLASS_SYMMETRIC = 3; + +const int CSSM_ALGCLASS_DIGEST = 4; + +const int CSSM_ALGCLASS_RANDOMGEN = 5; + +const int CSSM_ALGCLASS_UNIQUEGEN = 6; + +const int CSSM_ALGCLASS_MAC = 7; + +const int CSSM_ALGCLASS_ASYMMETRIC = 8; + +const int CSSM_ALGCLASS_KEYGEN = 9; + +const int CSSM_ALGCLASS_DERIVEKEY = 10; + +const int CSSM_ATTRIBUTE_DATA_NONE = 0; + +const int CSSM_ATTRIBUTE_DATA_UINT32 = 268435456; + +const int CSSM_ATTRIBUTE_DATA_CSSM_DATA = 536870912; + +const int CSSM_ATTRIBUTE_DATA_CRYPTO_DATA = 805306368; + +const int CSSM_ATTRIBUTE_DATA_KEY = 1073741824; + +const int CSSM_ATTRIBUTE_DATA_STRING = 1342177280; + +const int CSSM_ATTRIBUTE_DATA_DATE = 1610612736; + +const int CSSM_ATTRIBUTE_DATA_RANGE = 1879048192; + +const int CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS = -2147483648; + +const int CSSM_ATTRIBUTE_DATA_VERSION = 16777216; + +const int CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE = 33554432; + +const int CSSM_ATTRIBUTE_DATA_KR_PROFILE = 50331648; + +const int CSSM_ATTRIBUTE_TYPE_MASK = -16777216; + +const int CSSM_ATTRIBUTE_NONE = 0; + +const int CSSM_ATTRIBUTE_CUSTOM = 536870913; + +const int CSSM_ATTRIBUTE_DESCRIPTION = 1342177282; + +const int CSSM_ATTRIBUTE_KEY = 1073741827; + +const int CSSM_ATTRIBUTE_INIT_VECTOR = 536870916; + +const int CSSM_ATTRIBUTE_SALT = 536870917; + +const int CSSM_ATTRIBUTE_PADDING = 268435462; + +const int CSSM_ATTRIBUTE_RANDOM = 536870919; + +const int CSSM_ATTRIBUTE_SEED = 805306376; + +const int CSSM_ATTRIBUTE_PASSPHRASE = 805306377; + +const int CSSM_ATTRIBUTE_KEY_LENGTH = 268435466; + +const int CSSM_ATTRIBUTE_KEY_LENGTH_RANGE = 1879048203; + +const int CSSM_ATTRIBUTE_BLOCK_SIZE = 268435468; + +const int CSSM_ATTRIBUTE_OUTPUT_SIZE = 268435469; + +const int CSSM_ATTRIBUTE_ROUNDS = 268435470; + +const int CSSM_ATTRIBUTE_IV_SIZE = 268435471; + +const int CSSM_ATTRIBUTE_ALG_PARAMS = 536870928; + +const int CSSM_ATTRIBUTE_LABEL = 536870929; + +const int CSSM_ATTRIBUTE_KEY_TYPE = 268435474; + +const int CSSM_ATTRIBUTE_MODE = 268435475; + +const int CSSM_ATTRIBUTE_EFFECTIVE_BITS = 268435476; + +const int CSSM_ATTRIBUTE_START_DATE = 1610612757; + +const int CSSM_ATTRIBUTE_END_DATE = 1610612758; + +const int CSSM_ATTRIBUTE_KEYUSAGE = 268435479; + +const int CSSM_ATTRIBUTE_KEYATTR = 268435480; + +const int CSSM_ATTRIBUTE_VERSION = 16777241; + +const int CSSM_ATTRIBUTE_PRIME = 536870938; + +const int CSSM_ATTRIBUTE_BASE = 536870939; + +const int CSSM_ATTRIBUTE_SUBPRIME = 536870940; + +const int CSSM_ATTRIBUTE_ALG_ID = 268435485; + +const int CSSM_ATTRIBUTE_ITERATION_COUNT = 268435486; + +const int CSSM_ATTRIBUTE_ROUNDS_RANGE = 1879048223; + +const int CSSM_ATTRIBUTE_KRPROFILE_LOCAL = 50331680; + +const int CSSM_ATTRIBUTE_KRPROFILE_REMOTE = 50331681; + +const int CSSM_ATTRIBUTE_CSP_HANDLE = 268435490; + +const int CSSM_ATTRIBUTE_DL_DB_HANDLE = 33554467; + +const int CSSM_ATTRIBUTE_ACCESS_CREDENTIALS = -2147483612; + +const int CSSM_ATTRIBUTE_PUBLIC_KEY_FORMAT = 268435493; + +const int CSSM_ATTRIBUTE_PRIVATE_KEY_FORMAT = 268435494; + +const int CSSM_ATTRIBUTE_SYMMETRIC_KEY_FORMAT = 268435495; + +const int CSSM_ATTRIBUTE_WRAPPED_KEY_FORMAT = 268435496; + +const int CSSM_PADDING_NONE = 0; + +const int CSSM_PADDING_CUSTOM = 1; + +const int CSSM_PADDING_ZERO = 2; + +const int CSSM_PADDING_ONE = 3; + +const int CSSM_PADDING_ALTERNATE = 4; + +const int CSSM_PADDING_FF = 5; + +const int CSSM_PADDING_PKCS5 = 6; + +const int CSSM_PADDING_PKCS7 = 7; + +const int CSSM_PADDING_CIPHERSTEALING = 8; + +const int CSSM_PADDING_RANDOM = 9; + +const int CSSM_PADDING_PKCS1 = 10; + +const int CSSM_PADDING_SIGRAW = 11; + +const int CSSM_PADDING_VENDOR_DEFINED = -2147483648; + +const int CSSM_CSP_TOK_RNG = 1; + +const int CSSM_CSP_TOK_CLOCK_EXISTS = 64; + +const int CSSM_CSP_RDR_TOKENPRESENT = 1; + +const int CSSM_CSP_RDR_EXISTS = 2; + +const int CSSM_CSP_RDR_HW = 4; + +const int CSSM_CSP_TOK_WRITE_PROTECTED = 2; + +const int CSSM_CSP_TOK_LOGIN_REQUIRED = 4; + +const int CSSM_CSP_TOK_USER_PIN_INITIALIZED = 8; + +const int CSSM_CSP_TOK_PROT_AUTHENTICATION = 256; + +const int CSSM_CSP_TOK_USER_PIN_EXPIRED = 1048576; + +const int CSSM_CSP_TOK_SESSION_KEY_PASSWORD = 2097152; + +const int CSSM_CSP_TOK_PRIVATE_KEY_PASSWORD = 4194304; + +const int CSSM_CSP_STORES_PRIVATE_KEYS = 16777216; + +const int CSSM_CSP_STORES_PUBLIC_KEYS = 33554432; + +const int CSSM_CSP_STORES_SESSION_KEYS = 67108864; + +const int CSSM_CSP_STORES_CERTIFICATES = 134217728; + +const int CSSM_CSP_STORES_GENERIC = 268435456; + +const int CSSM_PKCS_OAEP_MGF_NONE = 0; + +const int CSSM_PKCS_OAEP_MGF1_SHA1 = 1; + +const int CSSM_PKCS_OAEP_MGF1_MD5 = 2; + +const int CSSM_PKCS_OAEP_PSOURCE_NONE = 0; + +const int CSSM_PKCS_OAEP_PSOURCE_Pspecified = 1; + +const int CSSM_VALUE_NOT_AVAILABLE = -1; + +const int CSSM_PKCS5_PBKDF2_PRF_HMAC_SHA1 = 0; + +const int CSSM_TP_AUTHORITY_REQUEST_CERTISSUE = 1; + +const int CSSM_TP_AUTHORITY_REQUEST_CERTREVOKE = 2; + +const int CSSM_TP_AUTHORITY_REQUEST_CERTSUSPEND = 3; + +const int CSSM_TP_AUTHORITY_REQUEST_CERTRESUME = 4; + +const int CSSM_TP_AUTHORITY_REQUEST_CERTVERIFY = 5; + +const int CSSM_TP_AUTHORITY_REQUEST_CERTNOTARIZE = 6; + +const int CSSM_TP_AUTHORITY_REQUEST_CERTUSERECOVER = 7; + +const int CSSM_TP_AUTHORITY_REQUEST_CRLISSUE = 256; + +const int CSSM_TP_KEY_ARCHIVE = 1; + +const int CSSM_TP_CERT_PUBLISH = 2; + +const int CSSM_TP_CERT_NOTIFY_RENEW = 4; + +const int CSSM_TP_CERT_DIR_UPDATE = 8; + +const int CSSM_TP_CRL_DISTRIBUTE = 16; + +const int CSSM_TP_ACTION_DEFAULT = 0; + +const int CSSM_TP_STOP_ON_POLICY = 0; + +const int CSSM_TP_STOP_ON_NONE = 1; + +const int CSSM_TP_STOP_ON_FIRST_PASS = 2; + +const int CSSM_TP_STOP_ON_FIRST_FAIL = 3; + +const int CSSM_CRL_PARSE_FORMAT_NONE = 0; + +const int CSSM_CRL_PARSE_FORMAT_CUSTOM = 1; + +const int CSSM_CRL_PARSE_FORMAT_SEXPR = 2; + +const int CSSM_CRL_PARSE_FORMAT_COMPLEX = 3; + +const int CSSM_CRL_PARSE_FORMAT_OID_NAMED = 4; + +const int CSSM_CRL_PARSE_FORMAT_TUPLE = 5; + +const int CSSM_CRL_PARSE_FORMAT_MULTIPLE = 32766; + +const int CSSM_CRL_PARSE_FORMAT_LAST = 32767; + +const int CSSM_CL_CUSTOM_CRL_PARSE_FORMAT = 32768; + +const int CSSM_CRL_TYPE_UNKNOWN = 0; + +const int CSSM_CRL_TYPE_X_509v1 = 1; + +const int CSSM_CRL_TYPE_X_509v2 = 2; + +const int CSSM_CRL_TYPE_SPKI = 3; + +const int CSSM_CRL_TYPE_MULTIPLE = 32766; + +const int CSSM_CRL_ENCODING_UNKNOWN = 0; + +const int CSSM_CRL_ENCODING_CUSTOM = 1; + +const int CSSM_CRL_ENCODING_BER = 2; + +const int CSSM_CRL_ENCODING_DER = 3; + +const int CSSM_CRL_ENCODING_BLOOM = 4; + +const int CSSM_CRL_ENCODING_SEXPR = 5; + +const int CSSM_CRL_ENCODING_MULTIPLE = 32766; + +const int CSSM_CRLGROUP_DATA = 0; + +const int CSSM_CRLGROUP_ENCODED_CRL = 1; + +const int CSSM_CRLGROUP_PARSED_CRL = 2; + +const int CSSM_CRLGROUP_CRL_PAIR = 3; + +const int CSSM_EVIDENCE_FORM_UNSPECIFIC = 0; + +const int CSSM_EVIDENCE_FORM_CERT = 1; + +const int CSSM_EVIDENCE_FORM_CRL = 2; + +const int CSSM_EVIDENCE_FORM_CERT_ID = 3; + +const int CSSM_EVIDENCE_FORM_CRL_ID = 4; + +const int CSSM_EVIDENCE_FORM_VERIFIER_TIME = 5; + +const int CSSM_EVIDENCE_FORM_CRL_THISTIME = 6; + +const int CSSM_EVIDENCE_FORM_CRL_NEXTTIME = 7; + +const int CSSM_EVIDENCE_FORM_POLICYINFO = 8; + +const int CSSM_EVIDENCE_FORM_TUPLEGROUP = 9; + +const int CSSM_TP_CONFIRM_STATUS_UNKNOWN = 0; + +const int CSSM_TP_CONFIRM_ACCEPT = 1; + +const int CSSM_TP_CONFIRM_REJECT = 2; + +const int CSSM_ESTIMATED_TIME_UNKNOWN = -1; + +const int CSSM_ELAPSED_TIME_UNKNOWN = -1; + +const int CSSM_ELAPSED_TIME_COMPLETE = -2; + +const int CSSM_TP_CERTISSUE_STATUS_UNKNOWN = 0; + +const int CSSM_TP_CERTISSUE_OK = 1; + +const int CSSM_TP_CERTISSUE_OKWITHCERTMODS = 2; + +const int CSSM_TP_CERTISSUE_OKWITHSERVICEMODS = 3; + +const int CSSM_TP_CERTISSUE_REJECTED = 4; + +const int CSSM_TP_CERTISSUE_NOT_AUTHORIZED = 5; + +const int CSSM_TP_CERTISSUE_WILL_BE_REVOKED = 6; + +const int CSSM_TP_CERTCHANGE_NONE = 0; + +const int CSSM_TP_CERTCHANGE_REVOKE = 1; + +const int CSSM_TP_CERTCHANGE_HOLD = 2; + +const int CSSM_TP_CERTCHANGE_RELEASE = 3; + +const int CSSM_TP_CERTCHANGE_REASON_UNKNOWN = 0; + +const int CSSM_TP_CERTCHANGE_REASON_KEYCOMPROMISE = 1; + +const int CSSM_TP_CERTCHANGE_REASON_CACOMPROMISE = 2; + +const int CSSM_TP_CERTCHANGE_REASON_CEASEOPERATION = 3; + +const int CSSM_TP_CERTCHANGE_REASON_AFFILIATIONCHANGE = 4; + +const int CSSM_TP_CERTCHANGE_REASON_SUPERCEDED = 5; + +const int CSSM_TP_CERTCHANGE_REASON_SUSPECTEDCOMPROMISE = 6; + +const int CSSM_TP_CERTCHANGE_REASON_HOLDRELEASE = 7; + +const int CSSM_TP_CERTCHANGE_STATUS_UNKNOWN = 0; + +const int CSSM_TP_CERTCHANGE_OK = 1; + +const int CSSM_TP_CERTCHANGE_OKWITHNEWTIME = 2; + +const int CSSM_TP_CERTCHANGE_WRONGCA = 3; + +const int CSSM_TP_CERTCHANGE_REJECTED = 4; + +const int CSSM_TP_CERTCHANGE_NOT_AUTHORIZED = 5; + +const int CSSM_TP_CERTVERIFY_UNKNOWN = 0; + +const int CSSM_TP_CERTVERIFY_VALID = 1; + +const int CSSM_TP_CERTVERIFY_INVALID = 2; + +const int CSSM_TP_CERTVERIFY_REVOKED = 3; + +const int CSSM_TP_CERTVERIFY_SUSPENDED = 4; + +const int CSSM_TP_CERTVERIFY_EXPIRED = 5; + +const int CSSM_TP_CERTVERIFY_NOT_VALID_YET = 6; + +const int CSSM_TP_CERTVERIFY_INVALID_AUTHORITY = 7; + +const int CSSM_TP_CERTVERIFY_INVALID_SIGNATURE = 8; + +const int CSSM_TP_CERTVERIFY_INVALID_CERT_VALUE = 9; + +const int CSSM_TP_CERTVERIFY_INVALID_CERTGROUP = 10; + +const int CSSM_TP_CERTVERIFY_INVALID_POLICY = 11; + +const int CSSM_TP_CERTVERIFY_INVALID_POLICY_IDS = 12; + +const int CSSM_TP_CERTVERIFY_INVALID_BASIC_CONSTRAINTS = 13; + +const int CSSM_TP_CERTVERIFY_INVALID_CRL_DIST_PT = 14; + +const int CSSM_TP_CERTVERIFY_INVALID_NAME_TREE = 15; + +const int CSSM_TP_CERTVERIFY_UNKNOWN_CRITICAL_EXT = 16; + +const int CSSM_TP_CERTNOTARIZE_STATUS_UNKNOWN = 0; + +const int CSSM_TP_CERTNOTARIZE_OK = 1; + +const int CSSM_TP_CERTNOTARIZE_OKWITHOUTFIELDS = 2; + +const int CSSM_TP_CERTNOTARIZE_OKWITHSERVICEMODS = 3; + +const int CSSM_TP_CERTNOTARIZE_REJECTED = 4; + +const int CSSM_TP_CERTNOTARIZE_NOT_AUTHORIZED = 5; + +const int CSSM_TP_CERTRECLAIM_STATUS_UNKNOWN = 0; + +const int CSSM_TP_CERTRECLAIM_OK = 1; + +const int CSSM_TP_CERTRECLAIM_NOMATCH = 2; + +const int CSSM_TP_CERTRECLAIM_REJECTED = 3; + +const int CSSM_TP_CERTRECLAIM_NOT_AUTHORIZED = 4; + +const int CSSM_TP_CRLISSUE_STATUS_UNKNOWN = 0; + +const int CSSM_TP_CRLISSUE_OK = 1; + +const int CSSM_TP_CRLISSUE_NOT_CURRENT = 2; + +const int CSSM_TP_CRLISSUE_INVALID_DOMAIN = 3; + +const int CSSM_TP_CRLISSUE_UNKNOWN_IDENTIFIER = 4; + +const int CSSM_TP_CRLISSUE_REJECTED = 5; + +const int CSSM_TP_CRLISSUE_NOT_AUTHORIZED = 6; + +const int CSSM_TP_FORM_TYPE_GENERIC = 0; + +const int CSSM_TP_FORM_TYPE_REGISTRATION = 1; + +const int CSSM_CL_TEMPLATE_INTERMEDIATE_CERT = 1; + +const int CSSM_CL_TEMPLATE_PKIX_CERTTEMPLATE = 2; + +const int CSSM_CERT_BUNDLE_UNKNOWN = 0; + +const int CSSM_CERT_BUNDLE_CUSTOM = 1; + +const int CSSM_CERT_BUNDLE_PKCS7_SIGNED_DATA = 2; + +const int CSSM_CERT_BUNDLE_PKCS7_SIGNED_ENVELOPED_DATA = 3; + +const int CSSM_CERT_BUNDLE_PKCS12 = 4; + +const int CSSM_CERT_BUNDLE_PFX = 5; + +const int CSSM_CERT_BUNDLE_SPKI_SEQUENCE = 6; + +const int CSSM_CERT_BUNDLE_PGP_KEYRING = 7; + +const int CSSM_CERT_BUNDLE_LAST = 32767; + +const int CSSM_CL_CUSTOM_CERT_BUNDLE_TYPE = 32768; + +const int CSSM_CERT_BUNDLE_ENCODING_UNKNOWN = 0; + +const int CSSM_CERT_BUNDLE_ENCODING_CUSTOM = 1; + +const int CSSM_CERT_BUNDLE_ENCODING_BER = 2; + +const int CSSM_CERT_BUNDLE_ENCODING_DER = 3; + +const int CSSM_CERT_BUNDLE_ENCODING_SEXPR = 4; + +const int CSSM_CERT_BUNDLE_ENCODING_PGP = 5; + +const int CSSM_FIELDVALUE_COMPLEX_DATA_TYPE = -1; + +const int CSSM_DB_ATTRIBUTE_NAME_AS_STRING = 0; + +const int CSSM_DB_ATTRIBUTE_NAME_AS_OID = 1; + +const int CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER = 2; + +const int CSSM_DB_ATTRIBUTE_FORMAT_STRING = 0; + +const int CSSM_DB_ATTRIBUTE_FORMAT_SINT32 = 1; + +const int CSSM_DB_ATTRIBUTE_FORMAT_UINT32 = 2; + +const int CSSM_DB_ATTRIBUTE_FORMAT_BIG_NUM = 3; + +const int CSSM_DB_ATTRIBUTE_FORMAT_REAL = 4; + +const int CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE = 5; + +const int CSSM_DB_ATTRIBUTE_FORMAT_BLOB = 6; + +const int CSSM_DB_ATTRIBUTE_FORMAT_MULTI_UINT32 = 7; + +const int CSSM_DB_ATTRIBUTE_FORMAT_COMPLEX = 8; + +const int CSSM_DB_RECORDTYPE_SCHEMA_START = 0; + +const int CSSM_DB_RECORDTYPE_SCHEMA_END = 4; + +const int CSSM_DB_RECORDTYPE_OPEN_GROUP_START = 10; + +const int CSSM_DB_RECORDTYPE_OPEN_GROUP_END = 18; + +const int CSSM_DB_RECORDTYPE_APP_DEFINED_START = -2147483648; + +const int CSSM_DB_RECORDTYPE_APP_DEFINED_END = -1; + +const int CSSM_DL_DB_SCHEMA_INFO = 0; + +const int CSSM_DL_DB_SCHEMA_INDEXES = 1; + +const int CSSM_DL_DB_SCHEMA_ATTRIBUTES = 2; + +const int CSSM_DL_DB_SCHEMA_PARSING_MODULE = 3; + +const int CSSM_DL_DB_RECORD_ANY = 10; + +const int CSSM_DL_DB_RECORD_CERT = 11; + +const int CSSM_DL_DB_RECORD_CRL = 12; + +const int CSSM_DL_DB_RECORD_POLICY = 13; + +const int CSSM_DL_DB_RECORD_GENERIC = 14; + +const int CSSM_DL_DB_RECORD_PUBLIC_KEY = 15; + +const int CSSM_DL_DB_RECORD_PRIVATE_KEY = 16; + +const int CSSM_DL_DB_RECORD_SYMMETRIC_KEY = 17; + +const int CSSM_DL_DB_RECORD_ALL_KEYS = 18; + +const int CSSM_DB_CERT_USE_TRUSTED = 1; + +const int CSSM_DB_CERT_USE_SYSTEM = 2; + +const int CSSM_DB_CERT_USE_OWNER = 4; + +const int CSSM_DB_CERT_USE_REVOKED = 8; + +const int CSSM_DB_CERT_USE_SIGNING = 16; + +const int CSSM_DB_CERT_USE_PRIVACY = 32; + +const int CSSM_DB_INDEX_UNIQUE = 0; + +const int CSSM_DB_INDEX_NONUNIQUE = 1; + +const int CSSM_DB_INDEX_ON_UNKNOWN = 0; + +const int CSSM_DB_INDEX_ON_ATTRIBUTE = 1; + +const int CSSM_DB_INDEX_ON_RECORD = 2; + +const int CSSM_DB_ACCESS_READ = 1; + +const int CSSM_DB_ACCESS_WRITE = 2; + +const int CSSM_DB_ACCESS_PRIVILEGED = 4; + +const int CSSM_DB_MODIFY_ATTRIBUTE_NONE = 0; + +const int CSSM_DB_MODIFY_ATTRIBUTE_ADD = 1; + +const int CSSM_DB_MODIFY_ATTRIBUTE_DELETE = 2; + +const int CSSM_DB_MODIFY_ATTRIBUTE_REPLACE = 3; + +const int CSSM_DB_EQUAL = 0; + +const int CSSM_DB_NOT_EQUAL = 1; + +const int CSSM_DB_LESS_THAN = 2; + +const int CSSM_DB_GREATER_THAN = 3; + +const int CSSM_DB_CONTAINS = 4; + +const int CSSM_DB_CONTAINS_INITIAL_SUBSTRING = 5; + +const int CSSM_DB_CONTAINS_FINAL_SUBSTRING = 6; + +const int CSSM_DB_NONE = 0; + +const int CSSM_DB_AND = 1; + +const int CSSM_DB_OR = 2; + +const int CSSM_QUERY_TIMELIMIT_NONE = 0; + +const int CSSM_QUERY_SIZELIMIT_NONE = 0; + +const int CSSM_QUERY_RETURN_DATA = 1; + +const int CSSM_DL_UNKNOWN = 0; + +const int CSSM_DL_CUSTOM = 1; + +const int CSSM_DL_LDAP = 2; + +const int CSSM_DL_ODBC = 3; + +const int CSSM_DL_PKCS11 = 4; + +const int CSSM_DL_FFS = 5; + +const int CSSM_DL_MEMORY = 6; + +const int CSSM_DL_REMOTEDIR = 7; + +const int CSSM_DB_DATASTORES_UNKNOWN = -1; + +const int CSSM_DB_TRANSACTIONAL_MODE = 0; + +const int CSSM_DB_FILESYSTEMSCAN_MODE = 1; + +const int CSSM_BASE_ERROR = -2147418112; + +const int CSSM_ERRORCODE_MODULE_EXTENT = 2048; + +const int CSSM_ERRORCODE_CUSTOM_OFFSET = 1024; + +const int CSSM_ERRORCODE_COMMON_EXTENT = 256; + +const int CSSM_CSSM_BASE_ERROR = -2147418112; + +const int CSSM_CSSM_PRIVATE_ERROR = -2147417088; + +const int CSSM_CSP_BASE_ERROR = -2147416064; + +const int CSSM_CSP_PRIVATE_ERROR = -2147415040; + +const int CSSM_DL_BASE_ERROR = -2147414016; + +const int CSSM_DL_PRIVATE_ERROR = -2147412992; + +const int CSSM_CL_BASE_ERROR = -2147411968; + +const int CSSM_CL_PRIVATE_ERROR = -2147410944; + +const int CSSM_TP_BASE_ERROR = -2147409920; + +const int CSSM_TP_PRIVATE_ERROR = -2147408896; + +const int CSSM_KR_BASE_ERROR = -2147407872; + +const int CSSM_KR_PRIVATE_ERROR = -2147406848; + +const int CSSM_AC_BASE_ERROR = -2147405824; + +const int CSSM_AC_PRIVATE_ERROR = -2147404800; + +const int CSSM_MDS_BASE_ERROR = -2147414016; + +const int CSSM_MDS_PRIVATE_ERROR = -2147412992; + +const int CSSMERR_CSSM_INVALID_ADDIN_HANDLE = -2147417855; + +const int CSSMERR_CSSM_NOT_INITIALIZED = -2147417854; + +const int CSSMERR_CSSM_INVALID_HANDLE_USAGE = -2147417853; + +const int CSSMERR_CSSM_PVC_REFERENT_NOT_FOUND = -2147417852; + +const int CSSMERR_CSSM_FUNCTION_INTEGRITY_FAIL = -2147417851; + +const int CSSM_ERRCODE_INTERNAL_ERROR = 1; + +const int CSSM_ERRCODE_MEMORY_ERROR = 2; + +const int CSSM_ERRCODE_MDS_ERROR = 3; + +const int CSSM_ERRCODE_INVALID_POINTER = 4; + +const int CSSM_ERRCODE_INVALID_INPUT_POINTER = 5; + +const int CSSM_ERRCODE_INVALID_OUTPUT_POINTER = 6; + +const int CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED = 7; + +const int CSSM_ERRCODE_SELF_CHECK_FAILED = 8; + +const int CSSM_ERRCODE_OS_ACCESS_DENIED = 9; + +const int CSSM_ERRCODE_FUNCTION_FAILED = 10; + +const int CSSM_ERRCODE_MODULE_MANIFEST_VERIFY_FAILED = 11; + +const int CSSM_ERRCODE_INVALID_GUID = 12; + +const int CSSM_ERRCODE_OPERATION_AUTH_DENIED = 32; + +const int CSSM_ERRCODE_OBJECT_USE_AUTH_DENIED = 33; + +const int CSSM_ERRCODE_OBJECT_MANIP_AUTH_DENIED = 34; + +const int CSSM_ERRCODE_OBJECT_ACL_NOT_SUPPORTED = 35; + +const int CSSM_ERRCODE_OBJECT_ACL_REQUIRED = 36; + +const int CSSM_ERRCODE_INVALID_ACCESS_CREDENTIALS = 37; + +const int CSSM_ERRCODE_INVALID_ACL_BASE_CERTS = 38; + +const int CSSM_ERRCODE_ACL_BASE_CERTS_NOT_SUPPORTED = 39; + +const int CSSM_ERRCODE_INVALID_SAMPLE_VALUE = 40; + +const int CSSM_ERRCODE_SAMPLE_VALUE_NOT_SUPPORTED = 41; + +const int CSSM_ERRCODE_INVALID_ACL_SUBJECT_VALUE = 42; + +const int CSSM_ERRCODE_ACL_SUBJECT_TYPE_NOT_SUPPORTED = 43; + +const int CSSM_ERRCODE_INVALID_ACL_CHALLENGE_CALLBACK = 44; + +const int CSSM_ERRCODE_ACL_CHALLENGE_CALLBACK_FAILED = 45; + +const int CSSM_ERRCODE_INVALID_ACL_ENTRY_TAG = 46; + +const int CSSM_ERRCODE_ACL_ENTRY_TAG_NOT_FOUND = 47; + +const int CSSM_ERRCODE_INVALID_ACL_EDIT_MODE = 48; + +const int CSSM_ERRCODE_ACL_CHANGE_FAILED = 49; + +const int CSSM_ERRCODE_INVALID_NEW_ACL_ENTRY = 50; + +const int CSSM_ERRCODE_INVALID_NEW_ACL_OWNER = 51; + +const int CSSM_ERRCODE_ACL_DELETE_FAILED = 52; + +const int CSSM_ERRCODE_ACL_REPLACE_FAILED = 53; + +const int CSSM_ERRCODE_ACL_ADD_FAILED = 54; + +const int CSSM_ERRCODE_INVALID_CONTEXT_HANDLE = 64; + +const int CSSM_ERRCODE_INCOMPATIBLE_VERSION = 65; + +const int CSSM_ERRCODE_INVALID_CERTGROUP_POINTER = 66; + +const int CSSM_ERRCODE_INVALID_CERT_POINTER = 67; + +const int CSSM_ERRCODE_INVALID_CRL_POINTER = 68; + +const int CSSM_ERRCODE_INVALID_FIELD_POINTER = 69; + +const int CSSM_ERRCODE_INVALID_DATA = 70; + +const int CSSM_ERRCODE_CRL_ALREADY_SIGNED = 71; + +const int CSSM_ERRCODE_INVALID_NUMBER_OF_FIELDS = 72; + +const int CSSM_ERRCODE_VERIFICATION_FAILURE = 73; + +const int CSSM_ERRCODE_INVALID_DB_HANDLE = 74; + +const int CSSM_ERRCODE_PRIVILEGE_NOT_GRANTED = 75; + +const int CSSM_ERRCODE_INVALID_DB_LIST = 76; + +const int CSSM_ERRCODE_INVALID_DB_LIST_POINTER = 77; + +const int CSSM_ERRCODE_UNKNOWN_FORMAT = 78; + +const int CSSM_ERRCODE_UNKNOWN_TAG = 79; + +const int CSSM_ERRCODE_INVALID_CSP_HANDLE = 80; + +const int CSSM_ERRCODE_INVALID_DL_HANDLE = 81; + +const int CSSM_ERRCODE_INVALID_CL_HANDLE = 82; + +const int CSSM_ERRCODE_INVALID_TP_HANDLE = 83; + +const int CSSM_ERRCODE_INVALID_KR_HANDLE = 84; + +const int CSSM_ERRCODE_INVALID_AC_HANDLE = 85; + +const int CSSM_ERRCODE_INVALID_PASSTHROUGH_ID = 86; + +const int CSSM_ERRCODE_INVALID_NETWORK_ADDR = 87; + +const int CSSM_ERRCODE_INVALID_CRYPTO_DATA = 88; + +const int CSSMERR_CSSM_INTERNAL_ERROR = -2147418111; + +const int CSSMERR_CSSM_MEMORY_ERROR = -2147418110; + +const int CSSMERR_CSSM_MDS_ERROR = -2147418109; + +const int CSSMERR_CSSM_INVALID_POINTER = -2147418108; + +const int CSSMERR_CSSM_INVALID_INPUT_POINTER = -2147418107; + +const int CSSMERR_CSSM_INVALID_OUTPUT_POINTER = -2147418106; + +const int CSSMERR_CSSM_FUNCTION_NOT_IMPLEMENTED = -2147418105; + +const int CSSMERR_CSSM_SELF_CHECK_FAILED = -2147418104; + +const int CSSMERR_CSSM_OS_ACCESS_DENIED = -2147418103; + +const int CSSMERR_CSSM_FUNCTION_FAILED = -2147418102; + +const int CSSMERR_CSSM_MODULE_MANIFEST_VERIFY_FAILED = -2147418101; + +const int CSSMERR_CSSM_INVALID_GUID = -2147418100; + +const int CSSMERR_CSSM_INVALID_CONTEXT_HANDLE = -2147418048; + +const int CSSMERR_CSSM_INCOMPATIBLE_VERSION = -2147418047; + +const int CSSMERR_CSSM_PRIVILEGE_NOT_GRANTED = -2147418037; + +const int CSSM_CSSM_BASE_CSSM_ERROR = -2147417840; + +const int CSSMERR_CSSM_SCOPE_NOT_SUPPORTED = -2147417839; + +const int CSSMERR_CSSM_PVC_ALREADY_CONFIGURED = -2147417838; + +const int CSSMERR_CSSM_INVALID_PVC = -2147417837; + +const int CSSMERR_CSSM_EMM_LOAD_FAILED = -2147417836; + +const int CSSMERR_CSSM_EMM_UNLOAD_FAILED = -2147417835; + +const int CSSMERR_CSSM_ADDIN_LOAD_FAILED = -2147417834; + +const int CSSMERR_CSSM_INVALID_KEY_HIERARCHY = -2147417833; + +const int CSSMERR_CSSM_ADDIN_UNLOAD_FAILED = -2147417832; + +const int CSSMERR_CSSM_LIB_REF_NOT_FOUND = -2147417831; + +const int CSSMERR_CSSM_INVALID_ADDIN_FUNCTION_TABLE = -2147417830; + +const int CSSMERR_CSSM_EMM_AUTHENTICATE_FAILED = -2147417829; + +const int CSSMERR_CSSM_ADDIN_AUTHENTICATE_FAILED = -2147417828; + +const int CSSMERR_CSSM_INVALID_SERVICE_MASK = -2147417827; + +const int CSSMERR_CSSM_MODULE_NOT_LOADED = -2147417826; + +const int CSSMERR_CSSM_INVALID_SUBSERVICEID = -2147417825; + +const int CSSMERR_CSSM_BUFFER_TOO_SMALL = -2147417824; + +const int CSSMERR_CSSM_INVALID_ATTRIBUTE = -2147417823; + +const int CSSMERR_CSSM_ATTRIBUTE_NOT_IN_CONTEXT = -2147417822; + +const int CSSMERR_CSSM_MODULE_MANAGER_INITIALIZE_FAIL = -2147417821; + +const int CSSMERR_CSSM_MODULE_MANAGER_NOT_FOUND = -2147417820; + +const int CSSMERR_CSSM_EVENT_NOTIFICATION_CALLBACK_NOT_FOUND = -2147417819; + +const int CSSMERR_CSP_INTERNAL_ERROR = -2147416063; + +const int CSSMERR_CSP_MEMORY_ERROR = -2147416062; + +const int CSSMERR_CSP_MDS_ERROR = -2147416061; + +const int CSSMERR_CSP_INVALID_POINTER = -2147416060; + +const int CSSMERR_CSP_INVALID_INPUT_POINTER = -2147416059; + +const int CSSMERR_CSP_INVALID_OUTPUT_POINTER = -2147416058; + +const int CSSMERR_CSP_FUNCTION_NOT_IMPLEMENTED = -2147416057; + +const int CSSMERR_CSP_SELF_CHECK_FAILED = -2147416056; + +const int CSSMERR_CSP_OS_ACCESS_DENIED = -2147416055; + +const int CSSMERR_CSP_FUNCTION_FAILED = -2147416054; + +const int CSSMERR_CSP_OPERATION_AUTH_DENIED = -2147416032; + +const int CSSMERR_CSP_OBJECT_USE_AUTH_DENIED = -2147416031; + +const int CSSMERR_CSP_OBJECT_MANIP_AUTH_DENIED = -2147416030; + +const int CSSMERR_CSP_OBJECT_ACL_NOT_SUPPORTED = -2147416029; + +const int CSSMERR_CSP_OBJECT_ACL_REQUIRED = -2147416028; + +const int CSSMERR_CSP_INVALID_ACCESS_CREDENTIALS = -2147416027; + +const int CSSMERR_CSP_INVALID_ACL_BASE_CERTS = -2147416026; + +const int CSSMERR_CSP_ACL_BASE_CERTS_NOT_SUPPORTED = -2147416025; + +const int CSSMERR_CSP_INVALID_SAMPLE_VALUE = -2147416024; + +const int CSSMERR_CSP_SAMPLE_VALUE_NOT_SUPPORTED = -2147416023; + +const int CSSMERR_CSP_INVALID_ACL_SUBJECT_VALUE = -2147416022; + +const int CSSMERR_CSP_ACL_SUBJECT_TYPE_NOT_SUPPORTED = -2147416021; + +const int CSSMERR_CSP_INVALID_ACL_CHALLENGE_CALLBACK = -2147416020; + +const int CSSMERR_CSP_ACL_CHALLENGE_CALLBACK_FAILED = -2147416019; + +const int CSSMERR_CSP_INVALID_ACL_ENTRY_TAG = -2147416018; + +const int CSSMERR_CSP_ACL_ENTRY_TAG_NOT_FOUND = -2147416017; + +const int CSSMERR_CSP_INVALID_ACL_EDIT_MODE = -2147416016; + +const int CSSMERR_CSP_ACL_CHANGE_FAILED = -2147416015; + +const int CSSMERR_CSP_INVALID_NEW_ACL_ENTRY = -2147416014; + +const int CSSMERR_CSP_INVALID_NEW_ACL_OWNER = -2147416013; + +const int CSSMERR_CSP_ACL_DELETE_FAILED = -2147416012; + +const int CSSMERR_CSP_ACL_REPLACE_FAILED = -2147416011; + +const int CSSMERR_CSP_ACL_ADD_FAILED = -2147416010; + +const int CSSMERR_CSP_INVALID_CONTEXT_HANDLE = -2147416000; + +const int CSSMERR_CSP_PRIVILEGE_NOT_GRANTED = -2147415989; + +const int CSSMERR_CSP_INVALID_DATA = -2147415994; + +const int CSSMERR_CSP_INVALID_PASSTHROUGH_ID = -2147415978; + +const int CSSMERR_CSP_INVALID_CRYPTO_DATA = -2147415976; + +const int CSSM_CSP_BASE_CSP_ERROR = -2147415808; + +const int CSSMERR_CSP_INPUT_LENGTH_ERROR = -2147415807; + +const int CSSMERR_CSP_OUTPUT_LENGTH_ERROR = -2147415806; + +const int CSSMERR_CSP_PRIVILEGE_NOT_SUPPORTED = -2147415805; + +const int CSSMERR_CSP_DEVICE_ERROR = -2147415804; + +const int CSSMERR_CSP_DEVICE_MEMORY_ERROR = -2147415803; + +const int CSSMERR_CSP_ATTACH_HANDLE_BUSY = -2147415802; + +const int CSSMERR_CSP_NOT_LOGGED_IN = -2147415801; + +const int CSSMERR_CSP_INVALID_KEY = -2147415792; + +const int CSSMERR_CSP_INVALID_KEY_REFERENCE = -2147415791; + +const int CSSMERR_CSP_INVALID_KEY_CLASS = -2147415790; + +const int CSSMERR_CSP_ALGID_MISMATCH = -2147415789; + +const int CSSMERR_CSP_KEY_USAGE_INCORRECT = -2147415788; + +const int CSSMERR_CSP_KEY_BLOB_TYPE_INCORRECT = -2147415787; + +const int CSSMERR_CSP_KEY_HEADER_INCONSISTENT = -2147415786; + +const int CSSMERR_CSP_UNSUPPORTED_KEY_FORMAT = -2147415785; + +const int CSSMERR_CSP_UNSUPPORTED_KEY_SIZE = -2147415784; + +const int CSSMERR_CSP_INVALID_KEY_POINTER = -2147415783; + +const int CSSMERR_CSP_INVALID_KEYUSAGE_MASK = -2147415782; + +const int CSSMERR_CSP_UNSUPPORTED_KEYUSAGE_MASK = -2147415781; + +const int CSSMERR_CSP_INVALID_KEYATTR_MASK = -2147415780; + +const int CSSMERR_CSP_UNSUPPORTED_KEYATTR_MASK = -2147415779; + +const int CSSMERR_CSP_INVALID_KEY_LABEL = -2147415778; + +const int CSSMERR_CSP_UNSUPPORTED_KEY_LABEL = -2147415777; + +const int CSSMERR_CSP_INVALID_KEY_FORMAT = -2147415776; + +const int CSSMERR_CSP_INVALID_DATA_COUNT = -2147415768; + +const int CSSMERR_CSP_VECTOR_OF_BUFS_UNSUPPORTED = -2147415767; + +const int CSSMERR_CSP_INVALID_INPUT_VECTOR = -2147415766; + +const int CSSMERR_CSP_INVALID_OUTPUT_VECTOR = -2147415765; + +const int CSSMERR_CSP_INVALID_CONTEXT = -2147415760; + +const int CSSMERR_CSP_INVALID_ALGORITHM = -2147415759; + +const int CSSMERR_CSP_INVALID_ATTR_KEY = -2147415754; + +const int CSSMERR_CSP_MISSING_ATTR_KEY = -2147415753; + +const int CSSMERR_CSP_INVALID_ATTR_INIT_VECTOR = -2147415752; + +const int CSSMERR_CSP_MISSING_ATTR_INIT_VECTOR = -2147415751; + +const int CSSMERR_CSP_INVALID_ATTR_SALT = -2147415750; + +const int CSSMERR_CSP_MISSING_ATTR_SALT = -2147415749; + +const int CSSMERR_CSP_INVALID_ATTR_PADDING = -2147415748; + +const int CSSMERR_CSP_MISSING_ATTR_PADDING = -2147415747; + +const int CSSMERR_CSP_INVALID_ATTR_RANDOM = -2147415746; + +const int CSSMERR_CSP_MISSING_ATTR_RANDOM = -2147415745; + +const int CSSMERR_CSP_INVALID_ATTR_SEED = -2147415744; + +const int CSSMERR_CSP_MISSING_ATTR_SEED = -2147415743; + +const int CSSMERR_CSP_INVALID_ATTR_PASSPHRASE = -2147415742; + +const int CSSMERR_CSP_MISSING_ATTR_PASSPHRASE = -2147415741; + +const int CSSMERR_CSP_INVALID_ATTR_KEY_LENGTH = -2147415740; + +const int CSSMERR_CSP_MISSING_ATTR_KEY_LENGTH = -2147415739; + +const int CSSMERR_CSP_INVALID_ATTR_BLOCK_SIZE = -2147415738; + +const int CSSMERR_CSP_MISSING_ATTR_BLOCK_SIZE = -2147415737; + +const int CSSMERR_CSP_INVALID_ATTR_OUTPUT_SIZE = -2147415708; + +const int CSSMERR_CSP_MISSING_ATTR_OUTPUT_SIZE = -2147415707; + +const int CSSMERR_CSP_INVALID_ATTR_ROUNDS = -2147415706; + +const int CSSMERR_CSP_MISSING_ATTR_ROUNDS = -2147415705; + +const int CSSMERR_CSP_INVALID_ATTR_ALG_PARAMS = -2147415704; + +const int CSSMERR_CSP_MISSING_ATTR_ALG_PARAMS = -2147415703; + +const int CSSMERR_CSP_INVALID_ATTR_LABEL = -2147415702; + +const int CSSMERR_CSP_MISSING_ATTR_LABEL = -2147415701; + +const int CSSMERR_CSP_INVALID_ATTR_KEY_TYPE = -2147415700; + +const int CSSMERR_CSP_MISSING_ATTR_KEY_TYPE = -2147415699; + +const int CSSMERR_CSP_INVALID_ATTR_MODE = -2147415698; + +const int CSSMERR_CSP_MISSING_ATTR_MODE = -2147415697; + +const int CSSMERR_CSP_INVALID_ATTR_EFFECTIVE_BITS = -2147415696; + +const int CSSMERR_CSP_MISSING_ATTR_EFFECTIVE_BITS = -2147415695; + +const int CSSMERR_CSP_INVALID_ATTR_START_DATE = -2147415694; + +const int CSSMERR_CSP_MISSING_ATTR_START_DATE = -2147415693; + +const int CSSMERR_CSP_INVALID_ATTR_END_DATE = -2147415692; + +const int CSSMERR_CSP_MISSING_ATTR_END_DATE = -2147415691; + +const int CSSMERR_CSP_INVALID_ATTR_VERSION = -2147415690; + +const int CSSMERR_CSP_MISSING_ATTR_VERSION = -2147415689; + +const int CSSMERR_CSP_INVALID_ATTR_PRIME = -2147415688; + +const int CSSMERR_CSP_MISSING_ATTR_PRIME = -2147415687; + +const int CSSMERR_CSP_INVALID_ATTR_BASE = -2147415686; + +const int CSSMERR_CSP_MISSING_ATTR_BASE = -2147415685; + +const int CSSMERR_CSP_INVALID_ATTR_SUBPRIME = -2147415684; + +const int CSSMERR_CSP_MISSING_ATTR_SUBPRIME = -2147415683; + +const int CSSMERR_CSP_INVALID_ATTR_ITERATION_COUNT = -2147415682; + +const int CSSMERR_CSP_MISSING_ATTR_ITERATION_COUNT = -2147415681; + +const int CSSMERR_CSP_INVALID_ATTR_DL_DB_HANDLE = -2147415680; + +const int CSSMERR_CSP_MISSING_ATTR_DL_DB_HANDLE = -2147415679; + +const int CSSMERR_CSP_INVALID_ATTR_ACCESS_CREDENTIALS = -2147415678; + +const int CSSMERR_CSP_MISSING_ATTR_ACCESS_CREDENTIALS = -2147415677; + +const int CSSMERR_CSP_INVALID_ATTR_PUBLIC_KEY_FORMAT = -2147415676; + +const int CSSMERR_CSP_MISSING_ATTR_PUBLIC_KEY_FORMAT = -2147415675; + +const int CSSMERR_CSP_INVALID_ATTR_PRIVATE_KEY_FORMAT = -2147415674; + +const int CSSMERR_CSP_MISSING_ATTR_PRIVATE_KEY_FORMAT = -2147415673; + +const int CSSMERR_CSP_INVALID_ATTR_SYMMETRIC_KEY_FORMAT = -2147415672; + +const int CSSMERR_CSP_MISSING_ATTR_SYMMETRIC_KEY_FORMAT = -2147415671; + +const int CSSMERR_CSP_INVALID_ATTR_WRAPPED_KEY_FORMAT = -2147415670; + +const int CSSMERR_CSP_MISSING_ATTR_WRAPPED_KEY_FORMAT = -2147415669; + +const int CSSMERR_CSP_STAGED_OPERATION_IN_PROGRESS = -2147415736; + +const int CSSMERR_CSP_STAGED_OPERATION_NOT_STARTED = -2147415735; + +const int CSSMERR_CSP_VERIFY_FAILED = -2147415734; + +const int CSSMERR_CSP_INVALID_SIGNATURE = -2147415733; + +const int CSSMERR_CSP_QUERY_SIZE_UNKNOWN = -2147415732; + +const int CSSMERR_CSP_BLOCK_SIZE_MISMATCH = -2147415731; + +const int CSSMERR_CSP_PRIVATE_KEY_NOT_FOUND = -2147415730; + +const int CSSMERR_CSP_PUBLIC_KEY_INCONSISTENT = -2147415729; + +const int CSSMERR_CSP_DEVICE_VERIFY_FAILED = -2147415728; + +const int CSSMERR_CSP_INVALID_LOGIN_NAME = -2147415727; + +const int CSSMERR_CSP_ALREADY_LOGGED_IN = -2147415726; + +const int CSSMERR_CSP_PRIVATE_KEY_ALREADY_EXISTS = -2147415725; + +const int CSSMERR_CSP_KEY_LABEL_ALREADY_EXISTS = -2147415724; + +const int CSSMERR_CSP_INVALID_DIGEST_ALGORITHM = -2147415723; + +const int CSSMERR_CSP_CRYPTO_DATA_CALLBACK_FAILED = -2147415722; + +const int CSSMERR_TP_INTERNAL_ERROR = -2147409919; + +const int CSSMERR_TP_MEMORY_ERROR = -2147409918; + +const int CSSMERR_TP_MDS_ERROR = -2147409917; + +const int CSSMERR_TP_INVALID_POINTER = -2147409916; + +const int CSSMERR_TP_INVALID_INPUT_POINTER = -2147409915; + +const int CSSMERR_TP_INVALID_OUTPUT_POINTER = -2147409914; + +const int CSSMERR_TP_FUNCTION_NOT_IMPLEMENTED = -2147409913; + +const int CSSMERR_TP_SELF_CHECK_FAILED = -2147409912; + +const int CSSMERR_TP_OS_ACCESS_DENIED = -2147409911; + +const int CSSMERR_TP_FUNCTION_FAILED = -2147409910; + +const int CSSMERR_TP_INVALID_CONTEXT_HANDLE = -2147409856; + +const int CSSMERR_TP_INVALID_DATA = -2147409850; + +const int CSSMERR_TP_INVALID_DB_LIST = -2147409844; + +const int CSSMERR_TP_INVALID_CERTGROUP_POINTER = -2147409854; + +const int CSSMERR_TP_INVALID_CERT_POINTER = -2147409853; + +const int CSSMERR_TP_INVALID_CRL_POINTER = -2147409852; + +const int CSSMERR_TP_INVALID_FIELD_POINTER = -2147409851; + +const int CSSMERR_TP_INVALID_NETWORK_ADDR = -2147409833; + +const int CSSMERR_TP_CRL_ALREADY_SIGNED = -2147409849; + +const int CSSMERR_TP_INVALID_NUMBER_OF_FIELDS = -2147409848; + +const int CSSMERR_TP_VERIFICATION_FAILURE = -2147409847; + +const int CSSMERR_TP_INVALID_DB_HANDLE = -2147409846; + +const int CSSMERR_TP_UNKNOWN_FORMAT = -2147409842; + +const int CSSMERR_TP_UNKNOWN_TAG = -2147409841; + +const int CSSMERR_TP_INVALID_PASSTHROUGH_ID = -2147409834; + +const int CSSMERR_TP_INVALID_CSP_HANDLE = -2147409840; + +const int CSSMERR_TP_INVALID_DL_HANDLE = -2147409839; + +const int CSSMERR_TP_INVALID_CL_HANDLE = -2147409838; + +const int CSSMERR_TP_INVALID_DB_LIST_POINTER = -2147409843; + +const int CSSM_TP_BASE_TP_ERROR = -2147409664; + +const int CSSMERR_TP_INVALID_CALLERAUTH_CONTEXT_POINTER = -2147409663; + +const int CSSMERR_TP_INVALID_IDENTIFIER_POINTER = -2147409662; + +const int CSSMERR_TP_INVALID_KEYCACHE_HANDLE = -2147409661; + +const int CSSMERR_TP_INVALID_CERTGROUP = -2147409660; + +const int CSSMERR_TP_INVALID_CRLGROUP = -2147409659; + +const int CSSMERR_TP_INVALID_CRLGROUP_POINTER = -2147409658; + +const int CSSMERR_TP_AUTHENTICATION_FAILED = -2147409657; + +const int CSSMERR_TP_CERTGROUP_INCOMPLETE = -2147409656; + +const int CSSMERR_TP_CERTIFICATE_CANT_OPERATE = -2147409655; + +const int CSSMERR_TP_CERT_EXPIRED = -2147409654; + +const int CSSMERR_TP_CERT_NOT_VALID_YET = -2147409653; + +const int CSSMERR_TP_CERT_REVOKED = -2147409652; + +const int CSSMERR_TP_CERT_SUSPENDED = -2147409651; + +const int CSSMERR_TP_INSUFFICIENT_CREDENTIALS = -2147409650; + +const int CSSMERR_TP_INVALID_ACTION = -2147409649; + +const int CSSMERR_TP_INVALID_ACTION_DATA = -2147409648; + +const int CSSMERR_TP_INVALID_ANCHOR_CERT = -2147409646; + +const int CSSMERR_TP_INVALID_AUTHORITY = -2147409645; + +const int CSSMERR_TP_VERIFY_ACTION_FAILED = -2147409644; + +const int CSSMERR_TP_INVALID_CERTIFICATE = -2147409643; + +const int CSSMERR_TP_INVALID_CERT_AUTHORITY = -2147409642; + +const int CSSMERR_TP_INVALID_CRL_AUTHORITY = -2147409641; + +const int CSSMERR_TP_INVALID_CRL_ENCODING = -2147409640; + +const int CSSMERR_TP_INVALID_CRL_TYPE = -2147409639; + +const int CSSMERR_TP_INVALID_CRL = -2147409638; + +const int CSSMERR_TP_INVALID_FORM_TYPE = -2147409637; + +const int CSSMERR_TP_INVALID_ID = -2147409636; + +const int CSSMERR_TP_INVALID_IDENTIFIER = -2147409635; + +const int CSSMERR_TP_INVALID_INDEX = -2147409634; + +const int CSSMERR_TP_INVALID_NAME = -2147409633; + +const int CSSMERR_TP_INVALID_POLICY_IDENTIFIERS = -2147409632; + +const int CSSMERR_TP_INVALID_TIMESTRING = -2147409631; + +const int CSSMERR_TP_INVALID_REASON = -2147409630; + +const int CSSMERR_TP_INVALID_REQUEST_INPUTS = -2147409629; + +const int CSSMERR_TP_INVALID_RESPONSE_VECTOR = -2147409628; + +const int CSSMERR_TP_INVALID_SIGNATURE = -2147409627; + +const int CSSMERR_TP_INVALID_STOP_ON_POLICY = -2147409626; + +const int CSSMERR_TP_INVALID_CALLBACK = -2147409625; + +const int CSSMERR_TP_INVALID_TUPLE = -2147409624; + +const int CSSMERR_TP_NOT_SIGNER = -2147409623; + +const int CSSMERR_TP_NOT_TRUSTED = -2147409622; + +const int CSSMERR_TP_NO_DEFAULT_AUTHORITY = -2147409621; + +const int CSSMERR_TP_REJECTED_FORM = -2147409620; + +const int CSSMERR_TP_REQUEST_LOST = -2147409619; + +const int CSSMERR_TP_REQUEST_REJECTED = -2147409618; + +const int CSSMERR_TP_UNSUPPORTED_ADDR_TYPE = -2147409617; + +const int CSSMERR_TP_UNSUPPORTED_SERVICE = -2147409616; + +const int CSSMERR_TP_INVALID_TUPLEGROUP_POINTER = -2147409615; + +const int CSSMERR_TP_INVALID_TUPLEGROUP = -2147409614; + +const int CSSMERR_AC_INTERNAL_ERROR = -2147405823; + +const int CSSMERR_AC_MEMORY_ERROR = -2147405822; + +const int CSSMERR_AC_MDS_ERROR = -2147405821; + +const int CSSMERR_AC_INVALID_POINTER = -2147405820; + +const int CSSMERR_AC_INVALID_INPUT_POINTER = -2147405819; + +const int CSSMERR_AC_INVALID_OUTPUT_POINTER = -2147405818; + +const int CSSMERR_AC_FUNCTION_NOT_IMPLEMENTED = -2147405817; + +const int CSSMERR_AC_SELF_CHECK_FAILED = -2147405816; + +const int CSSMERR_AC_OS_ACCESS_DENIED = -2147405815; + +const int CSSMERR_AC_FUNCTION_FAILED = -2147405814; + +const int CSSMERR_AC_INVALID_CONTEXT_HANDLE = -2147405760; + +const int CSSMERR_AC_INVALID_DATA = -2147405754; + +const int CSSMERR_AC_INVALID_DB_LIST = -2147405748; + +const int CSSMERR_AC_INVALID_PASSTHROUGH_ID = -2147405738; + +const int CSSMERR_AC_INVALID_DL_HANDLE = -2147405743; + +const int CSSMERR_AC_INVALID_CL_HANDLE = -2147405742; + +const int CSSMERR_AC_INVALID_TP_HANDLE = -2147405741; + +const int CSSMERR_AC_INVALID_DB_HANDLE = -2147405750; + +const int CSSMERR_AC_INVALID_DB_LIST_POINTER = -2147405747; + +const int CSSM_AC_BASE_AC_ERROR = -2147405568; + +const int CSSMERR_AC_INVALID_BASE_ACLS = -2147405567; + +const int CSSMERR_AC_INVALID_TUPLE_CREDENTIALS = -2147405566; + +const int CSSMERR_AC_INVALID_ENCODING = -2147405565; + +const int CSSMERR_AC_INVALID_VALIDITY_PERIOD = -2147405564; + +const int CSSMERR_AC_INVALID_REQUESTOR = -2147405563; + +const int CSSMERR_AC_INVALID_REQUEST_DESCRIPTOR = -2147405562; + +const int CSSMERR_CL_INTERNAL_ERROR = -2147411967; + +const int CSSMERR_CL_MEMORY_ERROR = -2147411966; + +const int CSSMERR_CL_MDS_ERROR = -2147411965; + +const int CSSMERR_CL_INVALID_POINTER = -2147411964; + +const int CSSMERR_CL_INVALID_INPUT_POINTER = -2147411963; + +const int CSSMERR_CL_INVALID_OUTPUT_POINTER = -2147411962; + +const int CSSMERR_CL_FUNCTION_NOT_IMPLEMENTED = -2147411961; + +const int CSSMERR_CL_SELF_CHECK_FAILED = -2147411960; + +const int CSSMERR_CL_OS_ACCESS_DENIED = -2147411959; + +const int CSSMERR_CL_FUNCTION_FAILED = -2147411958; + +const int CSSMERR_CL_INVALID_CONTEXT_HANDLE = -2147411904; + +const int CSSMERR_CL_INVALID_CERTGROUP_POINTER = -2147411902; + +const int CSSMERR_CL_INVALID_CERT_POINTER = -2147411901; + +const int CSSMERR_CL_INVALID_CRL_POINTER = -2147411900; + +const int CSSMERR_CL_INVALID_FIELD_POINTER = -2147411899; + +const int CSSMERR_CL_INVALID_DATA = -2147411898; + +const int CSSMERR_CL_CRL_ALREADY_SIGNED = -2147411897; + +const int CSSMERR_CL_INVALID_NUMBER_OF_FIELDS = -2147411896; + +const int CSSMERR_CL_VERIFICATION_FAILURE = -2147411895; + +const int CSSMERR_CL_UNKNOWN_FORMAT = -2147411890; + +const int CSSMERR_CL_UNKNOWN_TAG = -2147411889; + +const int CSSMERR_CL_INVALID_PASSTHROUGH_ID = -2147411882; + +const int CSSM_CL_BASE_CL_ERROR = -2147411712; + +const int CSSMERR_CL_INVALID_BUNDLE_POINTER = -2147411711; + +const int CSSMERR_CL_INVALID_CACHE_HANDLE = -2147411710; + +const int CSSMERR_CL_INVALID_RESULTS_HANDLE = -2147411709; + +const int CSSMERR_CL_INVALID_BUNDLE_INFO = -2147411708; + +const int CSSMERR_CL_INVALID_CRL_INDEX = -2147411707; + +const int CSSMERR_CL_INVALID_SCOPE = -2147411706; + +const int CSSMERR_CL_NO_FIELD_VALUES = -2147411705; + +const int CSSMERR_CL_SCOPE_NOT_SUPPORTED = -2147411704; + +const int CSSMERR_DL_INTERNAL_ERROR = -2147414015; + +const int CSSMERR_DL_MEMORY_ERROR = -2147414014; + +const int CSSMERR_DL_MDS_ERROR = -2147414013; + +const int CSSMERR_DL_INVALID_POINTER = -2147414012; + +const int CSSMERR_DL_INVALID_INPUT_POINTER = -2147414011; + +const int CSSMERR_DL_INVALID_OUTPUT_POINTER = -2147414010; + +const int CSSMERR_DL_FUNCTION_NOT_IMPLEMENTED = -2147414009; + +const int CSSMERR_DL_SELF_CHECK_FAILED = -2147414008; + +const int CSSMERR_DL_OS_ACCESS_DENIED = -2147414007; + +const int CSSMERR_DL_FUNCTION_FAILED = -2147414006; + +const int CSSMERR_DL_INVALID_CSP_HANDLE = -2147413936; + +const int CSSMERR_DL_INVALID_DL_HANDLE = -2147413935; + +const int CSSMERR_DL_INVALID_CL_HANDLE = -2147413934; + +const int CSSMERR_DL_INVALID_DB_LIST_POINTER = -2147413939; + +const int CSSMERR_DL_OPERATION_AUTH_DENIED = -2147413984; + +const int CSSMERR_DL_OBJECT_USE_AUTH_DENIED = -2147413983; + +const int CSSMERR_DL_OBJECT_MANIP_AUTH_DENIED = -2147413982; + +const int CSSMERR_DL_OBJECT_ACL_NOT_SUPPORTED = -2147413981; + +const int CSSMERR_DL_OBJECT_ACL_REQUIRED = -2147413980; + +const int CSSMERR_DL_INVALID_ACCESS_CREDENTIALS = -2147413979; + +const int CSSMERR_DL_INVALID_ACL_BASE_CERTS = -2147413978; + +const int CSSMERR_DL_ACL_BASE_CERTS_NOT_SUPPORTED = -2147413977; + +const int CSSMERR_DL_INVALID_SAMPLE_VALUE = -2147413976; + +const int CSSMERR_DL_SAMPLE_VALUE_NOT_SUPPORTED = -2147413975; + +const int CSSMERR_DL_INVALID_ACL_SUBJECT_VALUE = -2147413974; + +const int CSSMERR_DL_ACL_SUBJECT_TYPE_NOT_SUPPORTED = -2147413973; + +const int CSSMERR_DL_INVALID_ACL_CHALLENGE_CALLBACK = -2147413972; + +const int CSSMERR_DL_ACL_CHALLENGE_CALLBACK_FAILED = -2147413971; + +const int CSSMERR_DL_INVALID_ACL_ENTRY_TAG = -2147413970; + +const int CSSMERR_DL_ACL_ENTRY_TAG_NOT_FOUND = -2147413969; + +const int CSSMERR_DL_INVALID_ACL_EDIT_MODE = -2147413968; + +const int CSSMERR_DL_ACL_CHANGE_FAILED = -2147413967; + +const int CSSMERR_DL_INVALID_NEW_ACL_ENTRY = -2147413966; + +const int CSSMERR_DL_INVALID_NEW_ACL_OWNER = -2147413965; + +const int CSSMERR_DL_ACL_DELETE_FAILED = -2147413964; + +const int CSSMERR_DL_ACL_REPLACE_FAILED = -2147413963; + +const int CSSMERR_DL_ACL_ADD_FAILED = -2147413962; + +const int CSSMERR_DL_INVALID_DB_HANDLE = -2147413942; + +const int CSSMERR_DL_INVALID_PASSTHROUGH_ID = -2147413930; + +const int CSSMERR_DL_INVALID_NETWORK_ADDR = -2147413929; + +const int CSSM_DL_BASE_DL_ERROR = -2147413760; + +const int CSSMERR_DL_DATABASE_CORRUPT = -2147413759; + +const int CSSMERR_DL_INVALID_RECORD_INDEX = -2147413752; + +const int CSSMERR_DL_INVALID_RECORDTYPE = -2147413751; + +const int CSSMERR_DL_INVALID_FIELD_NAME = -2147413750; + +const int CSSMERR_DL_UNSUPPORTED_FIELD_FORMAT = -2147413749; + +const int CSSMERR_DL_UNSUPPORTED_INDEX_INFO = -2147413748; + +const int CSSMERR_DL_UNSUPPORTED_LOCALITY = -2147413747; + +const int CSSMERR_DL_UNSUPPORTED_NUM_ATTRIBUTES = -2147413746; + +const int CSSMERR_DL_UNSUPPORTED_NUM_INDEXES = -2147413745; + +const int CSSMERR_DL_UNSUPPORTED_NUM_RECORDTYPES = -2147413744; + +const int CSSMERR_DL_UNSUPPORTED_RECORDTYPE = -2147413743; + +const int CSSMERR_DL_FIELD_SPECIFIED_MULTIPLE = -2147413742; + +const int CSSMERR_DL_INCOMPATIBLE_FIELD_FORMAT = -2147413741; + +const int CSSMERR_DL_INVALID_PARSING_MODULE = -2147413740; + +const int CSSMERR_DL_INVALID_DB_NAME = -2147413738; + +const int CSSMERR_DL_DATASTORE_DOESNOT_EXIST = -2147413737; + +const int CSSMERR_DL_DATASTORE_ALREADY_EXISTS = -2147413736; + +const int CSSMERR_DL_DB_LOCKED = -2147413735; + +const int CSSMERR_DL_DATASTORE_IS_OPEN = -2147413734; + +const int CSSMERR_DL_RECORD_NOT_FOUND = -2147413733; + +const int CSSMERR_DL_MISSING_VALUE = -2147413732; + +const int CSSMERR_DL_UNSUPPORTED_QUERY = -2147413731; + +const int CSSMERR_DL_UNSUPPORTED_QUERY_LIMITS = -2147413730; + +const int CSSMERR_DL_UNSUPPORTED_NUM_SELECTION_PREDS = -2147413729; + +const int CSSMERR_DL_UNSUPPORTED_OPERATOR = -2147413727; + +const int CSSMERR_DL_INVALID_RESULTS_HANDLE = -2147413726; + +const int CSSMERR_DL_INVALID_DB_LOCATION = -2147413725; + +const int CSSMERR_DL_INVALID_ACCESS_REQUEST = -2147413724; + +const int CSSMERR_DL_INVALID_INDEX_INFO = -2147413723; + +const int CSSMERR_DL_INVALID_SELECTION_TAG = -2147413722; + +const int CSSMERR_DL_INVALID_NEW_OWNER = -2147413721; + +const int CSSMERR_DL_INVALID_RECORD_UID = -2147413720; + +const int CSSMERR_DL_INVALID_UNIQUE_INDEX_DATA = -2147413719; + +const int CSSMERR_DL_INVALID_MODIFY_MODE = -2147413718; + +const int CSSMERR_DL_INVALID_OPEN_PARAMETERS = -2147413717; + +const int CSSMERR_DL_RECORD_MODIFIED = -2147413716; + +const int CSSMERR_DL_ENDOFDATA = -2147413715; + +const int CSSMERR_DL_INVALID_QUERY = -2147413714; + +const int CSSMERR_DL_INVALID_VALUE = -2147413713; + +const int CSSMERR_DL_MULTIPLE_VALUES_UNSUPPORTED = -2147413712; + +const int CSSMERR_DL_STALE_UNIQUE_RECORD = -2147413711; + +const int CSSM_WORDID_KEYCHAIN_PROMPT = 65536; + +const int CSSM_WORDID_KEYCHAIN_LOCK = 65537; + +const int CSSM_WORDID_KEYCHAIN_CHANGE_LOCK = 65538; + +const int CSSM_WORDID_PROCESS = 65539; + +const int CSSM_WORDID__RESERVED_1 = 65540; + +const int CSSM_WORDID_SYMMETRIC_KEY = 65541; + +const int CSSM_WORDID_SYSTEM = 65542; + +const int CSSM_WORDID_KEY = 65543; + +const int CSSM_WORDID_PIN = 65544; + +const int CSSM_WORDID_PREAUTH = 65545; + +const int CSSM_WORDID_PREAUTH_SOURCE = 65546; + +const int CSSM_WORDID_ASYMMETRIC_KEY = 65547; + +const int CSSM_WORDID_PARTITION = 65548; + +const int CSSM_WORDID_KEYBAG_KEY = 65549; + +const int CSSM_WORDID__FIRST_UNUSED = 65550; + +const int CSSM_ACL_SUBJECT_TYPE_KEYCHAIN_PROMPT = 65536; + +const int CSSM_ACL_SUBJECT_TYPE_PROCESS = 65539; + +const int CSSM_ACL_SUBJECT_TYPE_CODE_SIGNATURE = 116; + +const int CSSM_ACL_SUBJECT_TYPE_COMMENT = 12; + +const int CSSM_ACL_SUBJECT_TYPE_SYMMETRIC_KEY = 65541; + +const int CSSM_ACL_SUBJECT_TYPE_PREAUTH = 65545; + +const int CSSM_ACL_SUBJECT_TYPE_PREAUTH_SOURCE = 65546; + +const int CSSM_ACL_SUBJECT_TYPE_ASYMMETRIC_KEY = 65547; + +const int CSSM_ACL_SUBJECT_TYPE_PARTITION = 65548; + +const int CSSM_SAMPLE_TYPE_KEYCHAIN_PROMPT = 65536; + +const int CSSM_SAMPLE_TYPE_KEYCHAIN_LOCK = 65537; + +const int CSSM_SAMPLE_TYPE_KEYCHAIN_CHANGE_LOCK = 65538; + +const int CSSM_SAMPLE_TYPE_PROCESS = 65539; + +const int CSSM_SAMPLE_TYPE_COMMENT = 12; + +const int CSSM_SAMPLE_TYPE_RETRY_ID = 85; + +const int CSSM_SAMPLE_TYPE_SYMMETRIC_KEY = 65541; + +const int CSSM_SAMPLE_TYPE_PREAUTH = 65545; + +const int CSSM_SAMPLE_TYPE_ASYMMETRIC_KEY = 65547; + +const int CSSM_SAMPLE_TYPE_KEYBAG_KEY = 65549; + +const int CSSM_ACL_AUTHORIZATION_CHANGE_ACL = 65536; + +const int CSSM_ACL_AUTHORIZATION_CHANGE_OWNER = 65537; + +const int CSSM_ACL_AUTHORIZATION_PARTITION_ID = 65538; + +const int CSSM_ACL_AUTHORIZATION_INTEGRITY = 65539; + +const int CSSM_ACL_AUTHORIZATION_PREAUTH_BASE = 16842752; + +const int CSSM_ACL_AUTHORIZATION_PREAUTH_END = 16908288; + +const int CSSM_ACL_CODE_SIGNATURE_INVALID = 0; + +const int CSSM_ACL_CODE_SIGNATURE_OSX = 1; + +const int CSSM_ACL_MATCH_UID = 1; + +const int CSSM_ACL_MATCH_GID = 2; + +const int CSSM_ACL_MATCH_HONOR_ROOT = 256; + +const int CSSM_ACL_MATCH_BITS = 3; + +const int CSSM_ACL_PROCESS_SELECTOR_CURRENT_VERSION = 257; + +const int CSSM_ACL_KEYCHAIN_PROMPT_CURRENT_VERSION = 257; + +const int CSSM_ACL_KEYCHAIN_PROMPT_REQUIRE_PASSPHRASE = 1; + +const int CSSM_ACL_KEYCHAIN_PROMPT_UNSIGNED = 16; + +const int CSSM_ACL_KEYCHAIN_PROMPT_UNSIGNED_ACT = 32; + +const int CSSM_ACL_KEYCHAIN_PROMPT_INVALID = 64; + +const int CSSM_ACL_KEYCHAIN_PROMPT_INVALID_ACT = 128; + +const int CSSM_ACL_PREAUTH_TRACKING_COUNT_MASK = 255; + +const int CSSM_ACL_PREAUTH_TRACKING_BLOCKED = 0; + +const int CSSM_ACL_PREAUTH_TRACKING_UNKNOWN = 1073741824; + +const int CSSM_ACL_PREAUTH_TRACKING_AUTHORIZED = -2147483648; + +const int CSSM_DB_ACCESS_RESET = 65536; + +const int CSSM_ALGID_APPLE_YARROW = -2147483648; + +const int CSSM_ALGID_AES = -2147483647; + +const int CSSM_ALGID_FEE = -2147483646; + +const int CSSM_ALGID_FEE_MD5 = -2147483645; + +const int CSSM_ALGID_FEE_SHA1 = -2147483644; + +const int CSSM_ALGID_FEED = -2147483643; + +const int CSSM_ALGID_FEEDEXP = -2147483642; + +const int CSSM_ALGID_ASC = -2147483641; + +const int CSSM_ALGID_SHA1HMAC_LEGACY = -2147483640; + +const int CSSM_ALGID_KEYCHAIN_KEY = -2147483639; + +const int CSSM_ALGID_PKCS12_PBE_ENCR = -2147483638; + +const int CSSM_ALGID_PKCS12_PBE_MAC = -2147483637; + +const int CSSM_ALGID_SECURE_PASSPHRASE = -2147483636; + +const int CSSM_ALGID_PBE_OPENSSL_MD5 = -2147483635; + +const int CSSM_ALGID_SHA256 = -2147483634; + +const int CSSM_ALGID_SHA384 = -2147483633; + +const int CSSM_ALGID_SHA512 = -2147483632; + +const int CSSM_ALGID_ENTROPY_DEFAULT = -2147483631; + +const int CSSM_ALGID_SHA224 = -2147483630; + +const int CSSM_ALGID_SHA224WithRSA = -2147483629; + +const int CSSM_ALGID_SHA256WithRSA = -2147483628; + +const int CSSM_ALGID_SHA384WithRSA = -2147483627; + +const int CSSM_ALGID_SHA512WithRSA = -2147483626; + +const int CSSM_ALGID_OPENSSH1 = -2147483625; + +const int CSSM_ALGID_SHA224WithECDSA = -2147483624; + +const int CSSM_ALGID_SHA256WithECDSA = -2147483623; + +const int CSSM_ALGID_SHA384WithECDSA = -2147483622; + +const int CSSM_ALGID_SHA512WithECDSA = -2147483621; + +const int CSSM_ALGID_ECDSA_SPECIFIED = -2147483620; + +const int CSSM_ALGID_ECDH_X963_KDF = -2147483619; + +const int CSSM_ALGID__FIRST_UNUSED = -2147483618; + +const int CSSM_PADDING_APPLE_SSLv2 = -2147483648; + +const int CSSM_KEYBLOB_RAW_FORMAT_VENDOR_DEFINED = -2147483648; + +const int CSSM_KEYBLOB_RAW_FORMAT_X509 = -2147483648; + +const int CSSM_KEYBLOB_RAW_FORMAT_OPENSSH = -2147483647; + +const int CSSM_KEYBLOB_RAW_FORMAT_OPENSSL = -2147483646; + +const int CSSM_KEYBLOB_RAW_FORMAT_OPENSSH2 = -2147483645; + +const int CSSM_CUSTOM_COMMON_ERROR_EXTENT = 224; + +const int CSSM_ERRCODE_NO_USER_INTERACTION = 224; + +const int CSSM_ERRCODE_USER_CANCELED = 225; + +const int CSSM_ERRCODE_SERVICE_NOT_AVAILABLE = 226; + +const int CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION = 227; + +const int CSSM_ERRCODE_DEVICE_RESET = 228; + +const int CSSM_ERRCODE_DEVICE_FAILED = 229; + +const int CSSM_ERRCODE_IN_DARK_WAKE = 230; + +const int CSSMERR_CSSM_NO_USER_INTERACTION = -2147417888; + +const int CSSMERR_AC_NO_USER_INTERACTION = -2147405600; + +const int CSSMERR_CSP_NO_USER_INTERACTION = -2147415840; + +const int CSSMERR_CL_NO_USER_INTERACTION = -2147411744; + +const int CSSMERR_DL_NO_USER_INTERACTION = -2147413792; + +const int CSSMERR_TP_NO_USER_INTERACTION = -2147409696; + +const int CSSMERR_CSSM_USER_CANCELED = -2147417887; + +const int CSSMERR_AC_USER_CANCELED = -2147405599; + +const int CSSMERR_CSP_USER_CANCELED = -2147415839; + +const int CSSMERR_CL_USER_CANCELED = -2147411743; + +const int CSSMERR_DL_USER_CANCELED = -2147413791; + +const int CSSMERR_TP_USER_CANCELED = -2147409695; + +const int CSSMERR_CSSM_SERVICE_NOT_AVAILABLE = -2147417886; + +const int CSSMERR_AC_SERVICE_NOT_AVAILABLE = -2147405598; + +const int CSSMERR_CSP_SERVICE_NOT_AVAILABLE = -2147415838; + +const int CSSMERR_CL_SERVICE_NOT_AVAILABLE = -2147411742; + +const int CSSMERR_DL_SERVICE_NOT_AVAILABLE = -2147413790; + +const int CSSMERR_TP_SERVICE_NOT_AVAILABLE = -2147409694; + +const int CSSMERR_CSSM_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147417885; + +const int CSSMERR_AC_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147405597; + +const int CSSMERR_CSP_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147415837; + +const int CSSMERR_CL_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147411741; + +const int CSSMERR_DL_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147413789; + +const int CSSMERR_TP_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147409693; + +const int CSSMERR_CSSM_DEVICE_RESET = -2147417884; + +const int CSSMERR_AC_DEVICE_RESET = -2147405596; + +const int CSSMERR_CSP_DEVICE_RESET = -2147415836; + +const int CSSMERR_CL_DEVICE_RESET = -2147411740; + +const int CSSMERR_DL_DEVICE_RESET = -2147413788; + +const int CSSMERR_TP_DEVICE_RESET = -2147409692; + +const int CSSMERR_CSSM_DEVICE_FAILED = -2147417883; + +const int CSSMERR_AC_DEVICE_FAILED = -2147405595; + +const int CSSMERR_CSP_DEVICE_FAILED = -2147415835; + +const int CSSMERR_CL_DEVICE_FAILED = -2147411739; + +const int CSSMERR_DL_DEVICE_FAILED = -2147413787; + +const int CSSMERR_TP_DEVICE_FAILED = -2147409691; + +const int CSSMERR_CSSM_IN_DARK_WAKE = -2147417882; + +const int CSSMERR_AC_IN_DARK_WAKE = -2147405594; + +const int CSSMERR_CSP_IN_DARK_WAKE = -2147415834; + +const int CSSMERR_CL_IN_DARK_WAKE = -2147411738; + +const int CSSMERR_DL_IN_DARK_WAKE = -2147413786; + +const int CSSMERR_TP_IN_DARK_WAKE = -2147409690; + +const int CSSMERR_CSP_APPLE_ADD_APPLICATION_ACL_SUBJECT = -2147415040; + +const int CSSMERR_CSP_APPLE_PUBLIC_KEY_INCOMPLETE = -2147415039; + +const int CSSMERR_CSP_APPLE_SIGNATURE_MISMATCH = -2147415038; + +const int CSSMERR_CSP_APPLE_INVALID_KEY_START_DATE = -2147415037; + +const int CSSMERR_CSP_APPLE_INVALID_KEY_END_DATE = -2147415036; + +const int CSSMERR_CSPDL_APPLE_DL_CONVERSION_ERROR = -2147415035; + +const int CSSMERR_CSP_APPLE_SSLv2_ROLLBACK = -2147415034; + +const int CSSM_DL_DB_RECORD_GENERIC_PASSWORD = -2147483648; + +const int CSSM_DL_DB_RECORD_INTERNET_PASSWORD = -2147483647; + +const int CSSM_DL_DB_RECORD_APPLESHARE_PASSWORD = -2147483646; + +const int CSSM_DL_DB_RECORD_X509_CERTIFICATE = -2147479552; + +const int CSSM_DL_DB_RECORD_USER_TRUST = -2147479551; + +const int CSSM_DL_DB_RECORD_X509_CRL = -2147479550; + +const int CSSM_DL_DB_RECORD_UNLOCK_REFERRAL = -2147479549; + +const int CSSM_DL_DB_RECORD_EXTENDED_ATTRIBUTE = -2147479548; + +const int CSSM_DL_DB_RECORD_METADATA = -2147450880; + +const int CSSM_APPLEFILEDL_TOGGLE_AUTOCOMMIT = 0; + +const int CSSM_APPLEFILEDL_COMMIT = 1; + +const int CSSM_APPLEFILEDL_ROLLBACK = 2; + +const int CSSM_APPLEFILEDL_TAKE_FILE_LOCK = 3; + +const int CSSM_APPLEFILEDL_MAKE_BACKUP = 4; + +const int CSSM_APPLEFILEDL_MAKE_COPY = 5; + +const int CSSM_APPLEFILEDL_DELETE_FILE = 6; + +const int CSSM_APPLE_UNLOCK_TYPE_KEY_DIRECT = 1; + +const int CSSM_APPLE_UNLOCK_TYPE_WRAPPED_PRIVATE = 2; + +const int CSSM_APPLE_UNLOCK_TYPE_KEYBAG = 3; + +const int CSSMERR_APPLEDL_INVALID_OPEN_PARAMETERS = -2147412992; + +const int CSSMERR_APPLEDL_DISK_FULL = -2147412991; + +const int CSSMERR_APPLEDL_QUOTA_EXCEEDED = -2147412990; + +const int CSSMERR_APPLEDL_FILE_TOO_BIG = -2147412989; + +const int CSSMERR_APPLEDL_INVALID_DATABASE_BLOB = -2147412988; + +const int CSSMERR_APPLEDL_INVALID_KEY_BLOB = -2147412987; + +const int CSSMERR_APPLEDL_INCOMPATIBLE_DATABASE_BLOB = -2147412986; + +const int CSSMERR_APPLEDL_INCOMPATIBLE_KEY_BLOB = -2147412985; + +const int CSSMERR_APPLETP_HOSTNAME_MISMATCH = -2147408896; + +const int CSSMERR_APPLETP_UNKNOWN_CRITICAL_EXTEN = -2147408895; + +const int CSSMERR_APPLETP_NO_BASIC_CONSTRAINTS = -2147408894; + +const int CSSMERR_APPLETP_INVALID_CA = -2147408893; + +const int CSSMERR_APPLETP_INVALID_AUTHORITY_ID = -2147408892; + +const int CSSMERR_APPLETP_INVALID_SUBJECT_ID = -2147408891; + +const int CSSMERR_APPLETP_INVALID_KEY_USAGE = -2147408890; + +const int CSSMERR_APPLETP_INVALID_EXTENDED_KEY_USAGE = -2147408889; + +const int CSSMERR_APPLETP_INVALID_ID_LINKAGE = -2147408888; + +const int CSSMERR_APPLETP_PATH_LEN_CONSTRAINT = -2147408887; + +const int CSSMERR_APPLETP_INVALID_ROOT = -2147408886; + +const int CSSMERR_APPLETP_CRL_EXPIRED = -2147408885; + +const int CSSMERR_APPLETP_CRL_NOT_VALID_YET = -2147408884; + +const int CSSMERR_APPLETP_CRL_NOT_FOUND = -2147408883; + +const int CSSMERR_APPLETP_CRL_SERVER_DOWN = -2147408882; + +const int CSSMERR_APPLETP_CRL_BAD_URI = -2147408881; + +const int CSSMERR_APPLETP_UNKNOWN_CERT_EXTEN = -2147408880; + +const int CSSMERR_APPLETP_UNKNOWN_CRL_EXTEN = -2147408879; + +const int CSSMERR_APPLETP_CRL_NOT_TRUSTED = -2147408878; + +const int CSSMERR_APPLETP_CRL_INVALID_ANCHOR_CERT = -2147408877; + +const int CSSMERR_APPLETP_CRL_POLICY_FAIL = -2147408876; + +const int CSSMERR_APPLETP_IDP_FAIL = -2147408875; + +const int CSSMERR_APPLETP_CERT_NOT_FOUND_FROM_ISSUER = -2147408874; + +const int CSSMERR_APPLETP_BAD_CERT_FROM_ISSUER = -2147408873; + +const int CSSMERR_APPLETP_SMIME_EMAIL_ADDRS_NOT_FOUND = -2147408872; + +const int CSSMERR_APPLETP_SMIME_BAD_EXT_KEY_USE = -2147408871; + +const int CSSMERR_APPLETP_SMIME_BAD_KEY_USE = -2147408870; + +const int CSSMERR_APPLETP_SMIME_KEYUSAGE_NOT_CRITICAL = -2147408869; + +const int CSSMERR_APPLETP_SMIME_NO_EMAIL_ADDRS = -2147408868; + +const int CSSMERR_APPLETP_SMIME_SUBJ_ALT_NAME_NOT_CRIT = -2147408867; + +const int CSSMERR_APPLETP_SSL_BAD_EXT_KEY_USE = -2147408866; + +const int CSSMERR_APPLETP_OCSP_BAD_RESPONSE = -2147408865; + +const int CSSMERR_APPLETP_OCSP_BAD_REQUEST = -2147408864; + +const int CSSMERR_APPLETP_OCSP_UNAVAILABLE = -2147408863; + +const int CSSMERR_APPLETP_OCSP_STATUS_UNRECOGNIZED = -2147408862; + +const int CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK = -2147408861; + +const int CSSMERR_APPLETP_NETWORK_FAILURE = -2147408860; + +const int CSSMERR_APPLETP_OCSP_NOT_TRUSTED = -2147408859; + +const int CSSMERR_APPLETP_OCSP_INVALID_ANCHOR_CERT = -2147408858; + +const int CSSMERR_APPLETP_OCSP_SIG_ERROR = -2147408857; + +const int CSSMERR_APPLETP_OCSP_NO_SIGNER = -2147408856; + +const int CSSMERR_APPLETP_OCSP_RESP_MALFORMED_REQ = -2147408855; + +const int CSSMERR_APPLETP_OCSP_RESP_INTERNAL_ERR = -2147408854; + +const int CSSMERR_APPLETP_OCSP_RESP_TRY_LATER = -2147408853; + +const int CSSMERR_APPLETP_OCSP_RESP_SIG_REQUIRED = -2147408852; + +const int CSSMERR_APPLETP_OCSP_RESP_UNAUTHORIZED = -2147408851; + +const int CSSMERR_APPLETP_OCSP_NONCE_MISMATCH = -2147408850; + +const int CSSMERR_APPLETP_CS_BAD_CERT_CHAIN_LENGTH = -2147408849; + +const int CSSMERR_APPLETP_CS_NO_BASIC_CONSTRAINTS = -2147408848; + +const int CSSMERR_APPLETP_CS_BAD_PATH_LENGTH = -2147408847; + +const int CSSMERR_APPLETP_CS_NO_EXTENDED_KEY_USAGE = -2147408846; + +const int CSSMERR_APPLETP_CODE_SIGN_DEVELOPMENT = -2147408845; + +const int CSSMERR_APPLETP_RS_BAD_CERT_CHAIN_LENGTH = -2147408844; + +const int CSSMERR_APPLETP_RS_BAD_EXTENDED_KEY_USAGE = -2147408843; + +const int CSSMERR_APPLETP_TRUST_SETTING_DENY = -2147408842; + +const int CSSMERR_APPLETP_INVALID_EMPTY_SUBJECT = -2147408841; + +const int CSSMERR_APPLETP_UNKNOWN_QUAL_CERT_STATEMENT = -2147408840; + +const int CSSMERR_APPLETP_MISSING_REQUIRED_EXTENSION = -2147408839; + +const int CSSMERR_APPLETP_EXT_KEYUSAGE_NOT_CRITICAL = -2147408838; + +const int CSSMERR_APPLETP_IDENTIFIER_MISSING = -2147408837; + +const int CSSMERR_APPLETP_CA_PIN_MISMATCH = -2147408836; + +const int CSSMERR_APPLETP_LEAF_PIN_MISMATCH = -2147408835; + +const int CSSMERR_APPLE_DOTMAC_REQ_QUEUED = -2147408796; + +const int CSSMERR_APPLE_DOTMAC_REQ_REDIRECT = -2147408795; + +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_ERR = -2147408794; + +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_PARAM = -2147408793; + +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_AUTH = -2147408792; + +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_UNIMPL = -2147408791; + +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_NOT_AVAIL = -2147408790; + +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_ALREADY_EXIST = -2147408789; + +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_SERVICE_ERROR = -2147408788; + +const int CSSMERR_APPLE_DOTMAC_REQ_IS_PENDING = -2147408787; + +const int CSSMERR_APPLE_DOTMAC_NO_REQ_PENDING = -2147408786; + +const int CSSMERR_APPLE_DOTMAC_CSR_VERIFY_FAIL = -2147408785; + +const int CSSMERR_APPLE_DOTMAC_FAILED_CONSISTENCY_CHECK = -2147408784; + +const int CSSM_APPLEDL_OPEN_PARAMETERS_VERSION = 1; + +const int CSSM_APPLECSPDL_DB_LOCK = 0; + +const int CSSM_APPLECSPDL_DB_UNLOCK = 1; + +const int CSSM_APPLECSPDL_DB_GET_SETTINGS = 2; + +const int CSSM_APPLECSPDL_DB_SET_SETTINGS = 3; + +const int CSSM_APPLECSPDL_DB_IS_LOCKED = 4; + +const int CSSM_APPLECSPDL_DB_CHANGE_PASSWORD = 5; + +const int CSSM_APPLECSPDL_DB_GET_HANDLE = 6; + +const int CSSM_APPLESCPDL_CSP_GET_KEYHANDLE = 7; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_8 = 8; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_9 = 9; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_10 = 10; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_11 = 11; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_12 = 12; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_13 = 13; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_14 = 14; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_15 = 15; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_16 = 16; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_17 = 17; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_18 = 18; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_19 = 19; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_20 = 20; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_21 = 21; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_22 = 22; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_23 = 23; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_24 = 24; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_25 = 25; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_26 = 26; + +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_27 = 27; + +const int CSSM_APPLECSP_KEYDIGEST = 256; + +const int CSSM_APPLECSP_PUBKEY = 257; + +const int CSSM_KEYBLOB_WRAPPED_FORMAT_APPLE_CUSTOM = 100; + +const int CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSL = 101; + +const int CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSH1 = 102; + +const int CSSM_ATTRIBUTE_VENDOR_DEFINED = 8388608; + +const int CSSM_ATTRIBUTE_PUBLIC_KEY = 1082130432; + +const int CSSM_ATTRIBUTE_FEE_PRIME_TYPE = 276824065; + +const int CSSM_ATTRIBUTE_FEE_CURVE_TYPE = 276824066; + +const int CSSM_ATTRIBUTE_ASC_OPTIMIZATION = 276824067; + +const int CSSM_ATTRIBUTE_RSA_BLINDING = 276824068; + +const int CSSM_ATTRIBUTE_PARAM_KEY = 1082130437; + +const int CSSM_ATTRIBUTE_PROMPT = 545259526; + +const int CSSM_ATTRIBUTE_ALERT_TITLE = 545259527; + +const int CSSM_ATTRIBUTE_VERIFY_PASSPHRASE = 276824072; + +const int CSSM_FEE_PRIME_TYPE_DEFAULT = 0; + +const int CSSM_FEE_PRIME_TYPE_MERSENNE = 1; + +const int CSSM_FEE_PRIME_TYPE_FEE = 2; + +const int CSSM_FEE_PRIME_TYPE_GENERAL = 3; + +const int CSSM_FEE_CURVE_TYPE_DEFAULT = 0; + +const int CSSM_FEE_CURVE_TYPE_MONTGOMERY = 1; + +const int CSSM_FEE_CURVE_TYPE_WEIERSTRASS = 2; + +const int CSSM_FEE_CURVE_TYPE_ANSI_X9_62 = 3; + +const int CSSM_ASC_OPTIMIZE_DEFAULT = 0; + +const int CSSM_ASC_OPTIMIZE_SIZE = 1; + +const int CSSM_ASC_OPTIMIZE_SECURITY = 2; + +const int CSSM_ASC_OPTIMIZE_TIME = 3; + +const int CSSM_ASC_OPTIMIZE_TIME_SIZE = 4; + +const int CSSM_ASC_OPTIMIZE_ASCII = 5; + +const int CSSM_KEYATTR_PARTIAL = 65536; + +const int CSSM_KEYATTR_PUBLIC_KEY_ENCRYPT = 131072; + +const int CSSM_TP_ACTION_REQUIRE_CRL_PER_CERT = 1; + +const int CSSM_TP_ACTION_FETCH_CRL_FROM_NET = 2; + +const int CSSM_TP_ACTION_CRL_SUFFICIENT = 4; + +const int CSSM_TP_ACTION_REQUIRE_CRL_IF_PRESENT = 8; + +const int CSSM_TP_ACTION_ALLOW_EXPIRED = 1; + +const int CSSM_TP_ACTION_LEAF_IS_CA = 2; + +const int CSSM_TP_ACTION_FETCH_CERT_FROM_NET = 4; + +const int CSSM_TP_ACTION_ALLOW_EXPIRED_ROOT = 8; + +const int CSSM_TP_ACTION_REQUIRE_REV_PER_CERT = 16; + +const int CSSM_TP_ACTION_TRUST_SETTINGS = 32; + +const int CSSM_TP_ACTION_IMPLICIT_ANCHORS = 64; + +const int CSSM_CERT_STATUS_EXPIRED = 1; + +const int CSSM_CERT_STATUS_NOT_VALID_YET = 2; + +const int CSSM_CERT_STATUS_IS_IN_INPUT_CERTS = 4; + +const int CSSM_CERT_STATUS_IS_IN_ANCHORS = 8; + +const int CSSM_CERT_STATUS_IS_ROOT = 16; + +const int CSSM_CERT_STATUS_IS_FROM_NET = 32; + +const int CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_USER = 64; + +const int CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_ADMIN = 128; + +const int CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_SYSTEM = 256; + +const int CSSM_CERT_STATUS_TRUST_SETTINGS_TRUST = 512; + +const int CSSM_CERT_STATUS_TRUST_SETTINGS_DENY = 1024; + +const int CSSM_CERT_STATUS_TRUST_SETTINGS_IGNORED_ERROR = 2048; + +const int CSSM_EVIDENCE_FORM_APPLE_HEADER = -2147483648; + +const int CSSM_EVIDENCE_FORM_APPLE_CERTGROUP = -2147483647; + +const int CSSM_EVIDENCE_FORM_APPLE_CERT_INFO = -2147483646; + +const int CSSM_APPLEX509CL_OBTAIN_CSR = 0; + +const int CSSM_APPLEX509CL_VERIFY_CSR = 1; + +const int kSecSubjectItemAttr = 1937072746; + +const int kSecIssuerItemAttr = 1769173877; + +const int kSecSerialNumberItemAttr = 1936614002; + +const int kSecPublicKeyHashItemAttr = 1752198009; + +const int kSecSubjectKeyIdentifierItemAttr = 1936419172; + +const int kSecCertTypeItemAttr = 1668577648; + +const int kSecCertEncodingItemAttr = 1667591779; + +const int SSL_NULL_WITH_NULL_NULL = 0; + +const int SSL_RSA_WITH_NULL_MD5 = 1; + +const int SSL_RSA_WITH_NULL_SHA = 2; + +const int SSL_RSA_EXPORT_WITH_RC4_40_MD5 = 3; + +const int SSL_RSA_WITH_RC4_128_MD5 = 4; + +const int SSL_RSA_WITH_RC4_128_SHA = 5; + +const int SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 6; + +const int SSL_RSA_WITH_IDEA_CBC_SHA = 7; + +const int SSL_RSA_EXPORT_WITH_DES40_CBC_SHA = 8; + +const int SSL_RSA_WITH_DES_CBC_SHA = 9; + +const int SSL_RSA_WITH_3DES_EDE_CBC_SHA = 10; + +const int SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 11; + +const int SSL_DH_DSS_WITH_DES_CBC_SHA = 12; + +const int SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA = 13; + +const int SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 14; + +const int SSL_DH_RSA_WITH_DES_CBC_SHA = 15; + +const int SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA = 16; + +const int SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 17; + +const int SSL_DHE_DSS_WITH_DES_CBC_SHA = 18; + +const int SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 19; + +const int SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 20; + +const int SSL_DHE_RSA_WITH_DES_CBC_SHA = 21; + +const int SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 22; + +const int SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 = 23; + +const int SSL_DH_anon_WITH_RC4_128_MD5 = 24; + +const int SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 25; + +const int SSL_DH_anon_WITH_DES_CBC_SHA = 26; + +const int SSL_DH_anon_WITH_3DES_EDE_CBC_SHA = 27; + +const int SSL_FORTEZZA_DMS_WITH_NULL_SHA = 28; + +const int SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA = 29; + +const int TLS_RSA_WITH_AES_128_CBC_SHA = 47; + +const int TLS_DH_DSS_WITH_AES_128_CBC_SHA = 48; + +const int TLS_DH_RSA_WITH_AES_128_CBC_SHA = 49; + +const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 50; + +const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 51; + +const int TLS_DH_anon_WITH_AES_128_CBC_SHA = 52; + +const int TLS_RSA_WITH_AES_256_CBC_SHA = 53; + +const int TLS_DH_DSS_WITH_AES_256_CBC_SHA = 54; + +const int TLS_DH_RSA_WITH_AES_256_CBC_SHA = 55; + +const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 56; + +const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 57; + +const int TLS_DH_anon_WITH_AES_256_CBC_SHA = 58; + +const int TLS_ECDH_ECDSA_WITH_NULL_SHA = -16383; + +const int TLS_ECDH_ECDSA_WITH_RC4_128_SHA = -16382; + +const int TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = -16381; + +const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = -16380; + +const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = -16379; + +const int TLS_ECDHE_ECDSA_WITH_NULL_SHA = -16378; + +const int TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = -16377; + +const int TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = -16376; + +const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = -16375; + +const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = -16374; + +const int TLS_ECDH_RSA_WITH_NULL_SHA = -16373; + +const int TLS_ECDH_RSA_WITH_RC4_128_SHA = -16372; + +const int TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = -16371; + +const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = -16370; + +const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = -16369; + +const int TLS_ECDHE_RSA_WITH_NULL_SHA = -16368; + +const int TLS_ECDHE_RSA_WITH_RC4_128_SHA = -16367; + +const int TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = -16366; + +const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = -16365; + +const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = -16364; + +const int TLS_ECDH_anon_WITH_NULL_SHA = -16363; + +const int TLS_ECDH_anon_WITH_RC4_128_SHA = -16362; + +const int TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA = -16361; + +const int TLS_ECDH_anon_WITH_AES_128_CBC_SHA = -16360; + +const int TLS_ECDH_anon_WITH_AES_256_CBC_SHA = -16359; + +const int TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA = -16331; + +const int TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA = -16330; + +const int TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 = -13141; + +const int TLS_NULL_WITH_NULL_NULL = 0; + +const int TLS_RSA_WITH_NULL_MD5 = 1; + +const int TLS_RSA_WITH_NULL_SHA = 2; + +const int TLS_RSA_WITH_RC4_128_MD5 = 4; + +const int TLS_RSA_WITH_RC4_128_SHA = 5; + +const int TLS_RSA_WITH_3DES_EDE_CBC_SHA = 10; + +const int TLS_RSA_WITH_NULL_SHA256 = 59; + +const int TLS_RSA_WITH_AES_128_CBC_SHA256 = 60; + +const int TLS_RSA_WITH_AES_256_CBC_SHA256 = 61; + +const int TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 13; + +const int TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 16; + +const int TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 19; + +const int TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 22; - /// Indicates that the write side of a connection has been closed. - /// Any outstanding writes complete, but future writes will immediately - /// fail. - static final URLSession_writeClosedForStreamTask_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionStreamTask)>( - _sel_URLSession_writeClosedForStreamTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_writeClosedForStreamTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), - ); +const int TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 62; - /// A notification that the system has determined that a better route - /// to the host has been detected (eg, a wi-fi interface becoming - /// available.) This is a hint to the delegate that it may be - /// desirable to create a new task for subsequent work. Note that - /// there is no guarantee that the future task will be able to connect - /// to the host, so callers should should be prepared for failure of - /// reads and writes over any new interface. - static final URLSession_betterRouteDiscoveredForStreamTask_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionStreamTask)>( - _sel_URLSession_betterRouteDiscoveredForStreamTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_betterRouteDiscoveredForStreamTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), - ); +const int TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 63; - /// The given task has been completed, and unopened NSInputStream and - /// NSOutputStream objects are created from the underlying network - /// connection. This will only be invoked after all enqueued IO has - /// completed (including any necessary handshakes.) The streamTask - /// will not receive any further delegate messages. - static final URLSession_streamTask_didBecomeInputStream_outputStream_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionStreamTask, - objc.NSInputStream, objc.NSOutputStream)>( - _sel_URLSession_streamTask_didBecomeInputStream_outputStream_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_streamTask_didBecomeInputStream_outputStream_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, - objc.NSOutputStream) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionStreamTask arg2, - objc.NSInputStream arg3, - objc.NSOutputStream arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, - objc.NSOutputStream) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionStreamTask arg2, - objc.NSInputStream arg3, - objc.NSOutputStream arg4) => - func(arg1, arg2, arg3, arg4)), - ); +const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 64; - /// Notification that a task has been created. This method is the first message - /// a task sends, providing a place to configure the task before it is resumed. - /// - /// This delegate callback is *NOT* dispatched to the delegate queue. It is - /// invoked synchronously before the task creation method returns. - static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _sel_URLSession_didCreateTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_didCreateTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); +const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 103; - /// Sent when the system is ready to begin work for a task with a delayed start - /// time set (using the earliestBeginDate property). The completionHandler must - /// be invoked in order for loading to proceed. The disposition provided to the - /// completion handler continues the load with the original request provided to - /// the task, replaces the request with the specified task, or cancels the task. - /// If this delegate is not implemented, loading will proceed with the original - /// request. - /// - /// Recommendation: only implement this delegate if tasks that have the - /// earliestBeginDate property set may become stale and require alteration prior - /// to starting the network load. - /// - /// If a new request is specified, the allowsExpensiveNetworkAccess, - /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties - /// from the new request will not be used; the properties from the - /// original request will continue to be used. - /// - /// Canceling the task is equivalent to calling the task's cancel method; the - /// URLSession:task:didCompleteWithError: task delegate will be called with error - /// NSURLErrorCancelled. - static final URLSession_task_willBeginDelayedRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)>( - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); +const int TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 104; - /// Sent when a task cannot start the network loading process because the current - /// network connectivity is not available or sufficient for the task's request. - /// - /// This delegate will be called at most one time per task, and is only called if - /// the waitsForConnectivity property in the NSURLSessionConfiguration has been - /// set to YES. - /// - /// This delegate callback will never be called for background sessions, because - /// the waitForConnectivity property is ignored by those sessions. - static final URLSession_taskIsWaitingForConnectivity_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _sel_URLSession_taskIsWaitingForConnectivity_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); +const int TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 105; - /// An HTTP request is attempting to perform a redirection to a different - /// URL. You must invoke the completion routine to allow the - /// redirection, allow the redirection with a modified request, or - /// pass nil to the completionHandler to cause the body of the redirection - /// response to be delivered as the payload of this request. The default - /// is to follow redirections. - /// - /// For tasks in background sessions, redirections will always be followed and this method will not be called. - static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)>( - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); +const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 106; - /// The task has received a request specific authentication challenge. - /// If this delegate is not implemented, the session specific authentication challenge - /// will *NOT* be called and the behavior will be the same as using the default handling - /// disposition. - static final URLSession_task_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - ); +const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 107; - /// Sent if a task requires a new, unopened body stream. This may be - /// necessary when authentication has failed for any request that - /// involves a body stream. - static final URLSession_task_needNewBodyStream_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)>( - _sel_URLSession_task_needNewBodyStream_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_task_needNewBodyStream_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_DH_anon_WITH_RC4_128_MD5 = 24; - /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be - /// necessary when resuming a failed upload task. - /// - /// - Parameter session: The session containing the task that needs a new body stream from the given offset. - /// - Parameter task: The task that needs a new body stream. - /// - Parameter offset: The starting offset required for the body stream. - /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)>( - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); +const int TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 27; - /// Sent periodically to notify the delegate of upload progress. This - /// information is also available as properties of the task. - static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, int, int)>( - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); +const int TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 108; - /// Sent for each informational response received except 101 switching protocols. - static final URLSession_task_didReceiveInformationalResponse_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - _sel_URLSession_task_didReceiveInformationalResponse_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 109; - /// Sent when complete statistics information has been collected for the task. - static final URLSession_task_didFinishCollectingMetrics_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - _sel_URLSession_task_didFinishCollectingMetrics_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_PSK_WITH_RC4_128_SHA = 138; - /// Sent as the last message related to a specific task. Error may be - /// nil, which implies that no error occurred and this task is complete. - static final URLSession_task_didCompleteWithError_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( - _sel_URLSession_task_didCompleteWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_task_didCompleteWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_PSK_WITH_3DES_EDE_CBC_SHA = 139; - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = objc - .ObjCProtocolListenableMethod( - _sel_URLSession_didBecomeInvalidWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - ); +const int TLS_PSK_WITH_AES_128_CBC_SHA = 140; + +const int TLS_PSK_WITH_AES_256_CBC_SHA = 141; + +const int TLS_DHE_PSK_WITH_RC4_128_SHA = 142; + +const int TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA = 143; + +const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA = 144; + +const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA = 145; + +const int TLS_RSA_PSK_WITH_RC4_128_SHA = 146; + +const int TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA = 147; + +const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA = 148; + +const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA = 149; + +const int TLS_PSK_WITH_NULL_SHA = 44; + +const int TLS_DHE_PSK_WITH_NULL_SHA = 45; + +const int TLS_RSA_PSK_WITH_NULL_SHA = 46; - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_RSA_WITH_AES_128_GCM_SHA256 = 156; - /// If an application has received an - /// -application:handleEventsForBackgroundURLSession:completionHandler: - /// message, the session delegate will receive this message to indicate - /// that all messages previously enqueued for this session have been - /// delivered. At this time it is safe to invoke the previously stored - /// completion handler, or to begin any internal updates that will - /// result in invoking the completion handler. - static final URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.ObjCProtocolListenableMethod( - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - ); -} +const int TLS_RSA_WITH_AES_256_GCM_SHA384 = 157; -late final _protocol_NSURLSessionStreamDelegate = - objc.getProtocol("NSURLSessionStreamDelegate"); -late final _sel_URLSession_readClosedForStreamTask_ = - objc.registerName("URLSession:readClosedForStreamTask:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} +const int TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 158; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerTrampoline) - ..keepIsolateAlive = false; +const int TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 159; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, NSURLSessionStreamTask)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask)>(pointer, - retain: retain, release: release); +const int TLS_DH_RSA_WITH_AES_128_GCM_SHA256 = 160; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) => - objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +const int TLS_DH_RSA_WITH_AES_256_GCM_SHA384 = 161; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionStreamTask.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); +const int TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = 162; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionStreamTask.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_tm2na8(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask)>(wrapper, retain: false, release: true); - } -} +const int TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = 163; -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, NSURLSessionStreamTask)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); -} +const int TLS_DH_DSS_WITH_AES_128_GCM_SHA256 = 164; -late final _sel_URLSession_writeClosedForStreamTask_ = - objc.registerName("URLSession:writeClosedForStreamTask:"); -late final _sel_URLSession_betterRouteDiscoveredForStreamTask_ = - objc.registerName("URLSession:betterRouteDiscoveredForStreamTask:"); -late final _sel_URLSession_streamTask_didBecomeInputStream_outputStream_ = objc - .registerName("URLSession:streamTask:didBecomeInputStream:outputStream:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} +const int TLS_DH_DSS_WITH_AES_256_GCM_SHA384 = 165; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerTrampoline) - ..keepIsolateAlive = false; +const int TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 166; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionStreamTask, - objc.NSInputStream, - objc.NSOutputStream)>(pointer, retain: retain, release: release); +const int TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 167; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionStreamTask, - objc.NSInputStream, - objc.NSOutputStream)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +const int TLS_PSK_WITH_AES_128_GCM_SHA256 = 168; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionStreamTask.castFromPointer(arg2, retain: true, release: true), - objc.NSInputStream.castFromPointer(arg3, retain: true, release: true), - objc.NSOutputStream.castFromPointer(arg4, retain: true, release: true))), - retain: false, - release: true); +const int TLS_PSK_WITH_AES_256_GCM_SHA384 = 169; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionStreamTask, - objc.NSInputStream, - objc.NSOutputStream)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask, - objc.NSInputStream, objc.NSOutputStream) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionStreamTask.castFromPointer(arg2, - retain: false, release: true), - objc.NSInputStream.castFromPointer(arg3, - retain: false, release: true), - objc.NSOutputStream.castFromPointer(arg4, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_no6pyg(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionStreamTask, - objc.NSInputStream, - objc.NSOutputStream)>(wrapper, retain: false, release: true); - } -} +const int TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 170; -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionStreamTask arg2, - objc.NSInputStream arg3, - objc.NSOutputStream arg4) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, - arg0, - arg1.ref.pointer, - arg2.ref.pointer, - arg3.ref.pointer, - arg4.ref.pointer); -} +const int TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 171; + +const int TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 = 172; + +const int TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 = 173; -/// NSURLSessionWebSocketDelegate -abstract final class NSURLSessionWebSocketDelegate { - /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? - URLSession_webSocketTask_didCloseWithCode_reason_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ - .implement(builder, URLSession_webSocketTask_didOpenWithProtocol_); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_ - .implement(builder, URLSession_webSocketTask_didCloseWithCode_reason_); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ - .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionWebSocketDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ - .implement(builder, URLSession_task_didCompleteWithError_); - NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ - .implement(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } +const int TLS_PSK_WITH_AES_128_CBC_SHA256 = 174; - /// Adds the implementation of the NSURLSessionWebSocketDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? - URLSession_webSocketTask_didCloseWithCode_reason_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ - .implement(builder, URLSession_webSocketTask_didOpenWithProtocol_); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_ - .implement(builder, URLSession_webSocketTask_didCloseWithCode_reason_); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ - .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionWebSocketDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ - .implement(builder, URLSession_task_didCompleteWithError_); - NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ - .implement(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } +const int TLS_PSK_WITH_AES_256_CBC_SHA384 = 175; - /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? - URLSession_webSocketTask_didCloseWithCode_reason_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ - .implementAsListener( - builder, URLSession_webSocketTask_didOpenWithProtocol_); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_ - .implementAsListener( - builder, URLSession_webSocketTask_didCloseWithCode_reason_); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionWebSocketDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } +const int TLS_PSK_WITH_NULL_SHA256 = 176; - /// Adds the implementation of the NSURLSessionWebSocketDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? - URLSession_webSocketTask_didOpenWithProtocol_, - void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? - URLSession_webSocketTask_didCloseWithCode_reason_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ - .implementAsListener( - builder, URLSession_webSocketTask_didOpenWithProtocol_); - NSURLSessionWebSocketDelegate - .URLSession_webSocketTask_didCloseWithCode_reason_ - .implementAsListener( - builder, URLSession_webSocketTask_didCloseWithCode_reason_); - NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionWebSocketDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionWebSocketDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionWebSocketDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionWebSocketDelegate - .URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionWebSocketDelegate - .URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionWebSocketDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } +const int TLS_PSK_WITH_NULL_SHA384 = 177; - /// Indicates that the WebSocket handshake was successful and the connection has been upgraded to webSockets. - /// It will also provide the protocol that is picked in the handshake. If the handshake fails, this delegate will not be invoked. - static final URLSession_webSocketTask_didOpenWithProtocol_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>( - _sel_URLSession_webSocketTask_didOpenWithProtocol_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_webSocketTask_didOpenWithProtocol_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionWebSocketTask arg2, objc.NSString? arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionWebSocketTask arg2, objc.NSString? arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 = 178; - /// Indicates that the WebSocket has received a close frame from the server endpoint. - /// The close code and the close reason may be provided by the delegate if the server elects to send - /// this information in the close frame - static final URLSession_webSocketTask_didCloseWithCode_reason_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, - objc.NSData?)>( - _sel_URLSession_webSocketTask_didCloseWithCode_reason_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_webSocketTask_didCloseWithCode_reason_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, - objc.NSData?) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionWebSocketTask arg2, - DartNSInteger arg3, - objc.NSData? arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, - objc.NSData?) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionWebSocketTask arg2, - DartNSInteger arg3, - objc.NSData? arg4) => - func(arg1, arg2, arg3, arg4)), - ); +const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 = 179; - /// Notification that a task has been created. This method is the first message - /// a task sends, providing a place to configure the task before it is resumed. - /// - /// This delegate callback is *NOT* dispatched to the delegate queue. It is - /// invoked synchronously before the task creation method returns. - static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _sel_URLSession_didCreateTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_didCreateTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); +const int TLS_DHE_PSK_WITH_NULL_SHA256 = 180; - /// Sent when the system is ready to begin work for a task with a delayed start - /// time set (using the earliestBeginDate property). The completionHandler must - /// be invoked in order for loading to proceed. The disposition provided to the - /// completion handler continues the load with the original request provided to - /// the task, replaces the request with the specified task, or cancels the task. - /// If this delegate is not implemented, loading will proceed with the original - /// request. - /// - /// Recommendation: only implement this delegate if tasks that have the - /// earliestBeginDate property set may become stale and require alteration prior - /// to starting the network load. - /// - /// If a new request is specified, the allowsExpensiveNetworkAccess, - /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties - /// from the new request will not be used; the properties from the - /// original request will continue to be used. - /// - /// Canceling the task is equivalent to calling the task's cancel method; the - /// URLSession:task:didCompleteWithError: task delegate will be called with error - /// NSURLErrorCancelled. - static final URLSession_task_willBeginDelayedRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)>( - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); +const int TLS_DHE_PSK_WITH_NULL_SHA384 = 181; + +const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 = 182; + +const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 = 183; + +const int TLS_RSA_PSK_WITH_NULL_SHA256 = 184; + +const int TLS_RSA_PSK_WITH_NULL_SHA384 = 185; + +const int TLS_AES_128_GCM_SHA256 = 4865; + +const int TLS_AES_256_GCM_SHA384 = 4866; + +const int TLS_CHACHA20_POLY1305_SHA256 = 4867; + +const int TLS_AES_128_CCM_SHA256 = 4868; + +const int TLS_AES_128_CCM_8_SHA256 = 4869; + +const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = -16349; + +const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = -16348; + +const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = -16347; - /// Sent when a task cannot start the network loading process because the current - /// network connectivity is not available or sufficient for the task's request. - /// - /// This delegate will be called at most one time per task, and is only called if - /// the waitsForConnectivity property in the NSURLSessionConfiguration has been - /// set to YES. - /// - /// This delegate callback will never be called for background sessions, because - /// the waitForConnectivity property is ignored by those sessions. - static final URLSession_taskIsWaitingForConnectivity_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _sel_URLSession_taskIsWaitingForConnectivity_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); +const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = -16346; - /// An HTTP request is attempting to perform a redirection to a different - /// URL. You must invoke the completion routine to allow the - /// redirection, allow the redirection with a modified request, or - /// pass nil to the completionHandler to cause the body of the redirection - /// response to be delivered as the payload of this request. The default - /// is to follow redirections. - /// - /// For tasks in background sessions, redirections will always be followed and this method will not be called. - static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)>( - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); +const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = -16345; - /// The task has received a request specific authentication challenge. - /// If this delegate is not implemented, the session specific authentication challenge - /// will *NOT* be called and the behavior will be the same as using the default handling - /// disposition. - static final URLSession_task_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - ); +const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = -16344; - /// Sent if a task requires a new, unopened body stream. This may be - /// necessary when authentication has failed for any request that - /// involves a body stream. - static final URLSession_task_needNewBodyStream_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)>( - _sel_URLSession_task_needNewBodyStream_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_needNewBodyStream_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = -16343; - /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be - /// necessary when resuming a failed upload task. - /// - /// - Parameter session: The session containing the task that needs a new body stream from the given offset. - /// - Parameter task: The task that needs a new body stream. - /// - Parameter offset: The starting offset required for the body stream. - /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)>( - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); +const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = -16342; - /// Sent periodically to notify the delegate of upload progress. This - /// information is also available as properties of the task. - static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, int, int)>( - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); +const int TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = -16341; - /// Sent for each informational response received except 101 switching protocols. - static final URLSession_task_didReceiveInformationalResponse_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - _sel_URLSession_task_didReceiveInformationalResponse_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = -16340; - /// Sent when complete statistics information has been collected for the task. - static final URLSession_task_didFinishCollectingMetrics_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - _sel_URLSession_task_didFinishCollectingMetrics_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = -16339; - /// Sent as the last message related to a specific task. Error may be - /// nil, which implies that no error occurred and this task is complete. - static final URLSession_task_didCompleteWithError_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( - _sel_URLSession_task_didCompleteWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_task_didCompleteWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = -16338; - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = objc - .ObjCProtocolListenableMethod( - _sel_URLSession_didBecomeInvalidWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - ); +const int TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = -16337; - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _sel_URLSession_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - ); +const int TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = -16336; - /// If an application has received an - /// -application:handleEventsForBackgroundURLSession:completionHandler: - /// message, the session delegate will receive this message to indicate - /// that all messages previously enqueued for this session have been - /// delivered. At this time it is safe to invoke the previously stored - /// completion handler, or to begin any internal updates that will - /// result in invoking the completion handler. - static final URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.ObjCProtocolListenableMethod( - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionWebSocketDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - ); -} +const int TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = -16335; -late final _protocol_NSURLSessionWebSocketDelegate = - objc.getProtocol("NSURLSessionWebSocketDelegate"); -late final _sel_URLSession_webSocketTask_didOpenWithProtocol_ = - objc.registerName("URLSession:webSocketTask:didOpenWithProtocol:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} +const int TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = -16334; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerTrampoline) - ..keepIsolateAlive = false; +const int TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = -13144; + +const int TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = -13143; + +const int TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 255; + +const int SSL_RSA_WITH_RC2_CBC_MD5 = -128; + +const int SSL_RSA_WITH_IDEA_CBC_MD5 = -127; + +const int SSL_RSA_WITH_DES_CBC_MD5 = -126; + +const int SSL_RSA_WITH_3DES_EDE_CBC_MD5 = -125; + +const int SSL_NO_SUCH_CIPHERSUITE = -1; + +const int noErr3 = 0; + +const int kNilOptions3 = 0; + +const int kVariableLengthArray3 = 1; + +const int kUnknownType3 = 1061109567; + +const int normal3 = 0; + +const int bold3 = 1; + +const int italic3 = 2; + +const int underline3 = 4; + +const int outline3 = 8; + +const int shadow3 = 16; + +const int condense3 = 32; + +const int extend3 = 64; + +const int developStage3 = 32; + +const int alphaStage3 = 64; + +const int betaStage3 = 96; + +const int finalStage3 = 128; + +const int NSScannedOption3 = 1; + +const int NSCollectorDisabledOption3 = 2; + +const int NSASCIIStringEncoding = 1; + +const int NSNEXTSTEPStringEncoding = 2; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, objc.NSString?)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionWebSocketTask, - objc.NSString?)>(pointer, retain: retain, release: release); +const int NSJapaneseEUCStringEncoding = 3; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, objc.NSString?)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, objc.NSString?)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +const int NSUTF8StringEncoding = 4; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionWebSocketTask.castFromPointer(arg2, retain: true, release: true), - arg3.address == 0 ? null : objc.NSString.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); +const int NSISOLatin1StringEncoding = 5; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, objc.NSString?)> listener( - void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, objc.NSString?) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionWebSocketTask.castFromPointer(arg2, - retain: false, release: true), - arg3.address == 0 - ? null - : objc.NSString.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_1a6kixf(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionWebSocketTask, - objc.NSString?)>(wrapper, retain: false, release: true); - } -} +const int NSSymbolStringEncoding = 6; -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, objc.NSString?)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionWebSocketTask arg2, objc.NSString? arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3?.ref.pointer ?? ffi.nullptr); -} +const int NSNonLossyASCIIStringEncoding = 7; -late final _sel_URLSession_webSocketTask_didCloseWithCode_reason_ = - objc.registerName("URLSession:webSocketTask:didCloseWithCode:reason:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - NSInteger arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>()( - arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} +const int NSShiftJISStringEncoding = 8; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerTrampoline) - ..keepIsolateAlive = false; +const int NSISOLatin2StringEncoding = 9; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionWebSocketTask, - NSInteger, - objc.NSData?)>(pointer, retain: retain, release: release); +const int NSUnicodeStringEncoding = 10; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, NSInteger arg3, ffi.Pointer arg4)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +const int NSWindowsCP1251StringEncoding = 11; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionWebSocketTask.castFromPointer(arg2, retain: true, release: true), - arg3, - arg4.address == 0 ? null : objc.NSData.castFromPointer(arg4, retain: true, release: true))), - retain: false, - release: true); +const int NSWindowsCP1252StringEncoding = 12; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> listener( - void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionWebSocketTask.castFromPointer(arg2, - retain: false, release: true), - arg3, - arg4.address == 0 - ? null - : objc.NSData.castFromPointer(arg4, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_10hgvcc(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionWebSocketTask, - NSInteger, - objc.NSData?)>(wrapper, retain: false, release: true); - } -} +const int NSWindowsCP1253StringEncoding = 13; -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionWebSocketTask arg2, - DartNSInteger arg3, - objc.NSData? arg4) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - NSInteger arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>()( - ref.pointer, - arg0, - arg1.ref.pointer, - arg2.ref.pointer, - arg3, - arg4?.ref.pointer ?? ffi.nullptr); -} +const int NSWindowsCP1254StringEncoding = 14; -typedef NSRange = objc.NSRange; +const int NSWindowsCP1250StringEncoding = 15; -/// NSItemProviderWriting -abstract final class NSItemProviderWriting { - /// Builds an object that implements the NSItemProviderWriting protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {objc.NSItemProviderRepresentationVisibility Function(objc.NSString)? - itemProviderVisibilityForRepresentationWithTypeIdentifier_, - required NSProgress? Function(objc.NSString, - objc.ObjCBlock) - loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, - objc.NSArray Function()? writableTypeIdentifiersForItemProvider}) { - final builder = objc.ObjCProtocolBuilder(); - NSItemProviderWriting - .itemProviderVisibilityForRepresentationWithTypeIdentifier_ - .implement(builder, - itemProviderVisibilityForRepresentationWithTypeIdentifier_); - NSItemProviderWriting - .loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ - .implement(builder, - loadDataWithTypeIdentifier_forItemProviderCompletionHandler_); - NSItemProviderWriting.writableTypeIdentifiersForItemProvider - .implement(builder, writableTypeIdentifiersForItemProvider); - return builder.build(); - } +const int NSISO2022JPStringEncoding = 21; - /// Adds the implementation of the NSItemProviderWriting protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {objc.NSItemProviderRepresentationVisibility Function(objc.NSString)? - itemProviderVisibilityForRepresentationWithTypeIdentifier_, - required NSProgress? Function(objc.NSString, - objc.ObjCBlock) - loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, - objc.NSArray Function()? writableTypeIdentifiersForItemProvider}) { - NSItemProviderWriting - .itemProviderVisibilityForRepresentationWithTypeIdentifier_ - .implement(builder, - itemProviderVisibilityForRepresentationWithTypeIdentifier_); - NSItemProviderWriting - .loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ - .implement(builder, - loadDataWithTypeIdentifier_forItemProviderCompletionHandler_); - NSItemProviderWriting.writableTypeIdentifiersForItemProvider - .implement(builder, writableTypeIdentifiersForItemProvider); - } +const int NSMacOSRomanStringEncoding = 30; - /// itemProviderVisibilityForRepresentationWithTypeIdentifier: - static final itemProviderVisibilityForRepresentationWithTypeIdentifier_ = - objc.ObjCProtocolMethod< - objc.NSItemProviderRepresentationVisibility Function(objc.NSString)>( - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - objc.getProtocolMethodSignature( - _protocol_NSItemProviderWriting, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - isRequired: false, - isInstanceMethod: true, - ), - (objc.NSItemProviderRepresentationVisibility Function(objc.NSString) - func) => - ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString - .fromFunction( - (ffi.Pointer _, objc.NSString arg1) => func(arg1)), - ); +const int NSUTF16StringEncoding = 10; - /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: - static final loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = - objc.ObjCProtocolMethod< - NSProgress? Function(objc.NSString, - objc.ObjCBlock)>( - _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSItemProviderWriting, - _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, - isRequired: true, - isInstanceMethod: true, - ), - (NSProgress? Function(objc.NSString, - objc.ObjCBlock) - func) => - ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError.fromFunction( - (ffi.Pointer _, - objc.NSString arg1, - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, objc.NSError?)> - arg2) => - func(arg1, arg2)), - ); +const int NSUTF16BigEndianStringEncoding = 2415919360; - /// writableTypeIdentifiersForItemProvider - static final writableTypeIdentifiersForItemProvider = - objc.ObjCProtocolMethod( - _sel_writableTypeIdentifiersForItemProvider, - objc.getProtocolMethodSignature( - _protocol_NSItemProviderWriting, - _sel_writableTypeIdentifiersForItemProvider, - isRequired: false, - isInstanceMethod: true, - ), - (objc.NSArray Function() func) => ObjCBlock_NSArray_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); -} +const int NSUTF16LittleEndianStringEncoding = 2483028224; -late final _protocol_NSItemProviderWriting = - objc.getProtocol("NSItemProviderWriting"); -late final _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_ = - objc.registerName( - "itemProviderVisibilityForRepresentationWithTypeIdentifier:"); -int _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable = - ffi.Pointer.fromFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline, - 0) - .cast(); -int _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as int Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable = - ffi.Pointer.fromFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline, - 0) - .cast(); +const int NSUTF32StringEncoding = 2348810496; + +const int NSUTF32BigEndianStringEncoding = 2550137088; + +const int NSUTF32LittleEndianStringEncoding = 2617245952; + +const int NSProprietaryStringEncoding = 65536; + +const int NSOpenStepUnicodeReservedBase = 62464; + +const int noErr4 = 0; + +const int kNilOptions4 = 0; -/// Construction methods for `objc.ObjCBlock, objc.NSString)>`. -abstract final class ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - NSInteger Function(ffi.Pointer, objc.NSString)> castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock, objc.NSString)>( - pointer, - retain: retain, - release: release); +const int kVariableLengthArray4 = 1; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSString)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, objc.NSString)>( - objc.newPointerBlock(_ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +const int kUnknownType4 = 1061109567; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSString)> fromFunction( - objc.NSItemProviderRepresentationVisibility Function( - ffi.Pointer, objc.NSString) - fn) => - objc.ObjCBlock, objc.NSString)>( - objc.newClosureBlock( - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true)) - .value), - retain: false, - release: true); -} +const int normal4 = 0; -/// Call operator for `objc.ObjCBlock, objc.NSString)>`. -extension ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_CallExtension - on objc - .ObjCBlock, objc.NSString)> { - objc.NSItemProviderRepresentationVisibility call( - ffi.Pointer arg0, objc.NSString arg1) => - objc.NSItemProviderRepresentationVisibility.fromValue(ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer)); -} +const int bold4 = 1; -void _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} +const int italic4 = 2; -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable = ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline) - ..keepIsolateAlive = false; +const int underline4 = 4; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSData_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock( - pointer, - retain: retain, - release: release); +const int outline4 = 8; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +const int shadow4 = 16; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSData?, objc.NSError?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSError_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, - retain: true, release: true), - arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); +const int condense4 = 32; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock - listener(void Function(objc.NSData?, objc.NSError?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, - retain: false, release: true), - arg1.address == 0 - ? null - : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_1tjlcwl(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true); - } -} +const int extend4 = 64; -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSData_NSError_CallExtension - on objc.ObjCBlock { - void call(objc.NSData? arg0, objc.NSError? arg1) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); -} +const int developStage4 = 32; -late final _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = - objc.registerName( - "loadDataWithTypeIdentifier:forItemProviderCompletionHandler:"); -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline) - .cast(); +const int alphaStage4 = 64; -/// Construction methods for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. -abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - NSProgress? Function(ffi.Pointer, objc.NSString, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - NSProgress? Function(ffi.Pointer, objc.NSString, - objc.ObjCBlock)>(pointer, - retain: retain, release: release); +const int betaStage4 = 96; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - NSProgress? Function(ffi.Pointer, objc.NSString, - objc.ObjCBlock)> - fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - NSProgress? Function(ffi.Pointer, objc.NSString, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +const int finalStage4 = 128; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSString, objc.ObjCBlock)> - fromFunction(NSProgress? Function(ffi.Pointer, objc.NSString, objc.ObjCBlock) fn) => - objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true), ObjCBlock_ffiVoid_NSData_NSError.castFromPointer(arg2, retain: true, release: true)) - ?.ref - .retainAndAutorelease() ?? - ffi.nullptr), - retain: false, - release: true); -} +const int NSScannedOption4 = 1; -/// Call operator for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. -extension ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_CallExtension - on objc.ObjCBlock< - NSProgress? Function(ffi.Pointer, objc.NSString, - objc.ObjCBlock)> { - NSProgress? call(ffi.Pointer arg0, objc.NSString arg1, objc.ObjCBlock arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>() - (ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer) - .address == - 0 - ? null - : NSProgress.castFromPointer( - ref.pointer.ref.invoke.cast Function(ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>>().asFunction Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer), - retain: true, - release: true); -} +const int NSCollectorDisabledOption4 = 2; -late final _sel_writableTypeIdentifiersForItemProvider = - objc.registerName("writableTypeIdentifiersForItemProvider"); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSArray_ffiVoid_closureTrampoline) - .cast(); +const int noErr5 = 0; -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_NSArray_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock)>(pointer, - retain: retain, release: release); +const int kNilOptions5 = 0; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_NSArray_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +const int kVariableLengthArray5 = 1; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(objc.NSArray Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_NSArray_ffiVoid_closureCallable, - (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), - retain: false, - release: true); -} +const int kUnknownType5 = 1061109567; -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_NSArray_ffiVoid_CallExtension - on objc.ObjCBlock)> { - objc.NSArray call(ffi.Pointer arg0) => objc.NSArray.castFromPointer( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0), - retain: true, - release: true); -} +const int normal5 = 0; -/// NSItemProviderReading -abstract final class NSItemProviderReading { - /// Builds an object that implements the NSItemProviderReading protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required Dartinstancetype? Function(objc.NSData, objc.NSString, - ffi.Pointer>) - objectWithItemProviderData_typeIdentifier_error_, - required objc.NSArray Function() - readableTypeIdentifiersForItemProvider}) { - final builder = objc.ObjCProtocolBuilder(); - NSItemProviderReading.objectWithItemProviderData_typeIdentifier_error_ - .implement(builder, objectWithItemProviderData_typeIdentifier_error_); - NSItemProviderReading.readableTypeIdentifiersForItemProvider - .implement(builder, readableTypeIdentifiersForItemProvider); - return builder.build(); - } +const int bold5 = 1; - /// Adds the implementation of the NSItemProviderReading protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required Dartinstancetype? Function(objc.NSData, objc.NSString, - ffi.Pointer>) - objectWithItemProviderData_typeIdentifier_error_, - required objc.NSArray Function() - readableTypeIdentifiersForItemProvider}) { - NSItemProviderReading.objectWithItemProviderData_typeIdentifier_error_ - .implement(builder, objectWithItemProviderData_typeIdentifier_error_); - NSItemProviderReading.readableTypeIdentifiersForItemProvider - .implement(builder, readableTypeIdentifiersForItemProvider); - } +const int italic5 = 2; - /// objectWithItemProviderData:typeIdentifier:error: - static final objectWithItemProviderData_typeIdentifier_error_ = - objc.ObjCProtocolMethod< - Dartinstancetype? Function(objc.NSData, objc.NSString, - ffi.Pointer>)>( - _sel_objectWithItemProviderData_typeIdentifier_error_, - objc.getProtocolMethodSignature( - _protocol_NSItemProviderReading, - _sel_objectWithItemProviderData_typeIdentifier_error_, - isRequired: true, - isInstanceMethod: false, - ), - (Dartinstancetype? Function(objc.NSData, objc.NSString, - ffi.Pointer>) - func) => - ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError.fromFunction( - (ffi.Pointer _, objc.NSData arg1, objc.NSString arg2, - ffi.Pointer> arg3) => - func(arg1, arg2, arg3)), - ); +const int underline5 = 4; - /// readableTypeIdentifiersForItemProvider - static final readableTypeIdentifiersForItemProvider = - objc.ObjCProtocolMethod( - _sel_readableTypeIdentifiersForItemProvider, - objc.getProtocolMethodSignature( - _protocol_NSItemProviderReading, - _sel_readableTypeIdentifiersForItemProvider, - isRequired: true, - isInstanceMethod: false, - ), - (objc.NSArray Function() func) => ObjCBlock_NSArray_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); -} +const int outline5 = 8; -late final _protocol_NSItemProviderReading = - objc.getProtocol("NSItemProviderReading"); -late final _sel_objectWithItemProviderData_typeIdentifier_error_ = - objc.registerName("objectWithItemProviderData:typeIdentifier:error:"); -instancetype - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>()( - arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>( - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline) - .cast(); -instancetype - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3) => - (objc.getBlockClosure(block) as instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable = - ffi.Pointer.fromFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>( - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline) - .cast(); +const int shadow5 = 16; + +const int condense5 = 32; + +const int extend5 = 64; + +const int developStage5 = 32; -/// Construction methods for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. -abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - objc.NSData, - objc.NSString, - ffi.Pointer>)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - objc.NSData, - objc.NSString, - ffi.Pointer>)>(pointer, retain: retain, release: release); +const int alphaStage5 = 64; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3)>> ptr) => - objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - objc.NSData, - objc.NSString, - ffi.Pointer>)>( - objc.newPointerBlock(_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +const int betaStage5 = 96; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> - fromFunction(Dartinstancetype? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>) fn) => - objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>( - objc.newClosureBlock( - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3) => - fn(arg0, objc.NSData.castFromPointer(arg1, retain: true, release: true), objc.NSString.castFromPointer(arg2, retain: true, release: true), arg3)?.ref.retainAndAutorelease() ?? - ffi.nullptr), - retain: false, - release: true); -} +const int finalStage5 = 128; -/// Call operator for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. -extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_CallExtension - on objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - objc.NSData, - objc.NSString, - ffi.Pointer>)> { - Dartinstancetype? call(ffi.Pointer arg0, objc.NSData arg1, objc.NSString arg2, ffi.Pointer> arg3) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>() - (ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3) - .address == - 0 - ? null - : objc.ObjCObjectBase( - ref.pointer.ref.invoke.cast block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3)>>().asFunction, ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3), - retain: true, - release: true); -} +const int NSScannedOption5 = 1; -late final _sel_readableTypeIdentifiersForItemProvider = - objc.registerName("readableTypeIdentifiersForItemProvider"); -typedef NSStringEncoding = NSUInteger; -typedef NSStringTransform = ffi.Pointer; -typedef DartNSStringTransform = objc.NSString; -typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; -typedef DartNSStringEncodingDetectionOptionsKey = objc.NSString; -typedef NSExceptionName = ffi.Pointer; -typedef DartNSExceptionName = objc.NSString; +const int NSCollectorDisabledOption5 = 2; -/// NSURLHandleClient -abstract final class NSURLHandleClient { - /// Builds an object that implements the NSURLHandleClient protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required void Function(objc.NSURLHandle, objc.NSData) - URLHandle_resourceDataDidBecomeAvailable_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidBeginLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidFinishLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidCancelLoading_, - required void Function(objc.NSURLHandle, objc.NSString) - URLHandle_resourceDidFailLoadingWithReason_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_.implement( - builder, URLHandle_resourceDataDidBecomeAvailable_); - NSURLHandleClient.URLHandleResourceDidBeginLoading_.implement( - builder, URLHandleResourceDidBeginLoading_); - NSURLHandleClient.URLHandleResourceDidFinishLoading_.implement( - builder, URLHandleResourceDidFinishLoading_); - NSURLHandleClient.URLHandleResourceDidCancelLoading_.implement( - builder, URLHandleResourceDidCancelLoading_); - NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_.implement( - builder, URLHandle_resourceDidFailLoadingWithReason_); - return builder.build(); - } +const int noErr6 = 0; - /// Adds the implementation of the NSURLHandleClient protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required void Function(objc.NSURLHandle, objc.NSData) - URLHandle_resourceDataDidBecomeAvailable_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidBeginLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidFinishLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidCancelLoading_, - required void Function(objc.NSURLHandle, objc.NSString) - URLHandle_resourceDidFailLoadingWithReason_}) { - NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_.implement( - builder, URLHandle_resourceDataDidBecomeAvailable_); - NSURLHandleClient.URLHandleResourceDidBeginLoading_.implement( - builder, URLHandleResourceDidBeginLoading_); - NSURLHandleClient.URLHandleResourceDidFinishLoading_.implement( - builder, URLHandleResourceDidFinishLoading_); - NSURLHandleClient.URLHandleResourceDidCancelLoading_.implement( - builder, URLHandleResourceDidCancelLoading_); - NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_.implement( - builder, URLHandle_resourceDidFailLoadingWithReason_); - } +const int kNilOptions6 = 0; - /// Builds an object that implements the NSURLHandleClient protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required void Function(objc.NSURLHandle, objc.NSData) - URLHandle_resourceDataDidBecomeAvailable_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidBeginLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidFinishLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidCancelLoading_, - required void Function(objc.NSURLHandle, objc.NSString) - URLHandle_resourceDidFailLoadingWithReason_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_ - .implementAsListener( - builder, URLHandle_resourceDataDidBecomeAvailable_); - NSURLHandleClient.URLHandleResourceDidBeginLoading_.implementAsListener( - builder, URLHandleResourceDidBeginLoading_); - NSURLHandleClient.URLHandleResourceDidFinishLoading_.implementAsListener( - builder, URLHandleResourceDidFinishLoading_); - NSURLHandleClient.URLHandleResourceDidCancelLoading_.implementAsListener( - builder, URLHandleResourceDidCancelLoading_); - NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_ - .implementAsListener( - builder, URLHandle_resourceDidFailLoadingWithReason_); - return builder.build(); - } +const int kVariableLengthArray6 = 1; - /// Adds the implementation of the NSURLHandleClient protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required void Function(objc.NSURLHandle, objc.NSData) - URLHandle_resourceDataDidBecomeAvailable_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidBeginLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidFinishLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidCancelLoading_, - required void Function(objc.NSURLHandle, objc.NSString) - URLHandle_resourceDidFailLoadingWithReason_}) { - NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_ - .implementAsListener( - builder, URLHandle_resourceDataDidBecomeAvailable_); - NSURLHandleClient.URLHandleResourceDidBeginLoading_.implementAsListener( - builder, URLHandleResourceDidBeginLoading_); - NSURLHandleClient.URLHandleResourceDidFinishLoading_.implementAsListener( - builder, URLHandleResourceDidFinishLoading_); - NSURLHandleClient.URLHandleResourceDidCancelLoading_.implementAsListener( - builder, URLHandleResourceDidCancelLoading_); - NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_ - .implementAsListener( - builder, URLHandle_resourceDidFailLoadingWithReason_); - } +const int kUnknownType6 = 1061109567; - /// URLHandle:resourceDataDidBecomeAvailable: - static final URLHandle_resourceDataDidBecomeAvailable_ = - objc.ObjCProtocolListenableMethod< - void Function(objc.NSURLHandle, objc.NSData)>( - _sel_URLHandle_resourceDataDidBecomeAvailable_, - objc.getProtocolMethodSignature( - _protocol_NSURLHandleClient, - _sel_URLHandle_resourceDataDidBecomeAvailable_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSURLHandle, objc.NSData) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData.fromFunction( - (ffi.Pointer _, objc.NSURLHandle arg1, - objc.NSData arg2) => - func(arg1, arg2)), - (void Function(objc.NSURLHandle, objc.NSData) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData.listener( - (ffi.Pointer _, objc.NSURLHandle arg1, - objc.NSData arg2) => - func(arg1, arg2)), - ); +const int normal6 = 0; - /// URLHandleResourceDidBeginLoading: - static final URLHandleResourceDidBeginLoading_ = - objc.ObjCProtocolListenableMethod( - _sel_URLHandleResourceDidBeginLoading_, - objc.getProtocolMethodSignature( - _protocol_NSURLHandleClient, - _sel_URLHandleResourceDidBeginLoading_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - ); +const int bold6 = 1; - /// URLHandleResourceDidFinishLoading: - static final URLHandleResourceDidFinishLoading_ = - objc.ObjCProtocolListenableMethod( - _sel_URLHandleResourceDidFinishLoading_, - objc.getProtocolMethodSignature( - _protocol_NSURLHandleClient, - _sel_URLHandleResourceDidFinishLoading_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - ); +const int italic6 = 2; - /// URLHandleResourceDidCancelLoading: - static final URLHandleResourceDidCancelLoading_ = - objc.ObjCProtocolListenableMethod( - _sel_URLHandleResourceDidCancelLoading_, - objc.getProtocolMethodSignature( - _protocol_NSURLHandleClient, - _sel_URLHandleResourceDidCancelLoading_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - ); +const int underline6 = 4; - /// URLHandle:resourceDidFailLoadingWithReason: - static final URLHandle_resourceDidFailLoadingWithReason_ = - objc.ObjCProtocolListenableMethod< - void Function(objc.NSURLHandle, objc.NSString)>( - _sel_URLHandle_resourceDidFailLoadingWithReason_, - objc.getProtocolMethodSignature( - _protocol_NSURLHandleClient, - _sel_URLHandle_resourceDidFailLoadingWithReason_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSURLHandle, objc.NSString) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString.fromFunction( - (ffi.Pointer _, objc.NSURLHandle arg1, - objc.NSString arg2) => - func(arg1, arg2)), - (void Function(objc.NSURLHandle, objc.NSString) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString.listener( - (ffi.Pointer _, objc.NSURLHandle arg1, - objc.NSString arg2) => - func(arg1, arg2)), - ); -} +const int outline6 = 8; -late final _protocol_NSURLHandleClient = objc.getProtocol("NSURLHandleClient"); -late final _sel_URLHandle_resourceDataDidBecomeAvailable_ = - objc.registerName("URLHandle:resourceDataDidBecomeAvailable:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} +const int shadow6 = 16; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerTrampoline) - ..keepIsolateAlive = false; +const int condense6 = 32; -/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSData)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSURLHandle, - objc.NSData)>(pointer, retain: retain, release: release); +const int extend6 = 64; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, objc.NSURLHandle, objc.NSData)> - fromFunctionPointer( - ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> - ptr) => - objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); +const int developStage6 = 32; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, objc.NSURLHandle, objc.NSData)> - fromFunction(void Function(ffi.Pointer, objc.NSURLHandle, objc.NSData) fn) => - objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, retain: true, release: true), - objc.NSData.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); +const int alphaStage6 = 64; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSData)> listener( - void Function(ffi.Pointer, objc.NSURLHandle, objc.NSData) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, - retain: false, release: true), - objc.NSData.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_tm2na8(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSURLHandle, - objc.NSData)>(wrapper, retain: false, release: true); - } -} +const int betaStage6 = 96; -/// Call operator for `objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSData)> { - void call(ffi.Pointer arg0, objc.NSURLHandle arg1, - objc.NSData arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); -} +const int finalStage6 = 128; -late final _sel_URLHandleResourceDidBeginLoading_ = - objc.registerName("URLHandleResourceDidBeginLoading:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} +const int NSScannedOption6 = 1; -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerCallable = ffi - .NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerTrampoline) - ..keepIsolateAlive = false; +const int NSCollectorDisabledOption6 = 2; -/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock, objc.NSURLHandle)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - objc.NSURLHandle)>(pointer, retain: retain, release: release); +const int noErr7 = 0; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSURLHandle)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, objc.NSURLHandle)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +const int kNilOptions7 = 0; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSURLHandle)> - fromFunction(void Function(ffi.Pointer, objc.NSURLHandle) fn) => - objc.ObjCBlock, objc.NSURLHandle)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, - retain: true, release: true))), - retain: false, - release: true); +const int kVariableLengthArray7 = 1; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc - .ObjCBlock, objc.NSURLHandle)> - listener(void Function(ffi.Pointer, objc.NSURLHandle) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_sjfpmz(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSURLHandle)>(wrapper, - retain: false, release: true); - } -} +const int kUnknownType7 = 1061109567; -/// Call operator for `objc.ObjCBlock, objc.NSURLHandle)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_CallExtension on objc - .ObjCBlock, objc.NSURLHandle)> { - void call(ffi.Pointer arg0, objc.NSURLHandle arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer); -} +const int normal7 = 0; -late final _sel_URLHandleResourceDidFinishLoading_ = - objc.registerName("URLHandleResourceDidFinishLoading:"); -late final _sel_URLHandleResourceDidCancelLoading_ = - objc.registerName("URLHandleResourceDidCancelLoading:"); -late final _sel_URLHandle_resourceDidFailLoadingWithReason_ = - objc.registerName("URLHandle:resourceDidFailLoadingWithReason:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} +const int bold7 = 1; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerTrampoline) - ..keepIsolateAlive = false; +const int italic7 = 2; -/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSString)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSURLHandle, - objc.NSString)>(pointer, retain: retain, release: release); +const int underline7 = 4; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, objc.NSURLHandle, objc.NSString)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSString)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); +const int outline7 = 8; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, objc.NSURLHandle, objc.NSString)> - fromFunction(void Function(ffi.Pointer, objc.NSURLHandle, objc.NSString) fn) => - objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, retain: true, release: true), - objc.NSString.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); +const int shadow7 = 16; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSString)> listener( - void Function(ffi.Pointer, objc.NSURLHandle, objc.NSString) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, - retain: false, release: true), - objc.NSString.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _wrapListenerBlock_tm2na8(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSURLHandle, - objc.NSString)>(wrapper, retain: false, release: true); - } -} +const int condense7 = 32; -/// Call operator for `objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSString)> { - void call(ffi.Pointer arg0, objc.NSURLHandle arg1, - objc.NSString arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); -} +const int extend7 = 64; -typedef NSURLResourceKey = ffi.Pointer; -typedef DartNSURLResourceKey = objc.NSString; -typedef NSURLFileResourceType = ffi.Pointer; -typedef DartNSURLFileResourceType = objc.NSString; -typedef NSURLThumbnailDictionaryItem = ffi.Pointer; -typedef DartNSURLThumbnailDictionaryItem = objc.NSString; -typedef NSURLFileProtectionType = ffi.Pointer; -typedef DartNSURLFileProtectionType = objc.NSString; -typedef NSURLUbiquitousItemDownloadingStatus = ffi.Pointer; -typedef DartNSURLUbiquitousItemDownloadingStatus = objc.NSString; -typedef NSURLUbiquitousSharedItemRole = ffi.Pointer; -typedef DartNSURLUbiquitousSharedItemRole = objc.NSString; -typedef NSURLUbiquitousSharedItemPermissions = ffi.Pointer; -typedef DartNSURLUbiquitousSharedItemPermissions = objc.NSString; +const int developStage7 = 32; -/// NSLocking -abstract final class NSLocking { - /// Builds an object that implements the NSLocking protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required void Function() lock, required void Function() unlock}) { - final builder = objc.ObjCProtocolBuilder(); - NSLocking.lock.implement(builder, lock); - NSLocking.unlock.implement(builder, unlock); - return builder.build(); - } +const int alphaStage7 = 64; - /// Adds the implementation of the NSLocking protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required void Function() lock, required void Function() unlock}) { - NSLocking.lock.implement(builder, lock); - NSLocking.unlock.implement(builder, unlock); - } +const int betaStage7 = 96; - /// Builds an object that implements the NSLocking protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required void Function() lock, required void Function() unlock}) { - final builder = objc.ObjCProtocolBuilder(); - NSLocking.lock.implementAsListener(builder, lock); - NSLocking.unlock.implementAsListener(builder, unlock); - return builder.build(); - } +const int finalStage7 = 128; - /// Adds the implementation of the NSLocking protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required void Function() lock, required void Function() unlock}) { - NSLocking.lock.implementAsListener(builder, lock); - NSLocking.unlock.implementAsListener(builder, unlock); - } +const int NSScannedOption7 = 1; - /// lock - static final lock = objc.ObjCProtocolListenableMethod( - _sel_lock, - objc.getProtocolMethodSignature( - _protocol_NSLocking, - _sel_lock, - isRequired: true, - isInstanceMethod: true, - ), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( - ffi.Pointer _, - ) => - func()), - ); +const int NSCollectorDisabledOption7 = 2; - /// unlock - static final unlock = objc.ObjCProtocolListenableMethod( - _sel_unlock, - objc.getProtocolMethodSignature( - _protocol_NSLocking, - _sel_unlock, - isRequired: true, - isInstanceMethod: true, - ), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( - ffi.Pointer _, - ) => - func()), - ); -} +const int noErr8 = 0; -late final _protocol_NSLocking = objc.getProtocol("NSLocking"); -late final _sel_lock = objc.registerName("lock"); -late final _sel_unlock = objc.registerName("unlock"); +const int kNilOptions8 = 0; -/// NSException -class NSException extends objc.NSObject { - NSException._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); +const int kVariableLengthArray8 = 1; - /// Constructs a [NSException] that points to the same underlying object as [other]. - NSException.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); +const int kUnknownType8 = 1061109567; - /// Constructs a [NSException] that wraps the given raw object pointer. - NSException.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); +const int normal8 = 0; - /// Returns whether [obj] is an instance of [NSException]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSException); - } - - /// exceptionWithName:reason:userInfo: - static NSException exceptionWithName_reason_userInfo_( - DartNSExceptionName name, - objc.NSString? reason, - objc.NSDictionary? userInfo) { - final _ret = _objc_msgSend_aud7dn( - _class_NSException, - _sel_exceptionWithName_reason_userInfo_, - name.ref.pointer, - reason?.ref.pointer ?? ffi.nullptr, - userInfo?.ref.pointer ?? ffi.nullptr); - return NSException.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithName:reason:userInfo: - NSException initWithName_reason_userInfo_(DartNSExceptionName aName, - objc.NSString? aReason, objc.NSDictionary? aUserInfo) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithName_reason_userInfo_, - aName.ref.pointer, - aReason?.ref.pointer ?? ffi.nullptr, - aUserInfo?.ref.pointer ?? ffi.nullptr); - return NSException.castFromPointer(_ret, retain: false, release: true); - } +const int bold8 = 1; - /// name - DartNSExceptionName get name { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } +const int italic8 = 2; - /// reason - objc.NSString? get reason { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_reason); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } +const int underline8 = 4; - /// userInfo - objc.NSDictionary? get userInfo { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_userInfo); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } +const int outline8 = 8; - /// callStackReturnAddresses - objc.NSArray get callStackReturnAddresses { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_callStackReturnAddresses); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } +const int shadow8 = 16; - /// callStackSymbols - objc.NSArray get callStackSymbols { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_callStackSymbols); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } +const int condense8 = 32; - /// raise - void raise() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_raise); - } +const int extend8 = 64; - /// raise:format: - static void raise_format_(DartNSExceptionName name, objc.NSString format) { - _objc_msgSend_1tjlcwl(_class_NSException, _sel_raise_format_, - name.ref.pointer, format.ref.pointer); - } +const int developStage8 = 32; - /// init - NSException init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSException.castFromPointer(_ret, retain: false, release: true); - } +const int alphaStage8 = 64; - /// new - static NSException new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSException, _sel_new); - return NSException.castFromPointer(_ret, retain: false, release: true); - } +const int betaStage8 = 96; - /// allocWithZone: - static NSException allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSException, _sel_allocWithZone_, zone); - return NSException.castFromPointer(_ret, retain: false, release: true); - } +const int finalStage8 = 128; - /// alloc - static NSException alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSException, _sel_alloc); - return NSException.castFromPointer(_ret, retain: false, release: true); - } +const int NSScannedOption8 = 1; - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1(_class_NSException, _sel_supportsSecureCoding); - } +const int NSCollectorDisabledOption8 = 2; - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } +const int NSASCIIStringEncoding1 = 1; - /// initWithCoder: - NSException? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSException.castFromPointer(_ret, retain: false, release: true); - } -} +const int NSNEXTSTEPStringEncoding1 = 2; -late final _class_NSException = objc.getClass("NSException"); -late final _sel_exceptionWithName_reason_userInfo_ = - objc.registerName("exceptionWithName:reason:userInfo:"); -late final _sel_initWithName_reason_userInfo_ = - objc.registerName("initWithName:reason:userInfo:"); -late final _sel_reason = objc.registerName("reason"); -late final _sel_callStackReturnAddresses = - objc.registerName("callStackReturnAddresses"); -late final _sel_callStackSymbols = objc.registerName("callStackSymbols"); -late final _sel_raise = objc.registerName("raise"); -late final _sel_raise_format_ = objc.registerName("raise:format:"); -typedef NSUncaughtExceptionHandler = ffi - .NativeFunction exception)>; -typedef NSErrorDomain = ffi.Pointer; -typedef DartNSErrorDomain = objc.NSString; -typedef NSErrorUserInfoKey = ffi.Pointer; -typedef DartNSErrorUserInfoKey = objc.NSString; -typedef _DidFinish = ffi.Pointer; -typedef Dart_DidFinish = objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)>; -typedef _DidFinishWithLock = ffi.Pointer; -typedef Dart_DidFinishWithLock = objc.ObjCBlock< - ffi.Void Function( - NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>; -void - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} +const int NSJapaneseEUCStringEncoding1 = 3; + +const int NSUTF8StringEncoding1 = 4; + +const int NSISOLatin1StringEncoding1 = 5; + +const int NSSymbolStringEncoding1 = 6; + +const int NSNonLossyASCIIStringEncoding1 = 7; + +const int NSShiftJISStringEncoding1 = 8; + +const int NSISOLatin2StringEncoding1 = 9; + +const int NSUnicodeStringEncoding1 = 10; + +const int NSWindowsCP1251StringEncoding1 = 11; + +const int NSWindowsCP1252StringEncoding1 = 12; + +const int NSWindowsCP1253StringEncoding1 = 13; + +const int NSWindowsCP1254StringEncoding1 = 14; -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline) - ..keepIsolateAlive = false; +const int NSWindowsCP1250StringEncoding1 = 15; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - NSCondition, - NSURLSession, - NSURLSessionDownloadTask, - objc.NSURL)>(pointer, retain: retain, release: release); +const int NSISO2022JPStringEncoding1 = 21; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(NSCondition, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); +const int NSMacOSRomanStringEncoding1 = 30; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction(void Function(NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - NSCondition.castFromPointer(arg0, retain: true, release: true), - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), - objc.NSURL.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); +const int NSUTF16StringEncoding1 = 10; - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(NSCondition, NSURLSession, NSURLSessionDownloadTask, - objc.NSURL)> listener( - void Function( - NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - NSCondition.castFromPointer(arg0, retain: false, release: true), - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, - retain: false, release: true), - objc.NSURL - .castFromPointer(arg3, retain: false, release: true))); - final wrapper = _wrapListenerBlock_19b8ge5(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(NSCondition, NSURLSession, NSURLSessionDownloadTask, - objc.NSURL)>(wrapper, retain: false, release: true); - } -} +const int NSUTF16BigEndianStringEncoding1 = 2415919360; -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> { - void call(NSCondition arg0, NSURLSession arg1, NSURLSessionDownloadTask arg2, - objc.NSURL arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, - arg0.ref.pointer, - arg1.ref.pointer, - arg2.ref.pointer, - arg3.ref.pointer); -} +const int NSUTF16LittleEndianStringEncoding1 = 2483028224; -/// NSCondition -class NSCondition extends objc.NSObject { - NSCondition._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); +const int NSUTF32StringEncoding1 = 2348810496; - /// Constructs a [NSCondition] that points to the same underlying object as [other]. - NSCondition.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); +const int NSUTF32BigEndianStringEncoding1 = 2550137088; - /// Constructs a [NSCondition] that wraps the given raw object pointer. - NSCondition.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); +const int NSUTF32LittleEndianStringEncoding1 = 2617245952; - /// Returns whether [obj] is an instance of [NSCondition]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSCondition); - } +const int NSProprietaryStringEncoding1 = 65536; - /// wait - void wait1() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_wait); - } +const int DISPATCH_WALLTIME_NOW1 = -2; - /// waitUntilDate: - bool waitUntilDate_(objc.NSDate limit) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_waitUntilDate_, limit.ref.pointer); - } +const int noErr9 = 0; - /// signal - void signal() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_signal); - } +const int kNilOptions9 = 0; - /// broadcast - void broadcast() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_broadcast); - } +const int kVariableLengthArray9 = 1; - /// name - objc.NSString? get name { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } +const int kUnknownType9 = 1061109567; - /// setName: - set name(objc.NSString? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); - } +const int normal9 = 0; - /// init - NSCondition init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSCondition.castFromPointer(_ret, retain: false, release: true); - } +const int bold9 = 1; - /// new - static NSCondition new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSCondition, _sel_new); - return NSCondition.castFromPointer(_ret, retain: false, release: true); - } +const int italic9 = 2; - /// allocWithZone: - static NSCondition allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSCondition, _sel_allocWithZone_, zone); - return NSCondition.castFromPointer(_ret, retain: false, release: true); - } +const int underline9 = 4; - /// alloc - static NSCondition alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSCondition, _sel_alloc); - return NSCondition.castFromPointer(_ret, retain: false, release: true); - } +const int outline9 = 8; - /// lock - void lock() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_lock); - } +const int shadow9 = 16; - /// unlock - void unlock() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_unlock); - } -} +const int condense9 = 32; -late final _class_NSCondition = objc.getClass("NSCondition"); -late final _sel_wait = objc.registerName("wait"); -late final _sel_waitUntilDate_ = objc.registerName("waitUntilDate:"); -final _objc_msgSend_l8lotg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_signal = objc.registerName("signal"); -late final _sel_broadcast = objc.registerName("broadcast"); +const int extend9 = 64; -const int noErr = 0; +const int developStage9 = 32; -const int kNilOptions = 0; +const int alphaStage9 = 64; -const int kVariableLengthArray = 1; +const int betaStage9 = 96; -const int kUnknownType = 1061109567; +const int finalStage9 = 128; -const int normal = 0; +const int NSScannedOption9 = 1; -const int bold = 1; +const int NSCollectorDisabledOption9 = 2; -const int italic = 2; +const int noErr10 = 0; -const int underline = 4; +const int kNilOptions10 = 0; -const int outline = 8; +const int kVariableLengthArray10 = 1; -const int shadow = 16; +const int kUnknownType10 = 1061109567; -const int condense = 32; +const int normal10 = 0; -const int extend = 64; +const int bold10 = 1; -const int developStage = 32; +const int italic10 = 2; -const int alphaStage = 64; +const int underline10 = 4; -const int betaStage = 96; +const int outline10 = 8; -const int finalStage = 128; +const int shadow10 = 16; -const int NSScannedOption = 1; +const int condense10 = 32; -const int NSCollectorDisabledOption = 2; +const int extend10 = 64; -const int errSecSuccess = 0; +const int developStage10 = 32; -const int errSecUnimplemented = -4; +const int alphaStage10 = 64; -const int errSecDiskFull = -34; +const int betaStage10 = 96; -const int errSecDskFull = -34; +const int finalStage10 = 128; -const int errSecIO = -36; +const int NSScannedOption10 = 1; -const int errSecOpWr = -49; +const int NSCollectorDisabledOption10 = 2; -const int errSecParam = -50; +const int noErr11 = 0; -const int errSecWrPerm = -61; +const int kNilOptions11 = 0; -const int errSecAllocate = -108; +const int kVariableLengthArray11 = 1; -const int errSecUserCanceled = -128; +const int kUnknownType11 = 1061109567; -const int errSecBadReq = -909; +const int normal11 = 0; -const int errSecInternalComponent = -2070; +const int bold11 = 1; -const int errSecCoreFoundationUnknown = -4960; +const int italic11 = 2; -const int errSecMissingEntitlement = -34018; +const int underline11 = 4; -const int errSecRestrictedAPI = -34020; +const int outline11 = 8; -const int errSecNotAvailable = -25291; +const int shadow11 = 16; -const int errSecReadOnly = -25292; +const int condense11 = 32; -const int errSecAuthFailed = -25293; +const int extend11 = 64; -const int errSecNoSuchKeychain = -25294; +const int developStage11 = 32; -const int errSecInvalidKeychain = -25295; +const int alphaStage11 = 64; -const int errSecDuplicateKeychain = -25296; +const int betaStage11 = 96; -const int errSecDuplicateCallback = -25297; +const int finalStage11 = 128; -const int errSecInvalidCallback = -25298; +const int NSScannedOption11 = 1; -const int errSecDuplicateItem = -25299; +const int NSCollectorDisabledOption11 = 2; -const int errSecItemNotFound = -25300; +const int NSASCIIStringEncoding2 = 1; -const int errSecBufferTooSmall = -25301; +const int NSNEXTSTEPStringEncoding2 = 2; -const int errSecDataTooLarge = -25302; +const int NSJapaneseEUCStringEncoding2 = 3; -const int errSecNoSuchAttr = -25303; +const int NSUTF8StringEncoding2 = 4; -const int errSecInvalidItemRef = -25304; +const int NSISOLatin1StringEncoding2 = 5; -const int errSecInvalidSearchRef = -25305; +const int NSSymbolStringEncoding2 = 6; -const int errSecNoSuchClass = -25306; +const int NSNonLossyASCIIStringEncoding2 = 7; -const int errSecNoDefaultKeychain = -25307; +const int NSShiftJISStringEncoding2 = 8; -const int errSecInteractionNotAllowed = -25308; +const int NSISOLatin2StringEncoding2 = 9; -const int errSecReadOnlyAttr = -25309; +const int NSUnicodeStringEncoding2 = 10; -const int errSecWrongSecVersion = -25310; +const int NSWindowsCP1251StringEncoding2 = 11; -const int errSecKeySizeNotAllowed = -25311; +const int NSWindowsCP1252StringEncoding2 = 12; -const int errSecNoStorageModule = -25312; +const int NSWindowsCP1253StringEncoding2 = 13; -const int errSecNoCertificateModule = -25313; +const int NSWindowsCP1254StringEncoding2 = 14; -const int errSecNoPolicyModule = -25314; +const int NSWindowsCP1250StringEncoding2 = 15; -const int errSecInteractionRequired = -25315; +const int NSISO2022JPStringEncoding2 = 21; -const int errSecDataNotAvailable = -25316; +const int NSMacOSRomanStringEncoding2 = 30; -const int errSecDataNotModifiable = -25317; +const int NSUTF16StringEncoding2 = 10; -const int errSecCreateChainFailed = -25318; +const int NSUTF16BigEndianStringEncoding2 = 2415919360; -const int errSecInvalidPrefsDomain = -25319; +const int NSUTF16LittleEndianStringEncoding2 = 2483028224; -const int errSecInDarkWake = -25320; +const int NSUTF32StringEncoding2 = 2348810496; -const int errSecACLNotSimple = -25240; +const int NSUTF32BigEndianStringEncoding2 = 2550137088; -const int errSecPolicyNotFound = -25241; +const int NSUTF32LittleEndianStringEncoding2 = 2617245952; -const int errSecInvalidTrustSetting = -25242; +const int NSProprietaryStringEncoding2 = 65536; -const int errSecNoAccessForItem = -25243; +const int NSOpenStepUnicodeReservedBase1 = 62464; -const int errSecInvalidOwnerEdit = -25244; +const int errSecSuccess1 = 0; -const int errSecTrustNotAvailable = -25245; +const int errSecUnimplemented1 = -4; -const int errSecUnsupportedFormat = -25256; +const int errSecDiskFull1 = -34; -const int errSecUnknownFormat = -25257; +const int errSecDskFull1 = -34; -const int errSecKeyIsSensitive = -25258; +const int errSecIO1 = -36; -const int errSecMultiplePrivKeys = -25259; +const int errSecOpWr1 = -49; -const int errSecPassphraseRequired = -25260; +const int errSecParam1 = -50; -const int errSecInvalidPasswordRef = -25261; +const int errSecWrPerm1 = -61; -const int errSecInvalidTrustSettings = -25262; +const int errSecAllocate1 = -108; -const int errSecNoTrustSettings = -25263; +const int errSecUserCanceled1 = -128; -const int errSecPkcs12VerifyFailure = -25264; +const int errSecBadReq1 = -909; -const int errSecNotSigner = -26267; +const int errSecInternalComponent1 = -2070; -const int errSecDecode = -26275; +const int errSecCoreFoundationUnknown1 = -4960; -const int errSecServiceNotAvailable = -67585; +const int errSecMissingEntitlement1 = -34018; -const int errSecInsufficientClientID = -67586; +const int errSecRestrictedAPI1 = -34020; -const int errSecDeviceReset = -67587; +const int errSecNotAvailable1 = -25291; -const int errSecDeviceFailed = -67588; +const int errSecReadOnly1 = -25292; -const int errSecAppleAddAppACLSubject = -67589; +const int errSecAuthFailed1 = -25293; -const int errSecApplePublicKeyIncomplete = -67590; +const int errSecNoSuchKeychain1 = -25294; -const int errSecAppleSignatureMismatch = -67591; +const int errSecInvalidKeychain1 = -25295; -const int errSecAppleInvalidKeyStartDate = -67592; +const int errSecDuplicateKeychain1 = -25296; -const int errSecAppleInvalidKeyEndDate = -67593; +const int errSecDuplicateCallback1 = -25297; -const int errSecConversionError = -67594; +const int errSecInvalidCallback1 = -25298; -const int errSecAppleSSLv2Rollback = -67595; +const int errSecDuplicateItem1 = -25299; -const int errSecQuotaExceeded = -67596; +const int errSecItemNotFound1 = -25300; -const int errSecFileTooBig = -67597; +const int errSecBufferTooSmall1 = -25301; -const int errSecInvalidDatabaseBlob = -67598; +const int errSecDataTooLarge1 = -25302; -const int errSecInvalidKeyBlob = -67599; +const int errSecNoSuchAttr1 = -25303; -const int errSecIncompatibleDatabaseBlob = -67600; +const int errSecInvalidItemRef1 = -25304; -const int errSecIncompatibleKeyBlob = -67601; +const int errSecInvalidSearchRef1 = -25305; -const int errSecHostNameMismatch = -67602; +const int errSecNoSuchClass1 = -25306; -const int errSecUnknownCriticalExtensionFlag = -67603; +const int errSecNoDefaultKeychain1 = -25307; -const int errSecNoBasicConstraints = -67604; +const int errSecInteractionNotAllowed1 = -25308; -const int errSecNoBasicConstraintsCA = -67605; +const int errSecReadOnlyAttr1 = -25309; -const int errSecInvalidAuthorityKeyID = -67606; +const int errSecWrongSecVersion1 = -25310; -const int errSecInvalidSubjectKeyID = -67607; +const int errSecKeySizeNotAllowed1 = -25311; -const int errSecInvalidKeyUsageForPolicy = -67608; +const int errSecNoStorageModule1 = -25312; -const int errSecInvalidExtendedKeyUsage = -67609; +const int errSecNoCertificateModule1 = -25313; -const int errSecInvalidIDLinkage = -67610; +const int errSecNoPolicyModule1 = -25314; -const int errSecPathLengthConstraintExceeded = -67611; +const int errSecInteractionRequired1 = -25315; -const int errSecInvalidRoot = -67612; +const int errSecDataNotAvailable1 = -25316; -const int errSecCRLExpired = -67613; +const int errSecDataNotModifiable1 = -25317; -const int errSecCRLNotValidYet = -67614; +const int errSecCreateChainFailed1 = -25318; -const int errSecCRLNotFound = -67615; +const int errSecInvalidPrefsDomain1 = -25319; -const int errSecCRLServerDown = -67616; +const int errSecInDarkWake1 = -25320; -const int errSecCRLBadURI = -67617; +const int errSecACLNotSimple1 = -25240; -const int errSecUnknownCertExtension = -67618; +const int errSecPolicyNotFound1 = -25241; -const int errSecUnknownCRLExtension = -67619; +const int errSecInvalidTrustSetting1 = -25242; -const int errSecCRLNotTrusted = -67620; +const int errSecNoAccessForItem1 = -25243; -const int errSecCRLPolicyFailed = -67621; +const int errSecInvalidOwnerEdit1 = -25244; -const int errSecIDPFailure = -67622; +const int errSecTrustNotAvailable1 = -25245; -const int errSecSMIMEEmailAddressesNotFound = -67623; +const int errSecUnsupportedFormat1 = -25256; -const int errSecSMIMEBadExtendedKeyUsage = -67624; +const int errSecUnknownFormat1 = -25257; -const int errSecSMIMEBadKeyUsage = -67625; +const int errSecKeyIsSensitive1 = -25258; -const int errSecSMIMEKeyUsageNotCritical = -67626; +const int errSecMultiplePrivKeys1 = -25259; -const int errSecSMIMENoEmailAddress = -67627; +const int errSecPassphraseRequired1 = -25260; -const int errSecSMIMESubjAltNameNotCritical = -67628; +const int errSecInvalidPasswordRef1 = -25261; -const int errSecSSLBadExtendedKeyUsage = -67629; +const int errSecInvalidTrustSettings1 = -25262; -const int errSecOCSPBadResponse = -67630; +const int errSecNoTrustSettings1 = -25263; -const int errSecOCSPBadRequest = -67631; +const int errSecPkcs12VerifyFailure1 = -25264; -const int errSecOCSPUnavailable = -67632; +const int errSecNotSigner1 = -26267; -const int errSecOCSPStatusUnrecognized = -67633; +const int errSecDecode1 = -26275; -const int errSecEndOfData = -67634; +const int errSecServiceNotAvailable1 = -67585; -const int errSecIncompleteCertRevocationCheck = -67635; +const int errSecInsufficientClientID1 = -67586; -const int errSecNetworkFailure = -67636; +const int errSecDeviceReset1 = -67587; -const int errSecOCSPNotTrustedToAnchor = -67637; +const int errSecDeviceFailed1 = -67588; -const int errSecRecordModified = -67638; +const int errSecAppleAddAppACLSubject1 = -67589; -const int errSecOCSPSignatureError = -67639; +const int errSecApplePublicKeyIncomplete1 = -67590; -const int errSecOCSPNoSigner = -67640; +const int errSecAppleSignatureMismatch1 = -67591; -const int errSecOCSPResponderMalformedReq = -67641; +const int errSecAppleInvalidKeyStartDate1 = -67592; -const int errSecOCSPResponderInternalError = -67642; +const int errSecAppleInvalidKeyEndDate1 = -67593; -const int errSecOCSPResponderTryLater = -67643; +const int errSecConversionError1 = -67594; -const int errSecOCSPResponderSignatureRequired = -67644; +const int errSecAppleSSLv2Rollback1 = -67595; -const int errSecOCSPResponderUnauthorized = -67645; +const int errSecQuotaExceeded1 = -67596; -const int errSecOCSPResponseNonceMismatch = -67646; +const int errSecFileTooBig1 = -67597; -const int errSecCodeSigningBadCertChainLength = -67647; +const int errSecInvalidDatabaseBlob1 = -67598; -const int errSecCodeSigningNoBasicConstraints = -67648; +const int errSecInvalidKeyBlob1 = -67599; -const int errSecCodeSigningBadPathLengthConstraint = -67649; +const int errSecIncompatibleDatabaseBlob1 = -67600; -const int errSecCodeSigningNoExtendedKeyUsage = -67650; +const int errSecIncompatibleKeyBlob1 = -67601; -const int errSecCodeSigningDevelopment = -67651; +const int errSecHostNameMismatch1 = -67602; -const int errSecResourceSignBadCertChainLength = -67652; +const int errSecUnknownCriticalExtensionFlag1 = -67603; -const int errSecResourceSignBadExtKeyUsage = -67653; +const int errSecNoBasicConstraints1 = -67604; -const int errSecTrustSettingDeny = -67654; +const int errSecNoBasicConstraintsCA1 = -67605; -const int errSecInvalidSubjectName = -67655; +const int errSecInvalidAuthorityKeyID1 = -67606; -const int errSecUnknownQualifiedCertStatement = -67656; +const int errSecInvalidSubjectKeyID1 = -67607; -const int errSecMobileMeRequestQueued = -67657; +const int errSecInvalidKeyUsageForPolicy1 = -67608; -const int errSecMobileMeRequestRedirected = -67658; +const int errSecInvalidExtendedKeyUsage1 = -67609; -const int errSecMobileMeServerError = -67659; +const int errSecInvalidIDLinkage1 = -67610; -const int errSecMobileMeServerNotAvailable = -67660; +const int errSecPathLengthConstraintExceeded1 = -67611; -const int errSecMobileMeServerAlreadyExists = -67661; +const int errSecInvalidRoot1 = -67612; -const int errSecMobileMeServerServiceErr = -67662; +const int errSecCRLExpired1 = -67613; -const int errSecMobileMeRequestAlreadyPending = -67663; +const int errSecCRLNotValidYet1 = -67614; -const int errSecMobileMeNoRequestPending = -67664; +const int errSecCRLNotFound1 = -67615; -const int errSecMobileMeCSRVerifyFailure = -67665; +const int errSecCRLServerDown1 = -67616; -const int errSecMobileMeFailedConsistencyCheck = -67666; +const int errSecCRLBadURI1 = -67617; -const int errSecNotInitialized = -67667; +const int errSecUnknownCertExtension1 = -67618; -const int errSecInvalidHandleUsage = -67668; +const int errSecUnknownCRLExtension1 = -67619; -const int errSecPVCReferentNotFound = -67669; +const int errSecCRLNotTrusted1 = -67620; -const int errSecFunctionIntegrityFail = -67670; +const int errSecCRLPolicyFailed1 = -67621; -const int errSecInternalError = -67671; +const int errSecIDPFailure1 = -67622; -const int errSecMemoryError = -67672; +const int errSecSMIMEEmailAddressesNotFound1 = -67623; -const int errSecInvalidData = -67673; +const int errSecSMIMEBadExtendedKeyUsage1 = -67624; -const int errSecMDSError = -67674; +const int errSecSMIMEBadKeyUsage1 = -67625; -const int errSecInvalidPointer = -67675; +const int errSecSMIMEKeyUsageNotCritical1 = -67626; -const int errSecSelfCheckFailed = -67676; +const int errSecSMIMENoEmailAddress1 = -67627; -const int errSecFunctionFailed = -67677; +const int errSecSMIMESubjAltNameNotCritical1 = -67628; -const int errSecModuleManifestVerifyFailed = -67678; +const int errSecSSLBadExtendedKeyUsage1 = -67629; -const int errSecInvalidGUID = -67679; +const int errSecOCSPBadResponse1 = -67630; -const int errSecInvalidHandle = -67680; +const int errSecOCSPBadRequest1 = -67631; -const int errSecInvalidDBList = -67681; +const int errSecOCSPUnavailable1 = -67632; -const int errSecInvalidPassthroughID = -67682; +const int errSecOCSPStatusUnrecognized1 = -67633; -const int errSecInvalidNetworkAddress = -67683; +const int errSecEndOfData1 = -67634; -const int errSecCRLAlreadySigned = -67684; +const int errSecIncompleteCertRevocationCheck1 = -67635; -const int errSecInvalidNumberOfFields = -67685; +const int errSecNetworkFailure1 = -67636; -const int errSecVerificationFailure = -67686; +const int errSecOCSPNotTrustedToAnchor1 = -67637; -const int errSecUnknownTag = -67687; +const int errSecRecordModified1 = -67638; -const int errSecInvalidSignature = -67688; +const int errSecOCSPSignatureError1 = -67639; -const int errSecInvalidName = -67689; +const int errSecOCSPNoSigner1 = -67640; -const int errSecInvalidCertificateRef = -67690; +const int errSecOCSPResponderMalformedReq1 = -67641; -const int errSecInvalidCertificateGroup = -67691; +const int errSecOCSPResponderInternalError1 = -67642; -const int errSecTagNotFound = -67692; +const int errSecOCSPResponderTryLater1 = -67643; -const int errSecInvalidQuery = -67693; +const int errSecOCSPResponderSignatureRequired1 = -67644; -const int errSecInvalidValue = -67694; +const int errSecOCSPResponderUnauthorized1 = -67645; -const int errSecCallbackFailed = -67695; +const int errSecOCSPResponseNonceMismatch1 = -67646; -const int errSecACLDeleteFailed = -67696; +const int errSecCodeSigningBadCertChainLength1 = -67647; -const int errSecACLReplaceFailed = -67697; +const int errSecCodeSigningNoBasicConstraints1 = -67648; -const int errSecACLAddFailed = -67698; +const int errSecCodeSigningBadPathLengthConstraint1 = -67649; -const int errSecACLChangeFailed = -67699; +const int errSecCodeSigningNoExtendedKeyUsage1 = -67650; -const int errSecInvalidAccessCredentials = -67700; +const int errSecCodeSigningDevelopment1 = -67651; -const int errSecInvalidRecord = -67701; +const int errSecResourceSignBadCertChainLength1 = -67652; -const int errSecInvalidACL = -67702; +const int errSecResourceSignBadExtKeyUsage1 = -67653; -const int errSecInvalidSampleValue = -67703; +const int errSecTrustSettingDeny1 = -67654; -const int errSecIncompatibleVersion = -67704; +const int errSecInvalidSubjectName1 = -67655; -const int errSecPrivilegeNotGranted = -67705; +const int errSecUnknownQualifiedCertStatement1 = -67656; -const int errSecInvalidScope = -67706; +const int errSecMobileMeRequestQueued1 = -67657; -const int errSecPVCAlreadyConfigured = -67707; +const int errSecMobileMeRequestRedirected1 = -67658; -const int errSecInvalidPVC = -67708; +const int errSecMobileMeServerError1 = -67659; -const int errSecEMMLoadFailed = -67709; +const int errSecMobileMeServerNotAvailable1 = -67660; -const int errSecEMMUnloadFailed = -67710; +const int errSecMobileMeServerAlreadyExists1 = -67661; -const int errSecAddinLoadFailed = -67711; +const int errSecMobileMeServerServiceErr1 = -67662; -const int errSecInvalidKeyRef = -67712; +const int errSecMobileMeRequestAlreadyPending1 = -67663; -const int errSecInvalidKeyHierarchy = -67713; +const int errSecMobileMeNoRequestPending1 = -67664; -const int errSecAddinUnloadFailed = -67714; +const int errSecMobileMeCSRVerifyFailure1 = -67665; -const int errSecLibraryReferenceNotFound = -67715; +const int errSecMobileMeFailedConsistencyCheck1 = -67666; -const int errSecInvalidAddinFunctionTable = -67716; +const int errSecNotInitialized1 = -67667; -const int errSecInvalidServiceMask = -67717; +const int errSecInvalidHandleUsage1 = -67668; -const int errSecModuleNotLoaded = -67718; +const int errSecPVCReferentNotFound1 = -67669; -const int errSecInvalidSubServiceID = -67719; +const int errSecFunctionIntegrityFail1 = -67670; -const int errSecAttributeNotInContext = -67720; +const int errSecInternalError1 = -67671; -const int errSecModuleManagerInitializeFailed = -67721; +const int errSecMemoryError1 = -67672; -const int errSecModuleManagerNotFound = -67722; +const int errSecInvalidData1 = -67673; -const int errSecEventNotificationCallbackNotFound = -67723; +const int errSecMDSError1 = -67674; -const int errSecInputLengthError = -67724; +const int errSecInvalidPointer1 = -67675; -const int errSecOutputLengthError = -67725; +const int errSecSelfCheckFailed1 = -67676; -const int errSecPrivilegeNotSupported = -67726; +const int errSecFunctionFailed1 = -67677; -const int errSecDeviceError = -67727; +const int errSecModuleManifestVerifyFailed1 = -67678; -const int errSecAttachHandleBusy = -67728; +const int errSecInvalidGUID1 = -67679; -const int errSecNotLoggedIn = -67729; +const int errSecInvalidHandle1 = -67680; -const int errSecAlgorithmMismatch = -67730; +const int errSecInvalidDBList1 = -67681; -const int errSecKeyUsageIncorrect = -67731; +const int errSecInvalidPassthroughID1 = -67682; -const int errSecKeyBlobTypeIncorrect = -67732; +const int errSecInvalidNetworkAddress1 = -67683; -const int errSecKeyHeaderInconsistent = -67733; +const int errSecCRLAlreadySigned1 = -67684; -const int errSecUnsupportedKeyFormat = -67734; +const int errSecInvalidNumberOfFields1 = -67685; -const int errSecUnsupportedKeySize = -67735; +const int errSecVerificationFailure1 = -67686; -const int errSecInvalidKeyUsageMask = -67736; +const int errSecUnknownTag1 = -67687; -const int errSecUnsupportedKeyUsageMask = -67737; +const int errSecInvalidSignature1 = -67688; -const int errSecInvalidKeyAttributeMask = -67738; +const int errSecInvalidName1 = -67689; -const int errSecUnsupportedKeyAttributeMask = -67739; +const int errSecInvalidCertificateRef1 = -67690; -const int errSecInvalidKeyLabel = -67740; +const int errSecInvalidCertificateGroup1 = -67691; -const int errSecUnsupportedKeyLabel = -67741; +const int errSecTagNotFound1 = -67692; -const int errSecInvalidKeyFormat = -67742; +const int errSecInvalidQuery1 = -67693; -const int errSecUnsupportedVectorOfBuffers = -67743; +const int errSecInvalidValue1 = -67694; -const int errSecInvalidInputVector = -67744; +const int errSecCallbackFailed1 = -67695; -const int errSecInvalidOutputVector = -67745; +const int errSecACLDeleteFailed1 = -67696; -const int errSecInvalidContext = -67746; +const int errSecACLReplaceFailed1 = -67697; -const int errSecInvalidAlgorithm = -67747; +const int errSecACLAddFailed1 = -67698; -const int errSecInvalidAttributeKey = -67748; +const int errSecACLChangeFailed1 = -67699; -const int errSecMissingAttributeKey = -67749; +const int errSecInvalidAccessCredentials1 = -67700; -const int errSecInvalidAttributeInitVector = -67750; +const int errSecInvalidRecord1 = -67701; -const int errSecMissingAttributeInitVector = -67751; +const int errSecInvalidACL1 = -67702; -const int errSecInvalidAttributeSalt = -67752; +const int errSecInvalidSampleValue1 = -67703; -const int errSecMissingAttributeSalt = -67753; +const int errSecIncompatibleVersion1 = -67704; -const int errSecInvalidAttributePadding = -67754; +const int errSecPrivilegeNotGranted1 = -67705; -const int errSecMissingAttributePadding = -67755; +const int errSecInvalidScope1 = -67706; -const int errSecInvalidAttributeRandom = -67756; +const int errSecPVCAlreadyConfigured1 = -67707; -const int errSecMissingAttributeRandom = -67757; +const int errSecInvalidPVC1 = -67708; -const int errSecInvalidAttributeSeed = -67758; +const int errSecEMMLoadFailed1 = -67709; -const int errSecMissingAttributeSeed = -67759; +const int errSecEMMUnloadFailed1 = -67710; -const int errSecInvalidAttributePassphrase = -67760; +const int errSecAddinLoadFailed1 = -67711; -const int errSecMissingAttributePassphrase = -67761; +const int errSecInvalidKeyRef1 = -67712; -const int errSecInvalidAttributeKeyLength = -67762; +const int errSecInvalidKeyHierarchy1 = -67713; -const int errSecMissingAttributeKeyLength = -67763; +const int errSecAddinUnloadFailed1 = -67714; -const int errSecInvalidAttributeBlockSize = -67764; +const int errSecLibraryReferenceNotFound1 = -67715; -const int errSecMissingAttributeBlockSize = -67765; +const int errSecInvalidAddinFunctionTable1 = -67716; -const int errSecInvalidAttributeOutputSize = -67766; +const int errSecInvalidServiceMask1 = -67717; -const int errSecMissingAttributeOutputSize = -67767; +const int errSecModuleNotLoaded1 = -67718; -const int errSecInvalidAttributeRounds = -67768; +const int errSecInvalidSubServiceID1 = -67719; -const int errSecMissingAttributeRounds = -67769; +const int errSecAttributeNotInContext1 = -67720; -const int errSecInvalidAlgorithmParms = -67770; +const int errSecModuleManagerInitializeFailed1 = -67721; -const int errSecMissingAlgorithmParms = -67771; +const int errSecModuleManagerNotFound1 = -67722; -const int errSecInvalidAttributeLabel = -67772; +const int errSecEventNotificationCallbackNotFound1 = -67723; -const int errSecMissingAttributeLabel = -67773; +const int errSecInputLengthError1 = -67724; -const int errSecInvalidAttributeKeyType = -67774; +const int errSecOutputLengthError1 = -67725; -const int errSecMissingAttributeKeyType = -67775; +const int errSecPrivilegeNotSupported1 = -67726; -const int errSecInvalidAttributeMode = -67776; +const int errSecDeviceError1 = -67727; -const int errSecMissingAttributeMode = -67777; +const int errSecAttachHandleBusy1 = -67728; -const int errSecInvalidAttributeEffectiveBits = -67778; +const int errSecNotLoggedIn1 = -67729; -const int errSecMissingAttributeEffectiveBits = -67779; +const int errSecAlgorithmMismatch1 = -67730; -const int errSecInvalidAttributeStartDate = -67780; +const int errSecKeyUsageIncorrect1 = -67731; -const int errSecMissingAttributeStartDate = -67781; +const int errSecKeyBlobTypeIncorrect1 = -67732; -const int errSecInvalidAttributeEndDate = -67782; +const int errSecKeyHeaderInconsistent1 = -67733; -const int errSecMissingAttributeEndDate = -67783; +const int errSecUnsupportedKeyFormat1 = -67734; -const int errSecInvalidAttributeVersion = -67784; +const int errSecUnsupportedKeySize1 = -67735; -const int errSecMissingAttributeVersion = -67785; +const int errSecInvalidKeyUsageMask1 = -67736; -const int errSecInvalidAttributePrime = -67786; +const int errSecUnsupportedKeyUsageMask1 = -67737; -const int errSecMissingAttributePrime = -67787; +const int errSecInvalidKeyAttributeMask1 = -67738; -const int errSecInvalidAttributeBase = -67788; +const int errSecUnsupportedKeyAttributeMask1 = -67739; -const int errSecMissingAttributeBase = -67789; +const int errSecInvalidKeyLabel1 = -67740; -const int errSecInvalidAttributeSubprime = -67790; +const int errSecUnsupportedKeyLabel1 = -67741; -const int errSecMissingAttributeSubprime = -67791; +const int errSecInvalidKeyFormat1 = -67742; -const int errSecInvalidAttributeIterationCount = -67792; +const int errSecUnsupportedVectorOfBuffers1 = -67743; -const int errSecMissingAttributeIterationCount = -67793; +const int errSecInvalidInputVector1 = -67744; -const int errSecInvalidAttributeDLDBHandle = -67794; +const int errSecInvalidOutputVector1 = -67745; -const int errSecMissingAttributeDLDBHandle = -67795; +const int errSecInvalidContext1 = -67746; -const int errSecInvalidAttributeAccessCredentials = -67796; +const int errSecInvalidAlgorithm1 = -67747; -const int errSecMissingAttributeAccessCredentials = -67797; +const int errSecInvalidAttributeKey1 = -67748; -const int errSecInvalidAttributePublicKeyFormat = -67798; +const int errSecMissingAttributeKey1 = -67749; -const int errSecMissingAttributePublicKeyFormat = -67799; +const int errSecInvalidAttributeInitVector1 = -67750; -const int errSecInvalidAttributePrivateKeyFormat = -67800; +const int errSecMissingAttributeInitVector1 = -67751; -const int errSecMissingAttributePrivateKeyFormat = -67801; +const int errSecInvalidAttributeSalt1 = -67752; -const int errSecInvalidAttributeSymmetricKeyFormat = -67802; +const int errSecMissingAttributeSalt1 = -67753; -const int errSecMissingAttributeSymmetricKeyFormat = -67803; +const int errSecInvalidAttributePadding1 = -67754; -const int errSecInvalidAttributeWrappedKeyFormat = -67804; +const int errSecMissingAttributePadding1 = -67755; -const int errSecMissingAttributeWrappedKeyFormat = -67805; +const int errSecInvalidAttributeRandom1 = -67756; -const int errSecStagedOperationInProgress = -67806; +const int errSecMissingAttributeRandom1 = -67757; -const int errSecStagedOperationNotStarted = -67807; +const int errSecInvalidAttributeSeed1 = -67758; -const int errSecVerifyFailed = -67808; +const int errSecMissingAttributeSeed1 = -67759; + +const int errSecInvalidAttributePassphrase1 = -67760; + +const int errSecMissingAttributePassphrase1 = -67761; + +const int errSecInvalidAttributeKeyLength1 = -67762; + +const int errSecMissingAttributeKeyLength1 = -67763; + +const int errSecInvalidAttributeBlockSize1 = -67764; + +const int errSecMissingAttributeBlockSize1 = -67765; + +const int errSecInvalidAttributeOutputSize1 = -67766; + +const int errSecMissingAttributeOutputSize1 = -67767; + +const int errSecInvalidAttributeRounds1 = -67768; + +const int errSecMissingAttributeRounds1 = -67769; + +const int errSecInvalidAlgorithmParms1 = -67770; + +const int errSecMissingAlgorithmParms1 = -67771; + +const int errSecInvalidAttributeLabel1 = -67772; + +const int errSecMissingAttributeLabel1 = -67773; + +const int errSecInvalidAttributeKeyType1 = -67774; + +const int errSecMissingAttributeKeyType1 = -67775; + +const int errSecInvalidAttributeMode1 = -67776; + +const int errSecMissingAttributeMode1 = -67777; + +const int errSecInvalidAttributeEffectiveBits1 = -67778; + +const int errSecMissingAttributeEffectiveBits1 = -67779; + +const int errSecInvalidAttributeStartDate1 = -67780; + +const int errSecMissingAttributeStartDate1 = -67781; + +const int errSecInvalidAttributeEndDate1 = -67782; + +const int errSecMissingAttributeEndDate1 = -67783; -const int errSecQuerySizeUnknown = -67809; +const int errSecInvalidAttributeVersion1 = -67784; -const int errSecBlockSizeMismatch = -67810; +const int errSecMissingAttributeVersion1 = -67785; -const int errSecPublicKeyInconsistent = -67811; +const int errSecInvalidAttributePrime1 = -67786; -const int errSecDeviceVerifyFailed = -67812; +const int errSecMissingAttributePrime1 = -67787; -const int errSecInvalidLoginName = -67813; +const int errSecInvalidAttributeBase1 = -67788; -const int errSecAlreadyLoggedIn = -67814; +const int errSecMissingAttributeBase1 = -67789; -const int errSecInvalidDigestAlgorithm = -67815; +const int errSecInvalidAttributeSubprime1 = -67790; -const int errSecInvalidCRLGroup = -67816; +const int errSecMissingAttributeSubprime1 = -67791; -const int errSecCertificateCannotOperate = -67817; +const int errSecInvalidAttributeIterationCount1 = -67792; -const int errSecCertificateExpired = -67818; +const int errSecMissingAttributeIterationCount1 = -67793; -const int errSecCertificateNotValidYet = -67819; +const int errSecInvalidAttributeDLDBHandle1 = -67794; -const int errSecCertificateRevoked = -67820; +const int errSecMissingAttributeDLDBHandle1 = -67795; -const int errSecCertificateSuspended = -67821; +const int errSecInvalidAttributeAccessCredentials1 = -67796; -const int errSecInsufficientCredentials = -67822; +const int errSecMissingAttributeAccessCredentials1 = -67797; -const int errSecInvalidAction = -67823; +const int errSecInvalidAttributePublicKeyFormat1 = -67798; -const int errSecInvalidAuthority = -67824; +const int errSecMissingAttributePublicKeyFormat1 = -67799; -const int errSecVerifyActionFailed = -67825; +const int errSecInvalidAttributePrivateKeyFormat1 = -67800; -const int errSecInvalidCertAuthority = -67826; +const int errSecMissingAttributePrivateKeyFormat1 = -67801; -const int errSecInvalidCRLAuthority = -67827; +const int errSecInvalidAttributeSymmetricKeyFormat1 = -67802; -const int errSecInvaldCRLAuthority = -67827; +const int errSecMissingAttributeSymmetricKeyFormat1 = -67803; -const int errSecInvalidCRLEncoding = -67828; +const int errSecInvalidAttributeWrappedKeyFormat1 = -67804; -const int errSecInvalidCRLType = -67829; +const int errSecMissingAttributeWrappedKeyFormat1 = -67805; -const int errSecInvalidCRL = -67830; +const int errSecStagedOperationInProgress1 = -67806; -const int errSecInvalidFormType = -67831; +const int errSecStagedOperationNotStarted1 = -67807; -const int errSecInvalidID = -67832; +const int errSecVerifyFailed1 = -67808; -const int errSecInvalidIdentifier = -67833; +const int errSecQuerySizeUnknown1 = -67809; -const int errSecInvalidIndex = -67834; +const int errSecBlockSizeMismatch1 = -67810; -const int errSecInvalidPolicyIdentifiers = -67835; +const int errSecPublicKeyInconsistent1 = -67811; -const int errSecInvalidTimeString = -67836; +const int errSecDeviceVerifyFailed1 = -67812; -const int errSecInvalidReason = -67837; +const int errSecInvalidLoginName1 = -67813; -const int errSecInvalidRequestInputs = -67838; +const int errSecAlreadyLoggedIn1 = -67814; -const int errSecInvalidResponseVector = -67839; +const int errSecInvalidDigestAlgorithm1 = -67815; -const int errSecInvalidStopOnPolicy = -67840; +const int errSecInvalidCRLGroup1 = -67816; -const int errSecInvalidTuple = -67841; +const int errSecCertificateCannotOperate1 = -67817; -const int errSecMultipleValuesUnsupported = -67842; +const int errSecCertificateExpired1 = -67818; -const int errSecNotTrusted = -67843; +const int errSecCertificateNotValidYet1 = -67819; -const int errSecNoDefaultAuthority = -67844; +const int errSecCertificateRevoked1 = -67820; -const int errSecRejectedForm = -67845; +const int errSecCertificateSuspended1 = -67821; -const int errSecRequestLost = -67846; +const int errSecInsufficientCredentials1 = -67822; -const int errSecRequestRejected = -67847; +const int errSecInvalidAction1 = -67823; -const int errSecUnsupportedAddressType = -67848; +const int errSecInvalidAuthority1 = -67824; -const int errSecUnsupportedService = -67849; +const int errSecVerifyActionFailed1 = -67825; -const int errSecInvalidTupleGroup = -67850; +const int errSecInvalidCertAuthority1 = -67826; -const int errSecInvalidBaseACLs = -67851; +const int errSecInvalidCRLAuthority1 = -67827; -const int errSecInvalidTupleCredentials = -67852; +const int errSecInvaldCRLAuthority1 = -67827; -const int errSecInvalidTupleCredendtials = -67852; +const int errSecInvalidCRLEncoding1 = -67828; -const int errSecInvalidEncoding = -67853; +const int errSecInvalidCRLType1 = -67829; -const int errSecInvalidValidityPeriod = -67854; +const int errSecInvalidCRL1 = -67830; -const int errSecInvalidRequestor = -67855; +const int errSecInvalidFormType1 = -67831; -const int errSecRequestDescriptor = -67856; +const int errSecInvalidID1 = -67832; -const int errSecInvalidBundleInfo = -67857; +const int errSecInvalidIdentifier1 = -67833; -const int errSecInvalidCRLIndex = -67858; +const int errSecInvalidIndex1 = -67834; -const int errSecNoFieldValues = -67859; +const int errSecInvalidPolicyIdentifiers1 = -67835; -const int errSecUnsupportedFieldFormat = -67860; +const int errSecInvalidTimeString1 = -67836; -const int errSecUnsupportedIndexInfo = -67861; +const int errSecInvalidReason1 = -67837; -const int errSecUnsupportedLocality = -67862; +const int errSecInvalidRequestInputs1 = -67838; -const int errSecUnsupportedNumAttributes = -67863; +const int errSecInvalidResponseVector1 = -67839; -const int errSecUnsupportedNumIndexes = -67864; +const int errSecInvalidStopOnPolicy1 = -67840; -const int errSecUnsupportedNumRecordTypes = -67865; +const int errSecInvalidTuple1 = -67841; -const int errSecFieldSpecifiedMultiple = -67866; +const int errSecMultipleValuesUnsupported1 = -67842; -const int errSecIncompatibleFieldFormat = -67867; +const int errSecNotTrusted1 = -67843; -const int errSecInvalidParsingModule = -67868; +const int errSecNoDefaultAuthority1 = -67844; -const int errSecDatabaseLocked = -67869; +const int errSecRejectedForm1 = -67845; -const int errSecDatastoreIsOpen = -67870; +const int errSecRequestLost1 = -67846; -const int errSecMissingValue = -67871; +const int errSecRequestRejected1 = -67847; -const int errSecUnsupportedQueryLimits = -67872; +const int errSecUnsupportedAddressType1 = -67848; -const int errSecUnsupportedNumSelectionPreds = -67873; +const int errSecUnsupportedService1 = -67849; -const int errSecUnsupportedOperator = -67874; +const int errSecInvalidTupleGroup1 = -67850; -const int errSecInvalidDBLocation = -67875; +const int errSecInvalidBaseACLs1 = -67851; -const int errSecInvalidAccessRequest = -67876; +const int errSecInvalidTupleCredentials1 = -67852; -const int errSecInvalidIndexInfo = -67877; +const int errSecInvalidTupleCredendtials1 = -67852; -const int errSecInvalidNewOwner = -67878; +const int errSecInvalidEncoding1 = -67853; -const int errSecInvalidModifyMode = -67879; +const int errSecInvalidValidityPeriod1 = -67854; -const int errSecMissingRequiredExtension = -67880; +const int errSecInvalidRequestor1 = -67855; -const int errSecExtendedKeyUsageNotCritical = -67881; +const int errSecRequestDescriptor1 = -67856; -const int errSecTimestampMissing = -67882; +const int errSecInvalidBundleInfo1 = -67857; -const int errSecTimestampInvalid = -67883; +const int errSecInvalidCRLIndex1 = -67858; -const int errSecTimestampNotTrusted = -67884; +const int errSecNoFieldValues1 = -67859; -const int errSecTimestampServiceNotAvailable = -67885; +const int errSecUnsupportedFieldFormat1 = -67860; -const int errSecTimestampBadAlg = -67886; +const int errSecUnsupportedIndexInfo1 = -67861; -const int errSecTimestampBadRequest = -67887; +const int errSecUnsupportedLocality1 = -67862; -const int errSecTimestampBadDataFormat = -67888; +const int errSecUnsupportedNumAttributes1 = -67863; -const int errSecTimestampTimeNotAvailable = -67889; +const int errSecUnsupportedNumIndexes1 = -67864; -const int errSecTimestampUnacceptedPolicy = -67890; +const int errSecUnsupportedNumRecordTypes1 = -67865; -const int errSecTimestampUnacceptedExtension = -67891; +const int errSecFieldSpecifiedMultiple1 = -67866; -const int errSecTimestampAddInfoNotAvailable = -67892; +const int errSecIncompatibleFieldFormat1 = -67867; -const int errSecTimestampSystemFailure = -67893; +const int errSecInvalidParsingModule1 = -67868; -const int errSecSigningTimeMissing = -67894; +const int errSecDatabaseLocked1 = -67869; -const int errSecTimestampRejection = -67895; +const int errSecDatastoreIsOpen1 = -67870; -const int errSecTimestampWaiting = -67896; +const int errSecMissingValue1 = -67871; -const int errSecTimestampRevocationWarning = -67897; +const int errSecUnsupportedQueryLimits1 = -67872; -const int errSecTimestampRevocationNotification = -67898; +const int errSecUnsupportedNumSelectionPreds1 = -67873; -const int errSecCertificatePolicyNotAllowed = -67899; +const int errSecUnsupportedOperator1 = -67874; -const int errSecCertificateNameNotAllowed = -67900; +const int errSecInvalidDBLocation1 = -67875; -const int errSecCertificateValidityPeriodTooLong = -67901; +const int errSecInvalidAccessRequest1 = -67876; -const int errSecCertificateIsCA = -67902; +const int errSecInvalidIndexInfo1 = -67877; -const int errSecCertificateDuplicateExtension = -67903; +const int errSecInvalidNewOwner1 = -67878; -const int errSSLProtocol = -9800; +const int errSecInvalidModifyMode1 = -67879; -const int errSSLNegotiation = -9801; +const int errSecMissingRequiredExtension1 = -67880; -const int errSSLFatalAlert = -9802; +const int errSecExtendedKeyUsageNotCritical1 = -67881; -const int errSSLWouldBlock = -9803; +const int errSecTimestampMissing1 = -67882; -const int errSSLSessionNotFound = -9804; +const int errSecTimestampInvalid1 = -67883; -const int errSSLClosedGraceful = -9805; +const int errSecTimestampNotTrusted1 = -67884; -const int errSSLClosedAbort = -9806; +const int errSecTimestampServiceNotAvailable1 = -67885; -const int errSSLXCertChainInvalid = -9807; +const int errSecTimestampBadAlg1 = -67886; -const int errSSLBadCert = -9808; +const int errSecTimestampBadRequest1 = -67887; -const int errSSLCrypto = -9809; +const int errSecTimestampBadDataFormat1 = -67888; -const int errSSLInternal = -9810; +const int errSecTimestampTimeNotAvailable1 = -67889; -const int errSSLModuleAttach = -9811; +const int errSecTimestampUnacceptedPolicy1 = -67890; -const int errSSLUnknownRootCert = -9812; +const int errSecTimestampUnacceptedExtension1 = -67891; -const int errSSLNoRootCert = -9813; +const int errSecTimestampAddInfoNotAvailable1 = -67892; -const int errSSLCertExpired = -9814; +const int errSecTimestampSystemFailure1 = -67893; -const int errSSLCertNotYetValid = -9815; +const int errSecSigningTimeMissing1 = -67894; -const int errSSLClosedNoNotify = -9816; +const int errSecTimestampRejection1 = -67895; -const int errSSLBufferOverflow = -9817; +const int errSecTimestampWaiting1 = -67896; -const int errSSLBadCipherSuite = -9818; +const int errSecTimestampRevocationWarning1 = -67897; -const int errSSLPeerUnexpectedMsg = -9819; +const int errSecTimestampRevocationNotification1 = -67898; -const int errSSLPeerBadRecordMac = -9820; +const int errSecCertificatePolicyNotAllowed1 = -67899; -const int errSSLPeerDecryptionFail = -9821; +const int errSecCertificateNameNotAllowed1 = -67900; -const int errSSLPeerRecordOverflow = -9822; +const int errSecCertificateValidityPeriodTooLong1 = -67901; -const int errSSLPeerDecompressFail = -9823; +const int errSecCertificateIsCA1 = -67902; -const int errSSLPeerHandshakeFail = -9824; +const int errSecCertificateDuplicateExtension1 = -67903; -const int errSSLPeerBadCert = -9825; +const int errSSLProtocol1 = -9800; -const int errSSLPeerUnsupportedCert = -9826; +const int errSSLNegotiation1 = -9801; -const int errSSLPeerCertRevoked = -9827; +const int errSSLFatalAlert1 = -9802; -const int errSSLPeerCertExpired = -9828; +const int errSSLWouldBlock1 = -9803; -const int errSSLPeerCertUnknown = -9829; +const int errSSLSessionNotFound1 = -9804; -const int errSSLIllegalParam = -9830; +const int errSSLClosedGraceful1 = -9805; -const int errSSLPeerUnknownCA = -9831; +const int errSSLClosedAbort1 = -9806; -const int errSSLPeerAccessDenied = -9832; +const int errSSLXCertChainInvalid1 = -9807; -const int errSSLPeerDecodeError = -9833; +const int errSSLBadCert1 = -9808; -const int errSSLPeerDecryptError = -9834; +const int errSSLCrypto1 = -9809; -const int errSSLPeerExportRestriction = -9835; +const int errSSLInternal1 = -9810; -const int errSSLPeerProtocolVersion = -9836; +const int errSSLModuleAttach1 = -9811; -const int errSSLPeerInsufficientSecurity = -9837; +const int errSSLUnknownRootCert1 = -9812; -const int errSSLPeerInternalError = -9838; +const int errSSLNoRootCert1 = -9813; -const int errSSLPeerUserCancelled = -9839; +const int errSSLCertExpired1 = -9814; -const int errSSLPeerNoRenegotiation = -9840; +const int errSSLCertNotYetValid1 = -9815; -const int errSSLPeerAuthCompleted = -9841; +const int errSSLClosedNoNotify1 = -9816; -const int errSSLClientCertRequested = -9842; +const int errSSLBufferOverflow1 = -9817; -const int errSSLHostNameMismatch = -9843; +const int errSSLBadCipherSuite1 = -9818; -const int errSSLConnectionRefused = -9844; +const int errSSLPeerUnexpectedMsg1 = -9819; -const int errSSLDecryptionFail = -9845; +const int errSSLPeerBadRecordMac1 = -9820; -const int errSSLBadRecordMac = -9846; +const int errSSLPeerDecryptionFail1 = -9821; -const int errSSLRecordOverflow = -9847; +const int errSSLPeerRecordOverflow1 = -9822; -const int errSSLBadConfiguration = -9848; +const int errSSLPeerDecompressFail1 = -9823; -const int errSSLUnexpectedRecord = -9849; +const int errSSLPeerHandshakeFail1 = -9824; -const int errSSLWeakPeerEphemeralDHKey = -9850; +const int errSSLPeerBadCert1 = -9825; -const int errSSLClientHelloReceived = -9851; +const int errSSLPeerUnsupportedCert1 = -9826; -const int errSSLTransportReset = -9852; +const int errSSLPeerCertRevoked1 = -9827; -const int errSSLNetworkTimeout = -9853; +const int errSSLPeerCertExpired1 = -9828; -const int errSSLConfigurationFailed = -9854; +const int errSSLPeerCertUnknown1 = -9829; -const int errSSLUnsupportedExtension = -9855; +const int errSSLIllegalParam1 = -9830; -const int errSSLUnexpectedMessage = -9856; +const int errSSLPeerUnknownCA1 = -9831; -const int errSSLDecompressFail = -9857; +const int errSSLPeerAccessDenied1 = -9832; -const int errSSLHandshakeFail = -9858; +const int errSSLPeerDecodeError1 = -9833; -const int errSSLDecodeError = -9859; +const int errSSLPeerDecryptError1 = -9834; -const int errSSLInappropriateFallback = -9860; +const int errSSLPeerExportRestriction1 = -9835; -const int errSSLMissingExtension = -9861; +const int errSSLPeerProtocolVersion1 = -9836; -const int errSSLBadCertificateStatusResponse = -9862; +const int errSSLPeerInsufficientSecurity1 = -9837; -const int errSSLCertificateRequired = -9863; +const int errSSLPeerInternalError1 = -9838; -const int errSSLUnknownPSKIdentity = -9864; +const int errSSLPeerUserCancelled1 = -9839; -const int errSSLUnrecognizedName = -9865; +const int errSSLPeerNoRenegotiation1 = -9840; -const int errSSLATSViolation = -9880; +const int errSSLPeerAuthCompleted1 = -9841; -const int errSSLATSMinimumVersionViolation = -9881; +const int errSSLClientCertRequested1 = -9842; -const int errSSLATSCiphersuiteViolation = -9882; +const int errSSLHostNameMismatch1 = -9843; -const int errSSLATSMinimumKeySizeViolation = -9883; +const int errSSLConnectionRefused1 = -9844; -const int errSSLATSLeafCertificateHashAlgorithmViolation = -9884; +const int errSSLDecryptionFail1 = -9845; -const int errSSLATSCertificateHashAlgorithmViolation = -9885; +const int errSSLBadRecordMac1 = -9846; -const int errSSLATSCertificateTrustViolation = -9886; +const int errSSLRecordOverflow1 = -9847; -const int errSSLEarlyDataRejected = -9890; +const int errSSLBadConfiguration1 = -9848; -const int OSUnknownByteOrder = 0; +const int errSSLUnexpectedRecord1 = -9849; -const int OSLittleEndian = 1; +const int errSSLWeakPeerEphemeralDHKey1 = -9850; -const int OSBigEndian = 2; +const int errSSLClientHelloReceived1 = -9851; -const int kCFNotificationDeliverImmediately = 1; +const int errSSLTransportReset1 = -9852; -const int kCFNotificationPostToAllSessions = 2; +const int errSSLNetworkTimeout1 = -9853; -const int kCFCalendarComponentsWrap = 1; +const int errSSLConfigurationFailed1 = -9854; -const int kCFSocketAutomaticallyReenableReadCallBack = 1; +const int errSSLUnsupportedExtension1 = -9855; -const int kCFSocketAutomaticallyReenableAcceptCallBack = 2; +const int errSSLUnexpectedMessage1 = -9856; -const int kCFSocketAutomaticallyReenableDataCallBack = 3; +const int errSSLDecompressFail1 = -9857; -const int kCFSocketAutomaticallyReenableWriteCallBack = 8; +const int errSSLHandshakeFail1 = -9858; -const int kCFSocketLeaveErrors = 64; +const int errSSLDecodeError1 = -9859; -const int kCFSocketCloseOnInvalidate = 128; +const int errSSLInappropriateFallback1 = -9860; -const int DISPATCH_WALLTIME_NOW = -2; +const int errSSLMissingExtension1 = -9861; -const int kCFPropertyListReadCorruptError = 3840; +const int errSSLBadCertificateStatusResponse1 = -9862; -const int kCFPropertyListReadUnknownVersionError = 3841; +const int errSSLCertificateRequired1 = -9863; -const int kCFPropertyListReadStreamError = 3842; +const int errSSLUnknownPSKIdentity1 = -9864; -const int kCFPropertyListWriteStreamError = 3851; +const int errSSLUnrecognizedName1 = -9865; -const int kCFBundleExecutableArchitectureI386 = 7; +const int errSSLATSViolation1 = -9880; -const int kCFBundleExecutableArchitecturePPC = 18; +const int errSSLATSMinimumVersionViolation1 = -9881; -const int kCFBundleExecutableArchitectureX86_64 = 16777223; +const int errSSLATSCiphersuiteViolation1 = -9882; -const int kCFBundleExecutableArchitecturePPC64 = 16777234; +const int errSSLATSMinimumKeySizeViolation1 = -9883; -const int kCFBundleExecutableArchitectureARM64 = 16777228; +const int errSSLATSLeafCertificateHashAlgorithmViolation1 = -9884; -const int kCFMessagePortSuccess = 0; +const int errSSLATSCertificateHashAlgorithmViolation1 = -9885; -const int kCFMessagePortSendTimeout = -1; +const int errSSLATSCertificateTrustViolation1 = -9886; -const int kCFMessagePortReceiveTimeout = -2; +const int errSSLEarlyDataRejected1 = -9890; -const int kCFMessagePortIsInvalid = -3; +const int OSUnknownByteOrder1 = 0; -const int kCFMessagePortTransportError = -4; +const int OSLittleEndian1 = 1; -const int kCFMessagePortBecameInvalidError = -5; +const int OSBigEndian1 = 2; -const int kCFStringTokenizerUnitWord = 0; +const int kCFNotificationDeliverImmediately1 = 1; -const int kCFStringTokenizerUnitSentence = 1; +const int kCFNotificationPostToAllSessions1 = 2; -const int kCFStringTokenizerUnitParagraph = 2; +const int kCFCalendarComponentsWrap1 = 1; -const int kCFStringTokenizerUnitLineBreak = 3; +const int kCFSocketAutomaticallyReenableReadCallBack1 = 1; -const int kCFStringTokenizerUnitWordBoundary = 4; +const int kCFSocketAutomaticallyReenableAcceptCallBack1 = 2; -const int kCFStringTokenizerAttributeLatinTranscription = 65536; +const int kCFSocketAutomaticallyReenableDataCallBack1 = 3; -const int kCFStringTokenizerAttributeLanguage = 131072; +const int kCFSocketAutomaticallyReenableWriteCallBack1 = 8; -const int kCFFileDescriptorReadCallBack = 1; +const int kCFSocketLeaveErrors1 = 64; -const int kCFFileDescriptorWriteCallBack = 2; +const int kCFSocketCloseOnInvalidate1 = 128; -const int kCFUserNotificationStopAlertLevel = 0; +const int DISPATCH_WALLTIME_NOW2 = -2; -const int kCFUserNotificationNoteAlertLevel = 1; +const int kCFPropertyListReadCorruptError1 = 3840; -const int kCFUserNotificationCautionAlertLevel = 2; +const int kCFPropertyListReadUnknownVersionError1 = 3841; -const int kCFUserNotificationPlainAlertLevel = 3; +const int kCFPropertyListReadStreamError1 = 3842; -const int kCFUserNotificationDefaultResponse = 0; +const int kCFPropertyListWriteStreamError1 = 3851; -const int kCFUserNotificationAlternateResponse = 1; +const int kCFBundleExecutableArchitectureI3861 = 7; -const int kCFUserNotificationOtherResponse = 2; +const int kCFBundleExecutableArchitecturePPC1 = 18; -const int kCFUserNotificationCancelResponse = 3; +const int kCFBundleExecutableArchitectureX86_641 = 16777223; -const int kCFUserNotificationNoDefaultButtonFlag = 32; +const int kCFBundleExecutableArchitecturePPC641 = 16777234; -const int kCFUserNotificationUseRadioButtonsFlag = 64; +const int kCFBundleExecutableArchitectureARM641 = 16777228; -const int kCFXMLNodeCurrentVersion = 1; +const int kCFMessagePortSuccess1 = 0; -const int CSSM_INVALID_HANDLE = 0; +const int kCFMessagePortSendTimeout1 = -1; -const int CSSM_FALSE = 0; +const int kCFMessagePortReceiveTimeout1 = -2; -const int CSSM_TRUE = 1; +const int kCFMessagePortIsInvalid1 = -3; -const int CSSM_OK = 0; +const int kCFMessagePortTransportError1 = -4; -const int CSSM_MODULE_STRING_SIZE = 64; +const int kCFMessagePortBecameInvalidError1 = -5; -const int CSSM_KEY_HIERARCHY_NONE = 0; +const int kCFStringTokenizerUnitWord1 = 0; -const int CSSM_KEY_HIERARCHY_INTEG = 1; +const int kCFStringTokenizerUnitSentence1 = 1; -const int CSSM_KEY_HIERARCHY_EXPORT = 2; +const int kCFStringTokenizerUnitParagraph1 = 2; -const int CSSM_PVC_NONE = 0; +const int kCFStringTokenizerUnitLineBreak1 = 3; -const int CSSM_PVC_APP = 1; +const int kCFStringTokenizerUnitWordBoundary1 = 4; -const int CSSM_PVC_SP = 2; +const int kCFStringTokenizerAttributeLatinTranscription1 = 65536; -const int CSSM_PRIVILEGE_SCOPE_NONE = 0; +const int kCFStringTokenizerAttributeLanguage1 = 131072; -const int CSSM_PRIVILEGE_SCOPE_PROCESS = 1; +const int kCFFileDescriptorReadCallBack1 = 1; -const int CSSM_PRIVILEGE_SCOPE_THREAD = 2; +const int kCFFileDescriptorWriteCallBack1 = 2; -const int CSSM_SERVICE_CSSM = 1; +const int kCFUserNotificationStopAlertLevel1 = 0; -const int CSSM_SERVICE_CSP = 2; +const int kCFUserNotificationNoteAlertLevel1 = 1; -const int CSSM_SERVICE_DL = 4; +const int kCFUserNotificationCautionAlertLevel1 = 2; -const int CSSM_SERVICE_CL = 8; +const int kCFUserNotificationPlainAlertLevel1 = 3; -const int CSSM_SERVICE_TP = 16; +const int kCFUserNotificationDefaultResponse1 = 0; -const int CSSM_SERVICE_AC = 32; +const int kCFUserNotificationAlternateResponse1 = 1; -const int CSSM_SERVICE_KR = 64; +const int kCFUserNotificationOtherResponse1 = 2; -const int CSSM_NOTIFY_INSERT = 1; +const int kCFUserNotificationCancelResponse1 = 3; -const int CSSM_NOTIFY_REMOVE = 2; +const int kCFUserNotificationNoDefaultButtonFlag1 = 32; -const int CSSM_NOTIFY_FAULT = 3; +const int kCFUserNotificationUseRadioButtonsFlag1 = 64; -const int CSSM_ATTACH_READ_ONLY = 1; +const int kCFXMLNodeCurrentVersion1 = 1; -const int CSSM_USEE_LAST = 255; +const int CSSM_INVALID_HANDLE1 = 0; -const int CSSM_USEE_NONE = 0; +const int CSSM_FALSE1 = 0; -const int CSSM_USEE_DOMESTIC = 1; +const int CSSM_TRUE1 = 1; -const int CSSM_USEE_FINANCIAL = 2; +const int CSSM_OK1 = 0; -const int CSSM_USEE_KRLE = 3; +const int CSSM_MODULE_STRING_SIZE1 = 64; -const int CSSM_USEE_KRENT = 4; +const int CSSM_KEY_HIERARCHY_NONE1 = 0; -const int CSSM_USEE_SSL = 5; +const int CSSM_KEY_HIERARCHY_INTEG1 = 1; -const int CSSM_USEE_AUTHENTICATION = 6; +const int CSSM_KEY_HIERARCHY_EXPORT1 = 2; -const int CSSM_USEE_KEYEXCH = 7; +const int CSSM_PVC_NONE1 = 0; -const int CSSM_USEE_MEDICAL = 8; +const int CSSM_PVC_APP1 = 1; -const int CSSM_USEE_INSURANCE = 9; +const int CSSM_PVC_SP1 = 2; -const int CSSM_USEE_WEAK = 10; +const int CSSM_PRIVILEGE_SCOPE_NONE1 = 0; -const int CSSM_ADDR_NONE = 0; +const int CSSM_PRIVILEGE_SCOPE_PROCESS1 = 1; -const int CSSM_ADDR_CUSTOM = 1; +const int CSSM_PRIVILEGE_SCOPE_THREAD1 = 2; -const int CSSM_ADDR_URL = 2; +const int CSSM_SERVICE_CSSM1 = 1; -const int CSSM_ADDR_SOCKADDR = 3; +const int CSSM_SERVICE_CSP1 = 2; -const int CSSM_ADDR_NAME = 4; +const int CSSM_SERVICE_DL1 = 4; -const int CSSM_NET_PROTO_NONE = 0; +const int CSSM_SERVICE_CL1 = 8; -const int CSSM_NET_PROTO_CUSTOM = 1; +const int CSSM_SERVICE_TP1 = 16; -const int CSSM_NET_PROTO_UNSPECIFIED = 2; +const int CSSM_SERVICE_AC1 = 32; -const int CSSM_NET_PROTO_LDAP = 3; +const int CSSM_SERVICE_KR1 = 64; -const int CSSM_NET_PROTO_LDAPS = 4; +const int CSSM_NOTIFY_INSERT1 = 1; -const int CSSM_NET_PROTO_LDAPNS = 5; +const int CSSM_NOTIFY_REMOVE1 = 2; -const int CSSM_NET_PROTO_X500DAP = 6; +const int CSSM_NOTIFY_FAULT1 = 3; -const int CSSM_NET_PROTO_FTP = 7; +const int CSSM_ATTACH_READ_ONLY1 = 1; -const int CSSM_NET_PROTO_FTPS = 8; +const int CSSM_USEE_LAST1 = 255; -const int CSSM_NET_PROTO_OCSP = 9; +const int CSSM_USEE_NONE1 = 0; -const int CSSM_NET_PROTO_CMP = 10; +const int CSSM_USEE_DOMESTIC1 = 1; -const int CSSM_NET_PROTO_CMPS = 11; +const int CSSM_USEE_FINANCIAL1 = 2; -const int CSSM_WORDID__UNK_ = -1; +const int CSSM_USEE_KRLE1 = 3; -const int CSSM_WORDID__NLU_ = 0; +const int CSSM_USEE_KRENT1 = 4; -const int CSSM_WORDID__STAR_ = 1; +const int CSSM_USEE_SSL1 = 5; -const int CSSM_WORDID_A = 2; +const int CSSM_USEE_AUTHENTICATION1 = 6; -const int CSSM_WORDID_ACL = 3; +const int CSSM_USEE_KEYEXCH1 = 7; -const int CSSM_WORDID_ALPHA = 4; +const int CSSM_USEE_MEDICAL1 = 8; -const int CSSM_WORDID_B = 5; +const int CSSM_USEE_INSURANCE1 = 9; -const int CSSM_WORDID_BER = 6; +const int CSSM_USEE_WEAK1 = 10; -const int CSSM_WORDID_BINARY = 7; +const int CSSM_ADDR_NONE1 = 0; -const int CSSM_WORDID_BIOMETRIC = 8; +const int CSSM_ADDR_CUSTOM1 = 1; -const int CSSM_WORDID_C = 9; +const int CSSM_ADDR_URL1 = 2; -const int CSSM_WORDID_CANCELED = 10; +const int CSSM_ADDR_SOCKADDR1 = 3; -const int CSSM_WORDID_CERT = 11; +const int CSSM_ADDR_NAME1 = 4; -const int CSSM_WORDID_COMMENT = 12; +const int CSSM_NET_PROTO_NONE1 = 0; -const int CSSM_WORDID_CRL = 13; +const int CSSM_NET_PROTO_CUSTOM1 = 1; -const int CSSM_WORDID_CUSTOM = 14; +const int CSSM_NET_PROTO_UNSPECIFIED1 = 2; -const int CSSM_WORDID_D = 15; +const int CSSM_NET_PROTO_LDAP1 = 3; -const int CSSM_WORDID_DATE = 16; +const int CSSM_NET_PROTO_LDAPS1 = 4; -const int CSSM_WORDID_DB_DELETE = 17; +const int CSSM_NET_PROTO_LDAPNS1 = 5; -const int CSSM_WORDID_DB_EXEC_STORED_QUERY = 18; +const int CSSM_NET_PROTO_X500DAP1 = 6; -const int CSSM_WORDID_DB_INSERT = 19; +const int CSSM_NET_PROTO_FTP1 = 7; -const int CSSM_WORDID_DB_MODIFY = 20; +const int CSSM_NET_PROTO_FTPS1 = 8; -const int CSSM_WORDID_DB_READ = 21; +const int CSSM_NET_PROTO_OCSP1 = 9; -const int CSSM_WORDID_DBS_CREATE = 22; +const int CSSM_NET_PROTO_CMP1 = 10; -const int CSSM_WORDID_DBS_DELETE = 23; +const int CSSM_NET_PROTO_CMPS1 = 11; -const int CSSM_WORDID_DECRYPT = 24; +const int CSSM_WORDID__UNK_1 = -1; -const int CSSM_WORDID_DELETE = 25; +const int CSSM_WORDID__NLU_1 = 0; -const int CSSM_WORDID_DELTA_CRL = 26; +const int CSSM_WORDID__STAR_1 = 1; -const int CSSM_WORDID_DER = 27; +const int CSSM_WORDID_A1 = 2; -const int CSSM_WORDID_DERIVE = 28; +const int CSSM_WORDID_ACL1 = 3; -const int CSSM_WORDID_DISPLAY = 29; +const int CSSM_WORDID_ALPHA1 = 4; -const int CSSM_WORDID_DO = 30; +const int CSSM_WORDID_B1 = 5; -const int CSSM_WORDID_DSA = 31; +const int CSSM_WORDID_BER1 = 6; -const int CSSM_WORDID_DSA_SHA1 = 32; +const int CSSM_WORDID_BINARY1 = 7; -const int CSSM_WORDID_E = 33; +const int CSSM_WORDID_BIOMETRIC1 = 8; -const int CSSM_WORDID_ELGAMAL = 34; +const int CSSM_WORDID_C1 = 9; -const int CSSM_WORDID_ENCRYPT = 35; +const int CSSM_WORDID_CANCELED1 = 10; -const int CSSM_WORDID_ENTRY = 36; +const int CSSM_WORDID_CERT1 = 11; -const int CSSM_WORDID_EXPORT_CLEAR = 37; +const int CSSM_WORDID_COMMENT1 = 12; -const int CSSM_WORDID_EXPORT_WRAPPED = 38; +const int CSSM_WORDID_CRL1 = 13; -const int CSSM_WORDID_G = 39; +const int CSSM_WORDID_CUSTOM1 = 14; -const int CSSM_WORDID_GE = 40; +const int CSSM_WORDID_D1 = 15; -const int CSSM_WORDID_GENKEY = 41; +const int CSSM_WORDID_DATE1 = 16; -const int CSSM_WORDID_HASH = 42; +const int CSSM_WORDID_DB_DELETE1 = 17; -const int CSSM_WORDID_HASHED_PASSWORD = 43; +const int CSSM_WORDID_DB_EXEC_STORED_QUERY1 = 18; -const int CSSM_WORDID_HASHED_SUBJECT = 44; +const int CSSM_WORDID_DB_INSERT1 = 19; -const int CSSM_WORDID_HAVAL = 45; +const int CSSM_WORDID_DB_MODIFY1 = 20; -const int CSSM_WORDID_IBCHASH = 46; +const int CSSM_WORDID_DB_READ1 = 21; -const int CSSM_WORDID_IMPORT_CLEAR = 47; +const int CSSM_WORDID_DBS_CREATE1 = 22; -const int CSSM_WORDID_IMPORT_WRAPPED = 48; +const int CSSM_WORDID_DBS_DELETE1 = 23; -const int CSSM_WORDID_INTEL = 49; +const int CSSM_WORDID_DECRYPT1 = 24; -const int CSSM_WORDID_ISSUER = 50; +const int CSSM_WORDID_DELETE1 = 25; -const int CSSM_WORDID_ISSUER_INFO = 51; +const int CSSM_WORDID_DELTA_CRL1 = 26; -const int CSSM_WORDID_K_OF_N = 52; +const int CSSM_WORDID_DER1 = 27; -const int CSSM_WORDID_KEA = 53; +const int CSSM_WORDID_DERIVE1 = 28; -const int CSSM_WORDID_KEYHOLDER = 54; +const int CSSM_WORDID_DISPLAY1 = 29; -const int CSSM_WORDID_L = 55; +const int CSSM_WORDID_DO1 = 30; -const int CSSM_WORDID_LE = 56; +const int CSSM_WORDID_DSA1 = 31; -const int CSSM_WORDID_LOGIN = 57; +const int CSSM_WORDID_DSA_SHA11 = 32; -const int CSSM_WORDID_LOGIN_NAME = 58; +const int CSSM_WORDID_E1 = 33; -const int CSSM_WORDID_MAC = 59; +const int CSSM_WORDID_ELGAMAL1 = 34; -const int CSSM_WORDID_MD2 = 60; +const int CSSM_WORDID_ENCRYPT1 = 35; -const int CSSM_WORDID_MD2WITHRSA = 61; +const int CSSM_WORDID_ENTRY1 = 36; -const int CSSM_WORDID_MD4 = 62; +const int CSSM_WORDID_EXPORT_CLEAR1 = 37; -const int CSSM_WORDID_MD5 = 63; +const int CSSM_WORDID_EXPORT_WRAPPED1 = 38; -const int CSSM_WORDID_MD5WITHRSA = 64; +const int CSSM_WORDID_G1 = 39; -const int CSSM_WORDID_N = 65; +const int CSSM_WORDID_GE1 = 40; -const int CSSM_WORDID_NAME = 66; +const int CSSM_WORDID_GENKEY1 = 41; -const int CSSM_WORDID_NDR = 67; +const int CSSM_WORDID_HASH1 = 42; -const int CSSM_WORDID_NHASH = 68; +const int CSSM_WORDID_HASHED_PASSWORD1 = 43; -const int CSSM_WORDID_NOT_AFTER = 69; +const int CSSM_WORDID_HASHED_SUBJECT1 = 44; -const int CSSM_WORDID_NOT_BEFORE = 70; +const int CSSM_WORDID_HAVAL1 = 45; -const int CSSM_WORDID_NULL = 71; +const int CSSM_WORDID_IBCHASH1 = 46; -const int CSSM_WORDID_NUMERIC = 72; +const int CSSM_WORDID_IMPORT_CLEAR1 = 47; -const int CSSM_WORDID_OBJECT_HASH = 73; +const int CSSM_WORDID_IMPORT_WRAPPED1 = 48; -const int CSSM_WORDID_ONE_TIME = 74; +const int CSSM_WORDID_INTEL1 = 49; -const int CSSM_WORDID_ONLINE = 75; +const int CSSM_WORDID_ISSUER1 = 50; -const int CSSM_WORDID_OWNER = 76; +const int CSSM_WORDID_ISSUER_INFO1 = 51; -const int CSSM_WORDID_P = 77; +const int CSSM_WORDID_K_OF_N1 = 52; -const int CSSM_WORDID_PAM_NAME = 78; +const int CSSM_WORDID_KEA1 = 53; -const int CSSM_WORDID_PASSWORD = 79; +const int CSSM_WORDID_KEYHOLDER1 = 54; -const int CSSM_WORDID_PGP = 80; +const int CSSM_WORDID_L1 = 55; -const int CSSM_WORDID_PREFIX = 81; +const int CSSM_WORDID_LE1 = 56; -const int CSSM_WORDID_PRIVATE_KEY = 82; +const int CSSM_WORDID_LOGIN1 = 57; -const int CSSM_WORDID_PROMPTED_BIOMETRIC = 83; +const int CSSM_WORDID_LOGIN_NAME1 = 58; -const int CSSM_WORDID_PROMPTED_PASSWORD = 84; +const int CSSM_WORDID_MAC1 = 59; -const int CSSM_WORDID_PROPAGATE = 85; +const int CSSM_WORDID_MD21 = 60; -const int CSSM_WORDID_PROTECTED_BIOMETRIC = 86; +const int CSSM_WORDID_MD2WITHRSA1 = 61; -const int CSSM_WORDID_PROTECTED_PASSWORD = 87; +const int CSSM_WORDID_MD41 = 62; -const int CSSM_WORDID_PROTECTED_PIN = 88; +const int CSSM_WORDID_MD51 = 63; -const int CSSM_WORDID_PUBLIC_KEY = 89; +const int CSSM_WORDID_MD5WITHRSA1 = 64; -const int CSSM_WORDID_PUBLIC_KEY_FROM_CERT = 90; +const int CSSM_WORDID_N1 = 65; -const int CSSM_WORDID_Q = 91; +const int CSSM_WORDID_NAME1 = 66; -const int CSSM_WORDID_RANGE = 92; +const int CSSM_WORDID_NDR1 = 67; -const int CSSM_WORDID_REVAL = 93; +const int CSSM_WORDID_NHASH1 = 68; -const int CSSM_WORDID_RIPEMAC = 94; +const int CSSM_WORDID_NOT_AFTER1 = 69; -const int CSSM_WORDID_RIPEMD = 95; +const int CSSM_WORDID_NOT_BEFORE1 = 70; -const int CSSM_WORDID_RIPEMD160 = 96; +const int CSSM_WORDID_NULL1 = 71; -const int CSSM_WORDID_RSA = 97; +const int CSSM_WORDID_NUMERIC1 = 72; -const int CSSM_WORDID_RSA_ISO9796 = 98; +const int CSSM_WORDID_OBJECT_HASH1 = 73; -const int CSSM_WORDID_RSA_PKCS = 99; +const int CSSM_WORDID_ONE_TIME1 = 74; -const int CSSM_WORDID_RSA_PKCS_MD5 = 100; +const int CSSM_WORDID_ONLINE1 = 75; -const int CSSM_WORDID_RSA_PKCS_SHA1 = 101; +const int CSSM_WORDID_OWNER1 = 76; -const int CSSM_WORDID_RSA_PKCS1 = 102; +const int CSSM_WORDID_P1 = 77; -const int CSSM_WORDID_RSA_PKCS1_MD5 = 103; +const int CSSM_WORDID_PAM_NAME1 = 78; -const int CSSM_WORDID_RSA_PKCS1_SHA1 = 104; +const int CSSM_WORDID_PASSWORD1 = 79; -const int CSSM_WORDID_RSA_PKCS1_SIG = 105; +const int CSSM_WORDID_PGP1 = 80; -const int CSSM_WORDID_RSA_RAW = 106; +const int CSSM_WORDID_PREFIX1 = 81; -const int CSSM_WORDID_SDSIV1 = 107; +const int CSSM_WORDID_PRIVATE_KEY1 = 82; -const int CSSM_WORDID_SEQUENCE = 108; +const int CSSM_WORDID_PROMPTED_BIOMETRIC1 = 83; -const int CSSM_WORDID_SET = 109; +const int CSSM_WORDID_PROMPTED_PASSWORD1 = 84; -const int CSSM_WORDID_SEXPR = 110; +const int CSSM_WORDID_PROPAGATE1 = 85; -const int CSSM_WORDID_SHA1 = 111; +const int CSSM_WORDID_PROTECTED_BIOMETRIC1 = 86; -const int CSSM_WORDID_SHA1WITHDSA = 112; +const int CSSM_WORDID_PROTECTED_PASSWORD1 = 87; -const int CSSM_WORDID_SHA1WITHECDSA = 113; +const int CSSM_WORDID_PROTECTED_PIN1 = 88; -const int CSSM_WORDID_SHA1WITHRSA = 114; +const int CSSM_WORDID_PUBLIC_KEY1 = 89; -const int CSSM_WORDID_SIGN = 115; +const int CSSM_WORDID_PUBLIC_KEY_FROM_CERT1 = 90; -const int CSSM_WORDID_SIGNATURE = 116; +const int CSSM_WORDID_Q1 = 91; -const int CSSM_WORDID_SIGNED_NONCE = 117; +const int CSSM_WORDID_RANGE1 = 92; -const int CSSM_WORDID_SIGNED_SECRET = 118; +const int CSSM_WORDID_REVAL1 = 93; -const int CSSM_WORDID_SPKI = 119; +const int CSSM_WORDID_RIPEMAC1 = 94; -const int CSSM_WORDID_SUBJECT = 120; +const int CSSM_WORDID_RIPEMD1 = 95; -const int CSSM_WORDID_SUBJECT_INFO = 121; +const int CSSM_WORDID_RIPEMD1601 = 96; -const int CSSM_WORDID_TAG = 122; +const int CSSM_WORDID_RSA1 = 97; -const int CSSM_WORDID_THRESHOLD = 123; +const int CSSM_WORDID_RSA_ISO97961 = 98; -const int CSSM_WORDID_TIME = 124; +const int CSSM_WORDID_RSA_PKCS2 = 99; -const int CSSM_WORDID_URI = 125; +const int CSSM_WORDID_RSA_PKCS_MD51 = 100; -const int CSSM_WORDID_VERSION = 126; +const int CSSM_WORDID_RSA_PKCS_SHA11 = 101; -const int CSSM_WORDID_X509_ATTRIBUTE = 127; +const int CSSM_WORDID_RSA_PKCS11 = 102; -const int CSSM_WORDID_X509V1 = 128; +const int CSSM_WORDID_RSA_PKCS1_MD51 = 103; -const int CSSM_WORDID_X509V2 = 129; +const int CSSM_WORDID_RSA_PKCS1_SHA11 = 104; -const int CSSM_WORDID_X509V3 = 130; +const int CSSM_WORDID_RSA_PKCS1_SIG1 = 105; -const int CSSM_WORDID_X9_ATTRIBUTE = 131; +const int CSSM_WORDID_RSA_RAW1 = 106; -const int CSSM_WORDID_VENDOR_START = 65536; +const int CSSM_WORDID_SDSIV11 = 107; -const int CSSM_WORDID_VENDOR_END = 2147418112; +const int CSSM_WORDID_SEQUENCE1 = 108; -const int CSSM_LIST_ELEMENT_DATUM = 0; +const int CSSM_WORDID_SET1 = 109; -const int CSSM_LIST_ELEMENT_SUBLIST = 1; +const int CSSM_WORDID_SEXPR1 = 110; -const int CSSM_LIST_ELEMENT_WORDID = 2; +const int CSSM_WORDID_SHA11 = 111; -const int CSSM_LIST_TYPE_UNKNOWN = 0; +const int CSSM_WORDID_SHA1WITHDSA1 = 112; -const int CSSM_LIST_TYPE_CUSTOM = 1; +const int CSSM_WORDID_SHA1WITHECDSA1 = 113; -const int CSSM_LIST_TYPE_SEXPR = 2; +const int CSSM_WORDID_SHA1WITHRSA1 = 114; -const int CSSM_SAMPLE_TYPE_PASSWORD = 79; +const int CSSM_WORDID_SIGN1 = 115; -const int CSSM_SAMPLE_TYPE_HASHED_PASSWORD = 43; +const int CSSM_WORDID_SIGNATURE1 = 116; -const int CSSM_SAMPLE_TYPE_PROTECTED_PASSWORD = 87; +const int CSSM_WORDID_SIGNED_NONCE1 = 117; -const int CSSM_SAMPLE_TYPE_PROMPTED_PASSWORD = 84; +const int CSSM_WORDID_SIGNED_SECRET1 = 118; -const int CSSM_SAMPLE_TYPE_SIGNED_NONCE = 117; +const int CSSM_WORDID_SPKI1 = 119; -const int CSSM_SAMPLE_TYPE_SIGNED_SECRET = 118; +const int CSSM_WORDID_SUBJECT1 = 120; -const int CSSM_SAMPLE_TYPE_BIOMETRIC = 8; +const int CSSM_WORDID_SUBJECT_INFO1 = 121; -const int CSSM_SAMPLE_TYPE_PROTECTED_BIOMETRIC = 86; +const int CSSM_WORDID_TAG1 = 122; -const int CSSM_SAMPLE_TYPE_PROMPTED_BIOMETRIC = 83; +const int CSSM_WORDID_THRESHOLD1 = 123; -const int CSSM_SAMPLE_TYPE_THRESHOLD = 123; +const int CSSM_WORDID_TIME1 = 124; -const int CSSM_CERT_UNKNOWN = 0; +const int CSSM_WORDID_URI1 = 125; -const int CSSM_CERT_X_509v1 = 1; +const int CSSM_WORDID_VERSION1 = 126; -const int CSSM_CERT_X_509v2 = 2; +const int CSSM_WORDID_X509_ATTRIBUTE1 = 127; -const int CSSM_CERT_X_509v3 = 3; +const int CSSM_WORDID_X509V11 = 128; -const int CSSM_CERT_PGP = 4; +const int CSSM_WORDID_X509V21 = 129; -const int CSSM_CERT_SPKI = 5; +const int CSSM_WORDID_X509V31 = 130; -const int CSSM_CERT_SDSIv1 = 6; +const int CSSM_WORDID_X9_ATTRIBUTE1 = 131; -const int CSSM_CERT_Intel = 8; +const int CSSM_WORDID_VENDOR_START1 = 65536; -const int CSSM_CERT_X_509_ATTRIBUTE = 9; +const int CSSM_WORDID_VENDOR_END1 = 2147418112; -const int CSSM_CERT_X9_ATTRIBUTE = 10; +const int CSSM_LIST_ELEMENT_DATUM1 = 0; -const int CSSM_CERT_TUPLE = 11; +const int CSSM_LIST_ELEMENT_SUBLIST1 = 1; -const int CSSM_CERT_ACL_ENTRY = 12; +const int CSSM_LIST_ELEMENT_WORDID1 = 2; -const int CSSM_CERT_MULTIPLE = 32766; +const int CSSM_LIST_TYPE_UNKNOWN1 = 0; -const int CSSM_CERT_LAST = 32767; +const int CSSM_LIST_TYPE_CUSTOM1 = 1; -const int CSSM_CL_CUSTOM_CERT_TYPE = 32768; +const int CSSM_LIST_TYPE_SEXPR1 = 2; -const int CSSM_CERT_ENCODING_UNKNOWN = 0; +const int CSSM_SAMPLE_TYPE_PASSWORD1 = 79; -const int CSSM_CERT_ENCODING_CUSTOM = 1; +const int CSSM_SAMPLE_TYPE_HASHED_PASSWORD1 = 43; -const int CSSM_CERT_ENCODING_BER = 2; +const int CSSM_SAMPLE_TYPE_PROTECTED_PASSWORD1 = 87; -const int CSSM_CERT_ENCODING_DER = 3; +const int CSSM_SAMPLE_TYPE_PROMPTED_PASSWORD1 = 84; -const int CSSM_CERT_ENCODING_NDR = 4; +const int CSSM_SAMPLE_TYPE_SIGNED_NONCE1 = 117; -const int CSSM_CERT_ENCODING_SEXPR = 5; +const int CSSM_SAMPLE_TYPE_SIGNED_SECRET1 = 118; -const int CSSM_CERT_ENCODING_PGP = 6; +const int CSSM_SAMPLE_TYPE_BIOMETRIC1 = 8; -const int CSSM_CERT_ENCODING_MULTIPLE = 32766; +const int CSSM_SAMPLE_TYPE_PROTECTED_BIOMETRIC1 = 86; -const int CSSM_CERT_ENCODING_LAST = 32767; +const int CSSM_SAMPLE_TYPE_PROMPTED_BIOMETRIC1 = 83; -const int CSSM_CL_CUSTOM_CERT_ENCODING = 32768; +const int CSSM_SAMPLE_TYPE_THRESHOLD1 = 123; -const int CSSM_CERT_PARSE_FORMAT_NONE = 0; +const int CSSM_CERT_UNKNOWN1 = 0; -const int CSSM_CERT_PARSE_FORMAT_CUSTOM = 1; +const int CSSM_CERT_X_509v11 = 1; -const int CSSM_CERT_PARSE_FORMAT_SEXPR = 2; +const int CSSM_CERT_X_509v21 = 2; -const int CSSM_CERT_PARSE_FORMAT_COMPLEX = 3; +const int CSSM_CERT_X_509v31 = 3; -const int CSSM_CERT_PARSE_FORMAT_OID_NAMED = 4; +const int CSSM_CERT_PGP1 = 4; -const int CSSM_CERT_PARSE_FORMAT_TUPLE = 5; +const int CSSM_CERT_SPKI1 = 5; -const int CSSM_CERT_PARSE_FORMAT_MULTIPLE = 32766; +const int CSSM_CERT_SDSIv11 = 6; -const int CSSM_CERT_PARSE_FORMAT_LAST = 32767; +const int CSSM_CERT_Intel1 = 8; -const int CSSM_CL_CUSTOM_CERT_PARSE_FORMAT = 32768; +const int CSSM_CERT_X_509_ATTRIBUTE1 = 9; -const int CSSM_CERTGROUP_DATA = 0; +const int CSSM_CERT_X9_ATTRIBUTE1 = 10; -const int CSSM_CERTGROUP_ENCODED_CERT = 1; +const int CSSM_CERT_TUPLE1 = 11; -const int CSSM_CERTGROUP_PARSED_CERT = 2; +const int CSSM_CERT_ACL_ENTRY1 = 12; -const int CSSM_CERTGROUP_CERT_PAIR = 3; +const int CSSM_CERT_MULTIPLE1 = 32766; -const int CSSM_ACL_SUBJECT_TYPE_ANY = 1; +const int CSSM_CERT_LAST1 = 32767; -const int CSSM_ACL_SUBJECT_TYPE_THRESHOLD = 123; +const int CSSM_CL_CUSTOM_CERT_TYPE1 = 32768; -const int CSSM_ACL_SUBJECT_TYPE_PASSWORD = 79; +const int CSSM_CERT_ENCODING_UNKNOWN1 = 0; -const int CSSM_ACL_SUBJECT_TYPE_PROTECTED_PASSWORD = 87; +const int CSSM_CERT_ENCODING_CUSTOM1 = 1; -const int CSSM_ACL_SUBJECT_TYPE_PROMPTED_PASSWORD = 84; +const int CSSM_CERT_ENCODING_BER1 = 2; -const int CSSM_ACL_SUBJECT_TYPE_PUBLIC_KEY = 89; +const int CSSM_CERT_ENCODING_DER1 = 3; -const int CSSM_ACL_SUBJECT_TYPE_HASHED_SUBJECT = 44; +const int CSSM_CERT_ENCODING_NDR1 = 4; -const int CSSM_ACL_SUBJECT_TYPE_BIOMETRIC = 8; +const int CSSM_CERT_ENCODING_SEXPR1 = 5; -const int CSSM_ACL_SUBJECT_TYPE_PROTECTED_BIOMETRIC = 86; +const int CSSM_CERT_ENCODING_PGP1 = 6; -const int CSSM_ACL_SUBJECT_TYPE_PROMPTED_BIOMETRIC = 83; +const int CSSM_CERT_ENCODING_MULTIPLE1 = 32766; -const int CSSM_ACL_SUBJECT_TYPE_LOGIN_NAME = 58; +const int CSSM_CERT_ENCODING_LAST1 = 32767; -const int CSSM_ACL_SUBJECT_TYPE_EXT_PAM_NAME = 78; +const int CSSM_CL_CUSTOM_CERT_ENCODING1 = 32768; -const int CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START = 65536; +const int CSSM_CERT_PARSE_FORMAT_NONE1 = 0; -const int CSSM_ACL_AUTHORIZATION_ANY = 1; +const int CSSM_CERT_PARSE_FORMAT_CUSTOM1 = 1; -const int CSSM_ACL_AUTHORIZATION_LOGIN = 57; +const int CSSM_CERT_PARSE_FORMAT_SEXPR1 = 2; -const int CSSM_ACL_AUTHORIZATION_GENKEY = 41; +const int CSSM_CERT_PARSE_FORMAT_COMPLEX1 = 3; -const int CSSM_ACL_AUTHORIZATION_DELETE = 25; +const int CSSM_CERT_PARSE_FORMAT_OID_NAMED1 = 4; -const int CSSM_ACL_AUTHORIZATION_EXPORT_WRAPPED = 38; +const int CSSM_CERT_PARSE_FORMAT_TUPLE1 = 5; -const int CSSM_ACL_AUTHORIZATION_EXPORT_CLEAR = 37; +const int CSSM_CERT_PARSE_FORMAT_MULTIPLE1 = 32766; -const int CSSM_ACL_AUTHORIZATION_IMPORT_WRAPPED = 48; +const int CSSM_CERT_PARSE_FORMAT_LAST1 = 32767; -const int CSSM_ACL_AUTHORIZATION_IMPORT_CLEAR = 47; +const int CSSM_CL_CUSTOM_CERT_PARSE_FORMAT1 = 32768; -const int CSSM_ACL_AUTHORIZATION_SIGN = 115; +const int CSSM_CERTGROUP_DATA1 = 0; -const int CSSM_ACL_AUTHORIZATION_ENCRYPT = 35; +const int CSSM_CERTGROUP_ENCODED_CERT1 = 1; -const int CSSM_ACL_AUTHORIZATION_DECRYPT = 24; +const int CSSM_CERTGROUP_PARSED_CERT1 = 2; -const int CSSM_ACL_AUTHORIZATION_MAC = 59; +const int CSSM_CERTGROUP_CERT_PAIR1 = 3; -const int CSSM_ACL_AUTHORIZATION_DERIVE = 28; +const int CSSM_ACL_SUBJECT_TYPE_ANY1 = 1; -const int CSSM_ACL_AUTHORIZATION_DBS_CREATE = 22; +const int CSSM_ACL_SUBJECT_TYPE_THRESHOLD1 = 123; -const int CSSM_ACL_AUTHORIZATION_DBS_DELETE = 23; +const int CSSM_ACL_SUBJECT_TYPE_PASSWORD1 = 79; -const int CSSM_ACL_AUTHORIZATION_DB_READ = 21; +const int CSSM_ACL_SUBJECT_TYPE_PROTECTED_PASSWORD1 = 87; -const int CSSM_ACL_AUTHORIZATION_DB_INSERT = 19; +const int CSSM_ACL_SUBJECT_TYPE_PROMPTED_PASSWORD1 = 84; -const int CSSM_ACL_AUTHORIZATION_DB_MODIFY = 20; +const int CSSM_ACL_SUBJECT_TYPE_PUBLIC_KEY1 = 89; -const int CSSM_ACL_AUTHORIZATION_DB_DELETE = 17; +const int CSSM_ACL_SUBJECT_TYPE_HASHED_SUBJECT1 = 44; -const int CSSM_ACL_EDIT_MODE_ADD = 1; +const int CSSM_ACL_SUBJECT_TYPE_BIOMETRIC1 = 8; -const int CSSM_ACL_EDIT_MODE_DELETE = 2; +const int CSSM_ACL_SUBJECT_TYPE_PROTECTED_BIOMETRIC1 = 86; -const int CSSM_ACL_EDIT_MODE_REPLACE = 3; +const int CSSM_ACL_SUBJECT_TYPE_PROMPTED_BIOMETRIC1 = 83; -const int CSSM_KEYHEADER_VERSION = 2; +const int CSSM_ACL_SUBJECT_TYPE_LOGIN_NAME1 = 58; -const int CSSM_KEYBLOB_RAW = 0; +const int CSSM_ACL_SUBJECT_TYPE_EXT_PAM_NAME1 = 78; -const int CSSM_KEYBLOB_REFERENCE = 2; +const int CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START1 = 65536; -const int CSSM_KEYBLOB_WRAPPED = 3; +const int CSSM_ACL_AUTHORIZATION_ANY1 = 1; -const int CSSM_KEYBLOB_OTHER = -1; +const int CSSM_ACL_AUTHORIZATION_LOGIN1 = 57; -const int CSSM_KEYBLOB_RAW_FORMAT_NONE = 0; +const int CSSM_ACL_AUTHORIZATION_GENKEY1 = 41; -const int CSSM_KEYBLOB_RAW_FORMAT_PKCS1 = 1; +const int CSSM_ACL_AUTHORIZATION_DELETE1 = 25; -const int CSSM_KEYBLOB_RAW_FORMAT_PKCS3 = 2; +const int CSSM_ACL_AUTHORIZATION_EXPORT_WRAPPED1 = 38; -const int CSSM_KEYBLOB_RAW_FORMAT_MSCAPI = 3; +const int CSSM_ACL_AUTHORIZATION_EXPORT_CLEAR1 = 37; -const int CSSM_KEYBLOB_RAW_FORMAT_PGP = 4; +const int CSSM_ACL_AUTHORIZATION_IMPORT_WRAPPED1 = 48; -const int CSSM_KEYBLOB_RAW_FORMAT_FIPS186 = 5; +const int CSSM_ACL_AUTHORIZATION_IMPORT_CLEAR1 = 47; -const int CSSM_KEYBLOB_RAW_FORMAT_BSAFE = 6; +const int CSSM_ACL_AUTHORIZATION_SIGN1 = 115; -const int CSSM_KEYBLOB_RAW_FORMAT_CCA = 9; +const int CSSM_ACL_AUTHORIZATION_ENCRYPT1 = 35; -const int CSSM_KEYBLOB_RAW_FORMAT_PKCS8 = 10; +const int CSSM_ACL_AUTHORIZATION_DECRYPT1 = 24; -const int CSSM_KEYBLOB_RAW_FORMAT_SPKI = 11; +const int CSSM_ACL_AUTHORIZATION_MAC1 = 59; -const int CSSM_KEYBLOB_RAW_FORMAT_OCTET_STRING = 12; +const int CSSM_ACL_AUTHORIZATION_DERIVE1 = 28; -const int CSSM_KEYBLOB_RAW_FORMAT_OTHER = -1; +const int CSSM_ACL_AUTHORIZATION_DBS_CREATE1 = 22; -const int CSSM_KEYBLOB_WRAPPED_FORMAT_NONE = 0; +const int CSSM_ACL_AUTHORIZATION_DBS_DELETE1 = 23; -const int CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS8 = 1; +const int CSSM_ACL_AUTHORIZATION_DB_READ1 = 21; -const int CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS7 = 2; +const int CSSM_ACL_AUTHORIZATION_DB_INSERT1 = 19; -const int CSSM_KEYBLOB_WRAPPED_FORMAT_MSCAPI = 3; +const int CSSM_ACL_AUTHORIZATION_DB_MODIFY1 = 20; -const int CSSM_KEYBLOB_WRAPPED_FORMAT_OTHER = -1; +const int CSSM_ACL_AUTHORIZATION_DB_DELETE1 = 17; -const int CSSM_KEYBLOB_REF_FORMAT_INTEGER = 0; +const int CSSM_ACL_EDIT_MODE_ADD1 = 1; -const int CSSM_KEYBLOB_REF_FORMAT_STRING = 1; +const int CSSM_ACL_EDIT_MODE_DELETE1 = 2; -const int CSSM_KEYBLOB_REF_FORMAT_SPKI = 2; +const int CSSM_ACL_EDIT_MODE_REPLACE1 = 3; -const int CSSM_KEYBLOB_REF_FORMAT_OTHER = -1; +const int CSSM_KEYHEADER_VERSION1 = 2; -const int CSSM_KEYCLASS_PUBLIC_KEY = 0; +const int CSSM_KEYBLOB_RAW1 = 0; -const int CSSM_KEYCLASS_PRIVATE_KEY = 1; +const int CSSM_KEYBLOB_REFERENCE1 = 2; -const int CSSM_KEYCLASS_SESSION_KEY = 2; +const int CSSM_KEYBLOB_WRAPPED1 = 3; -const int CSSM_KEYCLASS_SECRET_PART = 3; +const int CSSM_KEYBLOB_OTHER1 = -1; -const int CSSM_KEYCLASS_OTHER = -1; +const int CSSM_KEYBLOB_RAW_FORMAT_NONE1 = 0; -const int CSSM_KEYATTR_RETURN_DEFAULT = 0; +const int CSSM_KEYBLOB_RAW_FORMAT_PKCS11 = 1; -const int CSSM_KEYATTR_RETURN_DATA = 268435456; +const int CSSM_KEYBLOB_RAW_FORMAT_PKCS31 = 2; -const int CSSM_KEYATTR_RETURN_REF = 536870912; +const int CSSM_KEYBLOB_RAW_FORMAT_MSCAPI1 = 3; -const int CSSM_KEYATTR_RETURN_NONE = 1073741824; +const int CSSM_KEYBLOB_RAW_FORMAT_PGP1 = 4; -const int CSSM_KEYATTR_PERMANENT = 1; +const int CSSM_KEYBLOB_RAW_FORMAT_FIPS1861 = 5; -const int CSSM_KEYATTR_PRIVATE = 2; +const int CSSM_KEYBLOB_RAW_FORMAT_BSAFE1 = 6; -const int CSSM_KEYATTR_MODIFIABLE = 4; +const int CSSM_KEYBLOB_RAW_FORMAT_CCA1 = 9; -const int CSSM_KEYATTR_SENSITIVE = 8; +const int CSSM_KEYBLOB_RAW_FORMAT_PKCS81 = 10; -const int CSSM_KEYATTR_EXTRACTABLE = 32; +const int CSSM_KEYBLOB_RAW_FORMAT_SPKI1 = 11; -const int CSSM_KEYATTR_ALWAYS_SENSITIVE = 16; +const int CSSM_KEYBLOB_RAW_FORMAT_OCTET_STRING1 = 12; -const int CSSM_KEYATTR_NEVER_EXTRACTABLE = 64; +const int CSSM_KEYBLOB_RAW_FORMAT_OTHER1 = -1; -const int CSSM_KEYUSE_ANY = -2147483648; +const int CSSM_KEYBLOB_WRAPPED_FORMAT_NONE1 = 0; -const int CSSM_KEYUSE_ENCRYPT = 1; +const int CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS81 = 1; -const int CSSM_KEYUSE_DECRYPT = 2; +const int CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS71 = 2; -const int CSSM_KEYUSE_SIGN = 4; +const int CSSM_KEYBLOB_WRAPPED_FORMAT_MSCAPI1 = 3; -const int CSSM_KEYUSE_VERIFY = 8; +const int CSSM_KEYBLOB_WRAPPED_FORMAT_OTHER1 = -1; -const int CSSM_KEYUSE_SIGN_RECOVER = 16; +const int CSSM_KEYBLOB_REF_FORMAT_INTEGER1 = 0; -const int CSSM_KEYUSE_VERIFY_RECOVER = 32; +const int CSSM_KEYBLOB_REF_FORMAT_STRING1 = 1; -const int CSSM_KEYUSE_WRAP = 64; +const int CSSM_KEYBLOB_REF_FORMAT_SPKI1 = 2; -const int CSSM_KEYUSE_UNWRAP = 128; +const int CSSM_KEYBLOB_REF_FORMAT_OTHER1 = -1; -const int CSSM_KEYUSE_DERIVE = 256; +const int CSSM_KEYCLASS_PUBLIC_KEY1 = 0; -const int CSSM_ALGID_NONE = 0; +const int CSSM_KEYCLASS_PRIVATE_KEY1 = 1; -const int CSSM_ALGID_CUSTOM = 1; +const int CSSM_KEYCLASS_SESSION_KEY1 = 2; -const int CSSM_ALGID_DH = 2; +const int CSSM_KEYCLASS_SECRET_PART1 = 3; -const int CSSM_ALGID_PH = 3; +const int CSSM_KEYCLASS_OTHER1 = -1; -const int CSSM_ALGID_KEA = 4; +const int CSSM_KEYATTR_RETURN_DEFAULT1 = 0; -const int CSSM_ALGID_MD2 = 5; +const int CSSM_KEYATTR_RETURN_DATA1 = 268435456; -const int CSSM_ALGID_MD4 = 6; +const int CSSM_KEYATTR_RETURN_REF1 = 536870912; -const int CSSM_ALGID_MD5 = 7; +const int CSSM_KEYATTR_RETURN_NONE1 = 1073741824; -const int CSSM_ALGID_SHA1 = 8; +const int CSSM_KEYATTR_PERMANENT1 = 1; -const int CSSM_ALGID_NHASH = 9; +const int CSSM_KEYATTR_PRIVATE1 = 2; -const int CSSM_ALGID_HAVAL = 10; +const int CSSM_KEYATTR_MODIFIABLE1 = 4; -const int CSSM_ALGID_RIPEMD = 11; +const int CSSM_KEYATTR_SENSITIVE1 = 8; -const int CSSM_ALGID_IBCHASH = 12; +const int CSSM_KEYATTR_EXTRACTABLE1 = 32; -const int CSSM_ALGID_RIPEMAC = 13; +const int CSSM_KEYATTR_ALWAYS_SENSITIVE1 = 16; -const int CSSM_ALGID_DES = 14; +const int CSSM_KEYATTR_NEVER_EXTRACTABLE1 = 64; -const int CSSM_ALGID_DESX = 15; +const int CSSM_KEYUSE_ANY1 = -2147483648; -const int CSSM_ALGID_RDES = 16; +const int CSSM_KEYUSE_ENCRYPT1 = 1; -const int CSSM_ALGID_3DES_3KEY_EDE = 17; +const int CSSM_KEYUSE_DECRYPT1 = 2; -const int CSSM_ALGID_3DES_2KEY_EDE = 18; +const int CSSM_KEYUSE_SIGN1 = 4; -const int CSSM_ALGID_3DES_1KEY_EEE = 19; +const int CSSM_KEYUSE_VERIFY1 = 8; -const int CSSM_ALGID_3DES_3KEY = 17; +const int CSSM_KEYUSE_SIGN_RECOVER1 = 16; -const int CSSM_ALGID_3DES_3KEY_EEE = 20; +const int CSSM_KEYUSE_VERIFY_RECOVER1 = 32; -const int CSSM_ALGID_3DES_2KEY = 18; +const int CSSM_KEYUSE_WRAP1 = 64; -const int CSSM_ALGID_3DES_2KEY_EEE = 21; +const int CSSM_KEYUSE_UNWRAP1 = 128; -const int CSSM_ALGID_3DES_1KEY = 20; +const int CSSM_KEYUSE_DERIVE1 = 256; -const int CSSM_ALGID_IDEA = 22; +const int CSSM_ALGID_NONE1 = 0; -const int CSSM_ALGID_RC2 = 23; +const int CSSM_ALGID_CUSTOM1 = 1; -const int CSSM_ALGID_RC5 = 24; +const int CSSM_ALGID_DH1 = 2; -const int CSSM_ALGID_RC4 = 25; +const int CSSM_ALGID_PH1 = 3; -const int CSSM_ALGID_SEAL = 26; +const int CSSM_ALGID_KEA1 = 4; -const int CSSM_ALGID_CAST = 27; +const int CSSM_ALGID_MD21 = 5; -const int CSSM_ALGID_BLOWFISH = 28; +const int CSSM_ALGID_MD41 = 6; -const int CSSM_ALGID_SKIPJACK = 29; +const int CSSM_ALGID_MD51 = 7; -const int CSSM_ALGID_LUCIFER = 30; +const int CSSM_ALGID_SHA11 = 8; -const int CSSM_ALGID_MADRYGA = 31; +const int CSSM_ALGID_NHASH1 = 9; -const int CSSM_ALGID_FEAL = 32; +const int CSSM_ALGID_HAVAL1 = 10; -const int CSSM_ALGID_REDOC = 33; +const int CSSM_ALGID_RIPEMD1 = 11; -const int CSSM_ALGID_REDOC3 = 34; +const int CSSM_ALGID_IBCHASH1 = 12; -const int CSSM_ALGID_LOKI = 35; +const int CSSM_ALGID_RIPEMAC1 = 13; -const int CSSM_ALGID_KHUFU = 36; +const int CSSM_ALGID_DES1 = 14; -const int CSSM_ALGID_KHAFRE = 37; +const int CSSM_ALGID_DESX1 = 15; -const int CSSM_ALGID_MMB = 38; +const int CSSM_ALGID_RDES1 = 16; -const int CSSM_ALGID_GOST = 39; +const int CSSM_ALGID_3DES_3KEY_EDE1 = 17; -const int CSSM_ALGID_SAFER = 40; +const int CSSM_ALGID_3DES_2KEY_EDE1 = 18; -const int CSSM_ALGID_CRAB = 41; +const int CSSM_ALGID_3DES_1KEY_EEE1 = 19; -const int CSSM_ALGID_RSA = 42; +const int CSSM_ALGID_3DES_3KEY1 = 17; -const int CSSM_ALGID_DSA = 43; +const int CSSM_ALGID_3DES_3KEY_EEE1 = 20; -const int CSSM_ALGID_MD5WithRSA = 44; +const int CSSM_ALGID_3DES_2KEY1 = 18; -const int CSSM_ALGID_MD2WithRSA = 45; +const int CSSM_ALGID_3DES_2KEY_EEE1 = 21; -const int CSSM_ALGID_ElGamal = 46; +const int CSSM_ALGID_3DES_1KEY1 = 20; -const int CSSM_ALGID_MD2Random = 47; +const int CSSM_ALGID_IDEA1 = 22; -const int CSSM_ALGID_MD5Random = 48; +const int CSSM_ALGID_RC21 = 23; -const int CSSM_ALGID_SHARandom = 49; +const int CSSM_ALGID_RC51 = 24; -const int CSSM_ALGID_DESRandom = 50; +const int CSSM_ALGID_RC41 = 25; -const int CSSM_ALGID_SHA1WithRSA = 51; +const int CSSM_ALGID_SEAL1 = 26; -const int CSSM_ALGID_CDMF = 52; +const int CSSM_ALGID_CAST1 = 27; -const int CSSM_ALGID_CAST3 = 53; +const int CSSM_ALGID_BLOWFISH1 = 28; -const int CSSM_ALGID_CAST5 = 54; +const int CSSM_ALGID_SKIPJACK1 = 29; -const int CSSM_ALGID_GenericSecret = 55; +const int CSSM_ALGID_LUCIFER1 = 30; -const int CSSM_ALGID_ConcatBaseAndKey = 56; +const int CSSM_ALGID_MADRYGA1 = 31; -const int CSSM_ALGID_ConcatKeyAndBase = 57; +const int CSSM_ALGID_FEAL1 = 32; -const int CSSM_ALGID_ConcatBaseAndData = 58; +const int CSSM_ALGID_REDOC1 = 33; -const int CSSM_ALGID_ConcatDataAndBase = 59; +const int CSSM_ALGID_REDOC31 = 34; -const int CSSM_ALGID_XORBaseAndData = 60; +const int CSSM_ALGID_LOKI1 = 35; -const int CSSM_ALGID_ExtractFromKey = 61; +const int CSSM_ALGID_KHUFU1 = 36; -const int CSSM_ALGID_SSL3PrePrimaryGen = 62; +const int CSSM_ALGID_KHAFRE1 = 37; -const int CSSM_ALGID_SSL3PreMasterGen = 62; +const int CSSM_ALGID_MMB1 = 38; -const int CSSM_ALGID_SSL3PrimaryDerive = 63; +const int CSSM_ALGID_GOST1 = 39; -const int CSSM_ALGID_SSL3MasterDerive = 63; +const int CSSM_ALGID_SAFER1 = 40; -const int CSSM_ALGID_SSL3KeyAndMacDerive = 64; +const int CSSM_ALGID_CRAB1 = 41; -const int CSSM_ALGID_SSL3MD5_MAC = 65; +const int CSSM_ALGID_RSA1 = 42; -const int CSSM_ALGID_SSL3SHA1_MAC = 66; +const int CSSM_ALGID_DSA1 = 43; -const int CSSM_ALGID_PKCS5_PBKDF1_MD5 = 67; +const int CSSM_ALGID_MD5WithRSA1 = 44; -const int CSSM_ALGID_PKCS5_PBKDF1_MD2 = 68; +const int CSSM_ALGID_MD2WithRSA1 = 45; -const int CSSM_ALGID_PKCS5_PBKDF1_SHA1 = 69; +const int CSSM_ALGID_ElGamal1 = 46; -const int CSSM_ALGID_WrapLynks = 70; +const int CSSM_ALGID_MD2Random1 = 47; -const int CSSM_ALGID_WrapSET_OAEP = 71; +const int CSSM_ALGID_MD5Random1 = 48; -const int CSSM_ALGID_BATON = 72; +const int CSSM_ALGID_SHARandom1 = 49; -const int CSSM_ALGID_ECDSA = 73; +const int CSSM_ALGID_DESRandom1 = 50; -const int CSSM_ALGID_MAYFLY = 74; +const int CSSM_ALGID_SHA1WithRSA1 = 51; -const int CSSM_ALGID_JUNIPER = 75; +const int CSSM_ALGID_CDMF1 = 52; -const int CSSM_ALGID_FASTHASH = 76; +const int CSSM_ALGID_CAST31 = 53; -const int CSSM_ALGID_3DES = 77; +const int CSSM_ALGID_CAST51 = 54; -const int CSSM_ALGID_SSL3MD5 = 78; +const int CSSM_ALGID_GenericSecret1 = 55; -const int CSSM_ALGID_SSL3SHA1 = 79; +const int CSSM_ALGID_ConcatBaseAndKey1 = 56; -const int CSSM_ALGID_FortezzaTimestamp = 80; +const int CSSM_ALGID_ConcatKeyAndBase1 = 57; -const int CSSM_ALGID_SHA1WithDSA = 81; +const int CSSM_ALGID_ConcatBaseAndData1 = 58; -const int CSSM_ALGID_SHA1WithECDSA = 82; +const int CSSM_ALGID_ConcatDataAndBase1 = 59; -const int CSSM_ALGID_DSA_BSAFE = 83; +const int CSSM_ALGID_XORBaseAndData1 = 60; -const int CSSM_ALGID_ECDH = 84; +const int CSSM_ALGID_ExtractFromKey1 = 61; -const int CSSM_ALGID_ECMQV = 85; +const int CSSM_ALGID_SSL3PrePrimaryGen1 = 62; -const int CSSM_ALGID_PKCS12_SHA1_PBE = 86; +const int CSSM_ALGID_SSL3PreMasterGen1 = 62; -const int CSSM_ALGID_ECNRA = 87; +const int CSSM_ALGID_SSL3PrimaryDerive1 = 63; -const int CSSM_ALGID_SHA1WithECNRA = 88; +const int CSSM_ALGID_SSL3MasterDerive1 = 63; -const int CSSM_ALGID_ECES = 89; +const int CSSM_ALGID_SSL3KeyAndMacDerive1 = 64; -const int CSSM_ALGID_ECAES = 90; +const int CSSM_ALGID_SSL3MD5_MAC1 = 65; -const int CSSM_ALGID_SHA1HMAC = 91; +const int CSSM_ALGID_SSL3SHA1_MAC1 = 66; -const int CSSM_ALGID_FIPS186Random = 92; +const int CSSM_ALGID_PKCS5_PBKDF1_MD51 = 67; -const int CSSM_ALGID_ECC = 93; +const int CSSM_ALGID_PKCS5_PBKDF1_MD21 = 68; -const int CSSM_ALGID_MQV = 94; +const int CSSM_ALGID_PKCS5_PBKDF1_SHA11 = 69; -const int CSSM_ALGID_NRA = 95; +const int CSSM_ALGID_WrapLynks1 = 70; -const int CSSM_ALGID_IntelPlatformRandom = 96; +const int CSSM_ALGID_WrapSET_OAEP1 = 71; -const int CSSM_ALGID_UTC = 97; +const int CSSM_ALGID_BATON1 = 72; -const int CSSM_ALGID_HAVAL3 = 98; +const int CSSM_ALGID_ECDSA1 = 73; -const int CSSM_ALGID_HAVAL4 = 99; +const int CSSM_ALGID_MAYFLY1 = 74; -const int CSSM_ALGID_HAVAL5 = 100; +const int CSSM_ALGID_JUNIPER1 = 75; -const int CSSM_ALGID_TIGER = 101; +const int CSSM_ALGID_FASTHASH1 = 76; -const int CSSM_ALGID_MD5HMAC = 102; +const int CSSM_ALGID_3DES1 = 77; -const int CSSM_ALGID_PKCS5_PBKDF2 = 103; +const int CSSM_ALGID_SSL3MD51 = 78; -const int CSSM_ALGID_RUNNING_COUNTER = 104; +const int CSSM_ALGID_SSL3SHA11 = 79; -const int CSSM_ALGID_LAST = 2147483647; +const int CSSM_ALGID_FortezzaTimestamp1 = 80; -const int CSSM_ALGID_VENDOR_DEFINED = -2147483648; +const int CSSM_ALGID_SHA1WithDSA1 = 81; -const int CSSM_ALGMODE_NONE = 0; +const int CSSM_ALGID_SHA1WithECDSA1 = 82; -const int CSSM_ALGMODE_CUSTOM = 1; +const int CSSM_ALGID_DSA_BSAFE1 = 83; -const int CSSM_ALGMODE_ECB = 2; +const int CSSM_ALGID_ECDH1 = 84; -const int CSSM_ALGMODE_ECBPad = 3; +const int CSSM_ALGID_ECMQV1 = 85; -const int CSSM_ALGMODE_CBC = 4; +const int CSSM_ALGID_PKCS12_SHA1_PBE1 = 86; -const int CSSM_ALGMODE_CBC_IV8 = 5; +const int CSSM_ALGID_ECNRA1 = 87; -const int CSSM_ALGMODE_CBCPadIV8 = 6; +const int CSSM_ALGID_SHA1WithECNRA1 = 88; -const int CSSM_ALGMODE_CFB = 7; +const int CSSM_ALGID_ECES1 = 89; -const int CSSM_ALGMODE_CFB_IV8 = 8; +const int CSSM_ALGID_ECAES1 = 90; -const int CSSM_ALGMODE_CFBPadIV8 = 9; +const int CSSM_ALGID_SHA1HMAC1 = 91; -const int CSSM_ALGMODE_OFB = 10; +const int CSSM_ALGID_FIPS186Random1 = 92; -const int CSSM_ALGMODE_OFB_IV8 = 11; +const int CSSM_ALGID_ECC1 = 93; -const int CSSM_ALGMODE_OFBPadIV8 = 12; +const int CSSM_ALGID_MQV1 = 94; -const int CSSM_ALGMODE_COUNTER = 13; +const int CSSM_ALGID_NRA1 = 95; -const int CSSM_ALGMODE_BC = 14; +const int CSSM_ALGID_IntelPlatformRandom1 = 96; -const int CSSM_ALGMODE_PCBC = 15; +const int CSSM_ALGID_UTC1 = 97; -const int CSSM_ALGMODE_CBCC = 16; +const int CSSM_ALGID_HAVAL31 = 98; -const int CSSM_ALGMODE_OFBNLF = 17; +const int CSSM_ALGID_HAVAL41 = 99; -const int CSSM_ALGMODE_PBC = 18; +const int CSSM_ALGID_HAVAL51 = 100; -const int CSSM_ALGMODE_PFB = 19; +const int CSSM_ALGID_TIGER1 = 101; -const int CSSM_ALGMODE_CBCPD = 20; +const int CSSM_ALGID_MD5HMAC1 = 102; -const int CSSM_ALGMODE_PUBLIC_KEY = 21; +const int CSSM_ALGID_PKCS5_PBKDF21 = 103; -const int CSSM_ALGMODE_PRIVATE_KEY = 22; +const int CSSM_ALGID_RUNNING_COUNTER1 = 104; -const int CSSM_ALGMODE_SHUFFLE = 23; +const int CSSM_ALGID_LAST1 = 2147483647; -const int CSSM_ALGMODE_ECB64 = 24; +const int CSSM_ALGID_VENDOR_DEFINED1 = -2147483648; -const int CSSM_ALGMODE_CBC64 = 25; +const int CSSM_ALGMODE_NONE1 = 0; -const int CSSM_ALGMODE_OFB64 = 26; +const int CSSM_ALGMODE_CUSTOM1 = 1; -const int CSSM_ALGMODE_CFB32 = 28; +const int CSSM_ALGMODE_ECB1 = 2; -const int CSSM_ALGMODE_CFB16 = 29; +const int CSSM_ALGMODE_ECBPad1 = 3; -const int CSSM_ALGMODE_CFB8 = 30; +const int CSSM_ALGMODE_CBC1 = 4; -const int CSSM_ALGMODE_WRAP = 31; +const int CSSM_ALGMODE_CBC_IV81 = 5; -const int CSSM_ALGMODE_PRIVATE_WRAP = 32; +const int CSSM_ALGMODE_CBCPadIV81 = 6; -const int CSSM_ALGMODE_RELAYX = 33; +const int CSSM_ALGMODE_CFB1 = 7; -const int CSSM_ALGMODE_ECB128 = 34; +const int CSSM_ALGMODE_CFB_IV81 = 8; -const int CSSM_ALGMODE_ECB96 = 35; +const int CSSM_ALGMODE_CFBPadIV81 = 9; -const int CSSM_ALGMODE_CBC128 = 36; +const int CSSM_ALGMODE_OFB1 = 10; -const int CSSM_ALGMODE_OAEP_HASH = 37; +const int CSSM_ALGMODE_OFB_IV81 = 11; -const int CSSM_ALGMODE_PKCS1_EME_V15 = 38; +const int CSSM_ALGMODE_OFBPadIV81 = 12; -const int CSSM_ALGMODE_PKCS1_EME_OAEP = 39; +const int CSSM_ALGMODE_COUNTER1 = 13; -const int CSSM_ALGMODE_PKCS1_EMSA_V15 = 40; +const int CSSM_ALGMODE_BC1 = 14; -const int CSSM_ALGMODE_ISO_9796 = 41; +const int CSSM_ALGMODE_PCBC1 = 15; -const int CSSM_ALGMODE_X9_31 = 42; +const int CSSM_ALGMODE_CBCC1 = 16; -const int CSSM_ALGMODE_LAST = 2147483647; +const int CSSM_ALGMODE_OFBNLF1 = 17; -const int CSSM_ALGMODE_VENDOR_DEFINED = -2147483648; +const int CSSM_ALGMODE_PBC1 = 18; -const int CSSM_CSP_SOFTWARE = 1; +const int CSSM_ALGMODE_PFB1 = 19; -const int CSSM_CSP_HARDWARE = 2; +const int CSSM_ALGMODE_CBCPD1 = 20; -const int CSSM_CSP_HYBRID = 3; +const int CSSM_ALGMODE_PUBLIC_KEY1 = 21; -const int CSSM_ALGCLASS_NONE = 0; +const int CSSM_ALGMODE_PRIVATE_KEY1 = 22; -const int CSSM_ALGCLASS_CUSTOM = 1; +const int CSSM_ALGMODE_SHUFFLE1 = 23; -const int CSSM_ALGCLASS_SIGNATURE = 2; +const int CSSM_ALGMODE_ECB641 = 24; -const int CSSM_ALGCLASS_SYMMETRIC = 3; +const int CSSM_ALGMODE_CBC641 = 25; -const int CSSM_ALGCLASS_DIGEST = 4; +const int CSSM_ALGMODE_OFB641 = 26; -const int CSSM_ALGCLASS_RANDOMGEN = 5; +const int CSSM_ALGMODE_CFB321 = 28; -const int CSSM_ALGCLASS_UNIQUEGEN = 6; +const int CSSM_ALGMODE_CFB161 = 29; -const int CSSM_ALGCLASS_MAC = 7; +const int CSSM_ALGMODE_CFB81 = 30; -const int CSSM_ALGCLASS_ASYMMETRIC = 8; +const int CSSM_ALGMODE_WRAP1 = 31; -const int CSSM_ALGCLASS_KEYGEN = 9; +const int CSSM_ALGMODE_PRIVATE_WRAP1 = 32; -const int CSSM_ALGCLASS_DERIVEKEY = 10; +const int CSSM_ALGMODE_RELAYX1 = 33; -const int CSSM_ATTRIBUTE_DATA_NONE = 0; +const int CSSM_ALGMODE_ECB1281 = 34; -const int CSSM_ATTRIBUTE_DATA_UINT32 = 268435456; +const int CSSM_ALGMODE_ECB961 = 35; -const int CSSM_ATTRIBUTE_DATA_CSSM_DATA = 536870912; +const int CSSM_ALGMODE_CBC1281 = 36; -const int CSSM_ATTRIBUTE_DATA_CRYPTO_DATA = 805306368; +const int CSSM_ALGMODE_OAEP_HASH1 = 37; -const int CSSM_ATTRIBUTE_DATA_KEY = 1073741824; +const int CSSM_ALGMODE_PKCS1_EME_V151 = 38; -const int CSSM_ATTRIBUTE_DATA_STRING = 1342177280; +const int CSSM_ALGMODE_PKCS1_EME_OAEP1 = 39; -const int CSSM_ATTRIBUTE_DATA_DATE = 1610612736; +const int CSSM_ALGMODE_PKCS1_EMSA_V151 = 40; -const int CSSM_ATTRIBUTE_DATA_RANGE = 1879048192; +const int CSSM_ALGMODE_ISO_97961 = 41; -const int CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS = -2147483648; +const int CSSM_ALGMODE_X9_311 = 42; -const int CSSM_ATTRIBUTE_DATA_VERSION = 16777216; +const int CSSM_ALGMODE_LAST1 = 2147483647; -const int CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE = 33554432; +const int CSSM_ALGMODE_VENDOR_DEFINED1 = -2147483648; -const int CSSM_ATTRIBUTE_DATA_KR_PROFILE = 50331648; +const int CSSM_CSP_SOFTWARE1 = 1; -const int CSSM_ATTRIBUTE_TYPE_MASK = -16777216; +const int CSSM_CSP_HARDWARE1 = 2; -const int CSSM_ATTRIBUTE_NONE = 0; +const int CSSM_CSP_HYBRID1 = 3; -const int CSSM_ATTRIBUTE_CUSTOM = 536870913; +const int CSSM_ALGCLASS_NONE1 = 0; -const int CSSM_ATTRIBUTE_DESCRIPTION = 1342177282; +const int CSSM_ALGCLASS_CUSTOM1 = 1; -const int CSSM_ATTRIBUTE_KEY = 1073741827; +const int CSSM_ALGCLASS_SIGNATURE1 = 2; -const int CSSM_ATTRIBUTE_INIT_VECTOR = 536870916; +const int CSSM_ALGCLASS_SYMMETRIC1 = 3; -const int CSSM_ATTRIBUTE_SALT = 536870917; +const int CSSM_ALGCLASS_DIGEST1 = 4; -const int CSSM_ATTRIBUTE_PADDING = 268435462; +const int CSSM_ALGCLASS_RANDOMGEN1 = 5; -const int CSSM_ATTRIBUTE_RANDOM = 536870919; +const int CSSM_ALGCLASS_UNIQUEGEN1 = 6; -const int CSSM_ATTRIBUTE_SEED = 805306376; +const int CSSM_ALGCLASS_MAC1 = 7; -const int CSSM_ATTRIBUTE_PASSPHRASE = 805306377; +const int CSSM_ALGCLASS_ASYMMETRIC1 = 8; -const int CSSM_ATTRIBUTE_KEY_LENGTH = 268435466; +const int CSSM_ALGCLASS_KEYGEN1 = 9; -const int CSSM_ATTRIBUTE_KEY_LENGTH_RANGE = 1879048203; +const int CSSM_ALGCLASS_DERIVEKEY1 = 10; -const int CSSM_ATTRIBUTE_BLOCK_SIZE = 268435468; +const int CSSM_ATTRIBUTE_DATA_NONE1 = 0; -const int CSSM_ATTRIBUTE_OUTPUT_SIZE = 268435469; +const int CSSM_ATTRIBUTE_DATA_UINT321 = 268435456; -const int CSSM_ATTRIBUTE_ROUNDS = 268435470; +const int CSSM_ATTRIBUTE_DATA_CSSM_DATA1 = 536870912; -const int CSSM_ATTRIBUTE_IV_SIZE = 268435471; +const int CSSM_ATTRIBUTE_DATA_CRYPTO_DATA1 = 805306368; -const int CSSM_ATTRIBUTE_ALG_PARAMS = 536870928; +const int CSSM_ATTRIBUTE_DATA_KEY1 = 1073741824; -const int CSSM_ATTRIBUTE_LABEL = 536870929; +const int CSSM_ATTRIBUTE_DATA_STRING1 = 1342177280; -const int CSSM_ATTRIBUTE_KEY_TYPE = 268435474; +const int CSSM_ATTRIBUTE_DATA_DATE1 = 1610612736; -const int CSSM_ATTRIBUTE_MODE = 268435475; +const int CSSM_ATTRIBUTE_DATA_RANGE1 = 1879048192; -const int CSSM_ATTRIBUTE_EFFECTIVE_BITS = 268435476; +const int CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS1 = -2147483648; -const int CSSM_ATTRIBUTE_START_DATE = 1610612757; +const int CSSM_ATTRIBUTE_DATA_VERSION1 = 16777216; -const int CSSM_ATTRIBUTE_END_DATE = 1610612758; +const int CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE1 = 33554432; -const int CSSM_ATTRIBUTE_KEYUSAGE = 268435479; +const int CSSM_ATTRIBUTE_DATA_KR_PROFILE1 = 50331648; -const int CSSM_ATTRIBUTE_KEYATTR = 268435480; +const int CSSM_ATTRIBUTE_TYPE_MASK1 = -16777216; -const int CSSM_ATTRIBUTE_VERSION = 16777241; +const int CSSM_ATTRIBUTE_NONE1 = 0; -const int CSSM_ATTRIBUTE_PRIME = 536870938; +const int CSSM_ATTRIBUTE_CUSTOM1 = 536870913; -const int CSSM_ATTRIBUTE_BASE = 536870939; +const int CSSM_ATTRIBUTE_DESCRIPTION1 = 1342177282; -const int CSSM_ATTRIBUTE_SUBPRIME = 536870940; +const int CSSM_ATTRIBUTE_KEY1 = 1073741827; -const int CSSM_ATTRIBUTE_ALG_ID = 268435485; +const int CSSM_ATTRIBUTE_INIT_VECTOR1 = 536870916; -const int CSSM_ATTRIBUTE_ITERATION_COUNT = 268435486; +const int CSSM_ATTRIBUTE_SALT1 = 536870917; -const int CSSM_ATTRIBUTE_ROUNDS_RANGE = 1879048223; +const int CSSM_ATTRIBUTE_PADDING1 = 268435462; -const int CSSM_ATTRIBUTE_KRPROFILE_LOCAL = 50331680; +const int CSSM_ATTRIBUTE_RANDOM1 = 536870919; -const int CSSM_ATTRIBUTE_KRPROFILE_REMOTE = 50331681; +const int CSSM_ATTRIBUTE_SEED1 = 805306376; -const int CSSM_ATTRIBUTE_CSP_HANDLE = 268435490; +const int CSSM_ATTRIBUTE_PASSPHRASE1 = 805306377; -const int CSSM_ATTRIBUTE_DL_DB_HANDLE = 33554467; +const int CSSM_ATTRIBUTE_KEY_LENGTH1 = 268435466; -const int CSSM_ATTRIBUTE_ACCESS_CREDENTIALS = -2147483612; +const int CSSM_ATTRIBUTE_KEY_LENGTH_RANGE1 = 1879048203; -const int CSSM_ATTRIBUTE_PUBLIC_KEY_FORMAT = 268435493; +const int CSSM_ATTRIBUTE_BLOCK_SIZE1 = 268435468; -const int CSSM_ATTRIBUTE_PRIVATE_KEY_FORMAT = 268435494; +const int CSSM_ATTRIBUTE_OUTPUT_SIZE1 = 268435469; -const int CSSM_ATTRIBUTE_SYMMETRIC_KEY_FORMAT = 268435495; +const int CSSM_ATTRIBUTE_ROUNDS1 = 268435470; -const int CSSM_ATTRIBUTE_WRAPPED_KEY_FORMAT = 268435496; +const int CSSM_ATTRIBUTE_IV_SIZE1 = 268435471; -const int CSSM_PADDING_NONE = 0; +const int CSSM_ATTRIBUTE_ALG_PARAMS1 = 536870928; -const int CSSM_PADDING_CUSTOM = 1; +const int CSSM_ATTRIBUTE_LABEL1 = 536870929; -const int CSSM_PADDING_ZERO = 2; +const int CSSM_ATTRIBUTE_KEY_TYPE1 = 268435474; -const int CSSM_PADDING_ONE = 3; +const int CSSM_ATTRIBUTE_MODE1 = 268435475; -const int CSSM_PADDING_ALTERNATE = 4; +const int CSSM_ATTRIBUTE_EFFECTIVE_BITS1 = 268435476; -const int CSSM_PADDING_FF = 5; +const int CSSM_ATTRIBUTE_START_DATE1 = 1610612757; -const int CSSM_PADDING_PKCS5 = 6; +const int CSSM_ATTRIBUTE_END_DATE1 = 1610612758; -const int CSSM_PADDING_PKCS7 = 7; +const int CSSM_ATTRIBUTE_KEYUSAGE1 = 268435479; -const int CSSM_PADDING_CIPHERSTEALING = 8; +const int CSSM_ATTRIBUTE_KEYATTR1 = 268435480; -const int CSSM_PADDING_RANDOM = 9; +const int CSSM_ATTRIBUTE_VERSION1 = 16777241; -const int CSSM_PADDING_PKCS1 = 10; +const int CSSM_ATTRIBUTE_PRIME1 = 536870938; -const int CSSM_PADDING_SIGRAW = 11; +const int CSSM_ATTRIBUTE_BASE1 = 536870939; -const int CSSM_PADDING_VENDOR_DEFINED = -2147483648; +const int CSSM_ATTRIBUTE_SUBPRIME1 = 536870940; -const int CSSM_CSP_TOK_RNG = 1; +const int CSSM_ATTRIBUTE_ALG_ID1 = 268435485; -const int CSSM_CSP_TOK_CLOCK_EXISTS = 64; +const int CSSM_ATTRIBUTE_ITERATION_COUNT1 = 268435486; -const int CSSM_CSP_RDR_TOKENPRESENT = 1; +const int CSSM_ATTRIBUTE_ROUNDS_RANGE1 = 1879048223; -const int CSSM_CSP_RDR_EXISTS = 2; +const int CSSM_ATTRIBUTE_KRPROFILE_LOCAL1 = 50331680; -const int CSSM_CSP_RDR_HW = 4; +const int CSSM_ATTRIBUTE_KRPROFILE_REMOTE1 = 50331681; -const int CSSM_CSP_TOK_WRITE_PROTECTED = 2; +const int CSSM_ATTRIBUTE_CSP_HANDLE1 = 268435490; -const int CSSM_CSP_TOK_LOGIN_REQUIRED = 4; +const int CSSM_ATTRIBUTE_DL_DB_HANDLE1 = 33554467; -const int CSSM_CSP_TOK_USER_PIN_INITIALIZED = 8; +const int CSSM_ATTRIBUTE_ACCESS_CREDENTIALS1 = -2147483612; -const int CSSM_CSP_TOK_PROT_AUTHENTICATION = 256; +const int CSSM_ATTRIBUTE_PUBLIC_KEY_FORMAT1 = 268435493; -const int CSSM_CSP_TOK_USER_PIN_EXPIRED = 1048576; +const int CSSM_ATTRIBUTE_PRIVATE_KEY_FORMAT1 = 268435494; -const int CSSM_CSP_TOK_SESSION_KEY_PASSWORD = 2097152; +const int CSSM_ATTRIBUTE_SYMMETRIC_KEY_FORMAT1 = 268435495; -const int CSSM_CSP_TOK_PRIVATE_KEY_PASSWORD = 4194304; +const int CSSM_ATTRIBUTE_WRAPPED_KEY_FORMAT1 = 268435496; -const int CSSM_CSP_STORES_PRIVATE_KEYS = 16777216; +const int CSSM_PADDING_NONE1 = 0; -const int CSSM_CSP_STORES_PUBLIC_KEYS = 33554432; +const int CSSM_PADDING_CUSTOM1 = 1; -const int CSSM_CSP_STORES_SESSION_KEYS = 67108864; +const int CSSM_PADDING_ZERO1 = 2; -const int CSSM_CSP_STORES_CERTIFICATES = 134217728; +const int CSSM_PADDING_ONE1 = 3; -const int CSSM_CSP_STORES_GENERIC = 268435456; +const int CSSM_PADDING_ALTERNATE1 = 4; -const int CSSM_PKCS_OAEP_MGF_NONE = 0; +const int CSSM_PADDING_FF1 = 5; -const int CSSM_PKCS_OAEP_MGF1_SHA1 = 1; +const int CSSM_PADDING_PKCS51 = 6; -const int CSSM_PKCS_OAEP_MGF1_MD5 = 2; +const int CSSM_PADDING_PKCS71 = 7; -const int CSSM_PKCS_OAEP_PSOURCE_NONE = 0; +const int CSSM_PADDING_CIPHERSTEALING1 = 8; -const int CSSM_PKCS_OAEP_PSOURCE_Pspecified = 1; +const int CSSM_PADDING_RANDOM1 = 9; -const int CSSM_VALUE_NOT_AVAILABLE = -1; +const int CSSM_PADDING_PKCS11 = 10; -const int CSSM_PKCS5_PBKDF2_PRF_HMAC_SHA1 = 0; +const int CSSM_PADDING_SIGRAW1 = 11; -const int CSSM_TP_AUTHORITY_REQUEST_CERTISSUE = 1; +const int CSSM_PADDING_VENDOR_DEFINED1 = -2147483648; -const int CSSM_TP_AUTHORITY_REQUEST_CERTREVOKE = 2; +const int CSSM_CSP_TOK_RNG1 = 1; -const int CSSM_TP_AUTHORITY_REQUEST_CERTSUSPEND = 3; +const int CSSM_CSP_TOK_CLOCK_EXISTS1 = 64; -const int CSSM_TP_AUTHORITY_REQUEST_CERTRESUME = 4; +const int CSSM_CSP_RDR_TOKENPRESENT1 = 1; -const int CSSM_TP_AUTHORITY_REQUEST_CERTVERIFY = 5; +const int CSSM_CSP_RDR_EXISTS1 = 2; -const int CSSM_TP_AUTHORITY_REQUEST_CERTNOTARIZE = 6; +const int CSSM_CSP_RDR_HW1 = 4; -const int CSSM_TP_AUTHORITY_REQUEST_CERTUSERECOVER = 7; +const int CSSM_CSP_TOK_WRITE_PROTECTED1 = 2; -const int CSSM_TP_AUTHORITY_REQUEST_CRLISSUE = 256; +const int CSSM_CSP_TOK_LOGIN_REQUIRED1 = 4; -const int CSSM_TP_KEY_ARCHIVE = 1; +const int CSSM_CSP_TOK_USER_PIN_INITIALIZED1 = 8; -const int CSSM_TP_CERT_PUBLISH = 2; +const int CSSM_CSP_TOK_PROT_AUTHENTICATION1 = 256; -const int CSSM_TP_CERT_NOTIFY_RENEW = 4; +const int CSSM_CSP_TOK_USER_PIN_EXPIRED1 = 1048576; -const int CSSM_TP_CERT_DIR_UPDATE = 8; +const int CSSM_CSP_TOK_SESSION_KEY_PASSWORD1 = 2097152; -const int CSSM_TP_CRL_DISTRIBUTE = 16; +const int CSSM_CSP_TOK_PRIVATE_KEY_PASSWORD1 = 4194304; -const int CSSM_TP_ACTION_DEFAULT = 0; +const int CSSM_CSP_STORES_PRIVATE_KEYS1 = 16777216; -const int CSSM_TP_STOP_ON_POLICY = 0; +const int CSSM_CSP_STORES_PUBLIC_KEYS1 = 33554432; -const int CSSM_TP_STOP_ON_NONE = 1; +const int CSSM_CSP_STORES_SESSION_KEYS1 = 67108864; -const int CSSM_TP_STOP_ON_FIRST_PASS = 2; +const int CSSM_CSP_STORES_CERTIFICATES1 = 134217728; -const int CSSM_TP_STOP_ON_FIRST_FAIL = 3; +const int CSSM_CSP_STORES_GENERIC1 = 268435456; -const int CSSM_CRL_PARSE_FORMAT_NONE = 0; +const int CSSM_PKCS_OAEP_MGF_NONE1 = 0; -const int CSSM_CRL_PARSE_FORMAT_CUSTOM = 1; +const int CSSM_PKCS_OAEP_MGF1_SHA11 = 1; -const int CSSM_CRL_PARSE_FORMAT_SEXPR = 2; +const int CSSM_PKCS_OAEP_MGF1_MD51 = 2; -const int CSSM_CRL_PARSE_FORMAT_COMPLEX = 3; +const int CSSM_PKCS_OAEP_PSOURCE_NONE1 = 0; -const int CSSM_CRL_PARSE_FORMAT_OID_NAMED = 4; +const int CSSM_PKCS_OAEP_PSOURCE_Pspecified1 = 1; -const int CSSM_CRL_PARSE_FORMAT_TUPLE = 5; +const int CSSM_VALUE_NOT_AVAILABLE1 = -1; -const int CSSM_CRL_PARSE_FORMAT_MULTIPLE = 32766; +const int CSSM_PKCS5_PBKDF2_PRF_HMAC_SHA11 = 0; -const int CSSM_CRL_PARSE_FORMAT_LAST = 32767; +const int CSSM_TP_AUTHORITY_REQUEST_CERTISSUE1 = 1; -const int CSSM_CL_CUSTOM_CRL_PARSE_FORMAT = 32768; +const int CSSM_TP_AUTHORITY_REQUEST_CERTREVOKE1 = 2; -const int CSSM_CRL_TYPE_UNKNOWN = 0; +const int CSSM_TP_AUTHORITY_REQUEST_CERTSUSPEND1 = 3; -const int CSSM_CRL_TYPE_X_509v1 = 1; +const int CSSM_TP_AUTHORITY_REQUEST_CERTRESUME1 = 4; -const int CSSM_CRL_TYPE_X_509v2 = 2; +const int CSSM_TP_AUTHORITY_REQUEST_CERTVERIFY1 = 5; -const int CSSM_CRL_TYPE_SPKI = 3; +const int CSSM_TP_AUTHORITY_REQUEST_CERTNOTARIZE1 = 6; -const int CSSM_CRL_TYPE_MULTIPLE = 32766; +const int CSSM_TP_AUTHORITY_REQUEST_CERTUSERECOVER1 = 7; -const int CSSM_CRL_ENCODING_UNKNOWN = 0; +const int CSSM_TP_AUTHORITY_REQUEST_CRLISSUE1 = 256; -const int CSSM_CRL_ENCODING_CUSTOM = 1; +const int CSSM_TP_KEY_ARCHIVE1 = 1; -const int CSSM_CRL_ENCODING_BER = 2; +const int CSSM_TP_CERT_PUBLISH1 = 2; -const int CSSM_CRL_ENCODING_DER = 3; +const int CSSM_TP_CERT_NOTIFY_RENEW1 = 4; -const int CSSM_CRL_ENCODING_BLOOM = 4; +const int CSSM_TP_CERT_DIR_UPDATE1 = 8; -const int CSSM_CRL_ENCODING_SEXPR = 5; +const int CSSM_TP_CRL_DISTRIBUTE1 = 16; -const int CSSM_CRL_ENCODING_MULTIPLE = 32766; +const int CSSM_TP_ACTION_DEFAULT1 = 0; -const int CSSM_CRLGROUP_DATA = 0; +const int CSSM_TP_STOP_ON_POLICY1 = 0; -const int CSSM_CRLGROUP_ENCODED_CRL = 1; +const int CSSM_TP_STOP_ON_NONE1 = 1; -const int CSSM_CRLGROUP_PARSED_CRL = 2; +const int CSSM_TP_STOP_ON_FIRST_PASS1 = 2; -const int CSSM_CRLGROUP_CRL_PAIR = 3; +const int CSSM_TP_STOP_ON_FIRST_FAIL1 = 3; -const int CSSM_EVIDENCE_FORM_UNSPECIFIC = 0; +const int CSSM_CRL_PARSE_FORMAT_NONE1 = 0; -const int CSSM_EVIDENCE_FORM_CERT = 1; +const int CSSM_CRL_PARSE_FORMAT_CUSTOM1 = 1; -const int CSSM_EVIDENCE_FORM_CRL = 2; +const int CSSM_CRL_PARSE_FORMAT_SEXPR1 = 2; -const int CSSM_EVIDENCE_FORM_CERT_ID = 3; +const int CSSM_CRL_PARSE_FORMAT_COMPLEX1 = 3; -const int CSSM_EVIDENCE_FORM_CRL_ID = 4; +const int CSSM_CRL_PARSE_FORMAT_OID_NAMED1 = 4; -const int CSSM_EVIDENCE_FORM_VERIFIER_TIME = 5; +const int CSSM_CRL_PARSE_FORMAT_TUPLE1 = 5; -const int CSSM_EVIDENCE_FORM_CRL_THISTIME = 6; +const int CSSM_CRL_PARSE_FORMAT_MULTIPLE1 = 32766; -const int CSSM_EVIDENCE_FORM_CRL_NEXTTIME = 7; +const int CSSM_CRL_PARSE_FORMAT_LAST1 = 32767; -const int CSSM_EVIDENCE_FORM_POLICYINFO = 8; +const int CSSM_CL_CUSTOM_CRL_PARSE_FORMAT1 = 32768; -const int CSSM_EVIDENCE_FORM_TUPLEGROUP = 9; +const int CSSM_CRL_TYPE_UNKNOWN1 = 0; -const int CSSM_TP_CONFIRM_STATUS_UNKNOWN = 0; +const int CSSM_CRL_TYPE_X_509v11 = 1; -const int CSSM_TP_CONFIRM_ACCEPT = 1; +const int CSSM_CRL_TYPE_X_509v21 = 2; -const int CSSM_TP_CONFIRM_REJECT = 2; +const int CSSM_CRL_TYPE_SPKI1 = 3; -const int CSSM_ESTIMATED_TIME_UNKNOWN = -1; +const int CSSM_CRL_TYPE_MULTIPLE1 = 32766; -const int CSSM_ELAPSED_TIME_UNKNOWN = -1; +const int CSSM_CRL_ENCODING_UNKNOWN1 = 0; -const int CSSM_ELAPSED_TIME_COMPLETE = -2; +const int CSSM_CRL_ENCODING_CUSTOM1 = 1; -const int CSSM_TP_CERTISSUE_STATUS_UNKNOWN = 0; +const int CSSM_CRL_ENCODING_BER1 = 2; -const int CSSM_TP_CERTISSUE_OK = 1; +const int CSSM_CRL_ENCODING_DER1 = 3; -const int CSSM_TP_CERTISSUE_OKWITHCERTMODS = 2; +const int CSSM_CRL_ENCODING_BLOOM1 = 4; -const int CSSM_TP_CERTISSUE_OKWITHSERVICEMODS = 3; +const int CSSM_CRL_ENCODING_SEXPR1 = 5; -const int CSSM_TP_CERTISSUE_REJECTED = 4; +const int CSSM_CRL_ENCODING_MULTIPLE1 = 32766; -const int CSSM_TP_CERTISSUE_NOT_AUTHORIZED = 5; +const int CSSM_CRLGROUP_DATA1 = 0; -const int CSSM_TP_CERTISSUE_WILL_BE_REVOKED = 6; +const int CSSM_CRLGROUP_ENCODED_CRL1 = 1; -const int CSSM_TP_CERTCHANGE_NONE = 0; +const int CSSM_CRLGROUP_PARSED_CRL1 = 2; -const int CSSM_TP_CERTCHANGE_REVOKE = 1; +const int CSSM_CRLGROUP_CRL_PAIR1 = 3; -const int CSSM_TP_CERTCHANGE_HOLD = 2; +const int CSSM_EVIDENCE_FORM_UNSPECIFIC1 = 0; -const int CSSM_TP_CERTCHANGE_RELEASE = 3; +const int CSSM_EVIDENCE_FORM_CERT1 = 1; -const int CSSM_TP_CERTCHANGE_REASON_UNKNOWN = 0; +const int CSSM_EVIDENCE_FORM_CRL1 = 2; -const int CSSM_TP_CERTCHANGE_REASON_KEYCOMPROMISE = 1; +const int CSSM_EVIDENCE_FORM_CERT_ID1 = 3; -const int CSSM_TP_CERTCHANGE_REASON_CACOMPROMISE = 2; +const int CSSM_EVIDENCE_FORM_CRL_ID1 = 4; -const int CSSM_TP_CERTCHANGE_REASON_CEASEOPERATION = 3; +const int CSSM_EVIDENCE_FORM_VERIFIER_TIME1 = 5; -const int CSSM_TP_CERTCHANGE_REASON_AFFILIATIONCHANGE = 4; +const int CSSM_EVIDENCE_FORM_CRL_THISTIME1 = 6; -const int CSSM_TP_CERTCHANGE_REASON_SUPERCEDED = 5; +const int CSSM_EVIDENCE_FORM_CRL_NEXTTIME1 = 7; -const int CSSM_TP_CERTCHANGE_REASON_SUSPECTEDCOMPROMISE = 6; +const int CSSM_EVIDENCE_FORM_POLICYINFO1 = 8; -const int CSSM_TP_CERTCHANGE_REASON_HOLDRELEASE = 7; +const int CSSM_EVIDENCE_FORM_TUPLEGROUP1 = 9; -const int CSSM_TP_CERTCHANGE_STATUS_UNKNOWN = 0; +const int CSSM_TP_CONFIRM_STATUS_UNKNOWN1 = 0; -const int CSSM_TP_CERTCHANGE_OK = 1; +const int CSSM_TP_CONFIRM_ACCEPT1 = 1; -const int CSSM_TP_CERTCHANGE_OKWITHNEWTIME = 2; +const int CSSM_TP_CONFIRM_REJECT1 = 2; -const int CSSM_TP_CERTCHANGE_WRONGCA = 3; +const int CSSM_ESTIMATED_TIME_UNKNOWN1 = -1; -const int CSSM_TP_CERTCHANGE_REJECTED = 4; +const int CSSM_ELAPSED_TIME_UNKNOWN1 = -1; -const int CSSM_TP_CERTCHANGE_NOT_AUTHORIZED = 5; +const int CSSM_ELAPSED_TIME_COMPLETE1 = -2; -const int CSSM_TP_CERTVERIFY_UNKNOWN = 0; +const int CSSM_TP_CERTISSUE_STATUS_UNKNOWN1 = 0; -const int CSSM_TP_CERTVERIFY_VALID = 1; +const int CSSM_TP_CERTISSUE_OK1 = 1; -const int CSSM_TP_CERTVERIFY_INVALID = 2; +const int CSSM_TP_CERTISSUE_OKWITHCERTMODS1 = 2; -const int CSSM_TP_CERTVERIFY_REVOKED = 3; +const int CSSM_TP_CERTISSUE_OKWITHSERVICEMODS1 = 3; -const int CSSM_TP_CERTVERIFY_SUSPENDED = 4; +const int CSSM_TP_CERTISSUE_REJECTED1 = 4; -const int CSSM_TP_CERTVERIFY_EXPIRED = 5; +const int CSSM_TP_CERTISSUE_NOT_AUTHORIZED1 = 5; -const int CSSM_TP_CERTVERIFY_NOT_VALID_YET = 6; +const int CSSM_TP_CERTISSUE_WILL_BE_REVOKED1 = 6; -const int CSSM_TP_CERTVERIFY_INVALID_AUTHORITY = 7; +const int CSSM_TP_CERTCHANGE_NONE1 = 0; -const int CSSM_TP_CERTVERIFY_INVALID_SIGNATURE = 8; +const int CSSM_TP_CERTCHANGE_REVOKE1 = 1; -const int CSSM_TP_CERTVERIFY_INVALID_CERT_VALUE = 9; +const int CSSM_TP_CERTCHANGE_HOLD1 = 2; -const int CSSM_TP_CERTVERIFY_INVALID_CERTGROUP = 10; +const int CSSM_TP_CERTCHANGE_RELEASE1 = 3; -const int CSSM_TP_CERTVERIFY_INVALID_POLICY = 11; +const int CSSM_TP_CERTCHANGE_REASON_UNKNOWN1 = 0; -const int CSSM_TP_CERTVERIFY_INVALID_POLICY_IDS = 12; +const int CSSM_TP_CERTCHANGE_REASON_KEYCOMPROMISE1 = 1; -const int CSSM_TP_CERTVERIFY_INVALID_BASIC_CONSTRAINTS = 13; +const int CSSM_TP_CERTCHANGE_REASON_CACOMPROMISE1 = 2; -const int CSSM_TP_CERTVERIFY_INVALID_CRL_DIST_PT = 14; +const int CSSM_TP_CERTCHANGE_REASON_CEASEOPERATION1 = 3; -const int CSSM_TP_CERTVERIFY_INVALID_NAME_TREE = 15; +const int CSSM_TP_CERTCHANGE_REASON_AFFILIATIONCHANGE1 = 4; -const int CSSM_TP_CERTVERIFY_UNKNOWN_CRITICAL_EXT = 16; +const int CSSM_TP_CERTCHANGE_REASON_SUPERCEDED1 = 5; -const int CSSM_TP_CERTNOTARIZE_STATUS_UNKNOWN = 0; +const int CSSM_TP_CERTCHANGE_REASON_SUSPECTEDCOMPROMISE1 = 6; -const int CSSM_TP_CERTNOTARIZE_OK = 1; +const int CSSM_TP_CERTCHANGE_REASON_HOLDRELEASE1 = 7; -const int CSSM_TP_CERTNOTARIZE_OKWITHOUTFIELDS = 2; +const int CSSM_TP_CERTCHANGE_STATUS_UNKNOWN1 = 0; -const int CSSM_TP_CERTNOTARIZE_OKWITHSERVICEMODS = 3; +const int CSSM_TP_CERTCHANGE_OK1 = 1; -const int CSSM_TP_CERTNOTARIZE_REJECTED = 4; +const int CSSM_TP_CERTCHANGE_OKWITHNEWTIME1 = 2; -const int CSSM_TP_CERTNOTARIZE_NOT_AUTHORIZED = 5; +const int CSSM_TP_CERTCHANGE_WRONGCA1 = 3; -const int CSSM_TP_CERTRECLAIM_STATUS_UNKNOWN = 0; +const int CSSM_TP_CERTCHANGE_REJECTED1 = 4; -const int CSSM_TP_CERTRECLAIM_OK = 1; +const int CSSM_TP_CERTCHANGE_NOT_AUTHORIZED1 = 5; -const int CSSM_TP_CERTRECLAIM_NOMATCH = 2; +const int CSSM_TP_CERTVERIFY_UNKNOWN1 = 0; -const int CSSM_TP_CERTRECLAIM_REJECTED = 3; +const int CSSM_TP_CERTVERIFY_VALID1 = 1; -const int CSSM_TP_CERTRECLAIM_NOT_AUTHORIZED = 4; +const int CSSM_TP_CERTVERIFY_INVALID1 = 2; -const int CSSM_TP_CRLISSUE_STATUS_UNKNOWN = 0; +const int CSSM_TP_CERTVERIFY_REVOKED1 = 3; -const int CSSM_TP_CRLISSUE_OK = 1; +const int CSSM_TP_CERTVERIFY_SUSPENDED1 = 4; -const int CSSM_TP_CRLISSUE_NOT_CURRENT = 2; +const int CSSM_TP_CERTVERIFY_EXPIRED1 = 5; -const int CSSM_TP_CRLISSUE_INVALID_DOMAIN = 3; +const int CSSM_TP_CERTVERIFY_NOT_VALID_YET1 = 6; -const int CSSM_TP_CRLISSUE_UNKNOWN_IDENTIFIER = 4; +const int CSSM_TP_CERTVERIFY_INVALID_AUTHORITY1 = 7; -const int CSSM_TP_CRLISSUE_REJECTED = 5; +const int CSSM_TP_CERTVERIFY_INVALID_SIGNATURE1 = 8; -const int CSSM_TP_CRLISSUE_NOT_AUTHORIZED = 6; +const int CSSM_TP_CERTVERIFY_INVALID_CERT_VALUE1 = 9; -const int CSSM_TP_FORM_TYPE_GENERIC = 0; +const int CSSM_TP_CERTVERIFY_INVALID_CERTGROUP1 = 10; -const int CSSM_TP_FORM_TYPE_REGISTRATION = 1; +const int CSSM_TP_CERTVERIFY_INVALID_POLICY1 = 11; -const int CSSM_CL_TEMPLATE_INTERMEDIATE_CERT = 1; +const int CSSM_TP_CERTVERIFY_INVALID_POLICY_IDS1 = 12; -const int CSSM_CL_TEMPLATE_PKIX_CERTTEMPLATE = 2; +const int CSSM_TP_CERTVERIFY_INVALID_BASIC_CONSTRAINTS1 = 13; -const int CSSM_CERT_BUNDLE_UNKNOWN = 0; +const int CSSM_TP_CERTVERIFY_INVALID_CRL_DIST_PT1 = 14; -const int CSSM_CERT_BUNDLE_CUSTOM = 1; +const int CSSM_TP_CERTVERIFY_INVALID_NAME_TREE1 = 15; -const int CSSM_CERT_BUNDLE_PKCS7_SIGNED_DATA = 2; +const int CSSM_TP_CERTVERIFY_UNKNOWN_CRITICAL_EXT1 = 16; -const int CSSM_CERT_BUNDLE_PKCS7_SIGNED_ENVELOPED_DATA = 3; +const int CSSM_TP_CERTNOTARIZE_STATUS_UNKNOWN1 = 0; -const int CSSM_CERT_BUNDLE_PKCS12 = 4; +const int CSSM_TP_CERTNOTARIZE_OK1 = 1; -const int CSSM_CERT_BUNDLE_PFX = 5; +const int CSSM_TP_CERTNOTARIZE_OKWITHOUTFIELDS1 = 2; -const int CSSM_CERT_BUNDLE_SPKI_SEQUENCE = 6; +const int CSSM_TP_CERTNOTARIZE_OKWITHSERVICEMODS1 = 3; -const int CSSM_CERT_BUNDLE_PGP_KEYRING = 7; +const int CSSM_TP_CERTNOTARIZE_REJECTED1 = 4; -const int CSSM_CERT_BUNDLE_LAST = 32767; +const int CSSM_TP_CERTNOTARIZE_NOT_AUTHORIZED1 = 5; -const int CSSM_CL_CUSTOM_CERT_BUNDLE_TYPE = 32768; +const int CSSM_TP_CERTRECLAIM_STATUS_UNKNOWN1 = 0; -const int CSSM_CERT_BUNDLE_ENCODING_UNKNOWN = 0; +const int CSSM_TP_CERTRECLAIM_OK1 = 1; -const int CSSM_CERT_BUNDLE_ENCODING_CUSTOM = 1; +const int CSSM_TP_CERTRECLAIM_NOMATCH1 = 2; -const int CSSM_CERT_BUNDLE_ENCODING_BER = 2; +const int CSSM_TP_CERTRECLAIM_REJECTED1 = 3; -const int CSSM_CERT_BUNDLE_ENCODING_DER = 3; +const int CSSM_TP_CERTRECLAIM_NOT_AUTHORIZED1 = 4; -const int CSSM_CERT_BUNDLE_ENCODING_SEXPR = 4; +const int CSSM_TP_CRLISSUE_STATUS_UNKNOWN1 = 0; -const int CSSM_CERT_BUNDLE_ENCODING_PGP = 5; +const int CSSM_TP_CRLISSUE_OK1 = 1; -const int CSSM_FIELDVALUE_COMPLEX_DATA_TYPE = -1; +const int CSSM_TP_CRLISSUE_NOT_CURRENT1 = 2; -const int CSSM_DB_ATTRIBUTE_NAME_AS_STRING = 0; +const int CSSM_TP_CRLISSUE_INVALID_DOMAIN1 = 3; -const int CSSM_DB_ATTRIBUTE_NAME_AS_OID = 1; +const int CSSM_TP_CRLISSUE_UNKNOWN_IDENTIFIER1 = 4; -const int CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER = 2; +const int CSSM_TP_CRLISSUE_REJECTED1 = 5; -const int CSSM_DB_ATTRIBUTE_FORMAT_STRING = 0; +const int CSSM_TP_CRLISSUE_NOT_AUTHORIZED1 = 6; -const int CSSM_DB_ATTRIBUTE_FORMAT_SINT32 = 1; +const int CSSM_TP_FORM_TYPE_GENERIC1 = 0; -const int CSSM_DB_ATTRIBUTE_FORMAT_UINT32 = 2; +const int CSSM_TP_FORM_TYPE_REGISTRATION1 = 1; -const int CSSM_DB_ATTRIBUTE_FORMAT_BIG_NUM = 3; +const int CSSM_CL_TEMPLATE_INTERMEDIATE_CERT1 = 1; -const int CSSM_DB_ATTRIBUTE_FORMAT_REAL = 4; +const int CSSM_CL_TEMPLATE_PKIX_CERTTEMPLATE1 = 2; -const int CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE = 5; +const int CSSM_CERT_BUNDLE_UNKNOWN1 = 0; -const int CSSM_DB_ATTRIBUTE_FORMAT_BLOB = 6; +const int CSSM_CERT_BUNDLE_CUSTOM1 = 1; -const int CSSM_DB_ATTRIBUTE_FORMAT_MULTI_UINT32 = 7; +const int CSSM_CERT_BUNDLE_PKCS7_SIGNED_DATA1 = 2; -const int CSSM_DB_ATTRIBUTE_FORMAT_COMPLEX = 8; +const int CSSM_CERT_BUNDLE_PKCS7_SIGNED_ENVELOPED_DATA1 = 3; -const int CSSM_DB_RECORDTYPE_SCHEMA_START = 0; +const int CSSM_CERT_BUNDLE_PKCS121 = 4; -const int CSSM_DB_RECORDTYPE_SCHEMA_END = 4; +const int CSSM_CERT_BUNDLE_PFX1 = 5; -const int CSSM_DB_RECORDTYPE_OPEN_GROUP_START = 10; +const int CSSM_CERT_BUNDLE_SPKI_SEQUENCE1 = 6; -const int CSSM_DB_RECORDTYPE_OPEN_GROUP_END = 18; +const int CSSM_CERT_BUNDLE_PGP_KEYRING1 = 7; -const int CSSM_DB_RECORDTYPE_APP_DEFINED_START = -2147483648; +const int CSSM_CERT_BUNDLE_LAST1 = 32767; -const int CSSM_DB_RECORDTYPE_APP_DEFINED_END = -1; +const int CSSM_CL_CUSTOM_CERT_BUNDLE_TYPE1 = 32768; -const int CSSM_DL_DB_SCHEMA_INFO = 0; +const int CSSM_CERT_BUNDLE_ENCODING_UNKNOWN1 = 0; -const int CSSM_DL_DB_SCHEMA_INDEXES = 1; +const int CSSM_CERT_BUNDLE_ENCODING_CUSTOM1 = 1; -const int CSSM_DL_DB_SCHEMA_ATTRIBUTES = 2; +const int CSSM_CERT_BUNDLE_ENCODING_BER1 = 2; -const int CSSM_DL_DB_SCHEMA_PARSING_MODULE = 3; +const int CSSM_CERT_BUNDLE_ENCODING_DER1 = 3; -const int CSSM_DL_DB_RECORD_ANY = 10; +const int CSSM_CERT_BUNDLE_ENCODING_SEXPR1 = 4; -const int CSSM_DL_DB_RECORD_CERT = 11; +const int CSSM_CERT_BUNDLE_ENCODING_PGP1 = 5; -const int CSSM_DL_DB_RECORD_CRL = 12; +const int CSSM_FIELDVALUE_COMPLEX_DATA_TYPE1 = -1; -const int CSSM_DL_DB_RECORD_POLICY = 13; +const int CSSM_DB_ATTRIBUTE_NAME_AS_STRING1 = 0; -const int CSSM_DL_DB_RECORD_GENERIC = 14; +const int CSSM_DB_ATTRIBUTE_NAME_AS_OID1 = 1; -const int CSSM_DL_DB_RECORD_PUBLIC_KEY = 15; +const int CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER1 = 2; -const int CSSM_DL_DB_RECORD_PRIVATE_KEY = 16; +const int CSSM_DB_ATTRIBUTE_FORMAT_STRING1 = 0; -const int CSSM_DL_DB_RECORD_SYMMETRIC_KEY = 17; +const int CSSM_DB_ATTRIBUTE_FORMAT_SINT321 = 1; -const int CSSM_DL_DB_RECORD_ALL_KEYS = 18; +const int CSSM_DB_ATTRIBUTE_FORMAT_UINT321 = 2; -const int CSSM_DB_CERT_USE_TRUSTED = 1; +const int CSSM_DB_ATTRIBUTE_FORMAT_BIG_NUM1 = 3; -const int CSSM_DB_CERT_USE_SYSTEM = 2; +const int CSSM_DB_ATTRIBUTE_FORMAT_REAL1 = 4; -const int CSSM_DB_CERT_USE_OWNER = 4; +const int CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE1 = 5; -const int CSSM_DB_CERT_USE_REVOKED = 8; +const int CSSM_DB_ATTRIBUTE_FORMAT_BLOB1 = 6; -const int CSSM_DB_CERT_USE_SIGNING = 16; +const int CSSM_DB_ATTRIBUTE_FORMAT_MULTI_UINT321 = 7; -const int CSSM_DB_CERT_USE_PRIVACY = 32; +const int CSSM_DB_ATTRIBUTE_FORMAT_COMPLEX1 = 8; -const int CSSM_DB_INDEX_UNIQUE = 0; +const int CSSM_DB_RECORDTYPE_SCHEMA_START1 = 0; -const int CSSM_DB_INDEX_NONUNIQUE = 1; +const int CSSM_DB_RECORDTYPE_SCHEMA_END1 = 4; -const int CSSM_DB_INDEX_ON_UNKNOWN = 0; +const int CSSM_DB_RECORDTYPE_OPEN_GROUP_START1 = 10; -const int CSSM_DB_INDEX_ON_ATTRIBUTE = 1; +const int CSSM_DB_RECORDTYPE_OPEN_GROUP_END1 = 18; -const int CSSM_DB_INDEX_ON_RECORD = 2; +const int CSSM_DB_RECORDTYPE_APP_DEFINED_START1 = -2147483648; -const int CSSM_DB_ACCESS_READ = 1; +const int CSSM_DB_RECORDTYPE_APP_DEFINED_END1 = -1; -const int CSSM_DB_ACCESS_WRITE = 2; +const int CSSM_DL_DB_SCHEMA_INFO1 = 0; -const int CSSM_DB_ACCESS_PRIVILEGED = 4; +const int CSSM_DL_DB_SCHEMA_INDEXES1 = 1; -const int CSSM_DB_MODIFY_ATTRIBUTE_NONE = 0; +const int CSSM_DL_DB_SCHEMA_ATTRIBUTES1 = 2; -const int CSSM_DB_MODIFY_ATTRIBUTE_ADD = 1; +const int CSSM_DL_DB_SCHEMA_PARSING_MODULE1 = 3; -const int CSSM_DB_MODIFY_ATTRIBUTE_DELETE = 2; +const int CSSM_DL_DB_RECORD_ANY1 = 10; -const int CSSM_DB_MODIFY_ATTRIBUTE_REPLACE = 3; +const int CSSM_DL_DB_RECORD_CERT1 = 11; -const int CSSM_DB_EQUAL = 0; +const int CSSM_DL_DB_RECORD_CRL1 = 12; -const int CSSM_DB_NOT_EQUAL = 1; +const int CSSM_DL_DB_RECORD_POLICY1 = 13; -const int CSSM_DB_LESS_THAN = 2; +const int CSSM_DL_DB_RECORD_GENERIC1 = 14; -const int CSSM_DB_GREATER_THAN = 3; +const int CSSM_DL_DB_RECORD_PUBLIC_KEY1 = 15; -const int CSSM_DB_CONTAINS = 4; +const int CSSM_DL_DB_RECORD_PRIVATE_KEY1 = 16; -const int CSSM_DB_CONTAINS_INITIAL_SUBSTRING = 5; +const int CSSM_DL_DB_RECORD_SYMMETRIC_KEY1 = 17; -const int CSSM_DB_CONTAINS_FINAL_SUBSTRING = 6; +const int CSSM_DL_DB_RECORD_ALL_KEYS1 = 18; -const int CSSM_DB_NONE = 0; +const int CSSM_DB_CERT_USE_TRUSTED1 = 1; -const int CSSM_DB_AND = 1; +const int CSSM_DB_CERT_USE_SYSTEM1 = 2; -const int CSSM_DB_OR = 2; +const int CSSM_DB_CERT_USE_OWNER1 = 4; -const int CSSM_QUERY_TIMELIMIT_NONE = 0; +const int CSSM_DB_CERT_USE_REVOKED1 = 8; -const int CSSM_QUERY_SIZELIMIT_NONE = 0; +const int CSSM_DB_CERT_USE_SIGNING1 = 16; -const int CSSM_QUERY_RETURN_DATA = 1; +const int CSSM_DB_CERT_USE_PRIVACY1 = 32; -const int CSSM_DL_UNKNOWN = 0; +const int CSSM_DB_INDEX_UNIQUE1 = 0; -const int CSSM_DL_CUSTOM = 1; +const int CSSM_DB_INDEX_NONUNIQUE1 = 1; -const int CSSM_DL_LDAP = 2; +const int CSSM_DB_INDEX_ON_UNKNOWN1 = 0; -const int CSSM_DL_ODBC = 3; +const int CSSM_DB_INDEX_ON_ATTRIBUTE1 = 1; -const int CSSM_DL_PKCS11 = 4; +const int CSSM_DB_INDEX_ON_RECORD1 = 2; -const int CSSM_DL_FFS = 5; +const int CSSM_DB_ACCESS_READ1 = 1; -const int CSSM_DL_MEMORY = 6; +const int CSSM_DB_ACCESS_WRITE1 = 2; -const int CSSM_DL_REMOTEDIR = 7; +const int CSSM_DB_ACCESS_PRIVILEGED1 = 4; -const int CSSM_DB_DATASTORES_UNKNOWN = -1; +const int CSSM_DB_MODIFY_ATTRIBUTE_NONE1 = 0; -const int CSSM_DB_TRANSACTIONAL_MODE = 0; +const int CSSM_DB_MODIFY_ATTRIBUTE_ADD1 = 1; -const int CSSM_DB_FILESYSTEMSCAN_MODE = 1; +const int CSSM_DB_MODIFY_ATTRIBUTE_DELETE1 = 2; -const int CSSM_BASE_ERROR = -2147418112; +const int CSSM_DB_MODIFY_ATTRIBUTE_REPLACE1 = 3; -const int CSSM_ERRORCODE_MODULE_EXTENT = 2048; +const int CSSM_DB_EQUAL1 = 0; -const int CSSM_ERRORCODE_CUSTOM_OFFSET = 1024; +const int CSSM_DB_NOT_EQUAL1 = 1; -const int CSSM_ERRORCODE_COMMON_EXTENT = 256; +const int CSSM_DB_LESS_THAN1 = 2; -const int CSSM_CSSM_BASE_ERROR = -2147418112; +const int CSSM_DB_GREATER_THAN1 = 3; -const int CSSM_CSSM_PRIVATE_ERROR = -2147417088; +const int CSSM_DB_CONTAINS1 = 4; -const int CSSM_CSP_BASE_ERROR = -2147416064; +const int CSSM_DB_CONTAINS_INITIAL_SUBSTRING1 = 5; -const int CSSM_CSP_PRIVATE_ERROR = -2147415040; +const int CSSM_DB_CONTAINS_FINAL_SUBSTRING1 = 6; -const int CSSM_DL_BASE_ERROR = -2147414016; +const int CSSM_DB_NONE1 = 0; -const int CSSM_DL_PRIVATE_ERROR = -2147412992; +const int CSSM_DB_AND1 = 1; -const int CSSM_CL_BASE_ERROR = -2147411968; +const int CSSM_DB_OR1 = 2; -const int CSSM_CL_PRIVATE_ERROR = -2147410944; +const int CSSM_QUERY_TIMELIMIT_NONE1 = 0; -const int CSSM_TP_BASE_ERROR = -2147409920; +const int CSSM_QUERY_SIZELIMIT_NONE1 = 0; -const int CSSM_TP_PRIVATE_ERROR = -2147408896; +const int CSSM_QUERY_RETURN_DATA1 = 1; -const int CSSM_KR_BASE_ERROR = -2147407872; +const int CSSM_DL_UNKNOWN1 = 0; -const int CSSM_KR_PRIVATE_ERROR = -2147406848; +const int CSSM_DL_CUSTOM1 = 1; -const int CSSM_AC_BASE_ERROR = -2147405824; +const int CSSM_DL_LDAP1 = 2; -const int CSSM_AC_PRIVATE_ERROR = -2147404800; +const int CSSM_DL_ODBC1 = 3; -const int CSSM_MDS_BASE_ERROR = -2147414016; +const int CSSM_DL_PKCS111 = 4; -const int CSSM_MDS_PRIVATE_ERROR = -2147412992; +const int CSSM_DL_FFS1 = 5; -const int CSSMERR_CSSM_INVALID_ADDIN_HANDLE = -2147417855; +const int CSSM_DL_MEMORY1 = 6; -const int CSSMERR_CSSM_NOT_INITIALIZED = -2147417854; +const int CSSM_DL_REMOTEDIR1 = 7; -const int CSSMERR_CSSM_INVALID_HANDLE_USAGE = -2147417853; +const int CSSM_DB_DATASTORES_UNKNOWN1 = -1; -const int CSSMERR_CSSM_PVC_REFERENT_NOT_FOUND = -2147417852; +const int CSSM_DB_TRANSACTIONAL_MODE1 = 0; -const int CSSMERR_CSSM_FUNCTION_INTEGRITY_FAIL = -2147417851; +const int CSSM_DB_FILESYSTEMSCAN_MODE1 = 1; -const int CSSM_ERRCODE_INTERNAL_ERROR = 1; +const int CSSM_BASE_ERROR1 = -2147418112; -const int CSSM_ERRCODE_MEMORY_ERROR = 2; +const int CSSM_ERRORCODE_MODULE_EXTENT1 = 2048; -const int CSSM_ERRCODE_MDS_ERROR = 3; +const int CSSM_ERRORCODE_CUSTOM_OFFSET1 = 1024; -const int CSSM_ERRCODE_INVALID_POINTER = 4; +const int CSSM_ERRORCODE_COMMON_EXTENT1 = 256; -const int CSSM_ERRCODE_INVALID_INPUT_POINTER = 5; +const int CSSM_CSSM_BASE_ERROR1 = -2147418112; -const int CSSM_ERRCODE_INVALID_OUTPUT_POINTER = 6; +const int CSSM_CSSM_PRIVATE_ERROR1 = -2147417088; -const int CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED = 7; +const int CSSM_CSP_BASE_ERROR1 = -2147416064; -const int CSSM_ERRCODE_SELF_CHECK_FAILED = 8; +const int CSSM_CSP_PRIVATE_ERROR1 = -2147415040; -const int CSSM_ERRCODE_OS_ACCESS_DENIED = 9; +const int CSSM_DL_BASE_ERROR1 = -2147414016; -const int CSSM_ERRCODE_FUNCTION_FAILED = 10; +const int CSSM_DL_PRIVATE_ERROR1 = -2147412992; -const int CSSM_ERRCODE_MODULE_MANIFEST_VERIFY_FAILED = 11; +const int CSSM_CL_BASE_ERROR1 = -2147411968; -const int CSSM_ERRCODE_INVALID_GUID = 12; +const int CSSM_CL_PRIVATE_ERROR1 = -2147410944; -const int CSSM_ERRCODE_OPERATION_AUTH_DENIED = 32; +const int CSSM_TP_BASE_ERROR1 = -2147409920; -const int CSSM_ERRCODE_OBJECT_USE_AUTH_DENIED = 33; +const int CSSM_TP_PRIVATE_ERROR1 = -2147408896; -const int CSSM_ERRCODE_OBJECT_MANIP_AUTH_DENIED = 34; +const int CSSM_KR_BASE_ERROR1 = -2147407872; -const int CSSM_ERRCODE_OBJECT_ACL_NOT_SUPPORTED = 35; +const int CSSM_KR_PRIVATE_ERROR1 = -2147406848; -const int CSSM_ERRCODE_OBJECT_ACL_REQUIRED = 36; +const int CSSM_AC_BASE_ERROR1 = -2147405824; -const int CSSM_ERRCODE_INVALID_ACCESS_CREDENTIALS = 37; +const int CSSM_AC_PRIVATE_ERROR1 = -2147404800; -const int CSSM_ERRCODE_INVALID_ACL_BASE_CERTS = 38; +const int CSSM_MDS_BASE_ERROR1 = -2147414016; -const int CSSM_ERRCODE_ACL_BASE_CERTS_NOT_SUPPORTED = 39; +const int CSSM_MDS_PRIVATE_ERROR1 = -2147412992; -const int CSSM_ERRCODE_INVALID_SAMPLE_VALUE = 40; +const int CSSMERR_CSSM_INVALID_ADDIN_HANDLE1 = -2147417855; -const int CSSM_ERRCODE_SAMPLE_VALUE_NOT_SUPPORTED = 41; +const int CSSMERR_CSSM_NOT_INITIALIZED1 = -2147417854; -const int CSSM_ERRCODE_INVALID_ACL_SUBJECT_VALUE = 42; +const int CSSMERR_CSSM_INVALID_HANDLE_USAGE1 = -2147417853; -const int CSSM_ERRCODE_ACL_SUBJECT_TYPE_NOT_SUPPORTED = 43; +const int CSSMERR_CSSM_PVC_REFERENT_NOT_FOUND1 = -2147417852; -const int CSSM_ERRCODE_INVALID_ACL_CHALLENGE_CALLBACK = 44; +const int CSSMERR_CSSM_FUNCTION_INTEGRITY_FAIL1 = -2147417851; -const int CSSM_ERRCODE_ACL_CHALLENGE_CALLBACK_FAILED = 45; +const int CSSM_ERRCODE_INTERNAL_ERROR1 = 1; -const int CSSM_ERRCODE_INVALID_ACL_ENTRY_TAG = 46; +const int CSSM_ERRCODE_MEMORY_ERROR1 = 2; -const int CSSM_ERRCODE_ACL_ENTRY_TAG_NOT_FOUND = 47; +const int CSSM_ERRCODE_MDS_ERROR1 = 3; -const int CSSM_ERRCODE_INVALID_ACL_EDIT_MODE = 48; +const int CSSM_ERRCODE_INVALID_POINTER1 = 4; -const int CSSM_ERRCODE_ACL_CHANGE_FAILED = 49; +const int CSSM_ERRCODE_INVALID_INPUT_POINTER1 = 5; -const int CSSM_ERRCODE_INVALID_NEW_ACL_ENTRY = 50; +const int CSSM_ERRCODE_INVALID_OUTPUT_POINTER1 = 6; -const int CSSM_ERRCODE_INVALID_NEW_ACL_OWNER = 51; +const int CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED1 = 7; -const int CSSM_ERRCODE_ACL_DELETE_FAILED = 52; +const int CSSM_ERRCODE_SELF_CHECK_FAILED1 = 8; -const int CSSM_ERRCODE_ACL_REPLACE_FAILED = 53; +const int CSSM_ERRCODE_OS_ACCESS_DENIED1 = 9; -const int CSSM_ERRCODE_ACL_ADD_FAILED = 54; +const int CSSM_ERRCODE_FUNCTION_FAILED1 = 10; -const int CSSM_ERRCODE_INVALID_CONTEXT_HANDLE = 64; +const int CSSM_ERRCODE_MODULE_MANIFEST_VERIFY_FAILED1 = 11; -const int CSSM_ERRCODE_INCOMPATIBLE_VERSION = 65; +const int CSSM_ERRCODE_INVALID_GUID1 = 12; -const int CSSM_ERRCODE_INVALID_CERTGROUP_POINTER = 66; +const int CSSM_ERRCODE_OPERATION_AUTH_DENIED1 = 32; -const int CSSM_ERRCODE_INVALID_CERT_POINTER = 67; +const int CSSM_ERRCODE_OBJECT_USE_AUTH_DENIED1 = 33; -const int CSSM_ERRCODE_INVALID_CRL_POINTER = 68; +const int CSSM_ERRCODE_OBJECT_MANIP_AUTH_DENIED1 = 34; -const int CSSM_ERRCODE_INVALID_FIELD_POINTER = 69; +const int CSSM_ERRCODE_OBJECT_ACL_NOT_SUPPORTED1 = 35; -const int CSSM_ERRCODE_INVALID_DATA = 70; +const int CSSM_ERRCODE_OBJECT_ACL_REQUIRED1 = 36; -const int CSSM_ERRCODE_CRL_ALREADY_SIGNED = 71; +const int CSSM_ERRCODE_INVALID_ACCESS_CREDENTIALS1 = 37; -const int CSSM_ERRCODE_INVALID_NUMBER_OF_FIELDS = 72; +const int CSSM_ERRCODE_INVALID_ACL_BASE_CERTS1 = 38; -const int CSSM_ERRCODE_VERIFICATION_FAILURE = 73; +const int CSSM_ERRCODE_ACL_BASE_CERTS_NOT_SUPPORTED1 = 39; -const int CSSM_ERRCODE_INVALID_DB_HANDLE = 74; +const int CSSM_ERRCODE_INVALID_SAMPLE_VALUE1 = 40; -const int CSSM_ERRCODE_PRIVILEGE_NOT_GRANTED = 75; +const int CSSM_ERRCODE_SAMPLE_VALUE_NOT_SUPPORTED1 = 41; -const int CSSM_ERRCODE_INVALID_DB_LIST = 76; +const int CSSM_ERRCODE_INVALID_ACL_SUBJECT_VALUE1 = 42; -const int CSSM_ERRCODE_INVALID_DB_LIST_POINTER = 77; +const int CSSM_ERRCODE_ACL_SUBJECT_TYPE_NOT_SUPPORTED1 = 43; -const int CSSM_ERRCODE_UNKNOWN_FORMAT = 78; +const int CSSM_ERRCODE_INVALID_ACL_CHALLENGE_CALLBACK1 = 44; -const int CSSM_ERRCODE_UNKNOWN_TAG = 79; +const int CSSM_ERRCODE_ACL_CHALLENGE_CALLBACK_FAILED1 = 45; -const int CSSM_ERRCODE_INVALID_CSP_HANDLE = 80; +const int CSSM_ERRCODE_INVALID_ACL_ENTRY_TAG1 = 46; -const int CSSM_ERRCODE_INVALID_DL_HANDLE = 81; +const int CSSM_ERRCODE_ACL_ENTRY_TAG_NOT_FOUND1 = 47; -const int CSSM_ERRCODE_INVALID_CL_HANDLE = 82; +const int CSSM_ERRCODE_INVALID_ACL_EDIT_MODE1 = 48; -const int CSSM_ERRCODE_INVALID_TP_HANDLE = 83; +const int CSSM_ERRCODE_ACL_CHANGE_FAILED1 = 49; -const int CSSM_ERRCODE_INVALID_KR_HANDLE = 84; +const int CSSM_ERRCODE_INVALID_NEW_ACL_ENTRY1 = 50; -const int CSSM_ERRCODE_INVALID_AC_HANDLE = 85; +const int CSSM_ERRCODE_INVALID_NEW_ACL_OWNER1 = 51; -const int CSSM_ERRCODE_INVALID_PASSTHROUGH_ID = 86; +const int CSSM_ERRCODE_ACL_DELETE_FAILED1 = 52; -const int CSSM_ERRCODE_INVALID_NETWORK_ADDR = 87; +const int CSSM_ERRCODE_ACL_REPLACE_FAILED1 = 53; -const int CSSM_ERRCODE_INVALID_CRYPTO_DATA = 88; +const int CSSM_ERRCODE_ACL_ADD_FAILED1 = 54; -const int CSSMERR_CSSM_INTERNAL_ERROR = -2147418111; +const int CSSM_ERRCODE_INVALID_CONTEXT_HANDLE1 = 64; -const int CSSMERR_CSSM_MEMORY_ERROR = -2147418110; +const int CSSM_ERRCODE_INCOMPATIBLE_VERSION1 = 65; -const int CSSMERR_CSSM_MDS_ERROR = -2147418109; +const int CSSM_ERRCODE_INVALID_CERTGROUP_POINTER1 = 66; -const int CSSMERR_CSSM_INVALID_POINTER = -2147418108; +const int CSSM_ERRCODE_INVALID_CERT_POINTER1 = 67; -const int CSSMERR_CSSM_INVALID_INPUT_POINTER = -2147418107; +const int CSSM_ERRCODE_INVALID_CRL_POINTER1 = 68; -const int CSSMERR_CSSM_INVALID_OUTPUT_POINTER = -2147418106; +const int CSSM_ERRCODE_INVALID_FIELD_POINTER1 = 69; -const int CSSMERR_CSSM_FUNCTION_NOT_IMPLEMENTED = -2147418105; +const int CSSM_ERRCODE_INVALID_DATA1 = 70; -const int CSSMERR_CSSM_SELF_CHECK_FAILED = -2147418104; +const int CSSM_ERRCODE_CRL_ALREADY_SIGNED1 = 71; -const int CSSMERR_CSSM_OS_ACCESS_DENIED = -2147418103; +const int CSSM_ERRCODE_INVALID_NUMBER_OF_FIELDS1 = 72; -const int CSSMERR_CSSM_FUNCTION_FAILED = -2147418102; +const int CSSM_ERRCODE_VERIFICATION_FAILURE1 = 73; -const int CSSMERR_CSSM_MODULE_MANIFEST_VERIFY_FAILED = -2147418101; +const int CSSM_ERRCODE_INVALID_DB_HANDLE1 = 74; -const int CSSMERR_CSSM_INVALID_GUID = -2147418100; +const int CSSM_ERRCODE_PRIVILEGE_NOT_GRANTED1 = 75; -const int CSSMERR_CSSM_INVALID_CONTEXT_HANDLE = -2147418048; +const int CSSM_ERRCODE_INVALID_DB_LIST1 = 76; -const int CSSMERR_CSSM_INCOMPATIBLE_VERSION = -2147418047; +const int CSSM_ERRCODE_INVALID_DB_LIST_POINTER1 = 77; -const int CSSMERR_CSSM_PRIVILEGE_NOT_GRANTED = -2147418037; +const int CSSM_ERRCODE_UNKNOWN_FORMAT1 = 78; -const int CSSM_CSSM_BASE_CSSM_ERROR = -2147417840; +const int CSSM_ERRCODE_UNKNOWN_TAG1 = 79; -const int CSSMERR_CSSM_SCOPE_NOT_SUPPORTED = -2147417839; +const int CSSM_ERRCODE_INVALID_CSP_HANDLE1 = 80; -const int CSSMERR_CSSM_PVC_ALREADY_CONFIGURED = -2147417838; +const int CSSM_ERRCODE_INVALID_DL_HANDLE1 = 81; -const int CSSMERR_CSSM_INVALID_PVC = -2147417837; +const int CSSM_ERRCODE_INVALID_CL_HANDLE1 = 82; -const int CSSMERR_CSSM_EMM_LOAD_FAILED = -2147417836; +const int CSSM_ERRCODE_INVALID_TP_HANDLE1 = 83; -const int CSSMERR_CSSM_EMM_UNLOAD_FAILED = -2147417835; +const int CSSM_ERRCODE_INVALID_KR_HANDLE1 = 84; -const int CSSMERR_CSSM_ADDIN_LOAD_FAILED = -2147417834; +const int CSSM_ERRCODE_INVALID_AC_HANDLE1 = 85; -const int CSSMERR_CSSM_INVALID_KEY_HIERARCHY = -2147417833; +const int CSSM_ERRCODE_INVALID_PASSTHROUGH_ID1 = 86; -const int CSSMERR_CSSM_ADDIN_UNLOAD_FAILED = -2147417832; +const int CSSM_ERRCODE_INVALID_NETWORK_ADDR1 = 87; -const int CSSMERR_CSSM_LIB_REF_NOT_FOUND = -2147417831; +const int CSSM_ERRCODE_INVALID_CRYPTO_DATA1 = 88; -const int CSSMERR_CSSM_INVALID_ADDIN_FUNCTION_TABLE = -2147417830; +const int CSSMERR_CSSM_INTERNAL_ERROR1 = -2147418111; -const int CSSMERR_CSSM_EMM_AUTHENTICATE_FAILED = -2147417829; +const int CSSMERR_CSSM_MEMORY_ERROR1 = -2147418110; -const int CSSMERR_CSSM_ADDIN_AUTHENTICATE_FAILED = -2147417828; +const int CSSMERR_CSSM_MDS_ERROR1 = -2147418109; -const int CSSMERR_CSSM_INVALID_SERVICE_MASK = -2147417827; +const int CSSMERR_CSSM_INVALID_POINTER1 = -2147418108; -const int CSSMERR_CSSM_MODULE_NOT_LOADED = -2147417826; +const int CSSMERR_CSSM_INVALID_INPUT_POINTER1 = -2147418107; -const int CSSMERR_CSSM_INVALID_SUBSERVICEID = -2147417825; +const int CSSMERR_CSSM_INVALID_OUTPUT_POINTER1 = -2147418106; -const int CSSMERR_CSSM_BUFFER_TOO_SMALL = -2147417824; +const int CSSMERR_CSSM_FUNCTION_NOT_IMPLEMENTED1 = -2147418105; -const int CSSMERR_CSSM_INVALID_ATTRIBUTE = -2147417823; +const int CSSMERR_CSSM_SELF_CHECK_FAILED1 = -2147418104; -const int CSSMERR_CSSM_ATTRIBUTE_NOT_IN_CONTEXT = -2147417822; +const int CSSMERR_CSSM_OS_ACCESS_DENIED1 = -2147418103; -const int CSSMERR_CSSM_MODULE_MANAGER_INITIALIZE_FAIL = -2147417821; +const int CSSMERR_CSSM_FUNCTION_FAILED1 = -2147418102; -const int CSSMERR_CSSM_MODULE_MANAGER_NOT_FOUND = -2147417820; +const int CSSMERR_CSSM_MODULE_MANIFEST_VERIFY_FAILED1 = -2147418101; -const int CSSMERR_CSSM_EVENT_NOTIFICATION_CALLBACK_NOT_FOUND = -2147417819; +const int CSSMERR_CSSM_INVALID_GUID1 = -2147418100; -const int CSSMERR_CSP_INTERNAL_ERROR = -2147416063; +const int CSSMERR_CSSM_INVALID_CONTEXT_HANDLE1 = -2147418048; -const int CSSMERR_CSP_MEMORY_ERROR = -2147416062; +const int CSSMERR_CSSM_INCOMPATIBLE_VERSION1 = -2147418047; -const int CSSMERR_CSP_MDS_ERROR = -2147416061; +const int CSSMERR_CSSM_PRIVILEGE_NOT_GRANTED1 = -2147418037; -const int CSSMERR_CSP_INVALID_POINTER = -2147416060; +const int CSSM_CSSM_BASE_CSSM_ERROR1 = -2147417840; -const int CSSMERR_CSP_INVALID_INPUT_POINTER = -2147416059; +const int CSSMERR_CSSM_SCOPE_NOT_SUPPORTED1 = -2147417839; -const int CSSMERR_CSP_INVALID_OUTPUT_POINTER = -2147416058; +const int CSSMERR_CSSM_PVC_ALREADY_CONFIGURED1 = -2147417838; -const int CSSMERR_CSP_FUNCTION_NOT_IMPLEMENTED = -2147416057; +const int CSSMERR_CSSM_INVALID_PVC1 = -2147417837; -const int CSSMERR_CSP_SELF_CHECK_FAILED = -2147416056; +const int CSSMERR_CSSM_EMM_LOAD_FAILED1 = -2147417836; -const int CSSMERR_CSP_OS_ACCESS_DENIED = -2147416055; +const int CSSMERR_CSSM_EMM_UNLOAD_FAILED1 = -2147417835; -const int CSSMERR_CSP_FUNCTION_FAILED = -2147416054; +const int CSSMERR_CSSM_ADDIN_LOAD_FAILED1 = -2147417834; -const int CSSMERR_CSP_OPERATION_AUTH_DENIED = -2147416032; +const int CSSMERR_CSSM_INVALID_KEY_HIERARCHY1 = -2147417833; -const int CSSMERR_CSP_OBJECT_USE_AUTH_DENIED = -2147416031; +const int CSSMERR_CSSM_ADDIN_UNLOAD_FAILED1 = -2147417832; -const int CSSMERR_CSP_OBJECT_MANIP_AUTH_DENIED = -2147416030; +const int CSSMERR_CSSM_LIB_REF_NOT_FOUND1 = -2147417831; -const int CSSMERR_CSP_OBJECT_ACL_NOT_SUPPORTED = -2147416029; +const int CSSMERR_CSSM_INVALID_ADDIN_FUNCTION_TABLE1 = -2147417830; -const int CSSMERR_CSP_OBJECT_ACL_REQUIRED = -2147416028; +const int CSSMERR_CSSM_EMM_AUTHENTICATE_FAILED1 = -2147417829; -const int CSSMERR_CSP_INVALID_ACCESS_CREDENTIALS = -2147416027; +const int CSSMERR_CSSM_ADDIN_AUTHENTICATE_FAILED1 = -2147417828; -const int CSSMERR_CSP_INVALID_ACL_BASE_CERTS = -2147416026; +const int CSSMERR_CSSM_INVALID_SERVICE_MASK1 = -2147417827; -const int CSSMERR_CSP_ACL_BASE_CERTS_NOT_SUPPORTED = -2147416025; +const int CSSMERR_CSSM_MODULE_NOT_LOADED1 = -2147417826; -const int CSSMERR_CSP_INVALID_SAMPLE_VALUE = -2147416024; +const int CSSMERR_CSSM_INVALID_SUBSERVICEID1 = -2147417825; -const int CSSMERR_CSP_SAMPLE_VALUE_NOT_SUPPORTED = -2147416023; +const int CSSMERR_CSSM_BUFFER_TOO_SMALL1 = -2147417824; -const int CSSMERR_CSP_INVALID_ACL_SUBJECT_VALUE = -2147416022; +const int CSSMERR_CSSM_INVALID_ATTRIBUTE1 = -2147417823; -const int CSSMERR_CSP_ACL_SUBJECT_TYPE_NOT_SUPPORTED = -2147416021; +const int CSSMERR_CSSM_ATTRIBUTE_NOT_IN_CONTEXT1 = -2147417822; -const int CSSMERR_CSP_INVALID_ACL_CHALLENGE_CALLBACK = -2147416020; +const int CSSMERR_CSSM_MODULE_MANAGER_INITIALIZE_FAIL1 = -2147417821; -const int CSSMERR_CSP_ACL_CHALLENGE_CALLBACK_FAILED = -2147416019; +const int CSSMERR_CSSM_MODULE_MANAGER_NOT_FOUND1 = -2147417820; -const int CSSMERR_CSP_INVALID_ACL_ENTRY_TAG = -2147416018; +const int CSSMERR_CSSM_EVENT_NOTIFICATION_CALLBACK_NOT_FOUND1 = -2147417819; -const int CSSMERR_CSP_ACL_ENTRY_TAG_NOT_FOUND = -2147416017; +const int CSSMERR_CSP_INTERNAL_ERROR1 = -2147416063; -const int CSSMERR_CSP_INVALID_ACL_EDIT_MODE = -2147416016; +const int CSSMERR_CSP_MEMORY_ERROR1 = -2147416062; -const int CSSMERR_CSP_ACL_CHANGE_FAILED = -2147416015; +const int CSSMERR_CSP_MDS_ERROR1 = -2147416061; -const int CSSMERR_CSP_INVALID_NEW_ACL_ENTRY = -2147416014; +const int CSSMERR_CSP_INVALID_POINTER1 = -2147416060; -const int CSSMERR_CSP_INVALID_NEW_ACL_OWNER = -2147416013; +const int CSSMERR_CSP_INVALID_INPUT_POINTER1 = -2147416059; -const int CSSMERR_CSP_ACL_DELETE_FAILED = -2147416012; +const int CSSMERR_CSP_INVALID_OUTPUT_POINTER1 = -2147416058; -const int CSSMERR_CSP_ACL_REPLACE_FAILED = -2147416011; +const int CSSMERR_CSP_FUNCTION_NOT_IMPLEMENTED1 = -2147416057; -const int CSSMERR_CSP_ACL_ADD_FAILED = -2147416010; +const int CSSMERR_CSP_SELF_CHECK_FAILED1 = -2147416056; -const int CSSMERR_CSP_INVALID_CONTEXT_HANDLE = -2147416000; +const int CSSMERR_CSP_OS_ACCESS_DENIED1 = -2147416055; -const int CSSMERR_CSP_PRIVILEGE_NOT_GRANTED = -2147415989; +const int CSSMERR_CSP_FUNCTION_FAILED1 = -2147416054; -const int CSSMERR_CSP_INVALID_DATA = -2147415994; +const int CSSMERR_CSP_OPERATION_AUTH_DENIED1 = -2147416032; -const int CSSMERR_CSP_INVALID_PASSTHROUGH_ID = -2147415978; +const int CSSMERR_CSP_OBJECT_USE_AUTH_DENIED1 = -2147416031; -const int CSSMERR_CSP_INVALID_CRYPTO_DATA = -2147415976; +const int CSSMERR_CSP_OBJECT_MANIP_AUTH_DENIED1 = -2147416030; -const int CSSM_CSP_BASE_CSP_ERROR = -2147415808; +const int CSSMERR_CSP_OBJECT_ACL_NOT_SUPPORTED1 = -2147416029; -const int CSSMERR_CSP_INPUT_LENGTH_ERROR = -2147415807; +const int CSSMERR_CSP_OBJECT_ACL_REQUIRED1 = -2147416028; -const int CSSMERR_CSP_OUTPUT_LENGTH_ERROR = -2147415806; +const int CSSMERR_CSP_INVALID_ACCESS_CREDENTIALS1 = -2147416027; -const int CSSMERR_CSP_PRIVILEGE_NOT_SUPPORTED = -2147415805; +const int CSSMERR_CSP_INVALID_ACL_BASE_CERTS1 = -2147416026; -const int CSSMERR_CSP_DEVICE_ERROR = -2147415804; +const int CSSMERR_CSP_ACL_BASE_CERTS_NOT_SUPPORTED1 = -2147416025; -const int CSSMERR_CSP_DEVICE_MEMORY_ERROR = -2147415803; +const int CSSMERR_CSP_INVALID_SAMPLE_VALUE1 = -2147416024; -const int CSSMERR_CSP_ATTACH_HANDLE_BUSY = -2147415802; +const int CSSMERR_CSP_SAMPLE_VALUE_NOT_SUPPORTED1 = -2147416023; -const int CSSMERR_CSP_NOT_LOGGED_IN = -2147415801; +const int CSSMERR_CSP_INVALID_ACL_SUBJECT_VALUE1 = -2147416022; -const int CSSMERR_CSP_INVALID_KEY = -2147415792; +const int CSSMERR_CSP_ACL_SUBJECT_TYPE_NOT_SUPPORTED1 = -2147416021; -const int CSSMERR_CSP_INVALID_KEY_REFERENCE = -2147415791; +const int CSSMERR_CSP_INVALID_ACL_CHALLENGE_CALLBACK1 = -2147416020; -const int CSSMERR_CSP_INVALID_KEY_CLASS = -2147415790; +const int CSSMERR_CSP_ACL_CHALLENGE_CALLBACK_FAILED1 = -2147416019; -const int CSSMERR_CSP_ALGID_MISMATCH = -2147415789; +const int CSSMERR_CSP_INVALID_ACL_ENTRY_TAG1 = -2147416018; -const int CSSMERR_CSP_KEY_USAGE_INCORRECT = -2147415788; +const int CSSMERR_CSP_ACL_ENTRY_TAG_NOT_FOUND1 = -2147416017; -const int CSSMERR_CSP_KEY_BLOB_TYPE_INCORRECT = -2147415787; +const int CSSMERR_CSP_INVALID_ACL_EDIT_MODE1 = -2147416016; -const int CSSMERR_CSP_KEY_HEADER_INCONSISTENT = -2147415786; +const int CSSMERR_CSP_ACL_CHANGE_FAILED1 = -2147416015; -const int CSSMERR_CSP_UNSUPPORTED_KEY_FORMAT = -2147415785; +const int CSSMERR_CSP_INVALID_NEW_ACL_ENTRY1 = -2147416014; -const int CSSMERR_CSP_UNSUPPORTED_KEY_SIZE = -2147415784; +const int CSSMERR_CSP_INVALID_NEW_ACL_OWNER1 = -2147416013; -const int CSSMERR_CSP_INVALID_KEY_POINTER = -2147415783; +const int CSSMERR_CSP_ACL_DELETE_FAILED1 = -2147416012; -const int CSSMERR_CSP_INVALID_KEYUSAGE_MASK = -2147415782; +const int CSSMERR_CSP_ACL_REPLACE_FAILED1 = -2147416011; -const int CSSMERR_CSP_UNSUPPORTED_KEYUSAGE_MASK = -2147415781; +const int CSSMERR_CSP_ACL_ADD_FAILED1 = -2147416010; -const int CSSMERR_CSP_INVALID_KEYATTR_MASK = -2147415780; +const int CSSMERR_CSP_INVALID_CONTEXT_HANDLE1 = -2147416000; -const int CSSMERR_CSP_UNSUPPORTED_KEYATTR_MASK = -2147415779; +const int CSSMERR_CSP_PRIVILEGE_NOT_GRANTED1 = -2147415989; -const int CSSMERR_CSP_INVALID_KEY_LABEL = -2147415778; +const int CSSMERR_CSP_INVALID_DATA1 = -2147415994; -const int CSSMERR_CSP_UNSUPPORTED_KEY_LABEL = -2147415777; +const int CSSMERR_CSP_INVALID_PASSTHROUGH_ID1 = -2147415978; -const int CSSMERR_CSP_INVALID_KEY_FORMAT = -2147415776; +const int CSSMERR_CSP_INVALID_CRYPTO_DATA1 = -2147415976; -const int CSSMERR_CSP_INVALID_DATA_COUNT = -2147415768; +const int CSSM_CSP_BASE_CSP_ERROR1 = -2147415808; -const int CSSMERR_CSP_VECTOR_OF_BUFS_UNSUPPORTED = -2147415767; +const int CSSMERR_CSP_INPUT_LENGTH_ERROR1 = -2147415807; -const int CSSMERR_CSP_INVALID_INPUT_VECTOR = -2147415766; +const int CSSMERR_CSP_OUTPUT_LENGTH_ERROR1 = -2147415806; -const int CSSMERR_CSP_INVALID_OUTPUT_VECTOR = -2147415765; +const int CSSMERR_CSP_PRIVILEGE_NOT_SUPPORTED1 = -2147415805; -const int CSSMERR_CSP_INVALID_CONTEXT = -2147415760; +const int CSSMERR_CSP_DEVICE_ERROR1 = -2147415804; -const int CSSMERR_CSP_INVALID_ALGORITHM = -2147415759; +const int CSSMERR_CSP_DEVICE_MEMORY_ERROR1 = -2147415803; -const int CSSMERR_CSP_INVALID_ATTR_KEY = -2147415754; +const int CSSMERR_CSP_ATTACH_HANDLE_BUSY1 = -2147415802; -const int CSSMERR_CSP_MISSING_ATTR_KEY = -2147415753; +const int CSSMERR_CSP_NOT_LOGGED_IN1 = -2147415801; -const int CSSMERR_CSP_INVALID_ATTR_INIT_VECTOR = -2147415752; +const int CSSMERR_CSP_INVALID_KEY1 = -2147415792; -const int CSSMERR_CSP_MISSING_ATTR_INIT_VECTOR = -2147415751; +const int CSSMERR_CSP_INVALID_KEY_REFERENCE1 = -2147415791; -const int CSSMERR_CSP_INVALID_ATTR_SALT = -2147415750; +const int CSSMERR_CSP_INVALID_KEY_CLASS1 = -2147415790; -const int CSSMERR_CSP_MISSING_ATTR_SALT = -2147415749; +const int CSSMERR_CSP_ALGID_MISMATCH1 = -2147415789; -const int CSSMERR_CSP_INVALID_ATTR_PADDING = -2147415748; +const int CSSMERR_CSP_KEY_USAGE_INCORRECT1 = -2147415788; -const int CSSMERR_CSP_MISSING_ATTR_PADDING = -2147415747; +const int CSSMERR_CSP_KEY_BLOB_TYPE_INCORRECT1 = -2147415787; -const int CSSMERR_CSP_INVALID_ATTR_RANDOM = -2147415746; +const int CSSMERR_CSP_KEY_HEADER_INCONSISTENT1 = -2147415786; -const int CSSMERR_CSP_MISSING_ATTR_RANDOM = -2147415745; +const int CSSMERR_CSP_UNSUPPORTED_KEY_FORMAT1 = -2147415785; -const int CSSMERR_CSP_INVALID_ATTR_SEED = -2147415744; +const int CSSMERR_CSP_UNSUPPORTED_KEY_SIZE1 = -2147415784; -const int CSSMERR_CSP_MISSING_ATTR_SEED = -2147415743; +const int CSSMERR_CSP_INVALID_KEY_POINTER1 = -2147415783; -const int CSSMERR_CSP_INVALID_ATTR_PASSPHRASE = -2147415742; +const int CSSMERR_CSP_INVALID_KEYUSAGE_MASK1 = -2147415782; -const int CSSMERR_CSP_MISSING_ATTR_PASSPHRASE = -2147415741; +const int CSSMERR_CSP_UNSUPPORTED_KEYUSAGE_MASK1 = -2147415781; -const int CSSMERR_CSP_INVALID_ATTR_KEY_LENGTH = -2147415740; +const int CSSMERR_CSP_INVALID_KEYATTR_MASK1 = -2147415780; -const int CSSMERR_CSP_MISSING_ATTR_KEY_LENGTH = -2147415739; +const int CSSMERR_CSP_UNSUPPORTED_KEYATTR_MASK1 = -2147415779; -const int CSSMERR_CSP_INVALID_ATTR_BLOCK_SIZE = -2147415738; +const int CSSMERR_CSP_INVALID_KEY_LABEL1 = -2147415778; -const int CSSMERR_CSP_MISSING_ATTR_BLOCK_SIZE = -2147415737; +const int CSSMERR_CSP_UNSUPPORTED_KEY_LABEL1 = -2147415777; -const int CSSMERR_CSP_INVALID_ATTR_OUTPUT_SIZE = -2147415708; +const int CSSMERR_CSP_INVALID_KEY_FORMAT1 = -2147415776; -const int CSSMERR_CSP_MISSING_ATTR_OUTPUT_SIZE = -2147415707; +const int CSSMERR_CSP_INVALID_DATA_COUNT1 = -2147415768; -const int CSSMERR_CSP_INVALID_ATTR_ROUNDS = -2147415706; +const int CSSMERR_CSP_VECTOR_OF_BUFS_UNSUPPORTED1 = -2147415767; -const int CSSMERR_CSP_MISSING_ATTR_ROUNDS = -2147415705; +const int CSSMERR_CSP_INVALID_INPUT_VECTOR1 = -2147415766; -const int CSSMERR_CSP_INVALID_ATTR_ALG_PARAMS = -2147415704; +const int CSSMERR_CSP_INVALID_OUTPUT_VECTOR1 = -2147415765; -const int CSSMERR_CSP_MISSING_ATTR_ALG_PARAMS = -2147415703; +const int CSSMERR_CSP_INVALID_CONTEXT1 = -2147415760; -const int CSSMERR_CSP_INVALID_ATTR_LABEL = -2147415702; +const int CSSMERR_CSP_INVALID_ALGORITHM1 = -2147415759; -const int CSSMERR_CSP_MISSING_ATTR_LABEL = -2147415701; +const int CSSMERR_CSP_INVALID_ATTR_KEY1 = -2147415754; -const int CSSMERR_CSP_INVALID_ATTR_KEY_TYPE = -2147415700; +const int CSSMERR_CSP_MISSING_ATTR_KEY1 = -2147415753; -const int CSSMERR_CSP_MISSING_ATTR_KEY_TYPE = -2147415699; +const int CSSMERR_CSP_INVALID_ATTR_INIT_VECTOR1 = -2147415752; -const int CSSMERR_CSP_INVALID_ATTR_MODE = -2147415698; +const int CSSMERR_CSP_MISSING_ATTR_INIT_VECTOR1 = -2147415751; -const int CSSMERR_CSP_MISSING_ATTR_MODE = -2147415697; +const int CSSMERR_CSP_INVALID_ATTR_SALT1 = -2147415750; -const int CSSMERR_CSP_INVALID_ATTR_EFFECTIVE_BITS = -2147415696; +const int CSSMERR_CSP_MISSING_ATTR_SALT1 = -2147415749; -const int CSSMERR_CSP_MISSING_ATTR_EFFECTIVE_BITS = -2147415695; +const int CSSMERR_CSP_INVALID_ATTR_PADDING1 = -2147415748; -const int CSSMERR_CSP_INVALID_ATTR_START_DATE = -2147415694; +const int CSSMERR_CSP_MISSING_ATTR_PADDING1 = -2147415747; -const int CSSMERR_CSP_MISSING_ATTR_START_DATE = -2147415693; +const int CSSMERR_CSP_INVALID_ATTR_RANDOM1 = -2147415746; -const int CSSMERR_CSP_INVALID_ATTR_END_DATE = -2147415692; +const int CSSMERR_CSP_MISSING_ATTR_RANDOM1 = -2147415745; -const int CSSMERR_CSP_MISSING_ATTR_END_DATE = -2147415691; +const int CSSMERR_CSP_INVALID_ATTR_SEED1 = -2147415744; -const int CSSMERR_CSP_INVALID_ATTR_VERSION = -2147415690; +const int CSSMERR_CSP_MISSING_ATTR_SEED1 = -2147415743; -const int CSSMERR_CSP_MISSING_ATTR_VERSION = -2147415689; +const int CSSMERR_CSP_INVALID_ATTR_PASSPHRASE1 = -2147415742; -const int CSSMERR_CSP_INVALID_ATTR_PRIME = -2147415688; +const int CSSMERR_CSP_MISSING_ATTR_PASSPHRASE1 = -2147415741; -const int CSSMERR_CSP_MISSING_ATTR_PRIME = -2147415687; +const int CSSMERR_CSP_INVALID_ATTR_KEY_LENGTH1 = -2147415740; -const int CSSMERR_CSP_INVALID_ATTR_BASE = -2147415686; +const int CSSMERR_CSP_MISSING_ATTR_KEY_LENGTH1 = -2147415739; -const int CSSMERR_CSP_MISSING_ATTR_BASE = -2147415685; +const int CSSMERR_CSP_INVALID_ATTR_BLOCK_SIZE1 = -2147415738; -const int CSSMERR_CSP_INVALID_ATTR_SUBPRIME = -2147415684; +const int CSSMERR_CSP_MISSING_ATTR_BLOCK_SIZE1 = -2147415737; -const int CSSMERR_CSP_MISSING_ATTR_SUBPRIME = -2147415683; +const int CSSMERR_CSP_INVALID_ATTR_OUTPUT_SIZE1 = -2147415708; -const int CSSMERR_CSP_INVALID_ATTR_ITERATION_COUNT = -2147415682; +const int CSSMERR_CSP_MISSING_ATTR_OUTPUT_SIZE1 = -2147415707; -const int CSSMERR_CSP_MISSING_ATTR_ITERATION_COUNT = -2147415681; +const int CSSMERR_CSP_INVALID_ATTR_ROUNDS1 = -2147415706; -const int CSSMERR_CSP_INVALID_ATTR_DL_DB_HANDLE = -2147415680; +const int CSSMERR_CSP_MISSING_ATTR_ROUNDS1 = -2147415705; -const int CSSMERR_CSP_MISSING_ATTR_DL_DB_HANDLE = -2147415679; +const int CSSMERR_CSP_INVALID_ATTR_ALG_PARAMS1 = -2147415704; -const int CSSMERR_CSP_INVALID_ATTR_ACCESS_CREDENTIALS = -2147415678; +const int CSSMERR_CSP_MISSING_ATTR_ALG_PARAMS1 = -2147415703; -const int CSSMERR_CSP_MISSING_ATTR_ACCESS_CREDENTIALS = -2147415677; +const int CSSMERR_CSP_INVALID_ATTR_LABEL1 = -2147415702; -const int CSSMERR_CSP_INVALID_ATTR_PUBLIC_KEY_FORMAT = -2147415676; +const int CSSMERR_CSP_MISSING_ATTR_LABEL1 = -2147415701; -const int CSSMERR_CSP_MISSING_ATTR_PUBLIC_KEY_FORMAT = -2147415675; +const int CSSMERR_CSP_INVALID_ATTR_KEY_TYPE1 = -2147415700; -const int CSSMERR_CSP_INVALID_ATTR_PRIVATE_KEY_FORMAT = -2147415674; +const int CSSMERR_CSP_MISSING_ATTR_KEY_TYPE1 = -2147415699; -const int CSSMERR_CSP_MISSING_ATTR_PRIVATE_KEY_FORMAT = -2147415673; +const int CSSMERR_CSP_INVALID_ATTR_MODE1 = -2147415698; -const int CSSMERR_CSP_INVALID_ATTR_SYMMETRIC_KEY_FORMAT = -2147415672; +const int CSSMERR_CSP_MISSING_ATTR_MODE1 = -2147415697; -const int CSSMERR_CSP_MISSING_ATTR_SYMMETRIC_KEY_FORMAT = -2147415671; +const int CSSMERR_CSP_INVALID_ATTR_EFFECTIVE_BITS1 = -2147415696; -const int CSSMERR_CSP_INVALID_ATTR_WRAPPED_KEY_FORMAT = -2147415670; +const int CSSMERR_CSP_MISSING_ATTR_EFFECTIVE_BITS1 = -2147415695; -const int CSSMERR_CSP_MISSING_ATTR_WRAPPED_KEY_FORMAT = -2147415669; +const int CSSMERR_CSP_INVALID_ATTR_START_DATE1 = -2147415694; -const int CSSMERR_CSP_STAGED_OPERATION_IN_PROGRESS = -2147415736; +const int CSSMERR_CSP_MISSING_ATTR_START_DATE1 = -2147415693; -const int CSSMERR_CSP_STAGED_OPERATION_NOT_STARTED = -2147415735; +const int CSSMERR_CSP_INVALID_ATTR_END_DATE1 = -2147415692; -const int CSSMERR_CSP_VERIFY_FAILED = -2147415734; +const int CSSMERR_CSP_MISSING_ATTR_END_DATE1 = -2147415691; -const int CSSMERR_CSP_INVALID_SIGNATURE = -2147415733; +const int CSSMERR_CSP_INVALID_ATTR_VERSION1 = -2147415690; -const int CSSMERR_CSP_QUERY_SIZE_UNKNOWN = -2147415732; +const int CSSMERR_CSP_MISSING_ATTR_VERSION1 = -2147415689; -const int CSSMERR_CSP_BLOCK_SIZE_MISMATCH = -2147415731; +const int CSSMERR_CSP_INVALID_ATTR_PRIME1 = -2147415688; -const int CSSMERR_CSP_PRIVATE_KEY_NOT_FOUND = -2147415730; +const int CSSMERR_CSP_MISSING_ATTR_PRIME1 = -2147415687; -const int CSSMERR_CSP_PUBLIC_KEY_INCONSISTENT = -2147415729; +const int CSSMERR_CSP_INVALID_ATTR_BASE1 = -2147415686; -const int CSSMERR_CSP_DEVICE_VERIFY_FAILED = -2147415728; +const int CSSMERR_CSP_MISSING_ATTR_BASE1 = -2147415685; -const int CSSMERR_CSP_INVALID_LOGIN_NAME = -2147415727; +const int CSSMERR_CSP_INVALID_ATTR_SUBPRIME1 = -2147415684; -const int CSSMERR_CSP_ALREADY_LOGGED_IN = -2147415726; +const int CSSMERR_CSP_MISSING_ATTR_SUBPRIME1 = -2147415683; -const int CSSMERR_CSP_PRIVATE_KEY_ALREADY_EXISTS = -2147415725; +const int CSSMERR_CSP_INVALID_ATTR_ITERATION_COUNT1 = -2147415682; -const int CSSMERR_CSP_KEY_LABEL_ALREADY_EXISTS = -2147415724; +const int CSSMERR_CSP_MISSING_ATTR_ITERATION_COUNT1 = -2147415681; -const int CSSMERR_CSP_INVALID_DIGEST_ALGORITHM = -2147415723; +const int CSSMERR_CSP_INVALID_ATTR_DL_DB_HANDLE1 = -2147415680; -const int CSSMERR_CSP_CRYPTO_DATA_CALLBACK_FAILED = -2147415722; +const int CSSMERR_CSP_MISSING_ATTR_DL_DB_HANDLE1 = -2147415679; -const int CSSMERR_TP_INTERNAL_ERROR = -2147409919; +const int CSSMERR_CSP_INVALID_ATTR_ACCESS_CREDENTIALS1 = -2147415678; -const int CSSMERR_TP_MEMORY_ERROR = -2147409918; +const int CSSMERR_CSP_MISSING_ATTR_ACCESS_CREDENTIALS1 = -2147415677; -const int CSSMERR_TP_MDS_ERROR = -2147409917; +const int CSSMERR_CSP_INVALID_ATTR_PUBLIC_KEY_FORMAT1 = -2147415676; -const int CSSMERR_TP_INVALID_POINTER = -2147409916; +const int CSSMERR_CSP_MISSING_ATTR_PUBLIC_KEY_FORMAT1 = -2147415675; -const int CSSMERR_TP_INVALID_INPUT_POINTER = -2147409915; +const int CSSMERR_CSP_INVALID_ATTR_PRIVATE_KEY_FORMAT1 = -2147415674; -const int CSSMERR_TP_INVALID_OUTPUT_POINTER = -2147409914; +const int CSSMERR_CSP_MISSING_ATTR_PRIVATE_KEY_FORMAT1 = -2147415673; -const int CSSMERR_TP_FUNCTION_NOT_IMPLEMENTED = -2147409913; +const int CSSMERR_CSP_INVALID_ATTR_SYMMETRIC_KEY_FORMAT1 = -2147415672; -const int CSSMERR_TP_SELF_CHECK_FAILED = -2147409912; +const int CSSMERR_CSP_MISSING_ATTR_SYMMETRIC_KEY_FORMAT1 = -2147415671; -const int CSSMERR_TP_OS_ACCESS_DENIED = -2147409911; +const int CSSMERR_CSP_INVALID_ATTR_WRAPPED_KEY_FORMAT1 = -2147415670; -const int CSSMERR_TP_FUNCTION_FAILED = -2147409910; +const int CSSMERR_CSP_MISSING_ATTR_WRAPPED_KEY_FORMAT1 = -2147415669; -const int CSSMERR_TP_INVALID_CONTEXT_HANDLE = -2147409856; +const int CSSMERR_CSP_STAGED_OPERATION_IN_PROGRESS1 = -2147415736; -const int CSSMERR_TP_INVALID_DATA = -2147409850; +const int CSSMERR_CSP_STAGED_OPERATION_NOT_STARTED1 = -2147415735; -const int CSSMERR_TP_INVALID_DB_LIST = -2147409844; +const int CSSMERR_CSP_VERIFY_FAILED1 = -2147415734; -const int CSSMERR_TP_INVALID_CERTGROUP_POINTER = -2147409854; +const int CSSMERR_CSP_INVALID_SIGNATURE1 = -2147415733; -const int CSSMERR_TP_INVALID_CERT_POINTER = -2147409853; +const int CSSMERR_CSP_QUERY_SIZE_UNKNOWN1 = -2147415732; -const int CSSMERR_TP_INVALID_CRL_POINTER = -2147409852; +const int CSSMERR_CSP_BLOCK_SIZE_MISMATCH1 = -2147415731; -const int CSSMERR_TP_INVALID_FIELD_POINTER = -2147409851; +const int CSSMERR_CSP_PRIVATE_KEY_NOT_FOUND1 = -2147415730; -const int CSSMERR_TP_INVALID_NETWORK_ADDR = -2147409833; +const int CSSMERR_CSP_PUBLIC_KEY_INCONSISTENT1 = -2147415729; -const int CSSMERR_TP_CRL_ALREADY_SIGNED = -2147409849; +const int CSSMERR_CSP_DEVICE_VERIFY_FAILED1 = -2147415728; -const int CSSMERR_TP_INVALID_NUMBER_OF_FIELDS = -2147409848; +const int CSSMERR_CSP_INVALID_LOGIN_NAME1 = -2147415727; -const int CSSMERR_TP_VERIFICATION_FAILURE = -2147409847; +const int CSSMERR_CSP_ALREADY_LOGGED_IN1 = -2147415726; -const int CSSMERR_TP_INVALID_DB_HANDLE = -2147409846; +const int CSSMERR_CSP_PRIVATE_KEY_ALREADY_EXISTS1 = -2147415725; -const int CSSMERR_TP_UNKNOWN_FORMAT = -2147409842; +const int CSSMERR_CSP_KEY_LABEL_ALREADY_EXISTS1 = -2147415724; -const int CSSMERR_TP_UNKNOWN_TAG = -2147409841; +const int CSSMERR_CSP_INVALID_DIGEST_ALGORITHM1 = -2147415723; -const int CSSMERR_TP_INVALID_PASSTHROUGH_ID = -2147409834; +const int CSSMERR_CSP_CRYPTO_DATA_CALLBACK_FAILED1 = -2147415722; -const int CSSMERR_TP_INVALID_CSP_HANDLE = -2147409840; +const int CSSMERR_TP_INTERNAL_ERROR1 = -2147409919; -const int CSSMERR_TP_INVALID_DL_HANDLE = -2147409839; +const int CSSMERR_TP_MEMORY_ERROR1 = -2147409918; -const int CSSMERR_TP_INVALID_CL_HANDLE = -2147409838; +const int CSSMERR_TP_MDS_ERROR1 = -2147409917; -const int CSSMERR_TP_INVALID_DB_LIST_POINTER = -2147409843; +const int CSSMERR_TP_INVALID_POINTER1 = -2147409916; -const int CSSM_TP_BASE_TP_ERROR = -2147409664; +const int CSSMERR_TP_INVALID_INPUT_POINTER1 = -2147409915; -const int CSSMERR_TP_INVALID_CALLERAUTH_CONTEXT_POINTER = -2147409663; +const int CSSMERR_TP_INVALID_OUTPUT_POINTER1 = -2147409914; -const int CSSMERR_TP_INVALID_IDENTIFIER_POINTER = -2147409662; +const int CSSMERR_TP_FUNCTION_NOT_IMPLEMENTED1 = -2147409913; -const int CSSMERR_TP_INVALID_KEYCACHE_HANDLE = -2147409661; +const int CSSMERR_TP_SELF_CHECK_FAILED1 = -2147409912; -const int CSSMERR_TP_INVALID_CERTGROUP = -2147409660; +const int CSSMERR_TP_OS_ACCESS_DENIED1 = -2147409911; -const int CSSMERR_TP_INVALID_CRLGROUP = -2147409659; +const int CSSMERR_TP_FUNCTION_FAILED1 = -2147409910; -const int CSSMERR_TP_INVALID_CRLGROUP_POINTER = -2147409658; +const int CSSMERR_TP_INVALID_CONTEXT_HANDLE1 = -2147409856; -const int CSSMERR_TP_AUTHENTICATION_FAILED = -2147409657; +const int CSSMERR_TP_INVALID_DATA1 = -2147409850; -const int CSSMERR_TP_CERTGROUP_INCOMPLETE = -2147409656; +const int CSSMERR_TP_INVALID_DB_LIST1 = -2147409844; -const int CSSMERR_TP_CERTIFICATE_CANT_OPERATE = -2147409655; +const int CSSMERR_TP_INVALID_CERTGROUP_POINTER1 = -2147409854; -const int CSSMERR_TP_CERT_EXPIRED = -2147409654; +const int CSSMERR_TP_INVALID_CERT_POINTER1 = -2147409853; -const int CSSMERR_TP_CERT_NOT_VALID_YET = -2147409653; +const int CSSMERR_TP_INVALID_CRL_POINTER1 = -2147409852; -const int CSSMERR_TP_CERT_REVOKED = -2147409652; +const int CSSMERR_TP_INVALID_FIELD_POINTER1 = -2147409851; -const int CSSMERR_TP_CERT_SUSPENDED = -2147409651; +const int CSSMERR_TP_INVALID_NETWORK_ADDR1 = -2147409833; -const int CSSMERR_TP_INSUFFICIENT_CREDENTIALS = -2147409650; +const int CSSMERR_TP_CRL_ALREADY_SIGNED1 = -2147409849; -const int CSSMERR_TP_INVALID_ACTION = -2147409649; +const int CSSMERR_TP_INVALID_NUMBER_OF_FIELDS1 = -2147409848; -const int CSSMERR_TP_INVALID_ACTION_DATA = -2147409648; +const int CSSMERR_TP_VERIFICATION_FAILURE1 = -2147409847; -const int CSSMERR_TP_INVALID_ANCHOR_CERT = -2147409646; +const int CSSMERR_TP_INVALID_DB_HANDLE1 = -2147409846; -const int CSSMERR_TP_INVALID_AUTHORITY = -2147409645; +const int CSSMERR_TP_UNKNOWN_FORMAT1 = -2147409842; -const int CSSMERR_TP_VERIFY_ACTION_FAILED = -2147409644; +const int CSSMERR_TP_UNKNOWN_TAG1 = -2147409841; -const int CSSMERR_TP_INVALID_CERTIFICATE = -2147409643; +const int CSSMERR_TP_INVALID_PASSTHROUGH_ID1 = -2147409834; -const int CSSMERR_TP_INVALID_CERT_AUTHORITY = -2147409642; +const int CSSMERR_TP_INVALID_CSP_HANDLE1 = -2147409840; -const int CSSMERR_TP_INVALID_CRL_AUTHORITY = -2147409641; +const int CSSMERR_TP_INVALID_DL_HANDLE1 = -2147409839; -const int CSSMERR_TP_INVALID_CRL_ENCODING = -2147409640; +const int CSSMERR_TP_INVALID_CL_HANDLE1 = -2147409838; -const int CSSMERR_TP_INVALID_CRL_TYPE = -2147409639; +const int CSSMERR_TP_INVALID_DB_LIST_POINTER1 = -2147409843; -const int CSSMERR_TP_INVALID_CRL = -2147409638; +const int CSSM_TP_BASE_TP_ERROR1 = -2147409664; -const int CSSMERR_TP_INVALID_FORM_TYPE = -2147409637; +const int CSSMERR_TP_INVALID_CALLERAUTH_CONTEXT_POINTER1 = -2147409663; -const int CSSMERR_TP_INVALID_ID = -2147409636; +const int CSSMERR_TP_INVALID_IDENTIFIER_POINTER1 = -2147409662; -const int CSSMERR_TP_INVALID_IDENTIFIER = -2147409635; +const int CSSMERR_TP_INVALID_KEYCACHE_HANDLE1 = -2147409661; -const int CSSMERR_TP_INVALID_INDEX = -2147409634; +const int CSSMERR_TP_INVALID_CERTGROUP1 = -2147409660; -const int CSSMERR_TP_INVALID_NAME = -2147409633; +const int CSSMERR_TP_INVALID_CRLGROUP1 = -2147409659; -const int CSSMERR_TP_INVALID_POLICY_IDENTIFIERS = -2147409632; +const int CSSMERR_TP_INVALID_CRLGROUP_POINTER1 = -2147409658; -const int CSSMERR_TP_INVALID_TIMESTRING = -2147409631; +const int CSSMERR_TP_AUTHENTICATION_FAILED1 = -2147409657; -const int CSSMERR_TP_INVALID_REASON = -2147409630; +const int CSSMERR_TP_CERTGROUP_INCOMPLETE1 = -2147409656; -const int CSSMERR_TP_INVALID_REQUEST_INPUTS = -2147409629; +const int CSSMERR_TP_CERTIFICATE_CANT_OPERATE1 = -2147409655; -const int CSSMERR_TP_INVALID_RESPONSE_VECTOR = -2147409628; +const int CSSMERR_TP_CERT_EXPIRED1 = -2147409654; -const int CSSMERR_TP_INVALID_SIGNATURE = -2147409627; +const int CSSMERR_TP_CERT_NOT_VALID_YET1 = -2147409653; -const int CSSMERR_TP_INVALID_STOP_ON_POLICY = -2147409626; +const int CSSMERR_TP_CERT_REVOKED1 = -2147409652; -const int CSSMERR_TP_INVALID_CALLBACK = -2147409625; +const int CSSMERR_TP_CERT_SUSPENDED1 = -2147409651; -const int CSSMERR_TP_INVALID_TUPLE = -2147409624; +const int CSSMERR_TP_INSUFFICIENT_CREDENTIALS1 = -2147409650; -const int CSSMERR_TP_NOT_SIGNER = -2147409623; +const int CSSMERR_TP_INVALID_ACTION1 = -2147409649; -const int CSSMERR_TP_NOT_TRUSTED = -2147409622; +const int CSSMERR_TP_INVALID_ACTION_DATA1 = -2147409648; -const int CSSMERR_TP_NO_DEFAULT_AUTHORITY = -2147409621; +const int CSSMERR_TP_INVALID_ANCHOR_CERT1 = -2147409646; -const int CSSMERR_TP_REJECTED_FORM = -2147409620; +const int CSSMERR_TP_INVALID_AUTHORITY1 = -2147409645; -const int CSSMERR_TP_REQUEST_LOST = -2147409619; +const int CSSMERR_TP_VERIFY_ACTION_FAILED1 = -2147409644; -const int CSSMERR_TP_REQUEST_REJECTED = -2147409618; +const int CSSMERR_TP_INVALID_CERTIFICATE1 = -2147409643; -const int CSSMERR_TP_UNSUPPORTED_ADDR_TYPE = -2147409617; +const int CSSMERR_TP_INVALID_CERT_AUTHORITY1 = -2147409642; -const int CSSMERR_TP_UNSUPPORTED_SERVICE = -2147409616; +const int CSSMERR_TP_INVALID_CRL_AUTHORITY1 = -2147409641; -const int CSSMERR_TP_INVALID_TUPLEGROUP_POINTER = -2147409615; +const int CSSMERR_TP_INVALID_CRL_ENCODING1 = -2147409640; -const int CSSMERR_TP_INVALID_TUPLEGROUP = -2147409614; +const int CSSMERR_TP_INVALID_CRL_TYPE1 = -2147409639; -const int CSSMERR_AC_INTERNAL_ERROR = -2147405823; +const int CSSMERR_TP_INVALID_CRL1 = -2147409638; -const int CSSMERR_AC_MEMORY_ERROR = -2147405822; +const int CSSMERR_TP_INVALID_FORM_TYPE1 = -2147409637; -const int CSSMERR_AC_MDS_ERROR = -2147405821; +const int CSSMERR_TP_INVALID_ID1 = -2147409636; -const int CSSMERR_AC_INVALID_POINTER = -2147405820; +const int CSSMERR_TP_INVALID_IDENTIFIER1 = -2147409635; -const int CSSMERR_AC_INVALID_INPUT_POINTER = -2147405819; +const int CSSMERR_TP_INVALID_INDEX1 = -2147409634; -const int CSSMERR_AC_INVALID_OUTPUT_POINTER = -2147405818; +const int CSSMERR_TP_INVALID_NAME1 = -2147409633; -const int CSSMERR_AC_FUNCTION_NOT_IMPLEMENTED = -2147405817; +const int CSSMERR_TP_INVALID_POLICY_IDENTIFIERS1 = -2147409632; -const int CSSMERR_AC_SELF_CHECK_FAILED = -2147405816; +const int CSSMERR_TP_INVALID_TIMESTRING1 = -2147409631; -const int CSSMERR_AC_OS_ACCESS_DENIED = -2147405815; +const int CSSMERR_TP_INVALID_REASON1 = -2147409630; -const int CSSMERR_AC_FUNCTION_FAILED = -2147405814; +const int CSSMERR_TP_INVALID_REQUEST_INPUTS1 = -2147409629; -const int CSSMERR_AC_INVALID_CONTEXT_HANDLE = -2147405760; +const int CSSMERR_TP_INVALID_RESPONSE_VECTOR1 = -2147409628; -const int CSSMERR_AC_INVALID_DATA = -2147405754; +const int CSSMERR_TP_INVALID_SIGNATURE1 = -2147409627; -const int CSSMERR_AC_INVALID_DB_LIST = -2147405748; +const int CSSMERR_TP_INVALID_STOP_ON_POLICY1 = -2147409626; -const int CSSMERR_AC_INVALID_PASSTHROUGH_ID = -2147405738; +const int CSSMERR_TP_INVALID_CALLBACK1 = -2147409625; -const int CSSMERR_AC_INVALID_DL_HANDLE = -2147405743; +const int CSSMERR_TP_INVALID_TUPLE1 = -2147409624; -const int CSSMERR_AC_INVALID_CL_HANDLE = -2147405742; +const int CSSMERR_TP_NOT_SIGNER1 = -2147409623; -const int CSSMERR_AC_INVALID_TP_HANDLE = -2147405741; +const int CSSMERR_TP_NOT_TRUSTED1 = -2147409622; -const int CSSMERR_AC_INVALID_DB_HANDLE = -2147405750; +const int CSSMERR_TP_NO_DEFAULT_AUTHORITY1 = -2147409621; -const int CSSMERR_AC_INVALID_DB_LIST_POINTER = -2147405747; +const int CSSMERR_TP_REJECTED_FORM1 = -2147409620; -const int CSSM_AC_BASE_AC_ERROR = -2147405568; +const int CSSMERR_TP_REQUEST_LOST1 = -2147409619; -const int CSSMERR_AC_INVALID_BASE_ACLS = -2147405567; +const int CSSMERR_TP_REQUEST_REJECTED1 = -2147409618; -const int CSSMERR_AC_INVALID_TUPLE_CREDENTIALS = -2147405566; +const int CSSMERR_TP_UNSUPPORTED_ADDR_TYPE1 = -2147409617; -const int CSSMERR_AC_INVALID_ENCODING = -2147405565; +const int CSSMERR_TP_UNSUPPORTED_SERVICE1 = -2147409616; -const int CSSMERR_AC_INVALID_VALIDITY_PERIOD = -2147405564; +const int CSSMERR_TP_INVALID_TUPLEGROUP_POINTER1 = -2147409615; -const int CSSMERR_AC_INVALID_REQUESTOR = -2147405563; +const int CSSMERR_TP_INVALID_TUPLEGROUP1 = -2147409614; -const int CSSMERR_AC_INVALID_REQUEST_DESCRIPTOR = -2147405562; +const int CSSMERR_AC_INTERNAL_ERROR1 = -2147405823; -const int CSSMERR_CL_INTERNAL_ERROR = -2147411967; +const int CSSMERR_AC_MEMORY_ERROR1 = -2147405822; -const int CSSMERR_CL_MEMORY_ERROR = -2147411966; +const int CSSMERR_AC_MDS_ERROR1 = -2147405821; -const int CSSMERR_CL_MDS_ERROR = -2147411965; +const int CSSMERR_AC_INVALID_POINTER1 = -2147405820; -const int CSSMERR_CL_INVALID_POINTER = -2147411964; +const int CSSMERR_AC_INVALID_INPUT_POINTER1 = -2147405819; -const int CSSMERR_CL_INVALID_INPUT_POINTER = -2147411963; +const int CSSMERR_AC_INVALID_OUTPUT_POINTER1 = -2147405818; -const int CSSMERR_CL_INVALID_OUTPUT_POINTER = -2147411962; +const int CSSMERR_AC_FUNCTION_NOT_IMPLEMENTED1 = -2147405817; -const int CSSMERR_CL_FUNCTION_NOT_IMPLEMENTED = -2147411961; +const int CSSMERR_AC_SELF_CHECK_FAILED1 = -2147405816; -const int CSSMERR_CL_SELF_CHECK_FAILED = -2147411960; +const int CSSMERR_AC_OS_ACCESS_DENIED1 = -2147405815; -const int CSSMERR_CL_OS_ACCESS_DENIED = -2147411959; +const int CSSMERR_AC_FUNCTION_FAILED1 = -2147405814; -const int CSSMERR_CL_FUNCTION_FAILED = -2147411958; +const int CSSMERR_AC_INVALID_CONTEXT_HANDLE1 = -2147405760; -const int CSSMERR_CL_INVALID_CONTEXT_HANDLE = -2147411904; +const int CSSMERR_AC_INVALID_DATA1 = -2147405754; -const int CSSMERR_CL_INVALID_CERTGROUP_POINTER = -2147411902; +const int CSSMERR_AC_INVALID_DB_LIST1 = -2147405748; -const int CSSMERR_CL_INVALID_CERT_POINTER = -2147411901; +const int CSSMERR_AC_INVALID_PASSTHROUGH_ID1 = -2147405738; -const int CSSMERR_CL_INVALID_CRL_POINTER = -2147411900; +const int CSSMERR_AC_INVALID_DL_HANDLE1 = -2147405743; -const int CSSMERR_CL_INVALID_FIELD_POINTER = -2147411899; +const int CSSMERR_AC_INVALID_CL_HANDLE1 = -2147405742; -const int CSSMERR_CL_INVALID_DATA = -2147411898; +const int CSSMERR_AC_INVALID_TP_HANDLE1 = -2147405741; -const int CSSMERR_CL_CRL_ALREADY_SIGNED = -2147411897; +const int CSSMERR_AC_INVALID_DB_HANDLE1 = -2147405750; -const int CSSMERR_CL_INVALID_NUMBER_OF_FIELDS = -2147411896; +const int CSSMERR_AC_INVALID_DB_LIST_POINTER1 = -2147405747; -const int CSSMERR_CL_VERIFICATION_FAILURE = -2147411895; +const int CSSM_AC_BASE_AC_ERROR1 = -2147405568; -const int CSSMERR_CL_UNKNOWN_FORMAT = -2147411890; +const int CSSMERR_AC_INVALID_BASE_ACLS1 = -2147405567; -const int CSSMERR_CL_UNKNOWN_TAG = -2147411889; +const int CSSMERR_AC_INVALID_TUPLE_CREDENTIALS1 = -2147405566; -const int CSSMERR_CL_INVALID_PASSTHROUGH_ID = -2147411882; +const int CSSMERR_AC_INVALID_ENCODING1 = -2147405565; -const int CSSM_CL_BASE_CL_ERROR = -2147411712; +const int CSSMERR_AC_INVALID_VALIDITY_PERIOD1 = -2147405564; -const int CSSMERR_CL_INVALID_BUNDLE_POINTER = -2147411711; +const int CSSMERR_AC_INVALID_REQUESTOR1 = -2147405563; -const int CSSMERR_CL_INVALID_CACHE_HANDLE = -2147411710; +const int CSSMERR_AC_INVALID_REQUEST_DESCRIPTOR1 = -2147405562; -const int CSSMERR_CL_INVALID_RESULTS_HANDLE = -2147411709; +const int CSSMERR_CL_INTERNAL_ERROR1 = -2147411967; -const int CSSMERR_CL_INVALID_BUNDLE_INFO = -2147411708; +const int CSSMERR_CL_MEMORY_ERROR1 = -2147411966; -const int CSSMERR_CL_INVALID_CRL_INDEX = -2147411707; +const int CSSMERR_CL_MDS_ERROR1 = -2147411965; -const int CSSMERR_CL_INVALID_SCOPE = -2147411706; +const int CSSMERR_CL_INVALID_POINTER1 = -2147411964; -const int CSSMERR_CL_NO_FIELD_VALUES = -2147411705; +const int CSSMERR_CL_INVALID_INPUT_POINTER1 = -2147411963; -const int CSSMERR_CL_SCOPE_NOT_SUPPORTED = -2147411704; +const int CSSMERR_CL_INVALID_OUTPUT_POINTER1 = -2147411962; -const int CSSMERR_DL_INTERNAL_ERROR = -2147414015; +const int CSSMERR_CL_FUNCTION_NOT_IMPLEMENTED1 = -2147411961; -const int CSSMERR_DL_MEMORY_ERROR = -2147414014; +const int CSSMERR_CL_SELF_CHECK_FAILED1 = -2147411960; -const int CSSMERR_DL_MDS_ERROR = -2147414013; +const int CSSMERR_CL_OS_ACCESS_DENIED1 = -2147411959; -const int CSSMERR_DL_INVALID_POINTER = -2147414012; +const int CSSMERR_CL_FUNCTION_FAILED1 = -2147411958; -const int CSSMERR_DL_INVALID_INPUT_POINTER = -2147414011; +const int CSSMERR_CL_INVALID_CONTEXT_HANDLE1 = -2147411904; -const int CSSMERR_DL_INVALID_OUTPUT_POINTER = -2147414010; +const int CSSMERR_CL_INVALID_CERTGROUP_POINTER1 = -2147411902; -const int CSSMERR_DL_FUNCTION_NOT_IMPLEMENTED = -2147414009; +const int CSSMERR_CL_INVALID_CERT_POINTER1 = -2147411901; -const int CSSMERR_DL_SELF_CHECK_FAILED = -2147414008; +const int CSSMERR_CL_INVALID_CRL_POINTER1 = -2147411900; -const int CSSMERR_DL_OS_ACCESS_DENIED = -2147414007; +const int CSSMERR_CL_INVALID_FIELD_POINTER1 = -2147411899; -const int CSSMERR_DL_FUNCTION_FAILED = -2147414006; +const int CSSMERR_CL_INVALID_DATA1 = -2147411898; -const int CSSMERR_DL_INVALID_CSP_HANDLE = -2147413936; +const int CSSMERR_CL_CRL_ALREADY_SIGNED1 = -2147411897; -const int CSSMERR_DL_INVALID_DL_HANDLE = -2147413935; +const int CSSMERR_CL_INVALID_NUMBER_OF_FIELDS1 = -2147411896; -const int CSSMERR_DL_INVALID_CL_HANDLE = -2147413934; +const int CSSMERR_CL_VERIFICATION_FAILURE1 = -2147411895; -const int CSSMERR_DL_INVALID_DB_LIST_POINTER = -2147413939; +const int CSSMERR_CL_UNKNOWN_FORMAT1 = -2147411890; -const int CSSMERR_DL_OPERATION_AUTH_DENIED = -2147413984; +const int CSSMERR_CL_UNKNOWN_TAG1 = -2147411889; -const int CSSMERR_DL_OBJECT_USE_AUTH_DENIED = -2147413983; +const int CSSMERR_CL_INVALID_PASSTHROUGH_ID1 = -2147411882; -const int CSSMERR_DL_OBJECT_MANIP_AUTH_DENIED = -2147413982; +const int CSSM_CL_BASE_CL_ERROR1 = -2147411712; -const int CSSMERR_DL_OBJECT_ACL_NOT_SUPPORTED = -2147413981; +const int CSSMERR_CL_INVALID_BUNDLE_POINTER1 = -2147411711; -const int CSSMERR_DL_OBJECT_ACL_REQUIRED = -2147413980; +const int CSSMERR_CL_INVALID_CACHE_HANDLE1 = -2147411710; -const int CSSMERR_DL_INVALID_ACCESS_CREDENTIALS = -2147413979; +const int CSSMERR_CL_INVALID_RESULTS_HANDLE1 = -2147411709; -const int CSSMERR_DL_INVALID_ACL_BASE_CERTS = -2147413978; +const int CSSMERR_CL_INVALID_BUNDLE_INFO1 = -2147411708; -const int CSSMERR_DL_ACL_BASE_CERTS_NOT_SUPPORTED = -2147413977; +const int CSSMERR_CL_INVALID_CRL_INDEX1 = -2147411707; -const int CSSMERR_DL_INVALID_SAMPLE_VALUE = -2147413976; +const int CSSMERR_CL_INVALID_SCOPE1 = -2147411706; -const int CSSMERR_DL_SAMPLE_VALUE_NOT_SUPPORTED = -2147413975; +const int CSSMERR_CL_NO_FIELD_VALUES1 = -2147411705; -const int CSSMERR_DL_INVALID_ACL_SUBJECT_VALUE = -2147413974; +const int CSSMERR_CL_SCOPE_NOT_SUPPORTED1 = -2147411704; -const int CSSMERR_DL_ACL_SUBJECT_TYPE_NOT_SUPPORTED = -2147413973; +const int CSSMERR_DL_INTERNAL_ERROR1 = -2147414015; -const int CSSMERR_DL_INVALID_ACL_CHALLENGE_CALLBACK = -2147413972; +const int CSSMERR_DL_MEMORY_ERROR1 = -2147414014; -const int CSSMERR_DL_ACL_CHALLENGE_CALLBACK_FAILED = -2147413971; +const int CSSMERR_DL_MDS_ERROR1 = -2147414013; -const int CSSMERR_DL_INVALID_ACL_ENTRY_TAG = -2147413970; +const int CSSMERR_DL_INVALID_POINTER1 = -2147414012; -const int CSSMERR_DL_ACL_ENTRY_TAG_NOT_FOUND = -2147413969; +const int CSSMERR_DL_INVALID_INPUT_POINTER1 = -2147414011; -const int CSSMERR_DL_INVALID_ACL_EDIT_MODE = -2147413968; +const int CSSMERR_DL_INVALID_OUTPUT_POINTER1 = -2147414010; -const int CSSMERR_DL_ACL_CHANGE_FAILED = -2147413967; +const int CSSMERR_DL_FUNCTION_NOT_IMPLEMENTED1 = -2147414009; -const int CSSMERR_DL_INVALID_NEW_ACL_ENTRY = -2147413966; +const int CSSMERR_DL_SELF_CHECK_FAILED1 = -2147414008; -const int CSSMERR_DL_INVALID_NEW_ACL_OWNER = -2147413965; +const int CSSMERR_DL_OS_ACCESS_DENIED1 = -2147414007; -const int CSSMERR_DL_ACL_DELETE_FAILED = -2147413964; +const int CSSMERR_DL_FUNCTION_FAILED1 = -2147414006; -const int CSSMERR_DL_ACL_REPLACE_FAILED = -2147413963; +const int CSSMERR_DL_INVALID_CSP_HANDLE1 = -2147413936; -const int CSSMERR_DL_ACL_ADD_FAILED = -2147413962; +const int CSSMERR_DL_INVALID_DL_HANDLE1 = -2147413935; -const int CSSMERR_DL_INVALID_DB_HANDLE = -2147413942; +const int CSSMERR_DL_INVALID_CL_HANDLE1 = -2147413934; -const int CSSMERR_DL_INVALID_PASSTHROUGH_ID = -2147413930; +const int CSSMERR_DL_INVALID_DB_LIST_POINTER1 = -2147413939; -const int CSSMERR_DL_INVALID_NETWORK_ADDR = -2147413929; +const int CSSMERR_DL_OPERATION_AUTH_DENIED1 = -2147413984; -const int CSSM_DL_BASE_DL_ERROR = -2147413760; +const int CSSMERR_DL_OBJECT_USE_AUTH_DENIED1 = -2147413983; -const int CSSMERR_DL_DATABASE_CORRUPT = -2147413759; +const int CSSMERR_DL_OBJECT_MANIP_AUTH_DENIED1 = -2147413982; -const int CSSMERR_DL_INVALID_RECORD_INDEX = -2147413752; +const int CSSMERR_DL_OBJECT_ACL_NOT_SUPPORTED1 = -2147413981; -const int CSSMERR_DL_INVALID_RECORDTYPE = -2147413751; +const int CSSMERR_DL_OBJECT_ACL_REQUIRED1 = -2147413980; -const int CSSMERR_DL_INVALID_FIELD_NAME = -2147413750; +const int CSSMERR_DL_INVALID_ACCESS_CREDENTIALS1 = -2147413979; -const int CSSMERR_DL_UNSUPPORTED_FIELD_FORMAT = -2147413749; +const int CSSMERR_DL_INVALID_ACL_BASE_CERTS1 = -2147413978; -const int CSSMERR_DL_UNSUPPORTED_INDEX_INFO = -2147413748; +const int CSSMERR_DL_ACL_BASE_CERTS_NOT_SUPPORTED1 = -2147413977; -const int CSSMERR_DL_UNSUPPORTED_LOCALITY = -2147413747; +const int CSSMERR_DL_INVALID_SAMPLE_VALUE1 = -2147413976; -const int CSSMERR_DL_UNSUPPORTED_NUM_ATTRIBUTES = -2147413746; +const int CSSMERR_DL_SAMPLE_VALUE_NOT_SUPPORTED1 = -2147413975; -const int CSSMERR_DL_UNSUPPORTED_NUM_INDEXES = -2147413745; +const int CSSMERR_DL_INVALID_ACL_SUBJECT_VALUE1 = -2147413974; -const int CSSMERR_DL_UNSUPPORTED_NUM_RECORDTYPES = -2147413744; +const int CSSMERR_DL_ACL_SUBJECT_TYPE_NOT_SUPPORTED1 = -2147413973; -const int CSSMERR_DL_UNSUPPORTED_RECORDTYPE = -2147413743; +const int CSSMERR_DL_INVALID_ACL_CHALLENGE_CALLBACK1 = -2147413972; -const int CSSMERR_DL_FIELD_SPECIFIED_MULTIPLE = -2147413742; +const int CSSMERR_DL_ACL_CHALLENGE_CALLBACK_FAILED1 = -2147413971; -const int CSSMERR_DL_INCOMPATIBLE_FIELD_FORMAT = -2147413741; +const int CSSMERR_DL_INVALID_ACL_ENTRY_TAG1 = -2147413970; -const int CSSMERR_DL_INVALID_PARSING_MODULE = -2147413740; +const int CSSMERR_DL_ACL_ENTRY_TAG_NOT_FOUND1 = -2147413969; -const int CSSMERR_DL_INVALID_DB_NAME = -2147413738; +const int CSSMERR_DL_INVALID_ACL_EDIT_MODE1 = -2147413968; -const int CSSMERR_DL_DATASTORE_DOESNOT_EXIST = -2147413737; +const int CSSMERR_DL_ACL_CHANGE_FAILED1 = -2147413967; -const int CSSMERR_DL_DATASTORE_ALREADY_EXISTS = -2147413736; +const int CSSMERR_DL_INVALID_NEW_ACL_ENTRY1 = -2147413966; -const int CSSMERR_DL_DB_LOCKED = -2147413735; +const int CSSMERR_DL_INVALID_NEW_ACL_OWNER1 = -2147413965; -const int CSSMERR_DL_DATASTORE_IS_OPEN = -2147413734; +const int CSSMERR_DL_ACL_DELETE_FAILED1 = -2147413964; -const int CSSMERR_DL_RECORD_NOT_FOUND = -2147413733; +const int CSSMERR_DL_ACL_REPLACE_FAILED1 = -2147413963; -const int CSSMERR_DL_MISSING_VALUE = -2147413732; +const int CSSMERR_DL_ACL_ADD_FAILED1 = -2147413962; -const int CSSMERR_DL_UNSUPPORTED_QUERY = -2147413731; +const int CSSMERR_DL_INVALID_DB_HANDLE1 = -2147413942; -const int CSSMERR_DL_UNSUPPORTED_QUERY_LIMITS = -2147413730; +const int CSSMERR_DL_INVALID_PASSTHROUGH_ID1 = -2147413930; -const int CSSMERR_DL_UNSUPPORTED_NUM_SELECTION_PREDS = -2147413729; +const int CSSMERR_DL_INVALID_NETWORK_ADDR1 = -2147413929; -const int CSSMERR_DL_UNSUPPORTED_OPERATOR = -2147413727; +const int CSSM_DL_BASE_DL_ERROR1 = -2147413760; -const int CSSMERR_DL_INVALID_RESULTS_HANDLE = -2147413726; +const int CSSMERR_DL_DATABASE_CORRUPT1 = -2147413759; -const int CSSMERR_DL_INVALID_DB_LOCATION = -2147413725; +const int CSSMERR_DL_INVALID_RECORD_INDEX1 = -2147413752; -const int CSSMERR_DL_INVALID_ACCESS_REQUEST = -2147413724; +const int CSSMERR_DL_INVALID_RECORDTYPE1 = -2147413751; -const int CSSMERR_DL_INVALID_INDEX_INFO = -2147413723; +const int CSSMERR_DL_INVALID_FIELD_NAME1 = -2147413750; -const int CSSMERR_DL_INVALID_SELECTION_TAG = -2147413722; +const int CSSMERR_DL_UNSUPPORTED_FIELD_FORMAT1 = -2147413749; -const int CSSMERR_DL_INVALID_NEW_OWNER = -2147413721; +const int CSSMERR_DL_UNSUPPORTED_INDEX_INFO1 = -2147413748; -const int CSSMERR_DL_INVALID_RECORD_UID = -2147413720; +const int CSSMERR_DL_UNSUPPORTED_LOCALITY1 = -2147413747; -const int CSSMERR_DL_INVALID_UNIQUE_INDEX_DATA = -2147413719; +const int CSSMERR_DL_UNSUPPORTED_NUM_ATTRIBUTES1 = -2147413746; -const int CSSMERR_DL_INVALID_MODIFY_MODE = -2147413718; +const int CSSMERR_DL_UNSUPPORTED_NUM_INDEXES1 = -2147413745; -const int CSSMERR_DL_INVALID_OPEN_PARAMETERS = -2147413717; +const int CSSMERR_DL_UNSUPPORTED_NUM_RECORDTYPES1 = -2147413744; -const int CSSMERR_DL_RECORD_MODIFIED = -2147413716; +const int CSSMERR_DL_UNSUPPORTED_RECORDTYPE1 = -2147413743; -const int CSSMERR_DL_ENDOFDATA = -2147413715; +const int CSSMERR_DL_FIELD_SPECIFIED_MULTIPLE1 = -2147413742; -const int CSSMERR_DL_INVALID_QUERY = -2147413714; +const int CSSMERR_DL_INCOMPATIBLE_FIELD_FORMAT1 = -2147413741; -const int CSSMERR_DL_INVALID_VALUE = -2147413713; +const int CSSMERR_DL_INVALID_PARSING_MODULE1 = -2147413740; -const int CSSMERR_DL_MULTIPLE_VALUES_UNSUPPORTED = -2147413712; +const int CSSMERR_DL_INVALID_DB_NAME1 = -2147413738; -const int CSSMERR_DL_STALE_UNIQUE_RECORD = -2147413711; +const int CSSMERR_DL_DATASTORE_DOESNOT_EXIST1 = -2147413737; -const int CSSM_WORDID_KEYCHAIN_PROMPT = 65536; +const int CSSMERR_DL_DATASTORE_ALREADY_EXISTS1 = -2147413736; -const int CSSM_WORDID_KEYCHAIN_LOCK = 65537; +const int CSSMERR_DL_DB_LOCKED1 = -2147413735; -const int CSSM_WORDID_KEYCHAIN_CHANGE_LOCK = 65538; +const int CSSMERR_DL_DATASTORE_IS_OPEN1 = -2147413734; -const int CSSM_WORDID_PROCESS = 65539; +const int CSSMERR_DL_RECORD_NOT_FOUND1 = -2147413733; -const int CSSM_WORDID__RESERVED_1 = 65540; +const int CSSMERR_DL_MISSING_VALUE1 = -2147413732; -const int CSSM_WORDID_SYMMETRIC_KEY = 65541; +const int CSSMERR_DL_UNSUPPORTED_QUERY1 = -2147413731; -const int CSSM_WORDID_SYSTEM = 65542; +const int CSSMERR_DL_UNSUPPORTED_QUERY_LIMITS1 = -2147413730; -const int CSSM_WORDID_KEY = 65543; +const int CSSMERR_DL_UNSUPPORTED_NUM_SELECTION_PREDS1 = -2147413729; -const int CSSM_WORDID_PIN = 65544; +const int CSSMERR_DL_UNSUPPORTED_OPERATOR1 = -2147413727; -const int CSSM_WORDID_PREAUTH = 65545; +const int CSSMERR_DL_INVALID_RESULTS_HANDLE1 = -2147413726; -const int CSSM_WORDID_PREAUTH_SOURCE = 65546; +const int CSSMERR_DL_INVALID_DB_LOCATION1 = -2147413725; -const int CSSM_WORDID_ASYMMETRIC_KEY = 65547; +const int CSSMERR_DL_INVALID_ACCESS_REQUEST1 = -2147413724; -const int CSSM_WORDID_PARTITION = 65548; +const int CSSMERR_DL_INVALID_INDEX_INFO1 = -2147413723; -const int CSSM_WORDID_KEYBAG_KEY = 65549; +const int CSSMERR_DL_INVALID_SELECTION_TAG1 = -2147413722; -const int CSSM_WORDID__FIRST_UNUSED = 65550; +const int CSSMERR_DL_INVALID_NEW_OWNER1 = -2147413721; -const int CSSM_ACL_SUBJECT_TYPE_KEYCHAIN_PROMPT = 65536; +const int CSSMERR_DL_INVALID_RECORD_UID1 = -2147413720; -const int CSSM_ACL_SUBJECT_TYPE_PROCESS = 65539; +const int CSSMERR_DL_INVALID_UNIQUE_INDEX_DATA1 = -2147413719; -const int CSSM_ACL_SUBJECT_TYPE_CODE_SIGNATURE = 116; +const int CSSMERR_DL_INVALID_MODIFY_MODE1 = -2147413718; -const int CSSM_ACL_SUBJECT_TYPE_COMMENT = 12; +const int CSSMERR_DL_INVALID_OPEN_PARAMETERS1 = -2147413717; -const int CSSM_ACL_SUBJECT_TYPE_SYMMETRIC_KEY = 65541; +const int CSSMERR_DL_RECORD_MODIFIED1 = -2147413716; -const int CSSM_ACL_SUBJECT_TYPE_PREAUTH = 65545; +const int CSSMERR_DL_ENDOFDATA1 = -2147413715; -const int CSSM_ACL_SUBJECT_TYPE_PREAUTH_SOURCE = 65546; +const int CSSMERR_DL_INVALID_QUERY1 = -2147413714; -const int CSSM_ACL_SUBJECT_TYPE_ASYMMETRIC_KEY = 65547; +const int CSSMERR_DL_INVALID_VALUE1 = -2147413713; -const int CSSM_ACL_SUBJECT_TYPE_PARTITION = 65548; +const int CSSMERR_DL_MULTIPLE_VALUES_UNSUPPORTED1 = -2147413712; -const int CSSM_SAMPLE_TYPE_KEYCHAIN_PROMPT = 65536; +const int CSSMERR_DL_STALE_UNIQUE_RECORD1 = -2147413711; -const int CSSM_SAMPLE_TYPE_KEYCHAIN_LOCK = 65537; +const int CSSM_WORDID_KEYCHAIN_PROMPT1 = 65536; -const int CSSM_SAMPLE_TYPE_KEYCHAIN_CHANGE_LOCK = 65538; +const int CSSM_WORDID_KEYCHAIN_LOCK1 = 65537; -const int CSSM_SAMPLE_TYPE_PROCESS = 65539; +const int CSSM_WORDID_KEYCHAIN_CHANGE_LOCK1 = 65538; -const int CSSM_SAMPLE_TYPE_COMMENT = 12; +const int CSSM_WORDID_PROCESS1 = 65539; -const int CSSM_SAMPLE_TYPE_RETRY_ID = 85; +const int CSSM_WORDID__RESERVED_11 = 65540; -const int CSSM_SAMPLE_TYPE_SYMMETRIC_KEY = 65541; +const int CSSM_WORDID_SYMMETRIC_KEY1 = 65541; -const int CSSM_SAMPLE_TYPE_PREAUTH = 65545; +const int CSSM_WORDID_SYSTEM1 = 65542; -const int CSSM_SAMPLE_TYPE_ASYMMETRIC_KEY = 65547; +const int CSSM_WORDID_KEY1 = 65543; -const int CSSM_SAMPLE_TYPE_KEYBAG_KEY = 65549; +const int CSSM_WORDID_PIN1 = 65544; -const int CSSM_ACL_AUTHORIZATION_CHANGE_ACL = 65536; +const int CSSM_WORDID_PREAUTH1 = 65545; -const int CSSM_ACL_AUTHORIZATION_CHANGE_OWNER = 65537; +const int CSSM_WORDID_PREAUTH_SOURCE1 = 65546; -const int CSSM_ACL_AUTHORIZATION_PARTITION_ID = 65538; +const int CSSM_WORDID_ASYMMETRIC_KEY1 = 65547; -const int CSSM_ACL_AUTHORIZATION_INTEGRITY = 65539; +const int CSSM_WORDID_PARTITION1 = 65548; -const int CSSM_ACL_AUTHORIZATION_PREAUTH_BASE = 16842752; +const int CSSM_WORDID_KEYBAG_KEY1 = 65549; -const int CSSM_ACL_AUTHORIZATION_PREAUTH_END = 16908288; +const int CSSM_WORDID__FIRST_UNUSED1 = 65550; -const int CSSM_ACL_CODE_SIGNATURE_INVALID = 0; +const int CSSM_ACL_SUBJECT_TYPE_KEYCHAIN_PROMPT1 = 65536; -const int CSSM_ACL_CODE_SIGNATURE_OSX = 1; +const int CSSM_ACL_SUBJECT_TYPE_PROCESS1 = 65539; -const int CSSM_ACL_MATCH_UID = 1; +const int CSSM_ACL_SUBJECT_TYPE_CODE_SIGNATURE1 = 116; -const int CSSM_ACL_MATCH_GID = 2; +const int CSSM_ACL_SUBJECT_TYPE_COMMENT1 = 12; -const int CSSM_ACL_MATCH_HONOR_ROOT = 256; +const int CSSM_ACL_SUBJECT_TYPE_SYMMETRIC_KEY1 = 65541; -const int CSSM_ACL_MATCH_BITS = 3; +const int CSSM_ACL_SUBJECT_TYPE_PREAUTH1 = 65545; -const int CSSM_ACL_PROCESS_SELECTOR_CURRENT_VERSION = 257; +const int CSSM_ACL_SUBJECT_TYPE_PREAUTH_SOURCE1 = 65546; -const int CSSM_ACL_KEYCHAIN_PROMPT_CURRENT_VERSION = 257; +const int CSSM_ACL_SUBJECT_TYPE_ASYMMETRIC_KEY1 = 65547; -const int CSSM_ACL_KEYCHAIN_PROMPT_REQUIRE_PASSPHRASE = 1; +const int CSSM_ACL_SUBJECT_TYPE_PARTITION1 = 65548; -const int CSSM_ACL_KEYCHAIN_PROMPT_UNSIGNED = 16; +const int CSSM_SAMPLE_TYPE_KEYCHAIN_PROMPT1 = 65536; -const int CSSM_ACL_KEYCHAIN_PROMPT_UNSIGNED_ACT = 32; +const int CSSM_SAMPLE_TYPE_KEYCHAIN_LOCK1 = 65537; -const int CSSM_ACL_KEYCHAIN_PROMPT_INVALID = 64; +const int CSSM_SAMPLE_TYPE_KEYCHAIN_CHANGE_LOCK1 = 65538; -const int CSSM_ACL_KEYCHAIN_PROMPT_INVALID_ACT = 128; +const int CSSM_SAMPLE_TYPE_PROCESS1 = 65539; -const int CSSM_ACL_PREAUTH_TRACKING_COUNT_MASK = 255; +const int CSSM_SAMPLE_TYPE_COMMENT1 = 12; -const int CSSM_ACL_PREAUTH_TRACKING_BLOCKED = 0; +const int CSSM_SAMPLE_TYPE_RETRY_ID1 = 85; -const int CSSM_ACL_PREAUTH_TRACKING_UNKNOWN = 1073741824; +const int CSSM_SAMPLE_TYPE_SYMMETRIC_KEY1 = 65541; -const int CSSM_ACL_PREAUTH_TRACKING_AUTHORIZED = -2147483648; +const int CSSM_SAMPLE_TYPE_PREAUTH1 = 65545; -const int CSSM_DB_ACCESS_RESET = 65536; +const int CSSM_SAMPLE_TYPE_ASYMMETRIC_KEY1 = 65547; -const int CSSM_ALGID_APPLE_YARROW = -2147483648; +const int CSSM_SAMPLE_TYPE_KEYBAG_KEY1 = 65549; -const int CSSM_ALGID_AES = -2147483647; +const int CSSM_ACL_AUTHORIZATION_CHANGE_ACL1 = 65536; -const int CSSM_ALGID_FEE = -2147483646; +const int CSSM_ACL_AUTHORIZATION_CHANGE_OWNER1 = 65537; -const int CSSM_ALGID_FEE_MD5 = -2147483645; +const int CSSM_ACL_AUTHORIZATION_PARTITION_ID1 = 65538; -const int CSSM_ALGID_FEE_SHA1 = -2147483644; +const int CSSM_ACL_AUTHORIZATION_INTEGRITY1 = 65539; -const int CSSM_ALGID_FEED = -2147483643; +const int CSSM_ACL_AUTHORIZATION_PREAUTH_BASE1 = 16842752; -const int CSSM_ALGID_FEEDEXP = -2147483642; +const int CSSM_ACL_AUTHORIZATION_PREAUTH_END1 = 16908288; -const int CSSM_ALGID_ASC = -2147483641; +const int CSSM_ACL_CODE_SIGNATURE_INVALID1 = 0; -const int CSSM_ALGID_SHA1HMAC_LEGACY = -2147483640; +const int CSSM_ACL_CODE_SIGNATURE_OSX1 = 1; -const int CSSM_ALGID_KEYCHAIN_KEY = -2147483639; +const int CSSM_ACL_MATCH_UID1 = 1; -const int CSSM_ALGID_PKCS12_PBE_ENCR = -2147483638; +const int CSSM_ACL_MATCH_GID1 = 2; -const int CSSM_ALGID_PKCS12_PBE_MAC = -2147483637; +const int CSSM_ACL_MATCH_HONOR_ROOT1 = 256; -const int CSSM_ALGID_SECURE_PASSPHRASE = -2147483636; +const int CSSM_ACL_MATCH_BITS1 = 3; -const int CSSM_ALGID_PBE_OPENSSL_MD5 = -2147483635; +const int CSSM_ACL_PROCESS_SELECTOR_CURRENT_VERSION1 = 257; -const int CSSM_ALGID_SHA256 = -2147483634; +const int CSSM_ACL_KEYCHAIN_PROMPT_CURRENT_VERSION1 = 257; -const int CSSM_ALGID_SHA384 = -2147483633; +const int CSSM_ACL_KEYCHAIN_PROMPT_REQUIRE_PASSPHRASE1 = 1; -const int CSSM_ALGID_SHA512 = -2147483632; +const int CSSM_ACL_KEYCHAIN_PROMPT_UNSIGNED1 = 16; -const int CSSM_ALGID_ENTROPY_DEFAULT = -2147483631; +const int CSSM_ACL_KEYCHAIN_PROMPT_UNSIGNED_ACT1 = 32; -const int CSSM_ALGID_SHA224 = -2147483630; +const int CSSM_ACL_KEYCHAIN_PROMPT_INVALID1 = 64; -const int CSSM_ALGID_SHA224WithRSA = -2147483629; +const int CSSM_ACL_KEYCHAIN_PROMPT_INVALID_ACT1 = 128; -const int CSSM_ALGID_SHA256WithRSA = -2147483628; +const int CSSM_ACL_PREAUTH_TRACKING_COUNT_MASK1 = 255; -const int CSSM_ALGID_SHA384WithRSA = -2147483627; +const int CSSM_ACL_PREAUTH_TRACKING_BLOCKED1 = 0; -const int CSSM_ALGID_SHA512WithRSA = -2147483626; +const int CSSM_ACL_PREAUTH_TRACKING_UNKNOWN1 = 1073741824; -const int CSSM_ALGID_OPENSSH1 = -2147483625; +const int CSSM_ACL_PREAUTH_TRACKING_AUTHORIZED1 = -2147483648; -const int CSSM_ALGID_SHA224WithECDSA = -2147483624; +const int CSSM_DB_ACCESS_RESET1 = 65536; -const int CSSM_ALGID_SHA256WithECDSA = -2147483623; +const int CSSM_ALGID_APPLE_YARROW1 = -2147483648; -const int CSSM_ALGID_SHA384WithECDSA = -2147483622; +const int CSSM_ALGID_AES1 = -2147483647; -const int CSSM_ALGID_SHA512WithECDSA = -2147483621; +const int CSSM_ALGID_FEE1 = -2147483646; -const int CSSM_ALGID_ECDSA_SPECIFIED = -2147483620; +const int CSSM_ALGID_FEE_MD51 = -2147483645; -const int CSSM_ALGID_ECDH_X963_KDF = -2147483619; +const int CSSM_ALGID_FEE_SHA11 = -2147483644; -const int CSSM_ALGID__FIRST_UNUSED = -2147483618; +const int CSSM_ALGID_FEED1 = -2147483643; -const int CSSM_PADDING_APPLE_SSLv2 = -2147483648; +const int CSSM_ALGID_FEEDEXP1 = -2147483642; -const int CSSM_KEYBLOB_RAW_FORMAT_VENDOR_DEFINED = -2147483648; +const int CSSM_ALGID_ASC1 = -2147483641; -const int CSSM_KEYBLOB_RAW_FORMAT_X509 = -2147483648; +const int CSSM_ALGID_SHA1HMAC_LEGACY1 = -2147483640; -const int CSSM_KEYBLOB_RAW_FORMAT_OPENSSH = -2147483647; +const int CSSM_ALGID_KEYCHAIN_KEY1 = -2147483639; -const int CSSM_KEYBLOB_RAW_FORMAT_OPENSSL = -2147483646; +const int CSSM_ALGID_PKCS12_PBE_ENCR1 = -2147483638; -const int CSSM_KEYBLOB_RAW_FORMAT_OPENSSH2 = -2147483645; +const int CSSM_ALGID_PKCS12_PBE_MAC1 = -2147483637; -const int CSSM_CUSTOM_COMMON_ERROR_EXTENT = 224; +const int CSSM_ALGID_SECURE_PASSPHRASE1 = -2147483636; -const int CSSM_ERRCODE_NO_USER_INTERACTION = 224; +const int CSSM_ALGID_PBE_OPENSSL_MD51 = -2147483635; -const int CSSM_ERRCODE_USER_CANCELED = 225; +const int CSSM_ALGID_SHA2561 = -2147483634; -const int CSSM_ERRCODE_SERVICE_NOT_AVAILABLE = 226; +const int CSSM_ALGID_SHA3841 = -2147483633; -const int CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION = 227; +const int CSSM_ALGID_SHA5121 = -2147483632; -const int CSSM_ERRCODE_DEVICE_RESET = 228; +const int CSSM_ALGID_ENTROPY_DEFAULT1 = -2147483631; -const int CSSM_ERRCODE_DEVICE_FAILED = 229; +const int CSSM_ALGID_SHA2241 = -2147483630; -const int CSSM_ERRCODE_IN_DARK_WAKE = 230; +const int CSSM_ALGID_SHA224WithRSA1 = -2147483629; -const int CSSMERR_CSSM_NO_USER_INTERACTION = -2147417888; +const int CSSM_ALGID_SHA256WithRSA1 = -2147483628; -const int CSSMERR_AC_NO_USER_INTERACTION = -2147405600; +const int CSSM_ALGID_SHA384WithRSA1 = -2147483627; -const int CSSMERR_CSP_NO_USER_INTERACTION = -2147415840; +const int CSSM_ALGID_SHA512WithRSA1 = -2147483626; -const int CSSMERR_CL_NO_USER_INTERACTION = -2147411744; +const int CSSM_ALGID_OPENSSH11 = -2147483625; -const int CSSMERR_DL_NO_USER_INTERACTION = -2147413792; +const int CSSM_ALGID_SHA224WithECDSA1 = -2147483624; -const int CSSMERR_TP_NO_USER_INTERACTION = -2147409696; +const int CSSM_ALGID_SHA256WithECDSA1 = -2147483623; -const int CSSMERR_CSSM_USER_CANCELED = -2147417887; +const int CSSM_ALGID_SHA384WithECDSA1 = -2147483622; -const int CSSMERR_AC_USER_CANCELED = -2147405599; +const int CSSM_ALGID_SHA512WithECDSA1 = -2147483621; -const int CSSMERR_CSP_USER_CANCELED = -2147415839; +const int CSSM_ALGID_ECDSA_SPECIFIED1 = -2147483620; -const int CSSMERR_CL_USER_CANCELED = -2147411743; +const int CSSM_ALGID_ECDH_X963_KDF1 = -2147483619; -const int CSSMERR_DL_USER_CANCELED = -2147413791; +const int CSSM_ALGID__FIRST_UNUSED1 = -2147483618; -const int CSSMERR_TP_USER_CANCELED = -2147409695; +const int CSSM_PADDING_APPLE_SSLv21 = -2147483648; -const int CSSMERR_CSSM_SERVICE_NOT_AVAILABLE = -2147417886; +const int CSSM_KEYBLOB_RAW_FORMAT_VENDOR_DEFINED1 = -2147483648; -const int CSSMERR_AC_SERVICE_NOT_AVAILABLE = -2147405598; +const int CSSM_KEYBLOB_RAW_FORMAT_X5091 = -2147483648; -const int CSSMERR_CSP_SERVICE_NOT_AVAILABLE = -2147415838; +const int CSSM_KEYBLOB_RAW_FORMAT_OPENSSH1 = -2147483647; -const int CSSMERR_CL_SERVICE_NOT_AVAILABLE = -2147411742; +const int CSSM_KEYBLOB_RAW_FORMAT_OPENSSL1 = -2147483646; -const int CSSMERR_DL_SERVICE_NOT_AVAILABLE = -2147413790; +const int CSSM_KEYBLOB_RAW_FORMAT_OPENSSH21 = -2147483645; -const int CSSMERR_TP_SERVICE_NOT_AVAILABLE = -2147409694; +const int CSSM_CUSTOM_COMMON_ERROR_EXTENT1 = 224; -const int CSSMERR_CSSM_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147417885; +const int CSSM_ERRCODE_NO_USER_INTERACTION1 = 224; -const int CSSMERR_AC_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147405597; +const int CSSM_ERRCODE_USER_CANCELED1 = 225; -const int CSSMERR_CSP_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147415837; +const int CSSM_ERRCODE_SERVICE_NOT_AVAILABLE1 = 226; -const int CSSMERR_CL_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147411741; +const int CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION1 = 227; -const int CSSMERR_DL_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147413789; +const int CSSM_ERRCODE_DEVICE_RESET1 = 228; -const int CSSMERR_TP_INSUFFICIENT_CLIENT_IDENTIFICATION = -2147409693; +const int CSSM_ERRCODE_DEVICE_FAILED1 = 229; -const int CSSMERR_CSSM_DEVICE_RESET = -2147417884; +const int CSSM_ERRCODE_IN_DARK_WAKE1 = 230; -const int CSSMERR_AC_DEVICE_RESET = -2147405596; +const int CSSMERR_CSSM_NO_USER_INTERACTION1 = -2147417888; -const int CSSMERR_CSP_DEVICE_RESET = -2147415836; +const int CSSMERR_AC_NO_USER_INTERACTION1 = -2147405600; -const int CSSMERR_CL_DEVICE_RESET = -2147411740; +const int CSSMERR_CSP_NO_USER_INTERACTION1 = -2147415840; -const int CSSMERR_DL_DEVICE_RESET = -2147413788; +const int CSSMERR_CL_NO_USER_INTERACTION1 = -2147411744; -const int CSSMERR_TP_DEVICE_RESET = -2147409692; +const int CSSMERR_DL_NO_USER_INTERACTION1 = -2147413792; -const int CSSMERR_CSSM_DEVICE_FAILED = -2147417883; +const int CSSMERR_TP_NO_USER_INTERACTION1 = -2147409696; -const int CSSMERR_AC_DEVICE_FAILED = -2147405595; +const int CSSMERR_CSSM_USER_CANCELED1 = -2147417887; -const int CSSMERR_CSP_DEVICE_FAILED = -2147415835; +const int CSSMERR_AC_USER_CANCELED1 = -2147405599; -const int CSSMERR_CL_DEVICE_FAILED = -2147411739; +const int CSSMERR_CSP_USER_CANCELED1 = -2147415839; -const int CSSMERR_DL_DEVICE_FAILED = -2147413787; +const int CSSMERR_CL_USER_CANCELED1 = -2147411743; -const int CSSMERR_TP_DEVICE_FAILED = -2147409691; +const int CSSMERR_DL_USER_CANCELED1 = -2147413791; -const int CSSMERR_CSSM_IN_DARK_WAKE = -2147417882; +const int CSSMERR_TP_USER_CANCELED1 = -2147409695; -const int CSSMERR_AC_IN_DARK_WAKE = -2147405594; +const int CSSMERR_CSSM_SERVICE_NOT_AVAILABLE1 = -2147417886; -const int CSSMERR_CSP_IN_DARK_WAKE = -2147415834; +const int CSSMERR_AC_SERVICE_NOT_AVAILABLE1 = -2147405598; -const int CSSMERR_CL_IN_DARK_WAKE = -2147411738; +const int CSSMERR_CSP_SERVICE_NOT_AVAILABLE1 = -2147415838; -const int CSSMERR_DL_IN_DARK_WAKE = -2147413786; +const int CSSMERR_CL_SERVICE_NOT_AVAILABLE1 = -2147411742; -const int CSSMERR_TP_IN_DARK_WAKE = -2147409690; +const int CSSMERR_DL_SERVICE_NOT_AVAILABLE1 = -2147413790; -const int CSSMERR_CSP_APPLE_ADD_APPLICATION_ACL_SUBJECT = -2147415040; +const int CSSMERR_TP_SERVICE_NOT_AVAILABLE1 = -2147409694; -const int CSSMERR_CSP_APPLE_PUBLIC_KEY_INCOMPLETE = -2147415039; +const int CSSMERR_CSSM_INSUFFICIENT_CLIENT_IDENTIFICATION1 = -2147417885; -const int CSSMERR_CSP_APPLE_SIGNATURE_MISMATCH = -2147415038; +const int CSSMERR_AC_INSUFFICIENT_CLIENT_IDENTIFICATION1 = -2147405597; -const int CSSMERR_CSP_APPLE_INVALID_KEY_START_DATE = -2147415037; +const int CSSMERR_CSP_INSUFFICIENT_CLIENT_IDENTIFICATION1 = -2147415837; -const int CSSMERR_CSP_APPLE_INVALID_KEY_END_DATE = -2147415036; +const int CSSMERR_CL_INSUFFICIENT_CLIENT_IDENTIFICATION1 = -2147411741; -const int CSSMERR_CSPDL_APPLE_DL_CONVERSION_ERROR = -2147415035; +const int CSSMERR_DL_INSUFFICIENT_CLIENT_IDENTIFICATION1 = -2147413789; -const int CSSMERR_CSP_APPLE_SSLv2_ROLLBACK = -2147415034; +const int CSSMERR_TP_INSUFFICIENT_CLIENT_IDENTIFICATION1 = -2147409693; -const int CSSM_DL_DB_RECORD_GENERIC_PASSWORD = -2147483648; +const int CSSMERR_CSSM_DEVICE_RESET1 = -2147417884; -const int CSSM_DL_DB_RECORD_INTERNET_PASSWORD = -2147483647; +const int CSSMERR_AC_DEVICE_RESET1 = -2147405596; -const int CSSM_DL_DB_RECORD_APPLESHARE_PASSWORD = -2147483646; +const int CSSMERR_CSP_DEVICE_RESET1 = -2147415836; -const int CSSM_DL_DB_RECORD_X509_CERTIFICATE = -2147479552; +const int CSSMERR_CL_DEVICE_RESET1 = -2147411740; -const int CSSM_DL_DB_RECORD_USER_TRUST = -2147479551; +const int CSSMERR_DL_DEVICE_RESET1 = -2147413788; -const int CSSM_DL_DB_RECORD_X509_CRL = -2147479550; +const int CSSMERR_TP_DEVICE_RESET1 = -2147409692; -const int CSSM_DL_DB_RECORD_UNLOCK_REFERRAL = -2147479549; +const int CSSMERR_CSSM_DEVICE_FAILED1 = -2147417883; -const int CSSM_DL_DB_RECORD_EXTENDED_ATTRIBUTE = -2147479548; +const int CSSMERR_AC_DEVICE_FAILED1 = -2147405595; -const int CSSM_DL_DB_RECORD_METADATA = -2147450880; +const int CSSMERR_CSP_DEVICE_FAILED1 = -2147415835; -const int CSSM_APPLEFILEDL_TOGGLE_AUTOCOMMIT = 0; +const int CSSMERR_CL_DEVICE_FAILED1 = -2147411739; -const int CSSM_APPLEFILEDL_COMMIT = 1; +const int CSSMERR_DL_DEVICE_FAILED1 = -2147413787; -const int CSSM_APPLEFILEDL_ROLLBACK = 2; +const int CSSMERR_TP_DEVICE_FAILED1 = -2147409691; -const int CSSM_APPLEFILEDL_TAKE_FILE_LOCK = 3; +const int CSSMERR_CSSM_IN_DARK_WAKE1 = -2147417882; -const int CSSM_APPLEFILEDL_MAKE_BACKUP = 4; +const int CSSMERR_AC_IN_DARK_WAKE1 = -2147405594; -const int CSSM_APPLEFILEDL_MAKE_COPY = 5; +const int CSSMERR_CSP_IN_DARK_WAKE1 = -2147415834; -const int CSSM_APPLEFILEDL_DELETE_FILE = 6; +const int CSSMERR_CL_IN_DARK_WAKE1 = -2147411738; -const int CSSM_APPLE_UNLOCK_TYPE_KEY_DIRECT = 1; +const int CSSMERR_DL_IN_DARK_WAKE1 = -2147413786; -const int CSSM_APPLE_UNLOCK_TYPE_WRAPPED_PRIVATE = 2; +const int CSSMERR_TP_IN_DARK_WAKE1 = -2147409690; -const int CSSM_APPLE_UNLOCK_TYPE_KEYBAG = 3; +const int CSSMERR_CSP_APPLE_ADD_APPLICATION_ACL_SUBJECT1 = -2147415040; -const int CSSMERR_APPLEDL_INVALID_OPEN_PARAMETERS = -2147412992; +const int CSSMERR_CSP_APPLE_PUBLIC_KEY_INCOMPLETE1 = -2147415039; -const int CSSMERR_APPLEDL_DISK_FULL = -2147412991; +const int CSSMERR_CSP_APPLE_SIGNATURE_MISMATCH1 = -2147415038; -const int CSSMERR_APPLEDL_QUOTA_EXCEEDED = -2147412990; +const int CSSMERR_CSP_APPLE_INVALID_KEY_START_DATE1 = -2147415037; -const int CSSMERR_APPLEDL_FILE_TOO_BIG = -2147412989; +const int CSSMERR_CSP_APPLE_INVALID_KEY_END_DATE1 = -2147415036; -const int CSSMERR_APPLEDL_INVALID_DATABASE_BLOB = -2147412988; +const int CSSMERR_CSPDL_APPLE_DL_CONVERSION_ERROR1 = -2147415035; -const int CSSMERR_APPLEDL_INVALID_KEY_BLOB = -2147412987; +const int CSSMERR_CSP_APPLE_SSLv2_ROLLBACK1 = -2147415034; -const int CSSMERR_APPLEDL_INCOMPATIBLE_DATABASE_BLOB = -2147412986; +const int CSSM_DL_DB_RECORD_GENERIC_PASSWORD1 = -2147483648; -const int CSSMERR_APPLEDL_INCOMPATIBLE_KEY_BLOB = -2147412985; +const int CSSM_DL_DB_RECORD_INTERNET_PASSWORD1 = -2147483647; -const int CSSMERR_APPLETP_HOSTNAME_MISMATCH = -2147408896; +const int CSSM_DL_DB_RECORD_APPLESHARE_PASSWORD1 = -2147483646; -const int CSSMERR_APPLETP_UNKNOWN_CRITICAL_EXTEN = -2147408895; +const int CSSM_DL_DB_RECORD_X509_CERTIFICATE1 = -2147479552; -const int CSSMERR_APPLETP_NO_BASIC_CONSTRAINTS = -2147408894; +const int CSSM_DL_DB_RECORD_USER_TRUST1 = -2147479551; -const int CSSMERR_APPLETP_INVALID_CA = -2147408893; +const int CSSM_DL_DB_RECORD_X509_CRL1 = -2147479550; -const int CSSMERR_APPLETP_INVALID_AUTHORITY_ID = -2147408892; +const int CSSM_DL_DB_RECORD_UNLOCK_REFERRAL1 = -2147479549; -const int CSSMERR_APPLETP_INVALID_SUBJECT_ID = -2147408891; +const int CSSM_DL_DB_RECORD_EXTENDED_ATTRIBUTE1 = -2147479548; -const int CSSMERR_APPLETP_INVALID_KEY_USAGE = -2147408890; +const int CSSM_DL_DB_RECORD_METADATA1 = -2147450880; -const int CSSMERR_APPLETP_INVALID_EXTENDED_KEY_USAGE = -2147408889; +const int CSSM_APPLEFILEDL_TOGGLE_AUTOCOMMIT1 = 0; -const int CSSMERR_APPLETP_INVALID_ID_LINKAGE = -2147408888; +const int CSSM_APPLEFILEDL_COMMIT1 = 1; -const int CSSMERR_APPLETP_PATH_LEN_CONSTRAINT = -2147408887; +const int CSSM_APPLEFILEDL_ROLLBACK1 = 2; -const int CSSMERR_APPLETP_INVALID_ROOT = -2147408886; +const int CSSM_APPLEFILEDL_TAKE_FILE_LOCK1 = 3; -const int CSSMERR_APPLETP_CRL_EXPIRED = -2147408885; +const int CSSM_APPLEFILEDL_MAKE_BACKUP1 = 4; -const int CSSMERR_APPLETP_CRL_NOT_VALID_YET = -2147408884; +const int CSSM_APPLEFILEDL_MAKE_COPY1 = 5; -const int CSSMERR_APPLETP_CRL_NOT_FOUND = -2147408883; +const int CSSM_APPLEFILEDL_DELETE_FILE1 = 6; -const int CSSMERR_APPLETP_CRL_SERVER_DOWN = -2147408882; +const int CSSM_APPLE_UNLOCK_TYPE_KEY_DIRECT1 = 1; -const int CSSMERR_APPLETP_CRL_BAD_URI = -2147408881; +const int CSSM_APPLE_UNLOCK_TYPE_WRAPPED_PRIVATE1 = 2; -const int CSSMERR_APPLETP_UNKNOWN_CERT_EXTEN = -2147408880; +const int CSSM_APPLE_UNLOCK_TYPE_KEYBAG1 = 3; -const int CSSMERR_APPLETP_UNKNOWN_CRL_EXTEN = -2147408879; +const int CSSMERR_APPLEDL_INVALID_OPEN_PARAMETERS1 = -2147412992; -const int CSSMERR_APPLETP_CRL_NOT_TRUSTED = -2147408878; +const int CSSMERR_APPLEDL_DISK_FULL1 = -2147412991; -const int CSSMERR_APPLETP_CRL_INVALID_ANCHOR_CERT = -2147408877; +const int CSSMERR_APPLEDL_QUOTA_EXCEEDED1 = -2147412990; -const int CSSMERR_APPLETP_CRL_POLICY_FAIL = -2147408876; +const int CSSMERR_APPLEDL_FILE_TOO_BIG1 = -2147412989; -const int CSSMERR_APPLETP_IDP_FAIL = -2147408875; +const int CSSMERR_APPLEDL_INVALID_DATABASE_BLOB1 = -2147412988; -const int CSSMERR_APPLETP_CERT_NOT_FOUND_FROM_ISSUER = -2147408874; +const int CSSMERR_APPLEDL_INVALID_KEY_BLOB1 = -2147412987; -const int CSSMERR_APPLETP_BAD_CERT_FROM_ISSUER = -2147408873; +const int CSSMERR_APPLEDL_INCOMPATIBLE_DATABASE_BLOB1 = -2147412986; -const int CSSMERR_APPLETP_SMIME_EMAIL_ADDRS_NOT_FOUND = -2147408872; +const int CSSMERR_APPLEDL_INCOMPATIBLE_KEY_BLOB1 = -2147412985; -const int CSSMERR_APPLETP_SMIME_BAD_EXT_KEY_USE = -2147408871; +const int CSSMERR_APPLETP_HOSTNAME_MISMATCH1 = -2147408896; -const int CSSMERR_APPLETP_SMIME_BAD_KEY_USE = -2147408870; +const int CSSMERR_APPLETP_UNKNOWN_CRITICAL_EXTEN1 = -2147408895; -const int CSSMERR_APPLETP_SMIME_KEYUSAGE_NOT_CRITICAL = -2147408869; +const int CSSMERR_APPLETP_NO_BASIC_CONSTRAINTS1 = -2147408894; -const int CSSMERR_APPLETP_SMIME_NO_EMAIL_ADDRS = -2147408868; +const int CSSMERR_APPLETP_INVALID_CA1 = -2147408893; -const int CSSMERR_APPLETP_SMIME_SUBJ_ALT_NAME_NOT_CRIT = -2147408867; +const int CSSMERR_APPLETP_INVALID_AUTHORITY_ID1 = -2147408892; -const int CSSMERR_APPLETP_SSL_BAD_EXT_KEY_USE = -2147408866; +const int CSSMERR_APPLETP_INVALID_SUBJECT_ID1 = -2147408891; -const int CSSMERR_APPLETP_OCSP_BAD_RESPONSE = -2147408865; +const int CSSMERR_APPLETP_INVALID_KEY_USAGE1 = -2147408890; -const int CSSMERR_APPLETP_OCSP_BAD_REQUEST = -2147408864; +const int CSSMERR_APPLETP_INVALID_EXTENDED_KEY_USAGE1 = -2147408889; -const int CSSMERR_APPLETP_OCSP_UNAVAILABLE = -2147408863; +const int CSSMERR_APPLETP_INVALID_ID_LINKAGE1 = -2147408888; -const int CSSMERR_APPLETP_OCSP_STATUS_UNRECOGNIZED = -2147408862; +const int CSSMERR_APPLETP_PATH_LEN_CONSTRAINT1 = -2147408887; -const int CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK = -2147408861; +const int CSSMERR_APPLETP_INVALID_ROOT1 = -2147408886; -const int CSSMERR_APPLETP_NETWORK_FAILURE = -2147408860; +const int CSSMERR_APPLETP_CRL_EXPIRED1 = -2147408885; -const int CSSMERR_APPLETP_OCSP_NOT_TRUSTED = -2147408859; +const int CSSMERR_APPLETP_CRL_NOT_VALID_YET1 = -2147408884; -const int CSSMERR_APPLETP_OCSP_INVALID_ANCHOR_CERT = -2147408858; +const int CSSMERR_APPLETP_CRL_NOT_FOUND1 = -2147408883; -const int CSSMERR_APPLETP_OCSP_SIG_ERROR = -2147408857; +const int CSSMERR_APPLETP_CRL_SERVER_DOWN1 = -2147408882; -const int CSSMERR_APPLETP_OCSP_NO_SIGNER = -2147408856; +const int CSSMERR_APPLETP_CRL_BAD_URI1 = -2147408881; -const int CSSMERR_APPLETP_OCSP_RESP_MALFORMED_REQ = -2147408855; +const int CSSMERR_APPLETP_UNKNOWN_CERT_EXTEN1 = -2147408880; -const int CSSMERR_APPLETP_OCSP_RESP_INTERNAL_ERR = -2147408854; +const int CSSMERR_APPLETP_UNKNOWN_CRL_EXTEN1 = -2147408879; -const int CSSMERR_APPLETP_OCSP_RESP_TRY_LATER = -2147408853; +const int CSSMERR_APPLETP_CRL_NOT_TRUSTED1 = -2147408878; -const int CSSMERR_APPLETP_OCSP_RESP_SIG_REQUIRED = -2147408852; +const int CSSMERR_APPLETP_CRL_INVALID_ANCHOR_CERT1 = -2147408877; -const int CSSMERR_APPLETP_OCSP_RESP_UNAUTHORIZED = -2147408851; +const int CSSMERR_APPLETP_CRL_POLICY_FAIL1 = -2147408876; -const int CSSMERR_APPLETP_OCSP_NONCE_MISMATCH = -2147408850; +const int CSSMERR_APPLETP_IDP_FAIL1 = -2147408875; -const int CSSMERR_APPLETP_CS_BAD_CERT_CHAIN_LENGTH = -2147408849; +const int CSSMERR_APPLETP_CERT_NOT_FOUND_FROM_ISSUER1 = -2147408874; -const int CSSMERR_APPLETP_CS_NO_BASIC_CONSTRAINTS = -2147408848; +const int CSSMERR_APPLETP_BAD_CERT_FROM_ISSUER1 = -2147408873; -const int CSSMERR_APPLETP_CS_BAD_PATH_LENGTH = -2147408847; +const int CSSMERR_APPLETP_SMIME_EMAIL_ADDRS_NOT_FOUND1 = -2147408872; -const int CSSMERR_APPLETP_CS_NO_EXTENDED_KEY_USAGE = -2147408846; +const int CSSMERR_APPLETP_SMIME_BAD_EXT_KEY_USE1 = -2147408871; -const int CSSMERR_APPLETP_CODE_SIGN_DEVELOPMENT = -2147408845; +const int CSSMERR_APPLETP_SMIME_BAD_KEY_USE1 = -2147408870; -const int CSSMERR_APPLETP_RS_BAD_CERT_CHAIN_LENGTH = -2147408844; +const int CSSMERR_APPLETP_SMIME_KEYUSAGE_NOT_CRITICAL1 = -2147408869; -const int CSSMERR_APPLETP_RS_BAD_EXTENDED_KEY_USAGE = -2147408843; +const int CSSMERR_APPLETP_SMIME_NO_EMAIL_ADDRS1 = -2147408868; -const int CSSMERR_APPLETP_TRUST_SETTING_DENY = -2147408842; +const int CSSMERR_APPLETP_SMIME_SUBJ_ALT_NAME_NOT_CRIT1 = -2147408867; -const int CSSMERR_APPLETP_INVALID_EMPTY_SUBJECT = -2147408841; +const int CSSMERR_APPLETP_SSL_BAD_EXT_KEY_USE1 = -2147408866; -const int CSSMERR_APPLETP_UNKNOWN_QUAL_CERT_STATEMENT = -2147408840; +const int CSSMERR_APPLETP_OCSP_BAD_RESPONSE1 = -2147408865; -const int CSSMERR_APPLETP_MISSING_REQUIRED_EXTENSION = -2147408839; +const int CSSMERR_APPLETP_OCSP_BAD_REQUEST1 = -2147408864; -const int CSSMERR_APPLETP_EXT_KEYUSAGE_NOT_CRITICAL = -2147408838; +const int CSSMERR_APPLETP_OCSP_UNAVAILABLE1 = -2147408863; -const int CSSMERR_APPLETP_IDENTIFIER_MISSING = -2147408837; +const int CSSMERR_APPLETP_OCSP_STATUS_UNRECOGNIZED1 = -2147408862; -const int CSSMERR_APPLETP_CA_PIN_MISMATCH = -2147408836; +const int CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK1 = -2147408861; -const int CSSMERR_APPLETP_LEAF_PIN_MISMATCH = -2147408835; +const int CSSMERR_APPLETP_NETWORK_FAILURE1 = -2147408860; -const int CSSMERR_APPLE_DOTMAC_REQ_QUEUED = -2147408796; +const int CSSMERR_APPLETP_OCSP_NOT_TRUSTED1 = -2147408859; -const int CSSMERR_APPLE_DOTMAC_REQ_REDIRECT = -2147408795; +const int CSSMERR_APPLETP_OCSP_INVALID_ANCHOR_CERT1 = -2147408858; -const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_ERR = -2147408794; +const int CSSMERR_APPLETP_OCSP_SIG_ERROR1 = -2147408857; -const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_PARAM = -2147408793; +const int CSSMERR_APPLETP_OCSP_NO_SIGNER1 = -2147408856; -const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_AUTH = -2147408792; +const int CSSMERR_APPLETP_OCSP_RESP_MALFORMED_REQ1 = -2147408855; -const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_UNIMPL = -2147408791; +const int CSSMERR_APPLETP_OCSP_RESP_INTERNAL_ERR1 = -2147408854; -const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_NOT_AVAIL = -2147408790; +const int CSSMERR_APPLETP_OCSP_RESP_TRY_LATER1 = -2147408853; -const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_ALREADY_EXIST = -2147408789; +const int CSSMERR_APPLETP_OCSP_RESP_SIG_REQUIRED1 = -2147408852; -const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_SERVICE_ERROR = -2147408788; +const int CSSMERR_APPLETP_OCSP_RESP_UNAUTHORIZED1 = -2147408851; -const int CSSMERR_APPLE_DOTMAC_REQ_IS_PENDING = -2147408787; +const int CSSMERR_APPLETP_OCSP_NONCE_MISMATCH1 = -2147408850; -const int CSSMERR_APPLE_DOTMAC_NO_REQ_PENDING = -2147408786; +const int CSSMERR_APPLETP_CS_BAD_CERT_CHAIN_LENGTH1 = -2147408849; -const int CSSMERR_APPLE_DOTMAC_CSR_VERIFY_FAIL = -2147408785; +const int CSSMERR_APPLETP_CS_NO_BASIC_CONSTRAINTS1 = -2147408848; -const int CSSMERR_APPLE_DOTMAC_FAILED_CONSISTENCY_CHECK = -2147408784; +const int CSSMERR_APPLETP_CS_BAD_PATH_LENGTH1 = -2147408847; -const int CSSM_APPLEDL_OPEN_PARAMETERS_VERSION = 1; +const int CSSMERR_APPLETP_CS_NO_EXTENDED_KEY_USAGE1 = -2147408846; -const int CSSM_APPLECSPDL_DB_LOCK = 0; +const int CSSMERR_APPLETP_CODE_SIGN_DEVELOPMENT1 = -2147408845; -const int CSSM_APPLECSPDL_DB_UNLOCK = 1; +const int CSSMERR_APPLETP_RS_BAD_CERT_CHAIN_LENGTH1 = -2147408844; -const int CSSM_APPLECSPDL_DB_GET_SETTINGS = 2; +const int CSSMERR_APPLETP_RS_BAD_EXTENDED_KEY_USAGE1 = -2147408843; -const int CSSM_APPLECSPDL_DB_SET_SETTINGS = 3; +const int CSSMERR_APPLETP_TRUST_SETTING_DENY1 = -2147408842; -const int CSSM_APPLECSPDL_DB_IS_LOCKED = 4; +const int CSSMERR_APPLETP_INVALID_EMPTY_SUBJECT1 = -2147408841; -const int CSSM_APPLECSPDL_DB_CHANGE_PASSWORD = 5; +const int CSSMERR_APPLETP_UNKNOWN_QUAL_CERT_STATEMENT1 = -2147408840; -const int CSSM_APPLECSPDL_DB_GET_HANDLE = 6; +const int CSSMERR_APPLETP_MISSING_REQUIRED_EXTENSION1 = -2147408839; -const int CSSM_APPLESCPDL_CSP_GET_KEYHANDLE = 7; +const int CSSMERR_APPLETP_EXT_KEYUSAGE_NOT_CRITICAL1 = -2147408838; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_8 = 8; +const int CSSMERR_APPLETP_IDENTIFIER_MISSING1 = -2147408837; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_9 = 9; +const int CSSMERR_APPLETP_CA_PIN_MISMATCH1 = -2147408836; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_10 = 10; +const int CSSMERR_APPLETP_LEAF_PIN_MISMATCH1 = -2147408835; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_11 = 11; +const int CSSMERR_APPLE_DOTMAC_REQ_QUEUED1 = -2147408796; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_12 = 12; +const int CSSMERR_APPLE_DOTMAC_REQ_REDIRECT1 = -2147408795; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_13 = 13; +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_ERR1 = -2147408794; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_14 = 14; +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_PARAM1 = -2147408793; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_15 = 15; +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_AUTH1 = -2147408792; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_16 = 16; +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_UNIMPL1 = -2147408791; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_17 = 17; +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_NOT_AVAIL1 = -2147408790; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_18 = 18; +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_ALREADY_EXIST1 = -2147408789; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_19 = 19; +const int CSSMERR_APPLE_DOTMAC_REQ_SERVER_SERVICE_ERROR1 = -2147408788; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_20 = 20; +const int CSSMERR_APPLE_DOTMAC_REQ_IS_PENDING1 = -2147408787; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_21 = 21; +const int CSSMERR_APPLE_DOTMAC_NO_REQ_PENDING1 = -2147408786; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_22 = 22; +const int CSSMERR_APPLE_DOTMAC_CSR_VERIFY_FAIL1 = -2147408785; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_23 = 23; +const int CSSMERR_APPLE_DOTMAC_FAILED_CONSISTENCY_CHECK1 = -2147408784; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_24 = 24; +const int CSSM_APPLEDL_OPEN_PARAMETERS_VERSION1 = 1; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_25 = 25; +const int CSSM_APPLECSPDL_DB_LOCK1 = 0; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_26 = 26; +const int CSSM_APPLECSPDL_DB_UNLOCK1 = 1; -const int CSSM_APPLE_PRIVATE_CSPDL_CODE_27 = 27; +const int CSSM_APPLECSPDL_DB_GET_SETTINGS1 = 2; -const int CSSM_APPLECSP_KEYDIGEST = 256; +const int CSSM_APPLECSPDL_DB_SET_SETTINGS1 = 3; -const int CSSM_APPLECSP_PUBKEY = 257; +const int CSSM_APPLECSPDL_DB_IS_LOCKED1 = 4; -const int CSSM_KEYBLOB_WRAPPED_FORMAT_APPLE_CUSTOM = 100; +const int CSSM_APPLECSPDL_DB_CHANGE_PASSWORD1 = 5; -const int CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSL = 101; +const int CSSM_APPLECSPDL_DB_GET_HANDLE1 = 6; -const int CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSH1 = 102; +const int CSSM_APPLESCPDL_CSP_GET_KEYHANDLE1 = 7; -const int CSSM_ATTRIBUTE_VENDOR_DEFINED = 8388608; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_81 = 8; -const int CSSM_ATTRIBUTE_PUBLIC_KEY = 1082130432; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_91 = 9; -const int CSSM_ATTRIBUTE_FEE_PRIME_TYPE = 276824065; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_101 = 10; -const int CSSM_ATTRIBUTE_FEE_CURVE_TYPE = 276824066; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_111 = 11; -const int CSSM_ATTRIBUTE_ASC_OPTIMIZATION = 276824067; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_121 = 12; -const int CSSM_ATTRIBUTE_RSA_BLINDING = 276824068; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_131 = 13; -const int CSSM_ATTRIBUTE_PARAM_KEY = 1082130437; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_141 = 14; -const int CSSM_ATTRIBUTE_PROMPT = 545259526; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_151 = 15; -const int CSSM_ATTRIBUTE_ALERT_TITLE = 545259527; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_161 = 16; -const int CSSM_ATTRIBUTE_VERIFY_PASSPHRASE = 276824072; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_171 = 17; -const int CSSM_FEE_PRIME_TYPE_DEFAULT = 0; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_181 = 18; -const int CSSM_FEE_PRIME_TYPE_MERSENNE = 1; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_191 = 19; -const int CSSM_FEE_PRIME_TYPE_FEE = 2; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_201 = 20; -const int CSSM_FEE_PRIME_TYPE_GENERAL = 3; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_211 = 21; -const int CSSM_FEE_CURVE_TYPE_DEFAULT = 0; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_221 = 22; -const int CSSM_FEE_CURVE_TYPE_MONTGOMERY = 1; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_231 = 23; -const int CSSM_FEE_CURVE_TYPE_WEIERSTRASS = 2; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_241 = 24; -const int CSSM_FEE_CURVE_TYPE_ANSI_X9_62 = 3; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_251 = 25; -const int CSSM_ASC_OPTIMIZE_DEFAULT = 0; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_261 = 26; -const int CSSM_ASC_OPTIMIZE_SIZE = 1; +const int CSSM_APPLE_PRIVATE_CSPDL_CODE_271 = 27; -const int CSSM_ASC_OPTIMIZE_SECURITY = 2; +const int CSSM_APPLECSP_KEYDIGEST1 = 256; -const int CSSM_ASC_OPTIMIZE_TIME = 3; +const int CSSM_APPLECSP_PUBKEY1 = 257; -const int CSSM_ASC_OPTIMIZE_TIME_SIZE = 4; +const int CSSM_KEYBLOB_WRAPPED_FORMAT_APPLE_CUSTOM1 = 100; -const int CSSM_ASC_OPTIMIZE_ASCII = 5; +const int CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSL1 = 101; -const int CSSM_KEYATTR_PARTIAL = 65536; +const int CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSH11 = 102; -const int CSSM_KEYATTR_PUBLIC_KEY_ENCRYPT = 131072; +const int CSSM_ATTRIBUTE_VENDOR_DEFINED1 = 8388608; -const int CSSM_TP_ACTION_REQUIRE_CRL_PER_CERT = 1; +const int CSSM_ATTRIBUTE_PUBLIC_KEY1 = 1082130432; -const int CSSM_TP_ACTION_FETCH_CRL_FROM_NET = 2; +const int CSSM_ATTRIBUTE_FEE_PRIME_TYPE1 = 276824065; -const int CSSM_TP_ACTION_CRL_SUFFICIENT = 4; +const int CSSM_ATTRIBUTE_FEE_CURVE_TYPE1 = 276824066; -const int CSSM_TP_ACTION_REQUIRE_CRL_IF_PRESENT = 8; +const int CSSM_ATTRIBUTE_ASC_OPTIMIZATION1 = 276824067; -const int CSSM_TP_ACTION_ALLOW_EXPIRED = 1; +const int CSSM_ATTRIBUTE_RSA_BLINDING1 = 276824068; -const int CSSM_TP_ACTION_LEAF_IS_CA = 2; +const int CSSM_ATTRIBUTE_PARAM_KEY1 = 1082130437; -const int CSSM_TP_ACTION_FETCH_CERT_FROM_NET = 4; +const int CSSM_ATTRIBUTE_PROMPT1 = 545259526; -const int CSSM_TP_ACTION_ALLOW_EXPIRED_ROOT = 8; +const int CSSM_ATTRIBUTE_ALERT_TITLE1 = 545259527; -const int CSSM_TP_ACTION_REQUIRE_REV_PER_CERT = 16; +const int CSSM_ATTRIBUTE_VERIFY_PASSPHRASE1 = 276824072; -const int CSSM_TP_ACTION_TRUST_SETTINGS = 32; +const int CSSM_FEE_PRIME_TYPE_DEFAULT1 = 0; -const int CSSM_TP_ACTION_IMPLICIT_ANCHORS = 64; +const int CSSM_FEE_PRIME_TYPE_MERSENNE1 = 1; -const int CSSM_CERT_STATUS_EXPIRED = 1; +const int CSSM_FEE_PRIME_TYPE_FEE1 = 2; -const int CSSM_CERT_STATUS_NOT_VALID_YET = 2; +const int CSSM_FEE_PRIME_TYPE_GENERAL1 = 3; -const int CSSM_CERT_STATUS_IS_IN_INPUT_CERTS = 4; +const int CSSM_FEE_CURVE_TYPE_DEFAULT1 = 0; -const int CSSM_CERT_STATUS_IS_IN_ANCHORS = 8; +const int CSSM_FEE_CURVE_TYPE_MONTGOMERY1 = 1; -const int CSSM_CERT_STATUS_IS_ROOT = 16; +const int CSSM_FEE_CURVE_TYPE_WEIERSTRASS1 = 2; -const int CSSM_CERT_STATUS_IS_FROM_NET = 32; +const int CSSM_FEE_CURVE_TYPE_ANSI_X9_621 = 3; -const int CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_USER = 64; +const int CSSM_ASC_OPTIMIZE_DEFAULT1 = 0; -const int CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_ADMIN = 128; +const int CSSM_ASC_OPTIMIZE_SIZE1 = 1; -const int CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_SYSTEM = 256; +const int CSSM_ASC_OPTIMIZE_SECURITY1 = 2; -const int CSSM_CERT_STATUS_TRUST_SETTINGS_TRUST = 512; +const int CSSM_ASC_OPTIMIZE_TIME1 = 3; -const int CSSM_CERT_STATUS_TRUST_SETTINGS_DENY = 1024; +const int CSSM_ASC_OPTIMIZE_TIME_SIZE1 = 4; -const int CSSM_CERT_STATUS_TRUST_SETTINGS_IGNORED_ERROR = 2048; +const int CSSM_ASC_OPTIMIZE_ASCII1 = 5; -const int CSSM_EVIDENCE_FORM_APPLE_HEADER = -2147483648; +const int CSSM_KEYATTR_PARTIAL1 = 65536; -const int CSSM_EVIDENCE_FORM_APPLE_CERTGROUP = -2147483647; +const int CSSM_KEYATTR_PUBLIC_KEY_ENCRYPT1 = 131072; -const int CSSM_EVIDENCE_FORM_APPLE_CERT_INFO = -2147483646; +const int CSSM_TP_ACTION_REQUIRE_CRL_PER_CERT1 = 1; -const int CSSM_APPLEX509CL_OBTAIN_CSR = 0; +const int CSSM_TP_ACTION_FETCH_CRL_FROM_NET1 = 2; -const int CSSM_APPLEX509CL_VERIFY_CSR = 1; +const int CSSM_TP_ACTION_CRL_SUFFICIENT1 = 4; -const int kSecSubjectItemAttr = 1937072746; +const int CSSM_TP_ACTION_REQUIRE_CRL_IF_PRESENT1 = 8; -const int kSecIssuerItemAttr = 1769173877; +const int CSSM_TP_ACTION_ALLOW_EXPIRED1 = 1; -const int kSecSerialNumberItemAttr = 1936614002; +const int CSSM_TP_ACTION_LEAF_IS_CA1 = 2; -const int kSecPublicKeyHashItemAttr = 1752198009; +const int CSSM_TP_ACTION_FETCH_CERT_FROM_NET1 = 4; -const int kSecSubjectKeyIdentifierItemAttr = 1936419172; +const int CSSM_TP_ACTION_ALLOW_EXPIRED_ROOT1 = 8; -const int kSecCertTypeItemAttr = 1668577648; +const int CSSM_TP_ACTION_REQUIRE_REV_PER_CERT1 = 16; -const int kSecCertEncodingItemAttr = 1667591779; +const int CSSM_TP_ACTION_TRUST_SETTINGS1 = 32; -const int SSL_NULL_WITH_NULL_NULL = 0; +const int CSSM_TP_ACTION_IMPLICIT_ANCHORS1 = 64; -const int SSL_RSA_WITH_NULL_MD5 = 1; +const int CSSM_CERT_STATUS_EXPIRED1 = 1; -const int SSL_RSA_WITH_NULL_SHA = 2; +const int CSSM_CERT_STATUS_NOT_VALID_YET1 = 2; -const int SSL_RSA_EXPORT_WITH_RC4_40_MD5 = 3; +const int CSSM_CERT_STATUS_IS_IN_INPUT_CERTS1 = 4; -const int SSL_RSA_WITH_RC4_128_MD5 = 4; +const int CSSM_CERT_STATUS_IS_IN_ANCHORS1 = 8; -const int SSL_RSA_WITH_RC4_128_SHA = 5; +const int CSSM_CERT_STATUS_IS_ROOT1 = 16; -const int SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 6; +const int CSSM_CERT_STATUS_IS_FROM_NET1 = 32; -const int SSL_RSA_WITH_IDEA_CBC_SHA = 7; +const int CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_USER1 = 64; -const int SSL_RSA_EXPORT_WITH_DES40_CBC_SHA = 8; +const int CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_ADMIN1 = 128; -const int SSL_RSA_WITH_DES_CBC_SHA = 9; +const int CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_SYSTEM1 = 256; -const int SSL_RSA_WITH_3DES_EDE_CBC_SHA = 10; +const int CSSM_CERT_STATUS_TRUST_SETTINGS_TRUST1 = 512; -const int SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 11; +const int CSSM_CERT_STATUS_TRUST_SETTINGS_DENY1 = 1024; -const int SSL_DH_DSS_WITH_DES_CBC_SHA = 12; +const int CSSM_CERT_STATUS_TRUST_SETTINGS_IGNORED_ERROR1 = 2048; -const int SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA = 13; +const int CSSM_EVIDENCE_FORM_APPLE_HEADER1 = -2147483648; -const int SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 14; +const int CSSM_EVIDENCE_FORM_APPLE_CERTGROUP1 = -2147483647; -const int SSL_DH_RSA_WITH_DES_CBC_SHA = 15; +const int CSSM_EVIDENCE_FORM_APPLE_CERT_INFO1 = -2147483646; -const int SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA = 16; +const int CSSM_APPLEX509CL_OBTAIN_CSR1 = 0; -const int SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 17; +const int CSSM_APPLEX509CL_VERIFY_CSR1 = 1; -const int SSL_DHE_DSS_WITH_DES_CBC_SHA = 18; +const int kSecSubjectItemAttr1 = 1937072746; -const int SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 19; +const int kSecIssuerItemAttr1 = 1769173877; -const int SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 20; +const int kSecSerialNumberItemAttr1 = 1936614002; -const int SSL_DHE_RSA_WITH_DES_CBC_SHA = 21; +const int kSecPublicKeyHashItemAttr1 = 1752198009; -const int SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 22; +const int kSecSubjectKeyIdentifierItemAttr1 = 1936419172; -const int SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 = 23; +const int kSecCertTypeItemAttr1 = 1668577648; -const int SSL_DH_anon_WITH_RC4_128_MD5 = 24; +const int kSecCertEncodingItemAttr1 = 1667591779; -const int SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 25; +const int SSL_NULL_WITH_NULL_NULL1 = 0; -const int SSL_DH_anon_WITH_DES_CBC_SHA = 26; +const int SSL_RSA_WITH_NULL_MD51 = 1; -const int SSL_DH_anon_WITH_3DES_EDE_CBC_SHA = 27; +const int SSL_RSA_WITH_NULL_SHA1 = 2; -const int SSL_FORTEZZA_DMS_WITH_NULL_SHA = 28; +const int SSL_RSA_EXPORT_WITH_RC4_40_MD51 = 3; -const int SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA = 29; +const int SSL_RSA_WITH_RC4_128_MD51 = 4; -const int TLS_RSA_WITH_AES_128_CBC_SHA = 47; +const int SSL_RSA_WITH_RC4_128_SHA1 = 5; -const int TLS_DH_DSS_WITH_AES_128_CBC_SHA = 48; +const int SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD51 = 6; -const int TLS_DH_RSA_WITH_AES_128_CBC_SHA = 49; +const int SSL_RSA_WITH_IDEA_CBC_SHA1 = 7; -const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 50; +const int SSL_RSA_EXPORT_WITH_DES40_CBC_SHA1 = 8; -const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 51; +const int SSL_RSA_WITH_DES_CBC_SHA1 = 9; -const int TLS_DH_anon_WITH_AES_128_CBC_SHA = 52; +const int SSL_RSA_WITH_3DES_EDE_CBC_SHA1 = 10; -const int TLS_RSA_WITH_AES_256_CBC_SHA = 53; +const int SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA1 = 11; -const int TLS_DH_DSS_WITH_AES_256_CBC_SHA = 54; +const int SSL_DH_DSS_WITH_DES_CBC_SHA1 = 12; -const int TLS_DH_RSA_WITH_AES_256_CBC_SHA = 55; +const int SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA1 = 13; -const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 56; +const int SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA1 = 14; -const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 57; +const int SSL_DH_RSA_WITH_DES_CBC_SHA1 = 15; -const int TLS_DH_anon_WITH_AES_256_CBC_SHA = 58; +const int SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA1 = 16; -const int TLS_ECDH_ECDSA_WITH_NULL_SHA = -16383; +const int SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA1 = 17; -const int TLS_ECDH_ECDSA_WITH_RC4_128_SHA = -16382; +const int SSL_DHE_DSS_WITH_DES_CBC_SHA1 = 18; -const int TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = -16381; +const int SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA1 = 19; -const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = -16380; +const int SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA1 = 20; -const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = -16379; +const int SSL_DHE_RSA_WITH_DES_CBC_SHA1 = 21; -const int TLS_ECDHE_ECDSA_WITH_NULL_SHA = -16378; +const int SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA1 = 22; -const int TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = -16377; +const int SSL_DH_anon_EXPORT_WITH_RC4_40_MD51 = 23; -const int TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = -16376; +const int SSL_DH_anon_WITH_RC4_128_MD51 = 24; -const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = -16375; +const int SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA1 = 25; -const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = -16374; +const int SSL_DH_anon_WITH_DES_CBC_SHA1 = 26; -const int TLS_ECDH_RSA_WITH_NULL_SHA = -16373; +const int SSL_DH_anon_WITH_3DES_EDE_CBC_SHA1 = 27; -const int TLS_ECDH_RSA_WITH_RC4_128_SHA = -16372; +const int SSL_FORTEZZA_DMS_WITH_NULL_SHA1 = 28; -const int TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = -16371; +const int SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA1 = 29; -const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = -16370; +const int TLS_RSA_WITH_AES_128_CBC_SHA1 = 47; -const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = -16369; +const int TLS_DH_DSS_WITH_AES_128_CBC_SHA1 = 48; -const int TLS_ECDHE_RSA_WITH_NULL_SHA = -16368; +const int TLS_DH_RSA_WITH_AES_128_CBC_SHA1 = 49; -const int TLS_ECDHE_RSA_WITH_RC4_128_SHA = -16367; +const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA1 = 50; -const int TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = -16366; +const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA1 = 51; -const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = -16365; +const int TLS_DH_anon_WITH_AES_128_CBC_SHA1 = 52; -const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = -16364; +const int TLS_RSA_WITH_AES_256_CBC_SHA1 = 53; -const int TLS_ECDH_anon_WITH_NULL_SHA = -16363; +const int TLS_DH_DSS_WITH_AES_256_CBC_SHA1 = 54; -const int TLS_ECDH_anon_WITH_RC4_128_SHA = -16362; +const int TLS_DH_RSA_WITH_AES_256_CBC_SHA1 = 55; -const int TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA = -16361; +const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA1 = 56; -const int TLS_ECDH_anon_WITH_AES_128_CBC_SHA = -16360; +const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA1 = 57; -const int TLS_ECDH_anon_WITH_AES_256_CBC_SHA = -16359; +const int TLS_DH_anon_WITH_AES_256_CBC_SHA1 = 58; -const int TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA = -16331; +const int TLS_ECDH_ECDSA_WITH_NULL_SHA1 = -16383; -const int TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA = -16330; +const int TLS_ECDH_ECDSA_WITH_RC4_128_SHA1 = -16382; -const int TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 = -13141; +const int TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA1 = -16381; -const int TLS_NULL_WITH_NULL_NULL = 0; +const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA1 = -16380; -const int TLS_RSA_WITH_NULL_MD5 = 1; +const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA1 = -16379; -const int TLS_RSA_WITH_NULL_SHA = 2; +const int TLS_ECDHE_ECDSA_WITH_NULL_SHA1 = -16378; -const int TLS_RSA_WITH_RC4_128_MD5 = 4; +const int TLS_ECDHE_ECDSA_WITH_RC4_128_SHA1 = -16377; -const int TLS_RSA_WITH_RC4_128_SHA = 5; +const int TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA1 = -16376; -const int TLS_RSA_WITH_3DES_EDE_CBC_SHA = 10; +const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA1 = -16375; -const int TLS_RSA_WITH_NULL_SHA256 = 59; +const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA1 = -16374; -const int TLS_RSA_WITH_AES_128_CBC_SHA256 = 60; +const int TLS_ECDH_RSA_WITH_NULL_SHA1 = -16373; -const int TLS_RSA_WITH_AES_256_CBC_SHA256 = 61; +const int TLS_ECDH_RSA_WITH_RC4_128_SHA1 = -16372; -const int TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 13; +const int TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA1 = -16371; -const int TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 16; +const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA1 = -16370; -const int TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 19; +const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA1 = -16369; -const int TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 22; +const int TLS_ECDHE_RSA_WITH_NULL_SHA1 = -16368; -const int TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 62; +const int TLS_ECDHE_RSA_WITH_RC4_128_SHA1 = -16367; -const int TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 63; +const int TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA1 = -16366; -const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 64; +const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA1 = -16365; -const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 103; +const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA1 = -16364; -const int TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 104; +const int TLS_ECDH_anon_WITH_NULL_SHA1 = -16363; -const int TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 105; +const int TLS_ECDH_anon_WITH_RC4_128_SHA1 = -16362; -const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 106; +const int TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA1 = -16361; -const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 107; +const int TLS_ECDH_anon_WITH_AES_128_CBC_SHA1 = -16360; -const int TLS_DH_anon_WITH_RC4_128_MD5 = 24; +const int TLS_ECDH_anon_WITH_AES_256_CBC_SHA1 = -16359; -const int TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 27; +const int TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA1 = -16331; -const int TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 108; +const int TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA1 = -16330; -const int TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 109; +const int TLS_PSK_WITH_CHACHA20_POLY1305_SHA2561 = -13141; -const int TLS_PSK_WITH_RC4_128_SHA = 138; +const int TLS_NULL_WITH_NULL_NULL1 = 0; -const int TLS_PSK_WITH_3DES_EDE_CBC_SHA = 139; +const int TLS_RSA_WITH_NULL_MD51 = 1; -const int TLS_PSK_WITH_AES_128_CBC_SHA = 140; +const int TLS_RSA_WITH_NULL_SHA1 = 2; -const int TLS_PSK_WITH_AES_256_CBC_SHA = 141; +const int TLS_RSA_WITH_RC4_128_MD51 = 4; -const int TLS_DHE_PSK_WITH_RC4_128_SHA = 142; +const int TLS_RSA_WITH_RC4_128_SHA1 = 5; -const int TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA = 143; +const int TLS_RSA_WITH_3DES_EDE_CBC_SHA1 = 10; -const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA = 144; +const int TLS_RSA_WITH_NULL_SHA2561 = 59; -const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA = 145; +const int TLS_RSA_WITH_AES_128_CBC_SHA2561 = 60; -const int TLS_RSA_PSK_WITH_RC4_128_SHA = 146; +const int TLS_RSA_WITH_AES_256_CBC_SHA2561 = 61; -const int TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA = 147; +const int TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA1 = 13; -const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA = 148; +const int TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA1 = 16; -const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA = 149; +const int TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA1 = 19; -const int TLS_PSK_WITH_NULL_SHA = 44; +const int TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA1 = 22; -const int TLS_DHE_PSK_WITH_NULL_SHA = 45; +const int TLS_DH_DSS_WITH_AES_128_CBC_SHA2561 = 62; -const int TLS_RSA_PSK_WITH_NULL_SHA = 46; +const int TLS_DH_RSA_WITH_AES_128_CBC_SHA2561 = 63; -const int TLS_RSA_WITH_AES_128_GCM_SHA256 = 156; +const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA2561 = 64; -const int TLS_RSA_WITH_AES_256_GCM_SHA384 = 157; +const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA2561 = 103; -const int TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 158; +const int TLS_DH_DSS_WITH_AES_256_CBC_SHA2561 = 104; -const int TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 159; +const int TLS_DH_RSA_WITH_AES_256_CBC_SHA2561 = 105; -const int TLS_DH_RSA_WITH_AES_128_GCM_SHA256 = 160; +const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA2561 = 106; -const int TLS_DH_RSA_WITH_AES_256_GCM_SHA384 = 161; +const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA2561 = 107; -const int TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = 162; +const int TLS_DH_anon_WITH_RC4_128_MD51 = 24; -const int TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = 163; +const int TLS_DH_anon_WITH_3DES_EDE_CBC_SHA1 = 27; -const int TLS_DH_DSS_WITH_AES_128_GCM_SHA256 = 164; +const int TLS_DH_anon_WITH_AES_128_CBC_SHA2561 = 108; -const int TLS_DH_DSS_WITH_AES_256_GCM_SHA384 = 165; +const int TLS_DH_anon_WITH_AES_256_CBC_SHA2561 = 109; -const int TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 166; +const int TLS_PSK_WITH_RC4_128_SHA1 = 138; -const int TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 167; +const int TLS_PSK_WITH_3DES_EDE_CBC_SHA1 = 139; -const int TLS_PSK_WITH_AES_128_GCM_SHA256 = 168; +const int TLS_PSK_WITH_AES_128_CBC_SHA1 = 140; -const int TLS_PSK_WITH_AES_256_GCM_SHA384 = 169; +const int TLS_PSK_WITH_AES_256_CBC_SHA1 = 141; -const int TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 170; +const int TLS_DHE_PSK_WITH_RC4_128_SHA1 = 142; -const int TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 171; +const int TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA1 = 143; -const int TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 = 172; +const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA1 = 144; -const int TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 = 173; +const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA1 = 145; -const int TLS_PSK_WITH_AES_128_CBC_SHA256 = 174; +const int TLS_RSA_PSK_WITH_RC4_128_SHA1 = 146; -const int TLS_PSK_WITH_AES_256_CBC_SHA384 = 175; +const int TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA1 = 147; -const int TLS_PSK_WITH_NULL_SHA256 = 176; +const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA1 = 148; -const int TLS_PSK_WITH_NULL_SHA384 = 177; +const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA1 = 149; -const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 = 178; +const int TLS_PSK_WITH_NULL_SHA1 = 44; -const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 = 179; +const int TLS_DHE_PSK_WITH_NULL_SHA1 = 45; -const int TLS_DHE_PSK_WITH_NULL_SHA256 = 180; +const int TLS_RSA_PSK_WITH_NULL_SHA1 = 46; -const int TLS_DHE_PSK_WITH_NULL_SHA384 = 181; +const int TLS_RSA_WITH_AES_128_GCM_SHA2561 = 156; -const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 = 182; +const int TLS_RSA_WITH_AES_256_GCM_SHA3841 = 157; -const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 = 183; +const int TLS_DHE_RSA_WITH_AES_128_GCM_SHA2561 = 158; -const int TLS_RSA_PSK_WITH_NULL_SHA256 = 184; +const int TLS_DHE_RSA_WITH_AES_256_GCM_SHA3841 = 159; -const int TLS_RSA_PSK_WITH_NULL_SHA384 = 185; +const int TLS_DH_RSA_WITH_AES_128_GCM_SHA2561 = 160; -const int TLS_AES_128_GCM_SHA256 = 4865; +const int TLS_DH_RSA_WITH_AES_256_GCM_SHA3841 = 161; -const int TLS_AES_256_GCM_SHA384 = 4866; +const int TLS_DHE_DSS_WITH_AES_128_GCM_SHA2561 = 162; -const int TLS_CHACHA20_POLY1305_SHA256 = 4867; +const int TLS_DHE_DSS_WITH_AES_256_GCM_SHA3841 = 163; -const int TLS_AES_128_CCM_SHA256 = 4868; +const int TLS_DH_DSS_WITH_AES_128_GCM_SHA2561 = 164; -const int TLS_AES_128_CCM_8_SHA256 = 4869; +const int TLS_DH_DSS_WITH_AES_256_GCM_SHA3841 = 165; -const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = -16349; +const int TLS_DH_anon_WITH_AES_128_GCM_SHA2561 = 166; -const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = -16348; +const int TLS_DH_anon_WITH_AES_256_GCM_SHA3841 = 167; -const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = -16347; +const int TLS_PSK_WITH_AES_128_GCM_SHA2561 = 168; -const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = -16346; +const int TLS_PSK_WITH_AES_256_GCM_SHA3841 = 169; -const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = -16345; +const int TLS_DHE_PSK_WITH_AES_128_GCM_SHA2561 = 170; -const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = -16344; +const int TLS_DHE_PSK_WITH_AES_256_GCM_SHA3841 = 171; -const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = -16343; +const int TLS_RSA_PSK_WITH_AES_128_GCM_SHA2561 = 172; -const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = -16342; +const int TLS_RSA_PSK_WITH_AES_256_GCM_SHA3841 = 173; -const int TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = -16341; +const int TLS_PSK_WITH_AES_128_CBC_SHA2561 = 174; -const int TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = -16340; +const int TLS_PSK_WITH_AES_256_CBC_SHA3841 = 175; -const int TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = -16339; +const int TLS_PSK_WITH_NULL_SHA2561 = 176; -const int TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = -16338; +const int TLS_PSK_WITH_NULL_SHA3841 = 177; -const int TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = -16337; +const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA2561 = 178; -const int TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = -16336; +const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA3841 = 179; -const int TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = -16335; +const int TLS_DHE_PSK_WITH_NULL_SHA2561 = 180; -const int TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = -16334; +const int TLS_DHE_PSK_WITH_NULL_SHA3841 = 181; -const int TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = -13144; +const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA2561 = 182; -const int TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = -13143; +const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA3841 = 183; -const int TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 255; +const int TLS_RSA_PSK_WITH_NULL_SHA2561 = 184; -const int SSL_RSA_WITH_RC2_CBC_MD5 = -128; +const int TLS_RSA_PSK_WITH_NULL_SHA3841 = 185; -const int SSL_RSA_WITH_IDEA_CBC_MD5 = -127; +const int TLS_AES_128_GCM_SHA2561 = 4865; -const int SSL_RSA_WITH_DES_CBC_MD5 = -126; +const int TLS_AES_256_GCM_SHA3841 = 4866; -const int SSL_RSA_WITH_3DES_EDE_CBC_MD5 = -125; +const int TLS_CHACHA20_POLY1305_SHA2561 = 4867; -const int SSL_NO_SUCH_CIPHERSUITE = -1; +const int TLS_AES_128_CCM_SHA2561 = 4868; -const int NSASCIIStringEncoding = 1; +const int TLS_AES_128_CCM_8_SHA2561 = 4869; -const int NSNEXTSTEPStringEncoding = 2; +const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA2561 = -16349; -const int NSJapaneseEUCStringEncoding = 3; +const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA3841 = -16348; -const int NSUTF8StringEncoding = 4; +const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA2561 = -16347; -const int NSISOLatin1StringEncoding = 5; +const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA3841 = -16346; -const int NSSymbolStringEncoding = 6; +const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA2561 = -16345; -const int NSNonLossyASCIIStringEncoding = 7; +const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA3841 = -16344; -const int NSShiftJISStringEncoding = 8; +const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA2561 = -16343; -const int NSISOLatin2StringEncoding = 9; +const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA3841 = -16342; -const int NSUnicodeStringEncoding = 10; +const int TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA2561 = -16341; -const int NSWindowsCP1251StringEncoding = 11; +const int TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA3841 = -16340; -const int NSWindowsCP1252StringEncoding = 12; +const int TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA2561 = -16339; -const int NSWindowsCP1253StringEncoding = 13; +const int TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA3841 = -16338; -const int NSWindowsCP1254StringEncoding = 14; +const int TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA2561 = -16337; -const int NSWindowsCP1250StringEncoding = 15; +const int TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA3841 = -16336; -const int NSISO2022JPStringEncoding = 21; +const int TLS_ECDH_RSA_WITH_AES_128_GCM_SHA2561 = -16335; -const int NSMacOSRomanStringEncoding = 30; +const int TLS_ECDH_RSA_WITH_AES_256_GCM_SHA3841 = -16334; -const int NSUTF16StringEncoding = 10; +const int TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA2561 = -13144; -const int NSUTF16BigEndianStringEncoding = 2415919360; +const int TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA2561 = -13143; -const int NSUTF16LittleEndianStringEncoding = 2483028224; +const int TLS_EMPTY_RENEGOTIATION_INFO_SCSV1 = 255; -const int NSUTF32StringEncoding = 2348810496; +const int SSL_RSA_WITH_RC2_CBC_MD51 = -128; -const int NSUTF32BigEndianStringEncoding = 2550137088; +const int SSL_RSA_WITH_IDEA_CBC_MD51 = -127; -const int NSUTF32LittleEndianStringEncoding = 2617245952; +const int SSL_RSA_WITH_DES_CBC_MD51 = -126; -const int NSProprietaryStringEncoding = 65536; +const int SSL_RSA_WITH_3DES_EDE_CBC_MD51 = -125; -const int NSOpenStepUnicodeReservedBase = 62464; +const int SSL_NO_SUCH_CIPHERSUITE1 = -1; const int __API_TO_BE_DEPRECATED = 100000; diff --git a/pkgs/cupertino_http/pubspec.yaml b/pkgs/cupertino_http/pubspec.yaml index 0e53691da2..28456bf214 100644 --- a/pkgs/cupertino_http/pubspec.yaml +++ b/pkgs/cupertino_http/pubspec.yaml @@ -32,3 +32,9 @@ flutter: macos: ffiPlugin: true sharedDarwinSource: true + +dependency_overrides: + ffi: + path: /Users/bquinlan/dart/native/pkgs/ffi + objective_c: + path: /Users/bquinlan/dart/native/pkgs/objective_c \ No newline at end of file From 8fc6cb467af7b3182593f11406e011fca7aff80b Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 13 Nov 2024 16:51:00 -0800 Subject: [PATCH 2/6] Fix --- .../native_cupertino_bindings.m | 272 +- pkgs/cupertino_http/ffigen.yaml | 6 + .../cupertino_http/lib/src/cupertino_api.dart | 2 +- .../lib/src/native_cupertino_bindings.dart | 23041 ++++++---------- 4 files changed, 8713 insertions(+), 14608 deletions(-) diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m index 39dea970c2..3bc6c93307 100644 --- a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m +++ b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m @@ -27,20 +27,14 @@ _ListenerTrampoline _NativeCupertinoHttp_wrapListenerBlock_1pl9qdv(_ListenerTram }; } -typedef void (^_ListenerTrampoline1)(void * arg0); -_ListenerTrampoline1 _NativeCupertinoHttp_wrapListenerBlock_ovsamd(_ListenerTrampoline1 block) NS_RETURNS_RETAINED { - return ^void(void * arg0) { +typedef void (^_ListenerTrampoline1)(id arg0); +_ListenerTrampoline1 _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(_ListenerTrampoline1 block) NS_RETURNS_RETAINED { + return ^void(id arg0) { objc_retainBlock(block); - block(arg0); + block(objc_retain(arg0)); }; } -Protocol* _NativeCupertinoHttp_NSObject() { return @protocol(NSObject); } - -Protocol* _NativeCupertinoHttp_NSCopying() { return @protocol(NSCopying); } - -Protocol* _NativeCupertinoHttp_NSMutableCopying() { return @protocol(NSMutableCopying); } - typedef void (^_ListenerTrampoline2)(void * arg0, id arg1); _ListenerTrampoline2 _NativeCupertinoHttp_wrapListenerBlock_wjovn7(_ListenerTrampoline2 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1) { @@ -49,213 +43,157 @@ _ListenerTrampoline2 _NativeCupertinoHttp_wrapListenerBlock_wjovn7(_ListenerTram }; } -Protocol* _NativeCupertinoHttp_NSCoding() { return @protocol(NSCoding); } - -Protocol* _NativeCupertinoHttp_NSSecureCoding() { return @protocol(NSSecureCoding); } - -Protocol* _NativeCupertinoHttp_NSDiscardableContent() { return @protocol(NSDiscardableContent); } - -typedef void (^_ListenerTrampoline3)(id arg0); -_ListenerTrampoline3 _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(_ListenerTrampoline3 block) NS_RETURNS_RETAINED { - return ^void(id arg0) { - objc_retainBlock(block); - block(objc_retain(arg0)); - }; -} - -Protocol* _NativeCupertinoHttp_NSProgressReporting() { return @protocol(NSProgressReporting); } - -Protocol* _NativeCupertinoHttp_NSFastEnumeration() { return @protocol(NSFastEnumeration); } - -typedef void (^_ListenerTrampoline4)(id arg0, id arg1, BOOL * arg2); -_ListenerTrampoline4 _NativeCupertinoHttp_wrapListenerBlock_1krhfwz(_ListenerTrampoline4 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline3)(id arg0, id arg1, BOOL * arg2); +_ListenerTrampoline3 _NativeCupertinoHttp_wrapListenerBlock_1krhfwz(_ListenerTrampoline3 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, BOOL * arg2) { objc_retainBlock(block); block(objc_retain(arg0), objc_retain(arg1), arg2); }; } -Protocol* _NativeCupertinoHttp_OS_sec_object() { return @protocol(OS_sec_object); } - -typedef void (^_ListenerTrampoline5)(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); -_ListenerTrampoline5 _NativeCupertinoHttp_wrapListenerBlock_tg5tbv(_ListenerTrampoline5 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline4)(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); +_ListenerTrampoline4 _NativeCupertinoHttp_wrapListenerBlock_tg5tbv(_ListenerTrampoline4 block) NS_RETURNS_RETAINED { return ^void(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1) { objc_retainBlock(block); block(arg0, arg1); }; } -typedef void (^_ListenerTrampoline6)(struct __CFRunLoopTimer * arg0); -_ListenerTrampoline6 _NativeCupertinoHttp_wrapListenerBlock_1dqvvol(_ListenerTrampoline6 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline5)(struct __CFRunLoopTimer * arg0); +_ListenerTrampoline5 _NativeCupertinoHttp_wrapListenerBlock_1dqvvol(_ListenerTrampoline5 block) NS_RETURNS_RETAINED { return ^void(struct __CFRunLoopTimer * arg0) { objc_retainBlock(block); block(arg0); }; } -Protocol* _NativeCupertinoHttp_OS_os_workgroup_interval() { return @protocol(OS_os_workgroup_interval); } - -Protocol* _NativeCupertinoHttp_OS_os_workgroup_parallel() { return @protocol(OS_os_workgroup_parallel); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_object() { return @protocol(OS_dispatch_object); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_queue() { return @protocol(OS_dispatch_queue); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_queue_global() { return @protocol(OS_dispatch_queue_global); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_queue_serial_executor() { return @protocol(OS_dispatch_queue_serial_executor); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_queue_serial() { return @protocol(OS_dispatch_queue_serial); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_queue_main() { return @protocol(OS_dispatch_queue_main); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_queue_concurrent() { return @protocol(OS_dispatch_queue_concurrent); } - -typedef void (^_ListenerTrampoline7)(size_t arg0); -_ListenerTrampoline7 _NativeCupertinoHttp_wrapListenerBlock_6enxqz(_ListenerTrampoline7 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline6)(size_t arg0); +_ListenerTrampoline6 _NativeCupertinoHttp_wrapListenerBlock_6enxqz(_ListenerTrampoline6 block) NS_RETURNS_RETAINED { return ^void(size_t arg0) { objc_retainBlock(block); block(arg0); }; } -Protocol* _NativeCupertinoHttp_OS_dispatch_queue_attr() { return @protocol(OS_dispatch_queue_attr); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_source() { return @protocol(OS_dispatch_source); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_group() { return @protocol(OS_dispatch_group); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_semaphore() { return @protocol(OS_dispatch_semaphore); } - -Protocol* _NativeCupertinoHttp_OS_dispatch_data() { return @protocol(OS_dispatch_data); } - -typedef void (^_ListenerTrampoline8)(id arg0, int arg1); -_ListenerTrampoline8 _NativeCupertinoHttp_wrapListenerBlock_qxvyq2(_ListenerTrampoline8 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline7)(id arg0, int arg1); +_ListenerTrampoline7 _NativeCupertinoHttp_wrapListenerBlock_qxvyq2(_ListenerTrampoline7 block) NS_RETURNS_RETAINED { return ^void(id arg0, int arg1) { objc_retainBlock(block); block(objc_retain(arg0), arg1); }; } -Protocol* _NativeCupertinoHttp_OS_dispatch_io() { return @protocol(OS_dispatch_io); } - -typedef void (^_ListenerTrampoline9)(int arg0); -_ListenerTrampoline9 _NativeCupertinoHttp_wrapListenerBlock_9o8504(_ListenerTrampoline9 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline8)(int arg0); +_ListenerTrampoline8 _NativeCupertinoHttp_wrapListenerBlock_9o8504(_ListenerTrampoline8 block) NS_RETURNS_RETAINED { return ^void(int arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_ListenerTrampoline10)(BOOL arg0, id arg1, int arg2); -_ListenerTrampoline10 _NativeCupertinoHttp_wrapListenerBlock_12a4qua(_ListenerTrampoline10 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline9)(BOOL arg0, id arg1, int arg2); +_ListenerTrampoline9 _NativeCupertinoHttp_wrapListenerBlock_12a4qua(_ListenerTrampoline9 block) NS_RETURNS_RETAINED { return ^void(BOOL arg0, id arg1, int arg2) { objc_retainBlock(block); block(arg0, objc_retain(arg1), arg2); }; } -Protocol* _NativeCupertinoHttp_OS_dispatch_workloop() { return @protocol(OS_dispatch_workloop); } - -typedef void (^_ListenerTrampoline11)(struct __SecTrust * arg0, SecTrustResultType arg1); -_ListenerTrampoline11 _NativeCupertinoHttp_wrapListenerBlock_gwxhxt(_ListenerTrampoline11 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline10)(struct __SecTrust * arg0, SecTrustResultType arg1); +_ListenerTrampoline10 _NativeCupertinoHttp_wrapListenerBlock_gwxhxt(_ListenerTrampoline10 block) NS_RETURNS_RETAINED { return ^void(struct __SecTrust * arg0, SecTrustResultType arg1) { objc_retainBlock(block); block(arg0, arg1); }; } -typedef void (^_ListenerTrampoline12)(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); -_ListenerTrampoline12 _NativeCupertinoHttp_wrapListenerBlock_k73ff5(_ListenerTrampoline12 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline11)(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); +_ListenerTrampoline11 _NativeCupertinoHttp_wrapListenerBlock_k73ff5(_ListenerTrampoline11 block) NS_RETURNS_RETAINED { return ^void(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2) { objc_retainBlock(block); block(arg0, arg1, arg2); }; } -Protocol* _NativeCupertinoHttp_OS_sec_trust() { return @protocol(OS_sec_trust); } - -Protocol* _NativeCupertinoHttp_OS_sec_identity() { return @protocol(OS_sec_identity); } - -Protocol* _NativeCupertinoHttp_OS_sec_certificate() { return @protocol(OS_sec_certificate); } - -Protocol* _NativeCupertinoHttp_OS_sec_protocol_metadata() { return @protocol(OS_sec_protocol_metadata); } - -typedef void (^_ListenerTrampoline13)(uint16_t arg0); -_ListenerTrampoline13 _NativeCupertinoHttp_wrapListenerBlock_15f11yh(_ListenerTrampoline13 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline12)(uint16_t arg0); +_ListenerTrampoline12 _NativeCupertinoHttp_wrapListenerBlock_15f11yh(_ListenerTrampoline12 block) NS_RETURNS_RETAINED { return ^void(uint16_t arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_ListenerTrampoline14)(id arg0, id arg1); -_ListenerTrampoline14 _NativeCupertinoHttp_wrapListenerBlock_wjvic9(_ListenerTrampoline14 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline13)(id arg0, id arg1); +_ListenerTrampoline13 _NativeCupertinoHttp_wrapListenerBlock_wjvic9(_ListenerTrampoline13 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1) { objc_retainBlock(block); block(objc_retain(arg0), objc_retain(arg1)); }; } -Protocol* _NativeCupertinoHttp_OS_sec_protocol_options() { return @protocol(OS_sec_protocol_options); } - -typedef void (^_ListenerTrampoline15)(id arg0, id arg1, id arg2); -_ListenerTrampoline15 _NativeCupertinoHttp_wrapListenerBlock_91c9gi(_ListenerTrampoline15 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline14)(id arg0, id arg1, id arg2); +_ListenerTrampoline14 _NativeCupertinoHttp_wrapListenerBlock_91c9gi(_ListenerTrampoline14 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block(objc_retain(arg0), objc_retain(arg1), objc_retainBlock(arg2)); }; } -typedef void (^_ListenerTrampoline16)(id arg0, id arg1); -_ListenerTrampoline16 _NativeCupertinoHttp_wrapListenerBlock_14pxqbs(_ListenerTrampoline16 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline15)(id arg0, id arg1); +_ListenerTrampoline15 _NativeCupertinoHttp_wrapListenerBlock_14pxqbs(_ListenerTrampoline15 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1) { objc_retainBlock(block); block(objc_retain(arg0), objc_retainBlock(arg1)); }; } -typedef void (^_ListenerTrampoline17)(BOOL arg0); -_ListenerTrampoline17 _NativeCupertinoHttp_wrapListenerBlock_1s56lr9(_ListenerTrampoline17 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline16)(BOOL arg0); +_ListenerTrampoline16 _NativeCupertinoHttp_wrapListenerBlock_1s56lr9(_ListenerTrampoline16 block) NS_RETURNS_RETAINED { return ^void(BOOL arg0) { objc_retainBlock(block); block(arg0); }; } -typedef void (^_ListenerTrampoline18)(id arg0, id arg1, id arg2); -_ListenerTrampoline18 _NativeCupertinoHttp_wrapListenerBlock_1hcfngn(_ListenerTrampoline18 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline17)(id arg0, id arg1, id arg2); +_ListenerTrampoline17 _NativeCupertinoHttp_wrapListenerBlock_1hcfngn(_ListenerTrampoline17 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block(objc_retain(arg0), objc_retain(arg1), objc_retain(arg2)); }; } -typedef void (^_ListenerTrampoline19)(void * arg0, id arg1, id arg2); -_ListenerTrampoline19 _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(_ListenerTrampoline19 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, id arg1, id arg2) { +typedef void (^_ListenerTrampoline18)(NSURLSessionResponseDisposition arg0); +_ListenerTrampoline18 _NativeCupertinoHttp_wrapListenerBlock_16sve1d(_ListenerTrampoline18 block) NS_RETURNS_RETAINED { + return ^void(NSURLSessionResponseDisposition arg0) { objc_retainBlock(block); - block(arg0, objc_retain(arg1), objc_retain(arg2)); + block(arg0); }; } -typedef void (^_ListenerTrampoline20)(NSURLSessionAuthChallengeDisposition arg0, id arg1); -_ListenerTrampoline20 _NativeCupertinoHttp_wrapListenerBlock_37btrl(_ListenerTrampoline20 block) NS_RETURNS_RETAINED { - return ^void(NSURLSessionAuthChallengeDisposition arg0, id arg1) { +typedef void (^_ListenerTrampoline19)(void * arg0, id arg1, id arg2, id arg3, id arg4); +_ListenerTrampoline19 _NativeCupertinoHttp_wrapListenerBlock_1f43wec(_ListenerTrampoline19 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4) { objc_retainBlock(block); - block(arg0, objc_retain(arg1)); + block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3), objc_retainBlock(arg4)); }; } -typedef void (^_ListenerTrampoline21)(void * arg0, id arg1, id arg2, id arg3); -_ListenerTrampoline21 _NativeCupertinoHttp_wrapListenerBlock_12nszru(_ListenerTrampoline21 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline20)(void * arg0, id arg1, id arg2, id arg3); +_ListenerTrampoline20 _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(_ListenerTrampoline20 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3) { objc_retainBlock(block); - block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retainBlock(arg3)); + block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3)); }; } -Protocol* _NativeCupertinoHttp_NSURLSessionDelegate() { return @protocol(NSURLSessionDelegate); } +typedef void (^_ListenerTrampoline21)(void * arg0, id arg1, id arg2); +_ListenerTrampoline21 _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(_ListenerTrampoline21 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2)); + }; +} typedef void (^_ListenerTrampoline22)(NSURLSessionDelayedRequestDisposition arg0, id arg1); _ListenerTrampoline22 _NativeCupertinoHttp_wrapListenerBlock_mn1xu3(_ListenerTrampoline22 block) NS_RETURNS_RETAINED { @@ -265,60 +203,50 @@ _ListenerTrampoline22 _NativeCupertinoHttp_wrapListenerBlock_mn1xu3(_ListenerTra }; } -typedef void (^_ListenerTrampoline23)(void * arg0, id arg1, id arg2, id arg3, id arg4); -_ListenerTrampoline23 _NativeCupertinoHttp_wrapListenerBlock_1f43wec(_ListenerTrampoline23 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4) { - objc_retainBlock(block); - block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3), objc_retainBlock(arg4)); - }; -} - -typedef void (^_ListenerTrampoline24)(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); -_ListenerTrampoline24 _NativeCupertinoHttp_wrapListenerBlock_13vswqm(_ListenerTrampoline24 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline23)(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); +_ListenerTrampoline23 _NativeCupertinoHttp_wrapListenerBlock_13vswqm(_ListenerTrampoline23 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3), objc_retain(arg4), objc_retainBlock(arg5)); }; } -typedef void (^_ListenerTrampoline25)(void * arg0, id arg1, id arg2, int64_t arg3, id arg4); -_ListenerTrampoline25 _NativeCupertinoHttp_wrapListenerBlock_qm01og(_ListenerTrampoline25 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, id arg1, id arg2, int64_t arg3, id arg4) { +typedef void (^_ListenerTrampoline24)(NSURLSessionAuthChallengeDisposition arg0, id arg1); +_ListenerTrampoline24 _NativeCupertinoHttp_wrapListenerBlock_37btrl(_ListenerTrampoline24 block) NS_RETURNS_RETAINED { + return ^void(NSURLSessionAuthChallengeDisposition arg0, id arg1) { objc_retainBlock(block); - block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, objc_retainBlock(arg4)); + block(arg0, objc_retain(arg1)); }; } -typedef void (^_ListenerTrampoline26)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); -_ListenerTrampoline26 _NativeCupertinoHttp_wrapListenerBlock_1uuez7b(_ListenerTrampoline26 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5) { +typedef void (^_ListenerTrampoline25)(void * arg0, id arg1, id arg2, id arg3); +_ListenerTrampoline25 _NativeCupertinoHttp_wrapListenerBlock_12nszru(_ListenerTrampoline25 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, id arg3) { objc_retainBlock(block); - block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, arg4, arg5); + block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retainBlock(arg3)); }; } -typedef void (^_ListenerTrampoline27)(void * arg0, id arg1, id arg2, id arg3); -_ListenerTrampoline27 _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(_ListenerTrampoline27 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, id arg1, id arg2, id arg3) { +typedef void (^_ListenerTrampoline26)(void * arg0, id arg1, id arg2, int64_t arg3, id arg4); +_ListenerTrampoline26 _NativeCupertinoHttp_wrapListenerBlock_qm01og(_ListenerTrampoline26 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, int64_t arg3, id arg4) { objc_retainBlock(block); - block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3)); + block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, objc_retainBlock(arg4)); }; } -Protocol* _NativeCupertinoHttp_NSURLSessionTaskDelegate() { return @protocol(NSURLSessionTaskDelegate); } - -typedef void (^_ListenerTrampoline28)(NSURLSessionResponseDisposition arg0); -_ListenerTrampoline28 _NativeCupertinoHttp_wrapListenerBlock_16sve1d(_ListenerTrampoline28 block) NS_RETURNS_RETAINED { - return ^void(NSURLSessionResponseDisposition arg0) { +typedef void (^_ListenerTrampoline27)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); +_ListenerTrampoline27 _NativeCupertinoHttp_wrapListenerBlock_1uuez7b(_ListenerTrampoline27 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5) { objc_retainBlock(block); - block(arg0); + block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, arg4, arg5); }; } Protocol* _NativeCupertinoHttp_NSURLSessionDataDelegate() { return @protocol(NSURLSessionDataDelegate); } -typedef void (^_ListenerTrampoline29)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); -_ListenerTrampoline29 _NativeCupertinoHttp_wrapListenerBlock_9qxjkl(_ListenerTrampoline29 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline28)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); +_ListenerTrampoline28 _NativeCupertinoHttp_wrapListenerBlock_9qxjkl(_ListenerTrampoline28 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, arg4); @@ -327,18 +255,8 @@ _ListenerTrampoline29 _NativeCupertinoHttp_wrapListenerBlock_9qxjkl(_ListenerTra Protocol* _NativeCupertinoHttp_NSURLSessionDownloadDelegate() { return @protocol(NSURLSessionDownloadDelegate); } -typedef void (^_ListenerTrampoline30)(void * arg0, id arg1, id arg2, id arg3, id arg4); -_ListenerTrampoline30 _NativeCupertinoHttp_wrapListenerBlock_62mtml(_ListenerTrampoline30 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4) { - objc_retainBlock(block); - block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3), objc_retain(arg4)); - }; -} - -Protocol* _NativeCupertinoHttp_NSURLSessionStreamDelegate() { return @protocol(NSURLSessionStreamDelegate); } - -typedef void (^_ListenerTrampoline31)(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); -_ListenerTrampoline31 _NativeCupertinoHttp_wrapListenerBlock_3lo3bb(_ListenerTrampoline31 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline29)(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); +_ListenerTrampoline29 _NativeCupertinoHttp_wrapListenerBlock_3lo3bb(_ListenerTrampoline29 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4) { objc_retainBlock(block); block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, objc_retain(arg4)); @@ -347,64 +265,64 @@ _ListenerTrampoline31 _NativeCupertinoHttp_wrapListenerBlock_3lo3bb(_ListenerTra Protocol* _NativeCupertinoHttp_NSURLSessionWebSocketDelegate() { return @protocol(NSURLSessionWebSocketDelegate); } -typedef void (^_ListenerTrampoline32)(id arg0, unsigned long arg1, BOOL * arg2); -_ListenerTrampoline32 _NativeCupertinoHttp_wrapListenerBlock_16ko9u(_ListenerTrampoline32 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline30)(id arg0, unsigned long arg1, BOOL * arg2); +_ListenerTrampoline30 _NativeCupertinoHttp_wrapListenerBlock_16ko9u(_ListenerTrampoline30 block) NS_RETURNS_RETAINED { return ^void(id arg0, unsigned long arg1, BOOL * arg2) { objc_retainBlock(block); block(objc_retain(arg0), arg1, arg2); }; } -Protocol* _NativeCupertinoHttp_NSItemProviderWriting() { return @protocol(NSItemProviderWriting); } - -Protocol* _NativeCupertinoHttp_NSItemProviderReading() { return @protocol(NSItemProviderReading); } - -typedef void (^_ListenerTrampoline33)(id arg0, id arg1, id arg2); -_ListenerTrampoline33 _NativeCupertinoHttp_wrapListenerBlock_1j2nt86(_ListenerTrampoline33 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline31)(id arg0, id arg1, id arg2); +_ListenerTrampoline31 _NativeCupertinoHttp_wrapListenerBlock_1j2nt86(_ListenerTrampoline31 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); block(objc_retainBlock(arg0), objc_retain(arg1), objc_retain(arg2)); }; } -typedef void (^_ListenerTrampoline34)(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3); -_ListenerTrampoline34 _NativeCupertinoHttp_wrapListenerBlock_8wbg7l(_ListenerTrampoline34 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline32)(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3); +_ListenerTrampoline32 _NativeCupertinoHttp_wrapListenerBlock_8wbg7l(_ListenerTrampoline32 block) NS_RETURNS_RETAINED { return ^void(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3) { objc_retainBlock(block); block(objc_retain(arg0), arg1, arg2, arg3); }; } -typedef void (^_ListenerTrampoline35)(id arg0, BOOL * arg1); -_ListenerTrampoline35 _NativeCupertinoHttp_wrapListenerBlock_148br51(_ListenerTrampoline35 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline33)(id arg0, BOOL * arg1); +_ListenerTrampoline33 _NativeCupertinoHttp_wrapListenerBlock_148br51(_ListenerTrampoline33 block) NS_RETURNS_RETAINED { return ^void(id arg0, BOOL * arg1) { objc_retainBlock(block); block(objc_retain(arg0), arg1); }; } -typedef void (^_ListenerTrampoline36)(unsigned short * arg0, unsigned long arg1); -_ListenerTrampoline36 _NativeCupertinoHttp_wrapListenerBlock_vhbh5h(_ListenerTrampoline36 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline34)(unsigned short * arg0, unsigned long arg1); +_ListenerTrampoline34 _NativeCupertinoHttp_wrapListenerBlock_vhbh5h(_ListenerTrampoline34 block) NS_RETURNS_RETAINED { return ^void(unsigned short * arg0, unsigned long arg1) { objc_retainBlock(block); block(arg0, arg1); }; } -typedef void (^_ListenerTrampoline37)(void * arg0, unsigned long arg1); -_ListenerTrampoline37 _NativeCupertinoHttp_wrapListenerBlock_zuf90e(_ListenerTrampoline37 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline35)(void * arg0, unsigned long arg1); +_ListenerTrampoline35 _NativeCupertinoHttp_wrapListenerBlock_zuf90e(_ListenerTrampoline35 block) NS_RETURNS_RETAINED { return ^void(void * arg0, unsigned long arg1) { objc_retainBlock(block); block(arg0, arg1); }; } -Protocol* _NativeCupertinoHttp_NSURLHandleClient() { return @protocol(NSURLHandleClient); } - -Protocol* _NativeCupertinoHttp_NSLocking() { return @protocol(NSLocking); } +typedef void (^_ListenerTrampoline36)(void * arg0); +_ListenerTrampoline36 _NativeCupertinoHttp_wrapListenerBlock_ovsamd(_ListenerTrampoline36 block) NS_RETURNS_RETAINED { + return ^void(void * arg0) { + objc_retainBlock(block); + block(arg0); + }; +} -typedef void (^_ListenerTrampoline38)(id arg0, id arg1, id arg2, id arg3); -_ListenerTrampoline38 _NativeCupertinoHttp_wrapListenerBlock_4ya7yd(_ListenerTrampoline38 block) NS_RETURNS_RETAINED { +typedef void (^_ListenerTrampoline37)(id arg0, id arg1, id arg2, id arg3); +_ListenerTrampoline37 _NativeCupertinoHttp_wrapListenerBlock_4ya7yd(_ListenerTrampoline37 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2, id arg3) { objc_retainBlock(block); block(objc_retain(arg0), objc_retain(arg1), objc_retain(arg2), objc_retain(arg3)); diff --git a/pkgs/cupertino_http/ffigen.yaml b/pkgs/cupertino_http/ffigen.yaml index 9ec658d8bc..a67084acc4 100644 --- a/pkgs/cupertino_http/ffigen.yaml +++ b/pkgs/cupertino_http/ffigen.yaml @@ -31,6 +31,7 @@ preamble: | // ignore_for_file: return_of_invalid_type objc-interfaces: include: + - 'NSCondition' - 'NSHTTPURLResponse' - 'NSMutableURLRequest' - 'NSOperationQueue' @@ -43,6 +44,11 @@ objc-interfaces: - 'NSURLSessionTask' - 'NSURLSessionWebSocketMessage' - 'NSURLSessionWebSocketTask' +objc-protocols: + include: + - 'NSURLSessionDataDelegate' + - 'NSURLSessionDownloadDelegate' + - 'NSURLSessionWebSocketDelegate' comments: style: any length: full diff --git a/pkgs/cupertino_http/lib/src/cupertino_api.dart b/pkgs/cupertino_http/lib/src/cupertino_api.dart index 2be208f308..a87fa9c43d 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_api.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_api.dart @@ -939,7 +939,7 @@ class URLSession extends _ObjectHolder { .registerName('URLSession:downloadTask:didFinishDownloadingToURL:'); final signature = objc.getProtocolMethodSignature( downloadDelegate, didFinishDownloadingToURL, - isRequired: true, isInstanceMethod: true); + isRequired: true, isInstanceMethod: true)!; protoBuilder.implementMethod(didFinishDownloadingToURL, signature, linkedLibs.adaptFinishWithLock(asyncFinishDownloading)); } diff --git a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart index d71ecc7b05..9cc83b62e0 100644 --- a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart +++ b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart @@ -40511,7 +40511,7 @@ external ffi.Pointer ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_ovsamd( + _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf( ffi.Pointer block, ); @@ -40523,14 +40523,6 @@ external ffi.Pointer ffi.Pointer block, ); -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf( - ffi.Pointer block, -); - @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) @@ -40655,7 +40647,7 @@ external ffi.Pointer ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_ao4xm9( + _NativeCupertinoHttp_wrapListenerBlock_16sve1d( ffi.Pointer block, ); @@ -40663,7 +40655,7 @@ external ffi.Pointer ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_37btrl( + _NativeCupertinoHttp_wrapListenerBlock_1f43wec( ffi.Pointer block, ); @@ -40671,7 +40663,7 @@ external ffi.Pointer ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_12nszru( + _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f( ffi.Pointer block, ); @@ -40679,7 +40671,7 @@ external ffi.Pointer ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_mn1xu3( + _NativeCupertinoHttp_wrapListenerBlock_ao4xm9( ffi.Pointer block, ); @@ -40687,7 +40679,7 @@ external ffi.Pointer ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_1f43wec( + _NativeCupertinoHttp_wrapListenerBlock_mn1xu3( ffi.Pointer block, ); @@ -40703,7 +40695,7 @@ external ffi.Pointer ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_qm01og( + _NativeCupertinoHttp_wrapListenerBlock_37btrl( ffi.Pointer block, ); @@ -40711,7 +40703,7 @@ external ffi.Pointer ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_1uuez7b( + _NativeCupertinoHttp_wrapListenerBlock_12nszru( ffi.Pointer block, ); @@ -40719,7 +40711,7 @@ external ffi.Pointer ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f( + _NativeCupertinoHttp_wrapListenerBlock_qm01og( ffi.Pointer block, ); @@ -40727,7 +40719,7 @@ external ffi.Pointer ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_16sve1d( + _NativeCupertinoHttp_wrapListenerBlock_1uuez7b( ffi.Pointer block, ); @@ -40739,14 +40731,6 @@ external ffi.Pointer ffi.Pointer block, ); -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer - _NativeCupertinoHttp_wrapListenerBlock_62mtml( - ffi.Pointer block, -); - @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) @@ -40803,6 +40787,14 @@ external ffi.Pointer ffi.Pointer block, ); +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer + _NativeCupertinoHttp_wrapListenerBlock_ovsamd( + ffi.Pointer block, +); + @ffi.Native< ffi.Pointer Function( ffi.Pointer)>(isLeaf: true) @@ -42354,1093 +42346,817 @@ typedef NSInteger = ffi.Long; typedef DartNSInteger = int; typedef NSUInteger = ffi.UnsignedLong; typedef DartNSUInteger = int; -late final _protocol_NSObject = objc.getProtocol("NSObject"); -late final _sel_isEqual_ = objc.registerName("isEqual:"); -final _objc_msgSend_69e0x1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -bool _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrTrampoline( + +final class _NSZone extends ffi.Opaque {} + +typedef va_list = __builtin_va_list; +typedef __gnuc_va_list = __builtin_va_list; +typedef NSExceptionName = ffi.Pointer; +typedef DartNSExceptionName = objc.NSString; +typedef NSRunLoopMode = ffi.Pointer; +typedef DartNSRunLoopMode = objc.NSString; +int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1) => block.ref.target .cast< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, + NSInteger Function(ffi.Pointer arg0, ffi.Pointer arg1)>>() .asFunction< - bool Function(ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrCallable = +ffi.Pointer + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrTrampoline, false) + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline, + 0) .cast(); -bool _ObjCBlock_bool_ffiVoid_objcObjCObject_closureTrampoline( +int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCObject_closureCallable = + (objc.getBlockClosure(block) as int Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable = ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_objcObjCObject_closureTrampoline, false) + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline, + 0) .cast(); -/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. -abstract final class ObjCBlock_bool_ffiVoid_objcObjCObject { +/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. +abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)> + NSInteger Function( + ffi.Pointer, ffi.Pointer)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - pointer, - retain: retain, - release: release); + NSInteger Function(ffi.Pointer, + ffi.Pointer)>(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, ffi.Pointer)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + static objc + .ObjCBlock, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => + objc.ObjCBlock< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>( + objc.newPointerBlock( + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, ffi.Pointer)> - fromFunction( - bool Function(ffi.Pointer, objc.ObjCObjectBase) fn) => - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( + static objc.ObjCBlock, ffi.Pointer)> + fromFunction(objc.NSComparisonResult Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => + objc.ObjCBlock, ffi.Pointer)>( objc.newClosureBlock( - _ObjCBlock_bool_ffiVoid_objcObjCObject_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, objc.ObjCObjectBase(arg1, retain: true, release: true))), + _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true)) + .value), retain: false, release: true); } -/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. -extension ObjCBlock_bool_ffiVoid_objcObjCObject_CallExtension on objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, ffi.Pointer)> { - bool call(ffi.Pointer arg0, objc.ObjCObjectBase arg1) => - ref.pointer.ref.invoke +/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. +extension ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_CallExtension + on objc.ObjCBlock< + NSInteger Function( + ffi.Pointer, ffi.Pointer)> { + objc.NSComparisonResult call( + objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1) => + objc.NSComparisonResult.fromValue(ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Bool Function( + NSInteger Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer); + .asFunction, ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer)); } -late final _sel_hash = objc.registerName("hash"); -final _objc_msgSend_xw2lbc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -int _ObjCBlock_NSUInteger_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_NSUInteger_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSUInteger_ffiVoid_fnPtrTrampoline, 0) - .cast(); -int _ObjCBlock_NSUInteger_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as int Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_NSUInteger_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSUInteger_ffiVoid_closureTrampoline, 0) - .cast(); +typedef NSComparator = ffi.Pointer; +typedef DartNSComparator = objc.ObjCBlock< + NSInteger Function( + ffi.Pointer, ffi.Pointer)>; -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_NSUInteger_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock)>( - pointer, - retain: retain, - release: release); +enum NSQualityOfService { + NSQualityOfServiceUserInteractive(33), + NSQualityOfServiceUserInitiated(25), + NSQualityOfServiceUtility(17), + NSQualityOfServiceBackground(9), + NSQualityOfServiceDefault(-1); - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.UnsignedLong Function(ffi.Pointer)> fromFunctionPointer( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_NSUInteger_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + final int value; + const NSQualityOfService(this.value); - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(DartNSUInteger Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_NSUInteger_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0)), - retain: false, - release: true); + static NSQualityOfService fromValue(int value) => switch (value) { + 33 => NSQualityOfServiceUserInteractive, + 25 => NSQualityOfServiceUserInitiated, + 17 => NSQualityOfServiceUtility, + 9 => NSQualityOfServiceBackground, + -1 => NSQualityOfServiceDefault, + _ => + throw ArgumentError("Unknown value for NSQualityOfService: $value"), + }; } -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_NSUInteger_ffiVoid_CallExtension - on objc.ObjCBlock)> { - DartNSUInteger call(ffi.Pointer arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0); -} +typedef ptrauth_extra_data_t = ffi.UnsignedLong; +typedef Dartptrauth_extra_data_t = int; +typedef ptrauth_generic_signature_t = ffi.UnsignedLong; +typedef Dartptrauth_generic_signature_t = int; +typedef UInt8 = ffi.UnsignedChar; +typedef DartUInt8 = int; +typedef SInt8 = ffi.SignedChar; +typedef DartSInt8 = int; +typedef UInt16 = ffi.UnsignedShort; +typedef DartUInt16 = int; +typedef SInt16 = ffi.Short; +typedef DartSInt16 = int; +typedef UInt32 = ffi.UnsignedInt; +typedef DartUInt32 = int; +typedef SInt32 = ffi.Int; +typedef DartSInt32 = int; -late final _sel_superclass = objc.registerName("superclass"); -final _objc_msgSend_1x359cv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline) - .cast(); +@ffi.Packed(2) +final class wide extends ffi.Struct { + @UInt32() + external int lo; -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock Function(ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer)>( - pointer, - retain: retain, - release: release); + @SInt32() + external int hi; +} - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(ffi.Pointer)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock Function(ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +@ffi.Packed(2) +final class UnsignedWide extends ffi.Struct { + @UInt32() + external int lo; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock Function(ffi.Pointer)> - fromFunction(objc.ObjCObjectBase Function(ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_objcObjCObject_ffiVoid_closureCallable, - (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), - retain: false, - release: true); + @UInt32() + external int hi; } -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid_CallExtension on objc - .ObjCBlock Function(ffi.Pointer)> { - objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0), - retain: true, - release: true); -} +typedef SInt64 = ffi.LongLong; +typedef DartSInt64 = int; +typedef UInt64 = ffi.UnsignedLongLong; +typedef DartUInt64 = int; +typedef Fixed = SInt32; +typedef FixedPtr = ffi.Pointer; +typedef Fract = SInt32; +typedef FractPtr = ffi.Pointer; +typedef UnsignedFixed = UInt32; +typedef UnsignedFixedPtr = ffi.Pointer; +typedef ShortFixed = ffi.Short; +typedef DartShortFixed = int; +typedef ShortFixedPtr = ffi.Pointer; +typedef Float32 = ffi.Float; +typedef DartFloat32 = double; +typedef Float64 = ffi.Double; +typedef DartFloat64 = double; -late final _sel_class = objc.registerName("class"); -typedef instancetype = ffi.Pointer; -typedef Dartinstancetype = objc.ObjCObjectBase; -late final _sel_self = objc.registerName("self"); -late final _sel_performSelector_ = objc.registerName("performSelector:"); -final _objc_msgSend_19hbqky = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_closureTrampoline) - .cast(); +final class Float80 extends ffi.Struct { + @SInt16() + external int exp; -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - pointer, - retain: retain, - release: release); + @ffi.Array.multi([4]) + external ffi.Array man; +} - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => - objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +final class Float96 extends ffi.Struct { + @ffi.Array.multi([2]) + external ffi.Array exp; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer)> - fromFunction(objc.ObjCObjectBase Function(ffi.Pointer, ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, arg1).ref.retainAndAutorelease()), - retain: false, - release: true); + @ffi.Array.multi([4]) + external ffi.Array man; } -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_CallExtension - on objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)> { - objc.ObjCObjectBase call( - ffi.Pointer arg0, ffi.Pointer arg1) => - objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1), - retain: true, - release: true); +@ffi.Packed(2) +final class Float32Point extends ffi.Struct { + @Float32() + external double x; + + @Float32() + external double y; } -late final _sel_performSelector_withObject_ = - objc.registerName("performSelector:withObject:"); -final _objc_msgSend_1wlgx7q = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(pointer, - retain: retain, release: release); +typedef Ptr = ffi.Pointer; +typedef Handle = ffi.Pointer; +typedef Size = ffi.Long; +typedef DartSize = int; +typedef OSErr = SInt16; +typedef OSStatus = SInt32; +typedef LogicalAddress = ffi.Pointer; +typedef ConstLogicalAddress = ffi.Pointer; +typedef PhysicalAddress = ffi.Pointer; +typedef BytePtr = ffi.Pointer; +typedef ByteCount = ffi.UnsignedLong; +typedef DartByteCount = int; +typedef ByteOffset = ffi.UnsignedLong; +typedef DartByteOffset = int; +typedef Duration = SInt32; +typedef AbsoluteTime = UnsignedWide; +typedef OptionBits = UInt32; +typedef ItemCount = ffi.UnsignedLong; +typedef DartItemCount = int; +typedef PBVersion = UInt32; +typedef ScriptCode = SInt16; +typedef LangCode = SInt16; +typedef RegionCode = SInt16; +typedef FourCharCode = UInt32; +typedef OSType = FourCharCode; +typedef ResType = FourCharCode; +typedef OSTypePtr = ffi.Pointer; +typedef ResTypePtr = ffi.Pointer; +typedef Boolean = ffi.UnsignedChar; +typedef DartBoolean = int; +typedef ProcPtrFunction = ffi.Long Function(); +typedef DartProcPtrFunction = int Function(); +typedef ProcPtr = ffi.Pointer>; +typedef Register68kProcPtrFunction = ffi.Void Function(); +typedef DartRegister68kProcPtrFunction = void Function(); +typedef Register68kProcPtr + = ffi.Pointer>; +typedef UniversalProcPtr = ProcPtr; +typedef ProcHandle = ffi.Pointer; +typedef UniversalProcHandle = ffi.Pointer; +typedef PRefCon = ffi.Pointer; +typedef URefCon = ffi.Pointer; +typedef SRefCon = ffi.Pointer; +typedef UnicodeScalarValue = UInt32; +typedef UTF32Char = UInt32; +typedef UniChar = UInt16; +typedef UTF16Char = UInt16; +typedef UTF8Char = UInt8; +typedef UniCharPtr = ffi.Pointer; +typedef UniCharCount = ffi.UnsignedLong; +typedef DartUniCharCount = int; +typedef UniCharCountPtr = ffi.Pointer; +typedef StringPtr = ffi.Pointer; +typedef StringHandle = ffi.Pointer; +typedef ConstStringPtr = ffi.Pointer; +typedef ConstStr255Param = ffi.Pointer; +typedef ConstStr63Param = ffi.Pointer; +typedef ConstStr32Param = ffi.Pointer; +typedef ConstStr31Param = ffi.Pointer; +typedef ConstStr27Param = ffi.Pointer; +typedef ConstStr15Param = ffi.Pointer; +typedef ConstStrFileNameParam = ConstStr63Param; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +@ffi.Packed(2) +final class ProcessSerialNumber extends ffi.Struct { + @UInt32() + external int highLongOfPSN; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)> - fromFunction(objc.ObjCObjectBase Function(ffi.Pointer, ffi.Pointer, objc.ObjCObjectBase) fn) => - objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn(arg0, arg1, objc.ObjCObjectBase(arg2, retain: true, release: true)) - .ref - .retainAndAutorelease()), - retain: false, - release: true); + @UInt32() + external int lowLongOfPSN; } -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_CallExtension - on objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> { - objc.ObjCObjectBase call(ffi.Pointer arg0, - ffi.Pointer arg1, objc.ObjCObjectBase arg2) => - objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1, arg2.ref.pointer), - retain: true, - release: true); +typedef ProcessSerialNumberPtr = ffi.Pointer; + +final class Point extends ffi.Struct { + @ffi.Short() + external int v; + + @ffi.Short() + external int h; } -late final _sel_performSelector_withObject_withObject_ = - objc.registerName("performSelector:withObject:withObject:"); -final _objc_msgSend_189974q = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_closureTrampoline) - .cast(); +typedef PointPtr = ffi.Pointer; -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(pointer, retain: retain, release: release); +final class Rect extends ffi.Struct { + @ffi.Short() + external int top; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + @ffi.Short() + external int left; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)> - fromFunction(objc.ObjCObjectBase Function(ffi.Pointer, ffi.Pointer, objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => - objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn(arg0, arg1, objc.ObjCObjectBase(arg2, retain: true, release: true), objc.ObjCObjectBase(arg3, retain: true, release: true)) - .ref - .retainAndAutorelease()), - retain: false, - release: true); + @ffi.Short() + external int bottom; + + @ffi.Short() + external int right; } -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_CallExtension - on objc.ObjCBlock< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> { - objc.ObjCObjectBase call( - ffi.Pointer arg0, - ffi.Pointer arg1, - objc.ObjCObjectBase arg2, - objc.ObjCObjectBase arg3) => - objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, arg1, arg2.ref.pointer, arg3.ref.pointer), - retain: true, - release: true); +typedef RectPtr = ffi.Pointer; + +@ffi.Packed(2) +final class FixedPoint extends ffi.Struct { + @Fixed() + external int x; + + @Fixed() + external int y; } -late final _sel_isProxy = objc.registerName("isProxy"); -final _objc_msgSend_91o635 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function( - ffi.Pointer, ffi.Pointer)>(); -bool _ObjCBlock_bool_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_bool_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_bool_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_closureTrampoline, false) - .cast(); +@ffi.Packed(2) +final class FixedRect extends ffi.Struct { + @Fixed() + external int left; -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_bool_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock)>(pointer, - retain: retain, release: release); + @Fixed() + external int top; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + @Fixed() + external int right; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> fromFunction( - bool Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock(_ObjCBlock_bool_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0)), - retain: false, - release: true); + @Fixed() + external int bottom; } -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_bool_ffiVoid_CallExtension - on objc.ObjCBlock)> { - bool call(ffi.Pointer arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0); +typedef CharParameter = ffi.Short; +typedef DartCharParameter = int; +typedef Style = ffi.UnsignedChar; +typedef DartStyle = int; +typedef StyleParameter = ffi.Short; +typedef DartStyleParameter = int; +typedef StyleField = Style; +typedef TimeValue = SInt32; +typedef TimeScale = SInt32; +typedef CompTimeValue = wide; +typedef TimeValue64 = SInt64; + +final class TimeBaseRecord extends ffi.Opaque {} + +typedef TimeBase = ffi.Pointer; + +@ffi.Packed(2) +final class TimeRecord extends ffi.Struct { + external CompTimeValue value; + + @TimeScale() + external int scale; + + external TimeBase base; } -late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); -late final _sel_isMemberOfClass_ = objc.registerName("isMemberOfClass:"); -late final _sel_conformsToProtocol_ = objc.registerName("conformsToProtocol:"); -bool _ObjCBlock_bool_ffiVoid_Protocol_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_ffiVoid_Protocol_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_Protocol_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_ffiVoid_Protocol_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_ffiVoid_Protocol_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_Protocol_closureTrampoline, false) - .cast(); +final class NumVersion extends ffi.Struct { + @UInt8() + external int nonRelRev; -/// Construction methods for `objc.ObjCBlock, objc.Protocol)>`. -abstract final class ObjCBlock_bool_ffiVoid_Protocol { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock, objc.Protocol)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - objc.Protocol)>(pointer, retain: retain, release: release); + @UInt8() + external int stage; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.Protocol)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, objc.Protocol)>( - objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_Protocol_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + @UInt8() + external int minorAndBugRev; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.Protocol)> - fromFunction(bool Function(ffi.Pointer, objc.Protocol) fn) => - objc.ObjCBlock, objc.Protocol)>( - objc.newClosureBlock( - _ObjCBlock_bool_ffiVoid_Protocol_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0, - objc.Protocol.castFromPointer(arg1, - retain: true, release: true))), - retain: false, - release: true); + @UInt8() + external int majorRev; } -/// Call operator for `objc.ObjCBlock, objc.Protocol)>`. -extension ObjCBlock_bool_ffiVoid_Protocol_CallExtension - on objc.ObjCBlock, objc.Protocol)> { - bool call(ffi.Pointer arg0, objc.Protocol arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer); +final class NumVersionVariant extends ffi.Union { + external NumVersion parts; + + @UInt32() + external int whole; } -late final _sel_respondsToSelector_ = objc.registerName("respondsToSelector:"); -final _objc_msgSend_1srf6wk = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -bool _ObjCBlock_bool_ffiVoid_objcObjCSelector_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCSelector_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_objcObjCSelector_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_ffiVoid_objcObjCSelector_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCSelector_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_objcObjCSelector_closureTrampoline, false) - .cast(); +typedef NumVersionVariantPtr = ffi.Pointer; +typedef NumVersionVariantHandle = ffi.Pointer; -/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. -abstract final class ObjCBlock_bool_ffiVoid_objcObjCSelector { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - pointer, - retain: retain, - release: release); +final class VersRec extends ffi.Struct { + external NumVersion numericVersion; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, ffi.Pointer)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_objcObjCSelector_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + @ffi.Short() + external int countryCode; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer)> - fromFunction(bool Function(ffi.Pointer, ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_bool_ffiVoid_objcObjCSelector_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, arg1)), - retain: false, - release: true); -} + @ffi.Array.multi([256]) + external ffi.Array shortVersion; -/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. -extension ObjCBlock_bool_ffiVoid_objcObjCSelector_CallExtension - on objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)> { - bool call(ffi.Pointer arg0, ffi.Pointer arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, arg1); + @ffi.Array.multi([256]) + external ffi.Array reserved; } -late final _sel_retain = objc.registerName("retain"); -late final _sel_release = objc.registerName("release"); -final _objc_msgSend_1pl9qdv = objc.msgSendPointer +typedef VersRecPtr = ffi.Pointer; +typedef VersRecHndl = ffi.Pointer; +typedef Byte = UInt8; +typedef SignedByte = SInt8; +typedef WidePtr = ffi.Pointer; +typedef UnsignedWidePtr = ffi.Pointer; +typedef extended80 = Float80; +typedef extended96 = Float96; +typedef VHSelect = SInt8; +typedef CFTypeID = ffi.UnsignedLong; +typedef DartCFTypeID = int; +typedef CFOptionFlags = ffi.UnsignedLong; +typedef DartCFOptionFlags = int; +typedef CFHashCode = ffi.UnsignedLong; +typedef DartCFHashCode = int; +typedef CFIndex = ffi.Long; +typedef DartCFIndex = int; +typedef CFTypeRef = ffi.Pointer; + +final class __CFString extends ffi.Opaque {} + +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFMutableStringRef = ffi.Pointer<__CFString>; +typedef CFPropertyListRef = CFTypeRef; + +enum CFComparisonResult { + kCFCompareLessThan(-1), + kCFCompareEqualTo(0), + kCFCompareGreaterThan(1); + + final int value; + const CFComparisonResult(this.value); + + static CFComparisonResult fromValue(int value) => switch (value) { + -1 => kCFCompareLessThan, + 0 => kCFCompareEqualTo, + 1 => kCFCompareGreaterThan, + _ => + throw ArgumentError("Unknown value for CFComparisonResult: $value"), + }; +} + +typedef CFComparatorFunctionFunction = CFIndex Function( + ffi.Pointer val1, + ffi.Pointer val2, + ffi.Pointer context); +typedef DartCFComparatorFunctionFunction = CFComparisonResult Function( + ffi.Pointer val1, + ffi.Pointer val2, + ffi.Pointer context); +typedef CFComparatorFunction + = ffi.Pointer>; + +final class CFRange extends ffi.Struct { + @CFIndex() + external int location; + + @CFIndex() + external int length; +} + +final class __CFNull extends ffi.Opaque {} + +typedef CFNullRef = ffi.Pointer<__CFNull>; + +final class __CFAllocator extends ffi.Opaque {} + +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; +typedef CFAllocatorRetainCallBackFunction = ffi.Pointer Function( + ffi.Pointer info); +typedef CFAllocatorRetainCallBack + = ffi.Pointer>; +typedef CFAllocatorReleaseCallBackFunction = ffi.Void Function( + ffi.Pointer info); +typedef DartCFAllocatorReleaseCallBackFunction = void Function( + ffi.Pointer info); +typedef CFAllocatorReleaseCallBack + = ffi.Pointer>; +typedef CFAllocatorCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer info); +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer>; +typedef CFAllocatorAllocateCallBackFunction = ffi.Pointer Function( + CFIndex allocSize, CFOptionFlags hint, ffi.Pointer info); +typedef DartCFAllocatorAllocateCallBackFunction + = ffi.Pointer Function(DartCFIndex allocSize, + DartCFOptionFlags hint, ffi.Pointer info); +typedef CFAllocatorAllocateCallBack + = ffi.Pointer>; +typedef CFAllocatorReallocateCallBackFunction = ffi.Pointer Function( + ffi.Pointer ptr, + CFIndex newsize, + CFOptionFlags hint, + ffi.Pointer info); +typedef DartCFAllocatorReallocateCallBackFunction + = ffi.Pointer Function( + ffi.Pointer ptr, + DartCFIndex newsize, + DartCFOptionFlags hint, + ffi.Pointer info); +typedef CFAllocatorReallocateCallBack + = ffi.Pointer>; +typedef CFAllocatorDeallocateCallBackFunction = ffi.Void Function( + ffi.Pointer ptr, ffi.Pointer info); +typedef DartCFAllocatorDeallocateCallBackFunction = void Function( + ffi.Pointer ptr, ffi.Pointer info); +typedef CFAllocatorDeallocateCallBack + = ffi.Pointer>; +typedef CFAllocatorPreferredSizeCallBackFunction = CFIndex Function( + CFIndex size, CFOptionFlags hint, ffi.Pointer info); +typedef DartCFAllocatorPreferredSizeCallBackFunction = DartCFIndex Function( + DartCFIndex size, DartCFOptionFlags hint, ffi.Pointer info); +typedef CFAllocatorPreferredSizeCallBack + = ffi.Pointer>; + +final class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; + + external ffi.Pointer info; + + external CFAllocatorRetainCallBack retain; + + external CFAllocatorReleaseCallBack release; + + external CFAllocatorCopyDescriptionCallBack copyDescription; + + external CFAllocatorAllocateCallBack allocate; + + external CFAllocatorReallocateCallBack reallocate; + + external CFAllocatorDeallocateCallBack deallocate; + + external CFAllocatorPreferredSizeCallBack preferredSize; +} + +typedef NSZone = _NSZone; +late final _class_NSObject = objc.getClass("NSObject"); +late final _sel_version = objc.registerName("version"); +final _objc_msgSend_1hz7y9r = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setVersion_ = objc.registerName("setVersion:"); +final _objc_msgSend_4sp4xj = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_classForCoder = objc.registerName("classForCoder"); +final _objc_msgSend_1x359cv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>>() .asFunction< - void Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer)>(); -void _ObjCBlock_ffiVoid_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => +late final _sel_replacementObjectForCoder_ = + objc.registerName("replacementObjectForCoder:"); +final _objc_msgSend_62nh5j = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_awakeAfterUsingCoder_ = + objc.registerName("awakeAfterUsingCoder:"); + +/// NSCoderMethods +extension NSCoderMethods on objc.NSObject { + /// version + static DartNSInteger version() { + return _objc_msgSend_1hz7y9r(_class_NSObject, _sel_version); + } + + /// setVersion: + static void setVersion_(DartNSInteger aVersion) { + _objc_msgSend_4sp4xj(_class_NSObject, _sel_setVersion_, aVersion); + } + + /// classForCoder + objc.ObjCObjectBase get classForCoder { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_classForCoder); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// replacementObjectForCoder: + objc.ObjCObjectBase? replacementObjectForCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_replacementObjectForCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// awakeAfterUsingCoder: + objc.ObjCObjectBase? awakeAfterUsingCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_awakeAfterUsingCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } +} + +late final _sel_poseAsClass_ = objc.registerName("poseAsClass:"); +final _objc_msgSend_1jdvcbf = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + +/// NSDeprecatedMethods +extension NSDeprecatedMethods on objc.NSObject { + /// poseAsClass: + static void poseAsClass_(objc.ObjCObjectBase aClass) { + _objc_msgSend_1jdvcbf( + _class_NSObject, _sel_poseAsClass_, aClass.ref.pointer); + } +} + +late final _sel_autoContentAccessingProxy = + objc.registerName("autoContentAccessingProxy"); + +/// NSDiscardableContentProxy +extension NSDiscardableContentProxy on objc.NSObject { + /// autoContentAccessingProxy + objc.ObjCObjectBase get autoContentAccessingProxy { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_autoContentAccessingProxy); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } +} + +/// ! +/// @enum NSURLCacheStoragePolicy +/// +/// @discussion The NSURLCacheStoragePolicy enum defines constants that +/// can be used to specify the type of storage that is allowable for an +/// NSCachedURLResponse object that is to be stored in an NSURLCache. +/// +/// @constant NSURLCacheStorageAllowed Specifies that storage in an +/// NSURLCache is allowed without restriction. +/// +/// @constant NSURLCacheStorageAllowedInMemoryOnly Specifies that +/// storage in an NSURLCache is allowed; however storage should be +/// done in memory only, no disk storage should be done. +/// +/// @constant NSURLCacheStorageNotAllowed Specifies that storage in an +/// NSURLCache is not allowed in any fashion, either in memory or on +/// disk. +enum NSURLCacheStoragePolicy { + NSURLCacheStorageAllowed(0), + NSURLCacheStorageAllowedInMemoryOnly(1), + NSURLCacheStorageNotAllowed(2); + + final int value; + const NSURLCacheStoragePolicy(this.value); + + static NSURLCacheStoragePolicy fromValue(int value) => switch (value) { + 0 => NSURLCacheStorageAllowed, + 1 => NSURLCacheStorageAllowedInMemoryOnly, + 2 => NSURLCacheStorageNotAllowed, + _ => throw ArgumentError( + "Unknown value for NSURLCacheStoragePolicy: $value"), + }; +} + +/// WARNING: NSCachedURLResponse is a stub. To generate bindings for this class, include +/// NSCachedURLResponse in your config's objc-interfaces list. +/// +/// ! +/// @class NSCachedURLResponse +/// NSCachedURLResponse is a class whose objects functions as a wrapper for +/// objects that are stored in the framework's caching system. +/// It is used to maintain characteristics and attributes of a cached +/// object. +class NSCachedURLResponse extends objc.NSObject { + NSCachedURLResponse._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSCachedURLResponse] that points to the same underlying object as [other]. + NSCachedURLResponse.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSCachedURLResponse] that wraps the given raw object pointer. + NSCachedURLResponse.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +late final _class_NSURLCache = objc.getClass("NSURLCache"); +late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); +final _objc_msgSend_69e0x1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); + +/// WARNING: NSURLSessionDataTask is a stub. To generate bindings for this class, include +/// NSURLSessionDataTask in your config's objc-interfaces list. +/// +/// NSURLSessionDataTask +class NSURLSessionDataTask extends NSURLSessionTask { + NSURLSessionDataTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionDataTask] that points to the same underlying object as [other]. + NSURLSessionDataTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionDataTask] that wraps the given raw object pointer. + NSURLSessionDataTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +late final _sel_storeCachedResponse_forDataTask_ = + objc.registerName("storeCachedResponse:forDataTask:"); +final _objc_msgSend_wjvic9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +void _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => block.ref.target .cast< - ffi.NativeFunction arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_fnPtrCallable = + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_fnPtrTrampoline) + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_closureCallable = +void _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_closureTrampoline) + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer))(arg0); +void _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); objc.objectRelease(block.cast()); } ffi.NativeCallable< ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_listenerCallable = ffi.NativeCallable< + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable = ffi + .NativeCallable< ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_listenerTrampoline) + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid { +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> + static objc.ObjCBlock castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock)>(pointer, + objc.ObjCBlock(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -43448,27 +43164,33 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + static objc.ObjCBlock + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock)> fromFunction( - void Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0)), + static objc.ObjCBlock fromFunction( + void Function(NSCachedURLResponse?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(arg0, + retain: true, release: true))), retain: false, release: true); @@ -43481,162 +43203,257 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock)> listener( - void Function(ffi.Pointer) fn) { + static objc.ObjCBlock listener( + void Function(NSCachedURLResponse?) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn(arg0)); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ovsamd(raw); + _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(arg0, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock)>(wrapper, + return objc.ObjCBlock(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_CallExtension - on objc.ObjCBlock)> { - void call(ffi.Pointer arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0); +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSCachedURLResponse_CallExtension + on objc.ObjCBlock { + void call(NSCachedURLResponse? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); } -late final _sel_autorelease = objc.registerName("autorelease"); -late final _sel_retainCount = objc.registerName("retainCount"); - -final class _NSZone extends ffi.Opaque {} - -late final _sel_zone = objc.registerName("zone"); -final _objc_msgSend_sz90oi = objc.msgSendPointer +late final _sel_getCachedResponseForDataTask_completionHandler_ = + objc.registerName("getCachedResponseForDataTask:completionHandler:"); +final _objc_msgSend_14pxqbs = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer<_NSZone> Function(ffi.Pointer, - ffi.Pointer)>>() + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() .asFunction< - ffi.Pointer<_NSZone> Function( - ffi.Pointer, ffi.Pointer)>(); -ffi.Pointer<_NSZone> _ObjCBlock_NSZone_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer<_NSZone> Function(ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer<_NSZone> Function(ffi.Pointer)>()(arg0); -ffi.Pointer _ObjCBlock_NSZone_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer<_NSZone> Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSZone_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer<_NSZone> _ObjCBlock_NSZone_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer<_NSZone> Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_NSZone_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer<_NSZone> Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSZone_ffiVoid_closureTrampoline) - .cast(); + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removeCachedResponseForDataTask_ = + objc.registerName("removeCachedResponseForDataTask:"); -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. -abstract final class ObjCBlock_NSZone_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock Function(ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock Function(ffi.Pointer)>( - pointer, - retain: retain, - release: release); +/// NSURLSessionTaskAdditions +extension NSURLSessionTaskAdditions on NSURLCache { + /// storeCachedResponse:forDataTask: + void storeCachedResponse_forDataTask_( + NSCachedURLResponse cachedResponse, NSURLSessionDataTask dataTask) { + _objc_msgSend_wjvic9( + this.ref.pointer, + _sel_storeCachedResponse_forDataTask_, + cachedResponse.ref.pointer, + dataTask.ref.pointer); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(ffi.Pointer)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer<_NSZone> Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock Function(ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_NSZone_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + /// getCachedResponseForDataTask:completionHandler: + void getCachedResponseForDataTask_completionHandler_( + NSURLSessionDataTask dataTask, + objc.ObjCBlock + completionHandler) { + _objc_msgSend_14pxqbs( + this.ref.pointer, + _sel_getCachedResponseForDataTask_completionHandler_, + dataTask.ref.pointer, + completionHandler.ref.pointer); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(ffi.Pointer)> - fromFunction(ffi.Pointer<_NSZone> Function(ffi.Pointer) fn) => - objc.ObjCBlock Function(ffi.Pointer)>( - objc.newClosureBlock(_ObjCBlock_NSZone_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0)), - retain: false, - release: true); + /// removeCachedResponseForDataTask: + void removeCachedResponseForDataTask_(NSURLSessionDataTask dataTask) { + _objc_msgSend_1jdvcbf(this.ref.pointer, + _sel_removeCachedResponseForDataTask_, dataTask.ref.pointer); + } } -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. -extension ObjCBlock_NSZone_ffiVoid_CallExtension - on objc.ObjCBlock Function(ffi.Pointer)> { - ffi.Pointer<_NSZone> call(ffi.Pointer arg0) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer<_NSZone> Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer<_NSZone> Function(ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0); +late final _sel_sharedURLCache = objc.registerName("sharedURLCache"); +late final _sel_setSharedURLCache_ = objc.registerName("setSharedURLCache:"); +typedef instancetype = ffi.Pointer; +typedef Dartinstancetype = objc.ObjCObjectBase; +late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_ = + objc.registerName("initWithMemoryCapacity:diskCapacity:diskPath:"); +final _objc_msgSend_1dlfwfh = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.UnsignedLong, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); +late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_ = + objc.registerName("initWithMemoryCapacity:diskCapacity:directoryURL:"); +late final _class_NSURLRequest = objc.getClass("NSURLRequest"); +late final _sel_HTTPMethod = objc.registerName("HTTPMethod"); +late final _sel_allHTTPHeaderFields = objc.registerName("allHTTPHeaderFields"); +late final _sel_valueForHTTPHeaderField_ = + objc.registerName("valueForHTTPHeaderField:"); +late final _sel_HTTPBody = objc.registerName("HTTPBody"); +late final _sel_HTTPBodyStream = objc.registerName("HTTPBodyStream"); +late final _sel_HTTPShouldHandleCookies = + objc.registerName("HTTPShouldHandleCookies"); +final _objc_msgSend_91o635 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_HTTPShouldUsePipelining = + objc.registerName("HTTPShouldUsePipelining"); + +/// ! +/// @category NSURLRequest(NSHTTPURLRequest) +/// The NSHTTPURLRequest on NSURLRequest provides methods for accessing +/// information specific to HTTP protocol requests. +extension NSHTTPURLRequest on NSURLRequest { + /// ! + /// @abstract Returns the HTTP request method of the receiver. + /// @result the HTTP request method of the receiver. + objc.NSString? get HTTPMethod { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPMethod); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// ! + /// @abstract Returns a dictionary containing all the HTTP header fields + /// of the receiver. + /// @result a dictionary containing all the HTTP header fields of the + /// receiver. + objc.NSDictionary? get allHTTPHeaderFields { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_allHTTPHeaderFields); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } + + /// ! + /// @method valueForHTTPHeaderField: + /// @abstract Returns the value which corresponds to the given header + /// field. Note that, in keeping with the HTTP RFC, HTTP header field + /// names are case-insensitive. + /// @param field the header field name to use for the lookup + /// (case-insensitive). + /// @result the value associated with the given header field, or nil if + /// there is no value associated with the given header field. + objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// ! + /// @abstract Returns the request body data of the receiver. + /// @discussion This data is sent as the message body of the request, as + /// in done in an HTTP POST request. + /// @result The request body data of the receiver. + objc.NSData? get HTTPBody { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBody); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } + + /// ! + /// @abstract Returns the request body stream of the receiver + /// if any has been set + /// @discussion The stream is returned for examination only; it is + /// not safe for the caller to manipulate the stream in any way. Also + /// note that the HTTPBodyStream and HTTPBody are mutually exclusive - only + /// one can be set on a given request. Also note that the body stream is + /// preserved across copies, but is LOST when the request is coded via the + /// NSCoding protocol + /// @result The request body stream of the receiver. + objc.NSInputStream? get HTTPBodyStream { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBodyStream); + return _ret.address == 0 + ? null + : objc.NSInputStream.castFromPointer(_ret, retain: true, release: true); + } + + /// ! + /// @abstract Determine whether default cookie handling will happen for + /// this request. + /// @discussion NOTE: This value is not used prior to 10.3 + /// @result YES if cookies will be sent with and set for this request; + /// otherwise NO. + bool get HTTPShouldHandleCookies { + return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldHandleCookies); + } + + /// ! + /// @abstract Reports whether the receiver is not expected to wait for the + /// previous response before transmitting. + /// @result YES if the receiver should transmit before the previous response + /// is received. NO if the receiver should wait for the previous response + /// before transmitting. + bool get HTTPShouldUsePipelining { + return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); + } } -late final _sel_description = objc.registerName("description"); -ffi.Pointer _ObjCBlock_NSString_ffiVoid_fnPtrTrampoline( +late final _sel_requestWithURL_ = objc.registerName("requestWithURL:"); +late final _sel_supportsSecureCoding = + objc.registerName("supportsSecureCoding"); +bool _ObjCBlock_bool_ffiVoid_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0) => block.ref.target .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -ffi.Pointer _ObjCBlock_NSString_ffiVoid_fnPtrCallable = + ffi.NativeFunction arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_bool_ffiVoid_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Pointer Function( + ffi.Bool Function( ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSString_ffiVoid_fnPtrTrampoline) + _ObjCBlock_bool_ffiVoid_fnPtrTrampoline, false) .cast(); -ffi.Pointer _ObjCBlock_NSString_ffiVoid_closureTrampoline( +bool _ObjCBlock_bool_ffiVoid_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_NSString_ffiVoid_closureCallable = + (objc.getBlockClosure(block) as bool Function(ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_bool_ffiVoid_closureCallable = ffi.Pointer.fromFunction< - ffi.Pointer Function( + ffi.Bool Function( ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSString_ffiVoid_closureTrampoline) + _ObjCBlock_bool_ffiVoid_closureTrampoline, false) .cast(); -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_NSString_ffiVoid { +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_bool_ffiVoid { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> + static objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock)>(pointer, + objc.ObjCBlock)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -43644,15 +43461,14 @@ abstract final class ObjCBlock_NSString_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock)> + static objc.ObjCBlock)> fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> + ffi.Bool Function(ffi.Pointer arg0)>> ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_NSString_ffiVoid_fnPtrCallable, ptr.cast()), + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -43661,681 +43477,592 @@ abstract final class ObjCBlock_NSString_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(objc.NSString Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_NSString_ffiVoid_closureCallable, - (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), - retain: false, - release: true); + static objc.ObjCBlock)> fromFunction( + bool Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock(_ObjCBlock_bool_ffiVoid_closureCallable, + (ffi.Pointer arg0) => fn(arg0)), + retain: false, + release: true); } -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_NSString_ffiVoid_CallExtension - on objc.ObjCBlock)> { - objc.NSString call(ffi.Pointer arg0) => - objc.NSString.castFromPointer( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0), - retain: true, - release: true); +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_bool_ffiVoid_CallExtension + on objc.ObjCBlock)> { + bool call(ffi.Pointer arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0); } -late final _sel_debugDescription = objc.registerName("debugDescription"); +/// ! +/// @enum NSURLRequestCachePolicy +/// +/// @discussion The NSURLRequestCachePolicy enum defines constants that +/// can be used to specify the type of interactions that take place with +/// the caching system when the URL loading system processes a request. +/// Specifically, these constants cover interactions that have to do +/// with whether already-existing cache data is returned to satisfy a +/// URL load request. +/// +/// @constant NSURLRequestUseProtocolCachePolicy Specifies that the +/// caching logic defined in the protocol implementation, if any, is +/// used for a particular URL load request. This is the default policy +/// for URL load requests. +/// +/// @constant NSURLRequestReloadIgnoringLocalCacheData Specifies that the +/// data for the URL load should be loaded from the origin source. No +/// existing local cache data, regardless of its freshness or validity, +/// should be used to satisfy a URL load request. +/// +/// @constant NSURLRequestReloadIgnoringLocalAndRemoteCacheData Specifies that +/// not only should the local cache data be ignored, but that proxies and +/// other intermediates should be instructed to disregard their caches +/// so far as the protocol allows. +/// +/// @constant NSURLRequestReloadIgnoringCacheData Older name for +/// NSURLRequestReloadIgnoringLocalCacheData. +/// +/// @constant NSURLRequestReturnCacheDataElseLoad Specifies that the +/// existing cache data should be used to satisfy a URL load request, +/// regardless of its age or expiration date. However, if there is no +/// existing data in the cache corresponding to a URL load request, +/// the URL is loaded from the origin source. +/// +/// @constant NSURLRequestReturnCacheDataDontLoad Specifies that the +/// existing cache data should be used to satisfy a URL load request, +/// regardless of its age or expiration date. However, if there is no +/// existing data in the cache corresponding to a URL load request, no +/// attempt is made to load the URL from the origin source, and the +/// load is considered to have failed. This constant specifies a +/// behavior that is similar to an "offline" mode. +/// +/// @constant NSURLRequestReloadRevalidatingCacheData Specifies that +/// the existing cache data may be used provided the origin source +/// confirms its validity, otherwise the URL is loaded from the +/// origin source. +enum NSURLRequestCachePolicy { + NSURLRequestUseProtocolCachePolicy(0), + NSURLRequestReloadIgnoringLocalCacheData(1), + NSURLRequestReloadIgnoringLocalAndRemoteCacheData(4), + NSURLRequestReturnCacheDataElseLoad(2), + NSURLRequestReturnCacheDataDontLoad(3), + NSURLRequestReloadRevalidatingCacheData(5); -/// NSObject -abstract final class NSObject { - /// Builds an object that implements the NSObject protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required bool Function(objc.ObjCObjectBase) isEqual_, - required DartNSUInteger Function() hash, - required objc.ObjCObjectBase Function() superclass, - required objc.ObjCObjectBase Function() class1, - required objc.ObjCObjectBase Function() self, - required objc.ObjCObjectBase Function(ffi.Pointer) - performSelector_, - required objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase) - performSelector_withObject_, - required objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase) - performSelector_withObject_withObject_, - required bool Function() isProxy, - required bool Function(objc.ObjCObjectBase) isKindOfClass_, - required bool Function(objc.ObjCObjectBase) isMemberOfClass_, - required bool Function(objc.Protocol) conformsToProtocol_, - required bool Function(ffi.Pointer) - respondsToSelector_, - required objc.ObjCObjectBase Function() retain, - required void Function() release, - required objc.ObjCObjectBase Function() autorelease, - required DartNSUInteger Function() retainCount, - required ffi.Pointer<_NSZone> Function() zone, - required objc.NSString Function() description, - objc.NSString Function()? debugDescription}) { - final builder = objc.ObjCProtocolBuilder(); - NSObject.isEqual_.implement(builder, isEqual_); - NSObject.hash.implement(builder, hash); - NSObject.superclass.implement(builder, superclass); - NSObject.class1.implement(builder, class1); - NSObject.self.implement(builder, self); - NSObject.performSelector_.implement(builder, performSelector_); - NSObject.performSelector_withObject_ - .implement(builder, performSelector_withObject_); - NSObject.performSelector_withObject_withObject_ - .implement(builder, performSelector_withObject_withObject_); - NSObject.isProxy.implement(builder, isProxy); - NSObject.isKindOfClass_.implement(builder, isKindOfClass_); - NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); - NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); - NSObject.respondsToSelector_.implement(builder, respondsToSelector_); - NSObject.retain.implement(builder, retain); - NSObject.release.implement(builder, release); - NSObject.autorelease.implement(builder, autorelease); - NSObject.retainCount.implement(builder, retainCount); - NSObject.zone.implement(builder, zone); - NSObject.description.implement(builder, description); - NSObject.debugDescription.implement(builder, debugDescription); - return builder.build(); - } + static const NSURLRequestReloadIgnoringCacheData = + NSURLRequestReloadIgnoringLocalCacheData; - /// Adds the implementation of the NSObject protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required bool Function(objc.ObjCObjectBase) isEqual_, - required DartNSUInteger Function() hash, - required objc.ObjCObjectBase Function() superclass, - required objc.ObjCObjectBase Function() class1, - required objc.ObjCObjectBase Function() self, - required objc.ObjCObjectBase Function(ffi.Pointer) - performSelector_, - required objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase) - performSelector_withObject_, - required objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase) - performSelector_withObject_withObject_, - required bool Function() isProxy, - required bool Function(objc.ObjCObjectBase) isKindOfClass_, - required bool Function(objc.ObjCObjectBase) isMemberOfClass_, - required bool Function(objc.Protocol) conformsToProtocol_, - required bool Function(ffi.Pointer) - respondsToSelector_, - required objc.ObjCObjectBase Function() retain, - required void Function() release, - required objc.ObjCObjectBase Function() autorelease, - required DartNSUInteger Function() retainCount, - required ffi.Pointer<_NSZone> Function() zone, - required objc.NSString Function() description, - objc.NSString Function()? debugDescription}) { - NSObject.isEqual_.implement(builder, isEqual_); - NSObject.hash.implement(builder, hash); - NSObject.superclass.implement(builder, superclass); - NSObject.class1.implement(builder, class1); - NSObject.self.implement(builder, self); - NSObject.performSelector_.implement(builder, performSelector_); - NSObject.performSelector_withObject_ - .implement(builder, performSelector_withObject_); - NSObject.performSelector_withObject_withObject_ - .implement(builder, performSelector_withObject_withObject_); - NSObject.isProxy.implement(builder, isProxy); - NSObject.isKindOfClass_.implement(builder, isKindOfClass_); - NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); - NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); - NSObject.respondsToSelector_.implement(builder, respondsToSelector_); - NSObject.retain.implement(builder, retain); - NSObject.release.implement(builder, release); - NSObject.autorelease.implement(builder, autorelease); - NSObject.retainCount.implement(builder, retainCount); - NSObject.zone.implement(builder, zone); - NSObject.description.implement(builder, description); - NSObject.debugDescription.implement(builder, debugDescription); - } - - /// Builds an object that implements the NSObject protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required bool Function(objc.ObjCObjectBase) isEqual_, - required DartNSUInteger Function() hash, - required objc.ObjCObjectBase Function() superclass, - required objc.ObjCObjectBase Function() class1, - required objc.ObjCObjectBase Function() self, - required objc.ObjCObjectBase Function(ffi.Pointer) - performSelector_, - required objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase) - performSelector_withObject_, - required objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase) - performSelector_withObject_withObject_, - required bool Function() isProxy, - required bool Function(objc.ObjCObjectBase) isKindOfClass_, - required bool Function(objc.ObjCObjectBase) isMemberOfClass_, - required bool Function(objc.Protocol) conformsToProtocol_, - required bool Function(ffi.Pointer) - respondsToSelector_, - required objc.ObjCObjectBase Function() retain, - required void Function() release, - required objc.ObjCObjectBase Function() autorelease, - required DartNSUInteger Function() retainCount, - required ffi.Pointer<_NSZone> Function() zone, - required objc.NSString Function() description, - objc.NSString Function()? debugDescription}) { - final builder = objc.ObjCProtocolBuilder(); - NSObject.isEqual_.implement(builder, isEqual_); - NSObject.hash.implement(builder, hash); - NSObject.superclass.implement(builder, superclass); - NSObject.class1.implement(builder, class1); - NSObject.self.implement(builder, self); - NSObject.performSelector_.implement(builder, performSelector_); - NSObject.performSelector_withObject_ - .implement(builder, performSelector_withObject_); - NSObject.performSelector_withObject_withObject_ - .implement(builder, performSelector_withObject_withObject_); - NSObject.isProxy.implement(builder, isProxy); - NSObject.isKindOfClass_.implement(builder, isKindOfClass_); - NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); - NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); - NSObject.respondsToSelector_.implement(builder, respondsToSelector_); - NSObject.retain.implement(builder, retain); - NSObject.release.implementAsListener(builder, release); - NSObject.autorelease.implement(builder, autorelease); - NSObject.retainCount.implement(builder, retainCount); - NSObject.zone.implement(builder, zone); - NSObject.description.implement(builder, description); - NSObject.debugDescription.implement(builder, debugDescription); - return builder.build(); - } + final int value; + const NSURLRequestCachePolicy(this.value); - /// Adds the implementation of the NSObject protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required bool Function(objc.ObjCObjectBase) isEqual_, - required DartNSUInteger Function() hash, - required objc.ObjCObjectBase Function() superclass, - required objc.ObjCObjectBase Function() class1, - required objc.ObjCObjectBase Function() self, - required objc.ObjCObjectBase Function(ffi.Pointer) - performSelector_, - required objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase) - performSelector_withObject_, - required objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase) - performSelector_withObject_withObject_, - required bool Function() isProxy, - required bool Function(objc.ObjCObjectBase) isKindOfClass_, - required bool Function(objc.ObjCObjectBase) isMemberOfClass_, - required bool Function(objc.Protocol) conformsToProtocol_, - required bool Function(ffi.Pointer) - respondsToSelector_, - required objc.ObjCObjectBase Function() retain, - required void Function() release, - required objc.ObjCObjectBase Function() autorelease, - required DartNSUInteger Function() retainCount, - required ffi.Pointer<_NSZone> Function() zone, - required objc.NSString Function() description, - objc.NSString Function()? debugDescription}) { - NSObject.isEqual_.implement(builder, isEqual_); - NSObject.hash.implement(builder, hash); - NSObject.superclass.implement(builder, superclass); - NSObject.class1.implement(builder, class1); - NSObject.self.implement(builder, self); - NSObject.performSelector_.implement(builder, performSelector_); - NSObject.performSelector_withObject_ - .implement(builder, performSelector_withObject_); - NSObject.performSelector_withObject_withObject_ - .implement(builder, performSelector_withObject_withObject_); - NSObject.isProxy.implement(builder, isProxy); - NSObject.isKindOfClass_.implement(builder, isKindOfClass_); - NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); - NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); - NSObject.respondsToSelector_.implement(builder, respondsToSelector_); - NSObject.retain.implement(builder, retain); - NSObject.release.implementAsListener(builder, release); - NSObject.autorelease.implement(builder, autorelease); - NSObject.retainCount.implement(builder, retainCount); - NSObject.zone.implement(builder, zone); - NSObject.description.implement(builder, description); - NSObject.debugDescription.implement(builder, debugDescription); - } - - /// isEqual: - static final isEqual_ = - objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_isEqual_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_isEqual_, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function(objc.ObjCObjectBase) func) => - ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( - (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), - ); + static NSURLRequestCachePolicy fromValue(int value) => switch (value) { + 0 => NSURLRequestUseProtocolCachePolicy, + 1 => NSURLRequestReloadIgnoringLocalCacheData, + 4 => NSURLRequestReloadIgnoringLocalAndRemoteCacheData, + 2 => NSURLRequestReturnCacheDataElseLoad, + 3 => NSURLRequestReturnCacheDataDontLoad, + 5 => NSURLRequestReloadRevalidatingCacheData, + _ => throw ArgumentError( + "Unknown value for NSURLRequestCachePolicy: $value"), + }; - /// hash - static final hash = objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_hash, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_hash, - isRequired: true, - isInstanceMethod: true, - ), - (DartNSUInteger Function() func) => - ObjCBlock_NSUInteger_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); + @override + String toString() { + if (this == NSURLRequestReloadIgnoringLocalCacheData) + return "NSURLRequestCachePolicy.NSURLRequestReloadIgnoringLocalCacheData, NSURLRequestCachePolicy.NSURLRequestReloadIgnoringCacheData"; + return super.toString(); + } +} - /// superclass - static final superclass = - objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_superclass, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_superclass, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function() func) => - ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); +typedef NSTimeInterval = ffi.Double; +typedef DartNSTimeInterval = double; +late final _sel_requestWithURL_cachePolicy_timeoutInterval_ = + objc.registerName("requestWithURL:cachePolicy:timeoutInterval:"); +final _objc_msgSend_3phu9v = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Double)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + double)>(); +late final _sel_initWithURL_ = objc.registerName("initWithURL:"); +late final _sel_initWithURL_cachePolicy_timeoutInterval_ = + objc.registerName("initWithURL:cachePolicy:timeoutInterval:"); +late final _sel_URL = objc.registerName("URL"); +late final _sel_cachePolicy = objc.registerName("cachePolicy"); +final _objc_msgSend_8jm3uo = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_timeoutInterval = objc.registerName("timeoutInterval"); +final _objc_msgSend_1ukqyt8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_1ukqyt8Fpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_mainDocumentURL = objc.registerName("mainDocumentURL"); - /// class - static final class1 = objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_class, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_class, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function() func) => - ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); +/// ! +/// @enum NSURLRequestNetworkServiceType +/// +/// @discussion The NSURLRequestNetworkServiceType enum defines constants that +/// can be used to specify the service type to associate with this request. The +/// service type is used to provide the networking layers a hint of the purpose +/// of the request. +/// +/// @constant NSURLNetworkServiceTypeDefault Is the default value for an NSURLRequest +/// when created. This value should be left unchanged for the vast majority of requests. +/// +/// @constant NSURLNetworkServiceTypeVoIP Specifies that the request is for voice over IP +/// control traffic. +/// +/// @constant NSURLNetworkServiceTypeVideo Specifies that the request is for video +/// traffic. +/// +/// @constant NSURLNetworkServiceTypeBackground Specifies that the request is for background +/// traffic (such as a file download). +/// +/// @constant NSURLNetworkServiceTypeVoice Specifies that the request is for voice data. +/// +/// @constant NSURLNetworkServiceTypeResponsiveData Specifies that the request is for responsive (time sensitive) data. +/// +/// @constant NSURLNetworkServiceTypeAVStreaming Specifies that the request is streaming audio/video data. +/// +/// @constant NSURLNetworkServiceTypeResponsiveAV Specifies that the request is for responsive (time sensitive) audio/video data. +/// +/// @constant NSURLNetworkServiceTypeCallSignaling Specifies that the request is for call signaling. +enum NSURLRequestNetworkServiceType { + /// Standard internet traffic + NSURLNetworkServiceTypeDefault(0), - /// self - static final self = objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_self, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_self, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function() func) => - ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); + /// Voice over IP control traffic + NSURLNetworkServiceTypeVoIP(1), - /// performSelector: - static final performSelector_ = objc.ObjCProtocolMethod< - objc.ObjCObjectBase Function(ffi.Pointer)>( - _protocol_NSObject, - _sel_performSelector_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_performSelector_, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function(ffi.Pointer) func) => - ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector.fromFunction( - (ffi.Pointer _, ffi.Pointer arg1) => - func(arg1)), - ); + /// Video traffic + NSURLNetworkServiceTypeVideo(2), - /// performSelector:withObject: - static final performSelector_withObject_ = objc.ObjCProtocolMethod< - objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase)>( - _protocol_NSObject, - _sel_performSelector_withObject_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_performSelector_withObject_, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function( - ffi.Pointer, objc.ObjCObjectBase) - func) => - ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject - .fromFunction((ffi.Pointer _, - ffi.Pointer arg1, - objc.ObjCObjectBase arg2) => - func(arg1, arg2)), - ); + /// Background traffic + NSURLNetworkServiceTypeBackground(3), - /// performSelector:withObject:withObject: - static final performSelector_withObject_withObject_ = objc.ObjCProtocolMethod< - objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase)>( - _protocol_NSObject, - _sel_performSelector_withObject_withObject_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_performSelector_withObject_withObject_, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function(ffi.Pointer, - objc.ObjCObjectBase, objc.ObjCObjectBase) - func) => - ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject - .fromFunction((ffi.Pointer _, - ffi.Pointer arg1, - objc.ObjCObjectBase arg2, - objc.ObjCObjectBase arg3) => - func(arg1, arg2, arg3)), - ); + /// Voice data + NSURLNetworkServiceTypeVoice(4), - /// isProxy - static final isProxy = objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_isProxy, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_isProxy, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function() func) => ObjCBlock_bool_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); + /// Responsive data + NSURLNetworkServiceTypeResponsiveData(6), - /// isKindOfClass: - static final isKindOfClass_ = - objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_isKindOfClass_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_isKindOfClass_, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function(objc.ObjCObjectBase) func) => - ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( - (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), - ); + /// Multimedia Audio/Video Streaming + NSURLNetworkServiceTypeAVStreaming(8), - /// isMemberOfClass: - static final isMemberOfClass_ = - objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_isMemberOfClass_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_isMemberOfClass_, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function(objc.ObjCObjectBase) func) => - ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( - (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), - ); + /// Responsive Multimedia Audio/Video + NSURLNetworkServiceTypeResponsiveAV(9), - /// conformsToProtocol: - static final conformsToProtocol_ = - objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_conformsToProtocol_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_conformsToProtocol_, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function(objc.Protocol) func) => - ObjCBlock_bool_ffiVoid_Protocol.fromFunction( - (ffi.Pointer _, objc.Protocol arg1) => func(arg1)), - ); + /// Call Signaling + NSURLNetworkServiceTypeCallSignaling(11); - /// respondsToSelector: - static final respondsToSelector_ = - objc.ObjCProtocolMethod)>( - _protocol_NSObject, - _sel_respondsToSelector_, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_respondsToSelector_, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function(ffi.Pointer) func) => - ObjCBlock_bool_ffiVoid_objcObjCSelector.fromFunction( - (ffi.Pointer _, ffi.Pointer arg1) => - func(arg1)), - ); + final int value; + const NSURLRequestNetworkServiceType(this.value); - /// retain - static final retain = objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_retain, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_retain, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function() func) => - ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); + static NSURLRequestNetworkServiceType fromValue(int value) => switch (value) { + 0 => NSURLNetworkServiceTypeDefault, + 1 => NSURLNetworkServiceTypeVoIP, + 2 => NSURLNetworkServiceTypeVideo, + 3 => NSURLNetworkServiceTypeBackground, + 4 => NSURLNetworkServiceTypeVoice, + 6 => NSURLNetworkServiceTypeResponsiveData, + 8 => NSURLNetworkServiceTypeAVStreaming, + 9 => NSURLNetworkServiceTypeResponsiveAV, + 11 => NSURLNetworkServiceTypeCallSignaling, + _ => throw ArgumentError( + "Unknown value for NSURLRequestNetworkServiceType: $value"), + }; +} - /// release - static final release = objc.ObjCProtocolListenableMethod( - _protocol_NSObject, - _sel_release, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_release, - isRequired: true, - isInstanceMethod: true, - ), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( - ffi.Pointer _, - ) => - func()), - ); +late final _sel_networkServiceType = objc.registerName("networkServiceType"); +final _objc_msgSend_t4uaw1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_allowsCellularAccess = + objc.registerName("allowsCellularAccess"); +late final _sel_allowsExpensiveNetworkAccess = + objc.registerName("allowsExpensiveNetworkAccess"); +late final _sel_allowsConstrainedNetworkAccess = + objc.registerName("allowsConstrainedNetworkAccess"); +late final _sel_assumesHTTP3Capable = objc.registerName("assumesHTTP3Capable"); - /// autorelease - static final autorelease = - objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_autorelease, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_autorelease, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function() func) => - ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); +/// ! +/// @enum NSURLRequestAttribution +/// +/// @discussion The NSURLRequestAttribution enum is used to indicate whether the +/// user or developer specified the URL. +/// +/// @constant NSURLRequestAttributionDeveloper Indicates that the URL was specified +/// by the developer. This is the default value for an NSURLRequest when created. +/// +/// @constant NSURLRequestAttributionUser Indicates that the URL was specified by +/// the user. +enum NSURLRequestAttribution { + NSURLRequestAttributionDeveloper(0), + NSURLRequestAttributionUser(1); - /// retainCount - static final retainCount = objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_retainCount, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_retainCount, - isRequired: true, - isInstanceMethod: true, - ), - (DartNSUInteger Function() func) => - ObjCBlock_NSUInteger_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); + final int value; + const NSURLRequestAttribution(this.value); - /// zone - static final zone = objc.ObjCProtocolMethod Function()>( - _protocol_NSObject, - _sel_zone, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_zone, - isRequired: true, - isInstanceMethod: true, - ), - (ffi.Pointer<_NSZone> Function() func) => - ObjCBlock_NSZone_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); + static NSURLRequestAttribution fromValue(int value) => switch (value) { + 0 => NSURLRequestAttributionDeveloper, + 1 => NSURLRequestAttributionUser, + _ => throw ArgumentError( + "Unknown value for NSURLRequestAttribution: $value"), + }; +} - /// description - static final description = objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_description, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_description, - isRequired: true, - isInstanceMethod: true, - ), - (objc.NSString Function() func) => ObjCBlock_NSString_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); +late final _sel_attribution = objc.registerName("attribution"); +final _objc_msgSend_i3avs9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_requiresDNSSECValidation = + objc.registerName("requiresDNSSECValidation"); +late final _sel_init = objc.registerName("init"); +late final _sel_new = objc.registerName("new"); +late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); +final _objc_msgSend_hzlb60 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); +late final _sel_alloc = objc.registerName("alloc"); +late final _sel_self = objc.registerName("self"); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline) + .cast(); - /// debugDescription - static final debugDescription = - objc.ObjCProtocolMethod( - _protocol_NSObject, - _sel_debugDescription, - objc.getProtocolMethodSignature( - _protocol_NSObject, - _sel_debugDescription, - isRequired: false, - isInstanceMethod: true, - ), - (objc.NSString Function() func) => ObjCBlock_NSString_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); +/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. +abstract final class ObjCBlock_objcObjCObject_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock Function(ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer)>( + pointer, + retain: retain, + release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock Function(ffi.Pointer)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock Function(ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock Function(ffi.Pointer)> + fromFunction(objc.ObjCObjectBase Function(ffi.Pointer) fn) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_objcObjCObject_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); } -typedef va_list = __builtin_va_list; -typedef __gnuc_va_list = __builtin_va_list; -typedef NSExceptionName = ffi.Pointer; -typedef DartNSExceptionName = objc.NSString; -typedef NSRunLoopMode = ffi.Pointer; -typedef DartNSRunLoopMode = objc.NSString; -int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline( +/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. +extension ObjCBlock_objcObjCObject_ffiVoid_CallExtension on objc + .ObjCBlock Function(ffi.Pointer)> { + objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); +} + +late final _sel_retain = objc.registerName("retain"); +late final _sel_autorelease = objc.registerName("autorelease"); +late final _sel_encodeWithCoder_ = objc.registerName("encodeWithCoder:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1) => block.ref.target .cast< ffi.NativeFunction< - NSInteger Function(ffi.Pointer arg0, + ffi.Void Function(ffi.Pointer arg0, ffi.Pointer arg1)>>() .asFunction< - int Function(ffi.Pointer, + void Function(ffi.Pointer, ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable = +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable = ffi.Pointer.fromFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline, - 0) + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline) .cast(); -int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline( +void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1) => - (objc.getBlockClosure(block) as int Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable = + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable = ffi.Pointer.fromFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline, - 0) + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline) .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} -/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. -abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject { +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, objc.NSCoder)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock, objc.NSCoder)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + objc.NSCoder)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, objc.NSCoder)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, objc.NSCoder)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, objc.NSCoder)> + fromFunction(void Function(ffi.Pointer, objc.NSCoder) fn) => + objc.ObjCBlock, objc.NSCoder)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn( + arg0, + objc.NSCoder.castFromPointer(arg1, + retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock, objc.NSCoder)> + listener(void Function(ffi.Pointer, objc.NSCoder) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0, + objc.NSCoder.castFromPointer(arg1, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjovn7(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSCoder)>(wrapper, + retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, objc.NSCoder)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSCoder_CallExtension + on objc.ObjCBlock, objc.NSCoder)> { + void call(ffi.Pointer arg0, objc.NSCoder arg1) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer); +} + +late final _sel_initWithCoder_ = objc.registerName("initWithCoder:"); +instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable = + ffi.Pointer.fromFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline) + .cast(); +instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as instancetype Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable = + ffi.Pointer.fromFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. +abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - NSInteger Function( - ffi.Pointer, ffi.Pointer)> + objc.Retained?> Function( + ffi.Pointer, objc.NSCoder)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - NSInteger Function(ffi.Pointer, - ffi.Pointer)>(pointer, - retain: retain, release: release); + objc.Retained?> Function( + ffi.Pointer, + objc.NSCoder)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => + static objc.ObjCBlock< + objc.Retained?> Function( + ffi.Pointer, objc.NSCoder)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => objc.ObjCBlock< - NSInteger Function(ffi.Pointer, - ffi.Pointer)>( + objc.Retained?> Function( + ffi.Pointer, objc.NSCoder)>( objc.newPointerBlock( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable, - ptr.cast()), + _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -44344,1651 +44071,1037 @@ abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, ffi.Pointer)> - fromFunction(objc.NSComparisonResult Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => - objc.ObjCBlock, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true)) - .value), - retain: false, - release: true); + static objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)> fromFunction( + Dartinstancetype? Function(ffi.Pointer, objc.NSCoder) fn) => + objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>( + objc.newClosureBlock( + _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, objc.NSCoder.castFromPointer(arg1, retain: true, release: true)) + ?.ref + .retainAndReturnPointer() ?? + ffi.nullptr), + retain: false, + release: true); } -/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. -extension ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_CallExtension +/// Call operator for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. +extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension on objc.ObjCBlock< - NSInteger Function( - ffi.Pointer, ffi.Pointer)> { - objc.NSComparisonResult call( - objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1) => - objc.NSComparisonResult.fromValue(ref.pointer.ref.invoke + objc.Retained?> Function( + ffi.Pointer, objc.NSCoder)> { + Dartinstancetype? call(ffi.Pointer arg0, objc.NSCoder arg1) => ref + .pointer.ref.invoke .cast< ffi.NativeFunction< - NSInteger Function( + instancetype Function( ffi.Pointer block, - ffi.Pointer arg0, + ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer)); + .asFunction, ffi.Pointer, ffi.Pointer)>() + (ref.pointer, arg0, arg1.ref.pointer) + .address == + 0 + ? null + : objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast block, ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, arg1.ref.pointer), + retain: false, + release: true); } -typedef NSComparator = ffi.Pointer; -typedef DartNSComparator = objc.ObjCBlock< - NSInteger Function( - ffi.Pointer, ffi.Pointer)>; +/// NSURLRequest +class NSURLRequest extends objc.NSObject { + NSURLRequest._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); -enum NSQualityOfService { - NSQualityOfServiceUserInteractive(33), - NSQualityOfServiceUserInitiated(25), - NSQualityOfServiceUtility(17), - NSQualityOfServiceBackground(9), - NSQualityOfServiceDefault(-1); - - final int value; - const NSQualityOfService(this.value); - - static NSQualityOfService fromValue(int value) => switch (value) { - 33 => NSQualityOfServiceUserInteractive, - 25 => NSQualityOfServiceUserInitiated, - 17 => NSQualityOfServiceUtility, - 9 => NSQualityOfServiceBackground, - -1 => NSQualityOfServiceDefault, - _ => - throw ArgumentError("Unknown value for NSQualityOfService: $value"), - }; -} - -typedef ptrauth_extra_data_t = ffi.UnsignedLong; -typedef Dartptrauth_extra_data_t = int; -typedef ptrauth_generic_signature_t = ffi.UnsignedLong; -typedef Dartptrauth_generic_signature_t = int; -typedef UInt8 = ffi.UnsignedChar; -typedef DartUInt8 = int; -typedef SInt8 = ffi.SignedChar; -typedef DartSInt8 = int; -typedef UInt16 = ffi.UnsignedShort; -typedef DartUInt16 = int; -typedef SInt16 = ffi.Short; -typedef DartSInt16 = int; -typedef UInt32 = ffi.UnsignedInt; -typedef DartUInt32 = int; -typedef SInt32 = ffi.Int; -typedef DartSInt32 = int; - -@ffi.Packed(2) -final class wide extends ffi.Struct { - @UInt32() - external int lo; - - @SInt32() - external int hi; -} + /// Constructs a [NSURLRequest] that points to the same underlying object as [other]. + NSURLRequest.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); -@ffi.Packed(2) -final class UnsignedWide extends ffi.Struct { - @UInt32() - external int lo; + /// Constructs a [NSURLRequest] that wraps the given raw object pointer. + NSURLRequest.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - @UInt32() - external int hi; -} + /// Returns whether [obj] is an instance of [NSURLRequest]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLRequest); + } -typedef SInt64 = ffi.LongLong; -typedef DartSInt64 = int; -typedef UInt64 = ffi.UnsignedLongLong; -typedef DartUInt64 = int; -typedef Fixed = SInt32; -typedef FixedPtr = ffi.Pointer; -typedef Fract = SInt32; -typedef FractPtr = ffi.Pointer; -typedef UnsignedFixed = UInt32; -typedef UnsignedFixedPtr = ffi.Pointer; -typedef ShortFixed = ffi.Short; -typedef DartShortFixed = int; -typedef ShortFixedPtr = ffi.Pointer; -typedef Float32 = ffi.Float; -typedef DartFloat32 = double; -typedef Float64 = ffi.Double; -typedef DartFloat64 = double; + /// ! + /// @method requestWithURL: + /// @abstract Allocates and initializes an NSURLRequest with the given + /// URL. + /// @discussion Default values are used for cache policy + /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 + /// seconds). + /// @param URL The URL for the request. + /// @result A newly-created and autoreleased NSURLRequest instance. + static NSURLRequest requestWithURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_62nh5j( + _class_NSURLRequest, _sel_requestWithURL_, URL.ref.pointer); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } -final class Float80 extends ffi.Struct { - @SInt16() - external int exp; + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_91o635(_class_NSURLRequest, _sel_supportsSecureCoding); + } - @ffi.Array.multi([4]) - external ffi.Array man; -} + /// ! + /// @method requestWithURL:cachePolicy:timeoutInterval: + /// @abstract Allocates and initializes a NSURLRequest with the given + /// URL and cache policy. + /// @param URL The URL for the request. + /// @param cachePolicy The cache policy for the request. + /// @param timeoutInterval The timeout interval for the request. See the + /// commentary for the timeoutInterval for more information on + /// timeout intervals. + /// @result A newly-created and autoreleased NSURLRequest instance. + static NSURLRequest requestWithURL_cachePolicy_timeoutInterval_( + objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, + DartNSTimeInterval timeoutInterval) { + final _ret = _objc_msgSend_3phu9v( + _class_NSURLRequest, + _sel_requestWithURL_cachePolicy_timeoutInterval_, + URL.ref.pointer, + cachePolicy.value, + timeoutInterval); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } -final class Float96 extends ffi.Struct { - @ffi.Array.multi([2]) - external ffi.Array exp; + /// ! + /// @method initWithURL: + /// @abstract Initializes an NSURLRequest with the given URL. + /// @discussion Default values are used for cache policy + /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 + /// seconds). + /// @param URL The URL for the request. + /// @result An initialized NSURLRequest. + NSURLRequest initWithURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_62nh5j( + this.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + } - @ffi.Array.multi([4]) - external ffi.Array man; -} + /// ! + /// @method initWithURL: + /// @abstract Initializes an NSURLRequest with the given URL and + /// cache policy. + /// @discussion This is the designated initializer for the + /// NSURLRequest class. + /// @param URL The URL for the request. + /// @param cachePolicy The cache policy for the request. + /// @param timeoutInterval The timeout interval for the request. See the + /// commentary for the timeoutInterval for more information on + /// timeout intervals. + /// @result An initialized NSURLRequest. + NSURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { + final _ret = _objc_msgSend_3phu9v( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_cachePolicy_timeoutInterval_, + URL.ref.pointer, + cachePolicy.value, + timeoutInterval); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + } -@ffi.Packed(2) -final class Float32Point extends ffi.Struct { - @Float32() - external double x; + /// ! + /// @abstract Returns the URL of the receiver. + /// @result The URL of the receiver. + objc.NSURL? get URL { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_URL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } - @Float32() - external double y; -} + /// ! + /// @abstract Returns the cache policy of the receiver. + /// @result The cache policy of the receiver. + NSURLRequestCachePolicy get cachePolicy { + final _ret = _objc_msgSend_8jm3uo(this.ref.pointer, _sel_cachePolicy); + return NSURLRequestCachePolicy.fromValue(_ret); + } -typedef Ptr = ffi.Pointer; -typedef Handle = ffi.Pointer; -typedef Size = ffi.Long; -typedef DartSize = int; -typedef OSErr = SInt16; -typedef OSStatus = SInt32; -typedef LogicalAddress = ffi.Pointer; -typedef ConstLogicalAddress = ffi.Pointer; -typedef PhysicalAddress = ffi.Pointer; -typedef BytePtr = ffi.Pointer; -typedef ByteCount = ffi.UnsignedLong; -typedef DartByteCount = int; -typedef ByteOffset = ffi.UnsignedLong; -typedef DartByteOffset = int; -typedef Duration = SInt32; -typedef AbsoluteTime = UnsignedWide; -typedef OptionBits = UInt32; -typedef ItemCount = ffi.UnsignedLong; -typedef DartItemCount = int; -typedef PBVersion = UInt32; -typedef ScriptCode = SInt16; -typedef LangCode = SInt16; -typedef RegionCode = SInt16; -typedef FourCharCode = UInt32; -typedef OSType = FourCharCode; -typedef ResType = FourCharCode; -typedef OSTypePtr = ffi.Pointer; -typedef ResTypePtr = ffi.Pointer; -typedef Boolean = ffi.UnsignedChar; -typedef DartBoolean = int; -typedef ProcPtrFunction = ffi.Long Function(); -typedef DartProcPtrFunction = int Function(); -typedef ProcPtr = ffi.Pointer>; -typedef Register68kProcPtrFunction = ffi.Void Function(); -typedef DartRegister68kProcPtrFunction = void Function(); -typedef Register68kProcPtr - = ffi.Pointer>; -typedef UniversalProcPtr = ProcPtr; -typedef ProcHandle = ffi.Pointer; -typedef UniversalProcHandle = ffi.Pointer; -typedef PRefCon = ffi.Pointer; -typedef URefCon = ffi.Pointer; -typedef SRefCon = ffi.Pointer; -typedef UnicodeScalarValue = UInt32; -typedef UTF32Char = UInt32; -typedef UniChar = UInt16; -typedef UTF16Char = UInt16; -typedef UTF8Char = UInt8; -typedef UniCharPtr = ffi.Pointer; -typedef UniCharCount = ffi.UnsignedLong; -typedef DartUniCharCount = int; -typedef UniCharCountPtr = ffi.Pointer; -typedef StringPtr = ffi.Pointer; -typedef StringHandle = ffi.Pointer; -typedef ConstStringPtr = ffi.Pointer; -typedef ConstStr255Param = ffi.Pointer; -typedef ConstStr63Param = ffi.Pointer; -typedef ConstStr32Param = ffi.Pointer; -typedef ConstStr31Param = ffi.Pointer; -typedef ConstStr27Param = ffi.Pointer; -typedef ConstStr15Param = ffi.Pointer; -typedef ConstStrFileNameParam = ConstStr63Param; + /// ! + /// @abstract Returns the timeout interval of the receiver. + /// @discussion The timeout interval specifies the limit on the idle + /// interval allotted to a request in the process of loading. The "idle + /// interval" is defined as the period of time that has passed since the + /// last instance of load activity occurred for a request that is in the + /// process of loading. Hence, when an instance of load activity occurs + /// (e.g. bytes are received from the network for a request), the idle + /// interval for a request is reset to 0. If the idle interval ever + /// becomes greater than or equal to the timeout interval, the request + /// is considered to have timed out. This timeout interval is measured + /// in seconds. + /// @result The timeout interval of the receiver. + DartNSTimeInterval get timeoutInterval { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_timeoutInterval) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeoutInterval); + } -@ffi.Packed(2) -final class ProcessSerialNumber extends ffi.Struct { - @UInt32() - external int highLongOfPSN; + /// ! + /// @abstract The main document URL associated with this load. + /// @discussion This URL is used for the cookie "same domain as main + /// document" policy, and attributing the request as a sub-resource + /// of a user-specified URL. There may also be other future uses. + /// See setMainDocumentURL: + /// @result The main document URL. + objc.NSURL? get mainDocumentURL { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_mainDocumentURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } - @UInt32() - external int lowLongOfPSN; -} + /// ! + /// @abstract Returns the NSURLRequestNetworkServiceType associated with this request. + /// @discussion This will return NSURLNetworkServiceTypeDefault for requests that have + /// not explicitly set a networkServiceType (using the setNetworkServiceType method). + /// @result The NSURLRequestNetworkServiceType associated with this request. + NSURLRequestNetworkServiceType get networkServiceType { + final _ret = + _objc_msgSend_t4uaw1(this.ref.pointer, _sel_networkServiceType); + return NSURLRequestNetworkServiceType.fromValue(_ret); + } -typedef ProcessSerialNumberPtr = ffi.Pointer; + /// ! + /// @abstract returns whether a connection created with this request is allowed to use + /// the built in cellular radios (if present). + /// @result YES if the receiver is allowed to use the built in cellular radios to + /// satisfy the request, NO otherwise. + bool get allowsCellularAccess { + return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); + } -final class Point extends ffi.Struct { - @ffi.Short() - external int v; + /// ! + /// @abstract returns whether a connection created with this request is allowed to use + /// network interfaces which have been marked as expensive. + /// @result YES if the receiver is allowed to use an interface marked as expensive to + /// satisfy the request, NO otherwise. + bool get allowsExpensiveNetworkAccess { + return _objc_msgSend_91o635( + this.ref.pointer, _sel_allowsExpensiveNetworkAccess); + } - @ffi.Short() - external int h; -} + /// ! + /// @abstract returns whether a connection created with this request is allowed to use + /// network interfaces which have been marked as constrained. + /// @result YES if the receiver is allowed to use an interface marked as constrained to + /// satisfy the request, NO otherwise. + bool get allowsConstrainedNetworkAccess { + return _objc_msgSend_91o635( + this.ref.pointer, _sel_allowsConstrainedNetworkAccess); + } -typedef PointPtr = ffi.Pointer; + /// ! + /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC + /// racing without HTTP/3 service discovery. + /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. + /// The default may be YES in a future OS update. + bool get assumesHTTP3Capable { + return _objc_msgSend_91o635(this.ref.pointer, _sel_assumesHTTP3Capable); + } -final class Rect extends ffi.Struct { - @ffi.Short() - external int top; + /// ! + /// @abstract Returns the NSURLRequestAttribution associated with this request. + /// @discussion This will return NSURLRequestAttributionDeveloper for requests that + /// have not explicitly set an attribution. + /// @result The NSURLRequestAttribution associated with this request. + NSURLRequestAttribution get attribution { + final _ret = _objc_msgSend_i3avs9(this.ref.pointer, _sel_attribution); + return NSURLRequestAttribution.fromValue(_ret); + } - @ffi.Short() - external int left; + /// ! + /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. + /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, + /// No otherwise. Defaults to NO. + bool get requiresDNSSECValidation { + return _objc_msgSend_91o635( + this.ref.pointer, _sel_requiresDNSSECValidation); + } - @ffi.Short() - external int bottom; + /// init + NSURLRequest init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + } - @ffi.Short() - external int right; -} + /// new + static NSURLRequest new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLRequest, _sel_new); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + } -typedef RectPtr = ffi.Pointer; + /// allocWithZone: + static NSURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_hzlb60(_class_NSURLRequest, _sel_allocWithZone_, zone); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + } -@ffi.Packed(2) -final class FixedPoint extends ffi.Struct { - @Fixed() - external int x; + /// alloc + static NSURLRequest alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLRequest, _sel_alloc); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + } - @Fixed() - external int y; -} + /// self + NSURLRequest self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } -@ffi.Packed(2) -final class FixedRect extends ffi.Struct { - @Fixed() - external int left; + /// retain + NSURLRequest retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } - @Fixed() - external int top; + /// autorelease + NSURLRequest autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + } - @Fixed() - external int right; + /// encodeWithCoder: + void encodeWithCoder_(objc.NSCoder coder) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); + } - @Fixed() - external int bottom; + /// initWithCoder: + NSURLRequest? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : NSURLRequest.castFromPointer(_ret, retain: false, release: true); + } } -typedef CharParameter = ffi.Short; -typedef DartCharParameter = int; -typedef Style = ffi.UnsignedChar; -typedef DartStyle = int; -typedef StyleParameter = ffi.Short; -typedef DartStyleParameter = int; -typedef StyleField = Style; -typedef TimeValue = SInt32; -typedef TimeScale = SInt32; -typedef CompTimeValue = wide; -typedef TimeValue64 = SInt64; - -final class TimeBaseRecord extends ffi.Opaque {} +late final _sel_cachedResponseForRequest_ = + objc.registerName("cachedResponseForRequest:"); +late final _sel_storeCachedResponse_forRequest_ = + objc.registerName("storeCachedResponse:forRequest:"); +late final _sel_removeCachedResponseForRequest_ = + objc.registerName("removeCachedResponseForRequest:"); +late final _sel_removeAllCachedResponses = + objc.registerName("removeAllCachedResponses"); +final _objc_msgSend_1pl9qdv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_removeCachedResponsesSinceDate_ = + objc.registerName("removeCachedResponsesSinceDate:"); +late final _sel_memoryCapacity = objc.registerName("memoryCapacity"); +final _objc_msgSend_xw2lbc = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setMemoryCapacity_ = objc.registerName("setMemoryCapacity:"); +final _objc_msgSend_1i9r4xy = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_diskCapacity = objc.registerName("diskCapacity"); +late final _sel_setDiskCapacity_ = objc.registerName("setDiskCapacity:"); +late final _sel_currentMemoryUsage = objc.registerName("currentMemoryUsage"); +late final _sel_currentDiskUsage = objc.registerName("currentDiskUsage"); -typedef TimeBase = ffi.Pointer; +/// NSURLCache +class NSURLCache extends objc.NSObject { + NSURLCache._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); -@ffi.Packed(2) -final class TimeRecord extends ffi.Struct { - external CompTimeValue value; + /// Constructs a [NSURLCache] that points to the same underlying object as [other]. + NSURLCache.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - @TimeScale() - external int scale; + /// Constructs a [NSURLCache] that wraps the given raw object pointer. + NSURLCache.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - external TimeBase base; -} + /// Returns whether [obj] is an instance of [NSURLCache]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLCache); + } -final class NumVersion extends ffi.Struct { - @UInt8() - external int nonRelRev; - - @UInt8() - external int stage; - - @UInt8() - external int minorAndBugRev; - - @UInt8() - external int majorRev; -} - -final class NumVersionVariant extends ffi.Union { - external NumVersion parts; - - @UInt32() - external int whole; -} - -typedef NumVersionVariantPtr = ffi.Pointer; -typedef NumVersionVariantHandle = ffi.Pointer; - -final class VersRec extends ffi.Struct { - external NumVersion numericVersion; - - @ffi.Short() - external int countryCode; - - @ffi.Array.multi([256]) - external ffi.Array shortVersion; - - @ffi.Array.multi([256]) - external ffi.Array reserved; -} - -typedef VersRecPtr = ffi.Pointer; -typedef VersRecHndl = ffi.Pointer; -typedef Byte = UInt8; -typedef SignedByte = SInt8; -typedef WidePtr = ffi.Pointer; -typedef UnsignedWidePtr = ffi.Pointer; -typedef extended80 = Float80; -typedef extended96 = Float96; -typedef VHSelect = SInt8; -typedef CFTypeID = ffi.UnsignedLong; -typedef DartCFTypeID = int; -typedef CFOptionFlags = ffi.UnsignedLong; -typedef DartCFOptionFlags = int; -typedef CFHashCode = ffi.UnsignedLong; -typedef DartCFHashCode = int; -typedef CFIndex = ffi.Long; -typedef DartCFIndex = int; -typedef CFTypeRef = ffi.Pointer; - -final class __CFString extends ffi.Opaque {} - -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFMutableStringRef = ffi.Pointer<__CFString>; -typedef CFPropertyListRef = CFTypeRef; - -enum CFComparisonResult { - kCFCompareLessThan(-1), - kCFCompareEqualTo(0), - kCFCompareGreaterThan(1); - - final int value; - const CFComparisonResult(this.value); - - static CFComparisonResult fromValue(int value) => switch (value) { - -1 => kCFCompareLessThan, - 0 => kCFCompareEqualTo, - 1 => kCFCompareGreaterThan, - _ => - throw ArgumentError("Unknown value for CFComparisonResult: $value"), - }; -} - -typedef CFComparatorFunctionFunction = CFIndex Function( - ffi.Pointer val1, - ffi.Pointer val2, - ffi.Pointer context); -typedef DartCFComparatorFunctionFunction = CFComparisonResult Function( - ffi.Pointer val1, - ffi.Pointer val2, - ffi.Pointer context); -typedef CFComparatorFunction - = ffi.Pointer>; - -final class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -final class __CFNull extends ffi.Opaque {} - -typedef CFNullRef = ffi.Pointer<__CFNull>; - -final class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; -typedef CFAllocatorRetainCallBackFunction = ffi.Pointer Function( - ffi.Pointer info); -typedef CFAllocatorRetainCallBack - = ffi.Pointer>; -typedef CFAllocatorReleaseCallBackFunction = ffi.Void Function( - ffi.Pointer info); -typedef DartCFAllocatorReleaseCallBackFunction = void Function( - ffi.Pointer info); -typedef CFAllocatorReleaseCallBack - = ffi.Pointer>; -typedef CFAllocatorCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer info); -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer>; -typedef CFAllocatorAllocateCallBackFunction = ffi.Pointer Function( - CFIndex allocSize, CFOptionFlags hint, ffi.Pointer info); -typedef DartCFAllocatorAllocateCallBackFunction - = ffi.Pointer Function(DartCFIndex allocSize, - DartCFOptionFlags hint, ffi.Pointer info); -typedef CFAllocatorAllocateCallBack - = ffi.Pointer>; -typedef CFAllocatorReallocateCallBackFunction = ffi.Pointer Function( - ffi.Pointer ptr, - CFIndex newsize, - CFOptionFlags hint, - ffi.Pointer info); -typedef DartCFAllocatorReallocateCallBackFunction - = ffi.Pointer Function( - ffi.Pointer ptr, - DartCFIndex newsize, - DartCFOptionFlags hint, - ffi.Pointer info); -typedef CFAllocatorReallocateCallBack - = ffi.Pointer>; -typedef CFAllocatorDeallocateCallBackFunction = ffi.Void Function( - ffi.Pointer ptr, ffi.Pointer info); -typedef DartCFAllocatorDeallocateCallBackFunction = void Function( - ffi.Pointer ptr, ffi.Pointer info); -typedef CFAllocatorDeallocateCallBack - = ffi.Pointer>; -typedef CFAllocatorPreferredSizeCallBackFunction = CFIndex Function( - CFIndex size, CFOptionFlags hint, ffi.Pointer info); -typedef DartCFAllocatorPreferredSizeCallBackFunction = DartCFIndex Function( - DartCFIndex size, DartCFOptionFlags hint, ffi.Pointer info); -typedef CFAllocatorPreferredSizeCallBack - = ffi.Pointer>; + /// ! + /// @property sharedURLCache + /// @abstract Returns the shared NSURLCache instance or + /// sets the NSURLCache instance shared by all clients of + /// the current process. This will be the new object returned when + /// calls to the sharedURLCache method are made. + /// @discussion Unless set explicitly through a call to + /// +setSharedURLCache:, this method returns an NSURLCache + /// instance created with the following default values: + ///
    + ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) + ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) + ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) + ///
+ ///

Users who do not have special caching requirements or + /// constraints should find the default shared cache instance + /// acceptable. If this default shared cache instance is not + /// acceptable, +setSharedURLCache: can be called to set a + /// different NSURLCache instance to be returned from this method. + /// Callers should take care to ensure that the setter is called + /// at a time when no other caller has a reference to the previously-set + /// shared URL cache. This is to prevent storing cache data from + /// becoming unexpectedly unretrievable. + /// @result the shared NSURLCache instance. + static NSURLCache getSharedURLCache() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLCache, _sel_sharedURLCache); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); + } -final class CFAllocatorContext extends ffi.Struct { - @CFIndex() - external int version; + /// ! + /// @property sharedURLCache + /// @abstract Returns the shared NSURLCache instance or + /// sets the NSURLCache instance shared by all clients of + /// the current process. This will be the new object returned when + /// calls to the sharedURLCache method are made. + /// @discussion Unless set explicitly through a call to + /// +setSharedURLCache:, this method returns an NSURLCache + /// instance created with the following default values: + ///

    + ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) + ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) + ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) + ///
+ ///

Users who do not have special caching requirements or + /// constraints should find the default shared cache instance + /// acceptable. If this default shared cache instance is not + /// acceptable, +setSharedURLCache: can be called to set a + /// different NSURLCache instance to be returned from this method. + /// Callers should take care to ensure that the setter is called + /// at a time when no other caller has a reference to the previously-set + /// shared URL cache. This is to prevent storing cache data from + /// becoming unexpectedly unretrievable. + /// @result the shared NSURLCache instance. + static void setSharedURLCache(NSURLCache value) { + return _objc_msgSend_1jdvcbf( + _class_NSURLCache, _sel_setSharedURLCache_, value.ref.pointer); + } - external ffi.Pointer info; + /// ! + /// @method initWithMemoryCapacity:diskCapacity:diskPath: + /// @abstract Initializes an NSURLCache with the given capacity and + /// path. + /// @discussion The returned NSURLCache is backed by disk, so + /// developers can be more liberal with space when choosing the + /// capacity for this kind of cache. A disk cache measured in the tens + /// of megabytes should be acceptable in most cases. + /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. + /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. + /// @param path the path on disk where the cache data is stored. + /// @result an initialized NSURLCache, with the given capacity, backed + /// by disk. + NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( + DartNSUInteger memoryCapacity, + DartNSUInteger diskCapacity, + objc.NSString? path) { + final _ret = _objc_msgSend_1dlfwfh( + this.ref.retainAndReturnPointer(), + _sel_initWithMemoryCapacity_diskCapacity_diskPath_, + memoryCapacity, + diskCapacity, + path?.ref.pointer ?? ffi.nullptr); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); + } - external CFAllocatorRetainCallBack retain; + /// ! + /// @method initWithMemoryCapacity:diskCapacity:directoryURL: + /// @abstract Initializes an NSURLCache with the given capacity and directory. + /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. Or 0 to disable memory cache. + /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. Or 0 to disable disk cache. + /// @param directoryURL the path to a directory on disk where the cache data is stored. Or nil for default directory. + /// @result an initialized NSURLCache, with the given capacity, optionally backed by disk. + NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( + DartNSUInteger memoryCapacity, + DartNSUInteger diskCapacity, + objc.NSURL? directoryURL) { + final _ret = _objc_msgSend_1dlfwfh( + this.ref.retainAndReturnPointer(), + _sel_initWithMemoryCapacity_diskCapacity_directoryURL_, + memoryCapacity, + diskCapacity, + directoryURL?.ref.pointer ?? ffi.nullptr); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); + } - external CFAllocatorReleaseCallBack release; + /// ! + /// @method cachedResponseForRequest: + /// @abstract Returns the NSCachedURLResponse stored in the cache with + /// the given request. + /// @discussion The method returns nil if there is no + /// NSCachedURLResponse stored using the given request. + /// @param request the NSURLRequest to use as a key for the lookup. + /// @result The NSCachedURLResponse stored in the cache with the given + /// request, or nil if there is no NSCachedURLResponse stored with the + /// given request. + NSCachedURLResponse? cachedResponseForRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_cachedResponseForRequest_, request.ref.pointer); + return _ret.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(_ret, + retain: true, release: true); + } - external CFAllocatorCopyDescriptionCallBack copyDescription; + /// ! + /// @method storeCachedResponse:forRequest: + /// @abstract Stores the given NSCachedURLResponse in the cache using + /// the given request. + /// @param cachedResponse The cached response to store. + /// @param request the NSURLRequest to use as a key for the storage. + void storeCachedResponse_forRequest_( + NSCachedURLResponse cachedResponse, NSURLRequest request) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_storeCachedResponse_forRequest_, + cachedResponse.ref.pointer, request.ref.pointer); + } - external CFAllocatorAllocateCallBack allocate; + /// ! + /// @method removeCachedResponseForRequest: + /// @abstract Removes the NSCachedURLResponse from the cache that is + /// stored using the given request. + /// @discussion No action is taken if there is no NSCachedURLResponse + /// stored with the given request. + /// @param request the NSURLRequest to use as a key for the lookup. + void removeCachedResponseForRequest_(NSURLRequest request) { + _objc_msgSend_1jdvcbf(this.ref.pointer, + _sel_removeCachedResponseForRequest_, request.ref.pointer); + } - external CFAllocatorReallocateCallBack reallocate; + /// ! + /// @method removeAllCachedResponses + /// @abstract Clears the given cache, removing all NSCachedURLResponse + /// objects that it stores. + void removeAllCachedResponses() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllCachedResponses); + } - external CFAllocatorDeallocateCallBack deallocate; + /// ! + /// @method removeCachedResponsesSince: + /// @abstract Clears the given cache of any cached responses since the provided date. + void removeCachedResponsesSinceDate_(objc.NSDate date) { + _objc_msgSend_1jdvcbf(this.ref.pointer, + _sel_removeCachedResponsesSinceDate_, date.ref.pointer); + } - external CFAllocatorPreferredSizeCallBack preferredSize; -} + /// ! + /// @abstract In-memory capacity of the receiver. + /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. + /// @result The in-memory capacity, measured in bytes, for the receiver. + DartNSUInteger get memoryCapacity { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_memoryCapacity); + } -typedef NSZone = _NSZone; -late final _protocol_NSCopying = objc.getProtocol("NSCopying"); -late final _sel_copyWithZone_ = objc.registerName("copyWithZone:"); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_NSZone_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_NSZone_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_NSZone_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_NSZone_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_NSZone_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_NSZone_closureTrampoline) - .cast(); + /// ! + /// @abstract In-memory capacity of the receiver. + /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. + /// @result The in-memory capacity, measured in bytes, for the receiver. + set memoryCapacity(DartNSUInteger value) { + return _objc_msgSend_1i9r4xy( + this.ref.pointer, _sel_setMemoryCapacity_, value); + } -/// Construction methods for `objc.ObjCBlock> Function(ffi.Pointer, ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid_NSZone { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - objc.Retained> Function( - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - objc.Retained> Function( - ffi.Pointer, ffi.Pointer)>(pointer, - retain: retain, release: release); + /// ! + /// @abstract The on-disk capacity of the receiver. + /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. + DartNSUInteger get diskCapacity { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_diskCapacity); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - objc.Retained> Function( - ffi.Pointer, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => - objc.ObjCBlock< - objc.Retained> Function( - ffi.Pointer, ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_NSZone_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + /// ! + /// @abstract The on-disk capacity of the receiver. + /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. + set diskCapacity(DartNSUInteger value) { + return _objc_msgSend_1i9r4xy( + this.ref.pointer, _sel_setDiskCapacity_, value); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock> Function(ffi.Pointer, ffi.Pointer)> - fromFunction(objc.ObjCObjectBase Function(ffi.Pointer, ffi.Pointer) fn) => - objc.ObjCBlock< - objc.Retained> Function( - ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_objcObjCObject_ffiVoid_NSZone_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, arg1).ref.retainAndReturnPointer()), - retain: false, - release: true); -} + /// ! + /// @abstract Returns the current amount of space consumed by the + /// in-memory cache of the receiver. + /// @discussion This size, measured in bytes, indicates the current + /// usage of the in-memory cache. + /// @result the current usage of the in-memory cache of the receiver. + DartNSUInteger get currentMemoryUsage { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_currentMemoryUsage); + } -/// Call operator for `objc.ObjCBlock> Function(ffi.Pointer, ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid_NSZone_CallExtension - on objc.ObjCBlock< - objc.Retained> Function( - ffi.Pointer, ffi.Pointer)> { - objc.ObjCObjectBase call( - ffi.Pointer arg0, ffi.Pointer arg1) => - objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, arg1), - retain: false, - release: true); -} + /// ! + /// @abstract Returns the current amount of space consumed by the + /// on-disk cache of the receiver. + /// @discussion This size, measured in bytes, indicates the current + /// usage of the on-disk cache. + /// @result the current usage of the on-disk cache of the receiver. + DartNSUInteger get currentDiskUsage { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_currentDiskUsage); + } -/// NSCopying -abstract final class NSCopying { - /// Builds an object that implements the NSCopying protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required objc.ObjCObjectBase Function(ffi.Pointer) - copyWithZone_}) { - final builder = objc.ObjCProtocolBuilder(); - NSCopying.copyWithZone_.implement(builder, copyWithZone_); - return builder.build(); + /// init + NSURLCache init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } - /// Adds the implementation of the NSCopying protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required objc.ObjCObjectBase Function(ffi.Pointer) - copyWithZone_}) { - NSCopying.copyWithZone_.implement(builder, copyWithZone_); + /// new + static NSURLCache new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLCache, _sel_new); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } - /// copyWithZone: - static final copyWithZone_ = objc.ObjCProtocolMethod< - objc.ObjCObjectBase Function(ffi.Pointer)>( - _protocol_NSCopying, - _sel_copyWithZone_, - objc.getProtocolMethodSignature( - _protocol_NSCopying, - _sel_copyWithZone_, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function(ffi.Pointer) func) => - ObjCBlock_objcObjCObject_ffiVoid_NSZone.fromFunction( - (ffi.Pointer _, ffi.Pointer arg1) => func(arg1)), - ); -} + /// allocWithZone: + static NSURLCache allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_hzlb60(_class_NSURLCache, _sel_allocWithZone_, zone); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); + } -late final _protocol_NSMutableCopying = objc.getProtocol("NSMutableCopying"); -late final _sel_mutableCopyWithZone_ = - objc.registerName("mutableCopyWithZone:"); + /// alloc + static NSURLCache alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLCache, _sel_alloc); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); + } -/// NSMutableCopying -abstract final class NSMutableCopying { - /// Builds an object that implements the NSMutableCopying protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required objc.ObjCObjectBase Function(ffi.Pointer) - mutableCopyWithZone_}) { - final builder = objc.ObjCProtocolBuilder(); - NSMutableCopying.mutableCopyWithZone_ - .implement(builder, mutableCopyWithZone_); - return builder.build(); + /// self + NSURLCache self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); } - /// Adds the implementation of the NSMutableCopying protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required objc.ObjCObjectBase Function(ffi.Pointer) - mutableCopyWithZone_}) { - NSMutableCopying.mutableCopyWithZone_ - .implement(builder, mutableCopyWithZone_); + /// retain + NSURLCache retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); } - /// mutableCopyWithZone: - static final mutableCopyWithZone_ = objc.ObjCProtocolMethod< - objc.ObjCObjectBase Function(ffi.Pointer)>( - _protocol_NSMutableCopying, - _sel_mutableCopyWithZone_, - objc.getProtocolMethodSignature( - _protocol_NSMutableCopying, - _sel_mutableCopyWithZone_, - isRequired: true, - isInstanceMethod: true, - ), - (objc.ObjCObjectBase Function(ffi.Pointer) func) => - ObjCBlock_objcObjCObject_ffiVoid_NSZone.fromFunction( - (ffi.Pointer _, ffi.Pointer arg1) => func(arg1)), - ); + /// autorelease + NSURLCache autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); + } } -late final _protocol_NSCoding = objc.getProtocol("NSCoding"); -late final _sel_encodeWithCoder_ = objc.registerName("encodeWithCoder:"); -final _objc_msgSend_1jdvcbf = objc.msgSendPointer +typedef NSNotificationName = ffi.Pointer; +typedef DartNSNotificationName = objc.NSString; +late final _class_NSNotification = objc.getClass("NSNotification"); +late final _sel_notificationWithName_object_ = + objc.registerName("notificationWithName:object:"); +final _objc_msgSend_rsfdlh = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Void Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, objc.NSCoder)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock, objc.NSCoder)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - objc.NSCoder)>(pointer, retain: retain, release: release); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_notificationWithName_object_userInfo_ = + objc.registerName("notificationWithName:object:userInfo:"); +final _objc_msgSend_582s3n = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSCoder)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, objc.NSCoder)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable, ptr.cast()), - retain: false, - release: true); +/// NSNotificationCreation +extension NSNotificationCreation on objc.NSNotification { + /// notificationWithName:object: + static objc.NSNotification notificationWithName_object_( + DartNSNotificationName aName, objc.ObjCObjectBase? anObject) { + final _ret = _objc_msgSend_rsfdlh( + _class_NSNotification, + _sel_notificationWithName_object_, + aName.ref.pointer, + anObject?.ref.pointer ?? ffi.nullptr); + return objc.NSNotification.castFromPointer(_ret, + retain: true, release: true); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSCoder)> - fromFunction(void Function(ffi.Pointer, objc.NSCoder) fn) => - objc.ObjCBlock, objc.NSCoder)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0, - objc.NSCoder.castFromPointer(arg1, - retain: true, release: true))), - retain: false, - release: true); + /// notificationWithName:object:userInfo: + static objc.NSNotification notificationWithName_object_userInfo_( + DartNSNotificationName aName, + objc.ObjCObjectBase? anObject, + objc.NSDictionary? aUserInfo) { + final _ret = _objc_msgSend_582s3n( + _class_NSNotification, + _sel_notificationWithName_object_userInfo_, + aName.ref.pointer, + anObject?.ref.pointer ?? ffi.nullptr, + aUserInfo?.ref.pointer ?? ffi.nullptr); + return objc.NSNotification.castFromPointer(_ret, + retain: true, release: true); + } - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock, objc.NSCoder)> - listener(void Function(ffi.Pointer, objc.NSCoder) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - objc.NSCoder.castFromPointer(arg1, retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjovn7(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSCoder)>(wrapper, + /// init + objc.NSNotification init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return objc.NSNotification.castFromPointer(_ret, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, objc.NSCoder)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSCoder_CallExtension - on objc.ObjCBlock, objc.NSCoder)> { - void call(ffi.Pointer arg0, objc.NSCoder arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer); -} - -late final _sel_initWithCoder_ = objc.registerName("initWithCoder:"); -final _objc_msgSend_62nh5j = objc.msgSendPointer +late final _class_NSDate = objc.getClass("NSDate"); +late final _sel_timeIntervalSinceDate_ = + objc.registerName("timeIntervalSinceDate:"); +final _objc_msgSend_hlyk7w = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Double Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_hlyk7wFpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Double Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>>() + .asFunction< + double Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_timeIntervalSinceNow = + objc.registerName("timeIntervalSinceNow"); +late final _sel_timeIntervalSince1970 = + objc.registerName("timeIntervalSince1970"); +late final _sel_addTimeInterval_ = objc.registerName("addTimeInterval:"); +final _objc_msgSend_1x911p2 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>() .asFunction< ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, double)>(); +late final _sel_dateByAddingTimeInterval_ = + objc.registerName("dateByAddingTimeInterval:"); +late final _sel_earlierDate_ = objc.registerName("earlierDate:"); +late final _sel_laterDate_ = objc.registerName("laterDate:"); +late final _sel_compare_ = objc.registerName("compare:"); +final _objc_msgSend_1wpduvy = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); -instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable = - ffi.Pointer.fromFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline) - .cast(); -instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as instancetype Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable = - ffi.Pointer.fromFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. -abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, - objc.NSCoder)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => - objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)>( - objc.newPointerBlock( - _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)> fromFunction( - Dartinstancetype? Function(ffi.Pointer, objc.NSCoder) fn) => - objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>( - objc.newClosureBlock( - _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, objc.NSCoder.castFromPointer(arg1, retain: true, release: true)) - ?.ref - .retainAndReturnPointer() ?? - ffi.nullptr), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. -extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension - on objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)> { - Dartinstancetype? call(ffi.Pointer arg0, objc.NSCoder arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>() - (ref.pointer, arg0, arg1.ref.pointer) - .address == - 0 - ? null - : objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast block, ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, arg1.ref.pointer), - retain: false, - release: true); -} +late final _sel_isEqualToDate_ = objc.registerName("isEqualToDate:"); +late final _sel_description = objc.registerName("description"); +late final _sel_descriptionWithLocale_ = + objc.registerName("descriptionWithLocale:"); +late final _sel_timeIntervalSinceReferenceDate = + objc.registerName("timeIntervalSinceReferenceDate"); -/// NSCoding -abstract final class NSCoding { - /// Builds an object that implements the NSCoding protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - final builder = objc.ObjCProtocolBuilder(); - NSCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); - NSCoding.initWithCoder_.implement(builder, initWithCoder_); - return builder.build(); +/// NSExtendedDate +extension NSExtendedDate on objc.NSDate { + /// timeIntervalSinceDate: + DartNSTimeInterval timeIntervalSinceDate_(objc.NSDate anotherDate) { + return objc.useMsgSendVariants + ? _objc_msgSend_hlyk7wFpret(this.ref.pointer, + _sel_timeIntervalSinceDate_, anotherDate.ref.pointer) + : _objc_msgSend_hlyk7w(this.ref.pointer, _sel_timeIntervalSinceDate_, + anotherDate.ref.pointer); } - /// Adds the implementation of the NSCoding protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - NSCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); - NSCoding.initWithCoder_.implement(builder, initWithCoder_); + /// timeIntervalSinceNow + DartNSTimeInterval get timeIntervalSinceNow { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret( + this.ref.pointer, _sel_timeIntervalSinceNow) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeIntervalSinceNow); } - /// Builds an object that implements the NSCoding protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - final builder = objc.ObjCProtocolBuilder(); - NSCoding.encodeWithCoder_.implementAsListener(builder, encodeWithCoder_); - NSCoding.initWithCoder_.implement(builder, initWithCoder_); - return builder.build(); + /// timeIntervalSince1970 + DartNSTimeInterval get timeIntervalSince1970 { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret( + this.ref.pointer, _sel_timeIntervalSince1970) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeIntervalSince1970); } - /// Adds the implementation of the NSCoding protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - NSCoding.encodeWithCoder_.implementAsListener(builder, encodeWithCoder_); - NSCoding.initWithCoder_.implement(builder, initWithCoder_); + /// addTimeInterval: + objc.ObjCObjectBase addTimeInterval_(DartNSTimeInterval seconds) { + final _ret = + _objc_msgSend_1x911p2(this.ref.pointer, _sel_addTimeInterval_, seconds); + return objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// encodeWithCoder: - static final encodeWithCoder_ = - objc.ObjCProtocolListenableMethod( - _protocol_NSCoding, - _sel_encodeWithCoder_, - objc.getProtocolMethodSignature( - _protocol_NSCoding, - _sel_encodeWithCoder_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSCoder) func) => - ObjCBlock_ffiVoid_ffiVoid_NSCoder.fromFunction( - (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), - (void Function(objc.NSCoder) func) => - ObjCBlock_ffiVoid_ffiVoid_NSCoder.listener( - (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), - ); - - /// initWithCoder: - static final initWithCoder_ = - objc.ObjCProtocolMethod( - _protocol_NSCoding, - _sel_initWithCoder_, - objc.getProtocolMethodSignature( - _protocol_NSCoding, - _sel_initWithCoder_, - isRequired: true, - isInstanceMethod: true, - ), - (Dartinstancetype? Function(objc.NSCoder) func) => - ObjCBlock_instancetype_ffiVoid_NSCoder.fromFunction( - (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), - ); -} + /// dateByAddingTimeInterval: + objc.NSDate dateByAddingTimeInterval_(DartNSTimeInterval ti) { + final _ret = _objc_msgSend_1x911p2( + this.ref.pointer, _sel_dateByAddingTimeInterval_, ti); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); + } -late final _protocol_NSSecureCoding = objc.getProtocol("NSSecureCoding"); + /// earlierDate: + objc.NSDate earlierDate_(objc.NSDate anotherDate) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_earlierDate_, anotherDate.ref.pointer); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); + } -/// NSSecureCoding -abstract final class NSSecureCoding { - /// Builds an object that implements the NSSecureCoding protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - final builder = objc.ObjCProtocolBuilder(); - NSSecureCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); - NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); - return builder.build(); + /// laterDate: + objc.NSDate laterDate_(objc.NSDate anotherDate) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_laterDate_, anotherDate.ref.pointer); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// Adds the implementation of the NSSecureCoding protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - NSSecureCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); - NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); + /// compare: + objc.NSComparisonResult compare_(objc.NSDate other) { + final _ret = _objc_msgSend_1wpduvy( + this.ref.pointer, _sel_compare_, other.ref.pointer); + return objc.NSComparisonResult.fromValue(_ret); } - /// Builds an object that implements the NSSecureCoding protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - final builder = objc.ObjCProtocolBuilder(); - NSSecureCoding.encodeWithCoder_ - .implementAsListener(builder, encodeWithCoder_); - NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); - return builder.build(); + /// isEqualToDate: + bool isEqualToDate_(objc.NSDate otherDate) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_isEqualToDate_, otherDate.ref.pointer); } - /// Adds the implementation of the NSSecureCoding protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required void Function(objc.NSCoder) encodeWithCoder_, - required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { - NSSecureCoding.encodeWithCoder_ - .implementAsListener(builder, encodeWithCoder_); - NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); + /// description + objc.NSString get description { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_description); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// encodeWithCoder: - static final encodeWithCoder_ = - objc.ObjCProtocolListenableMethod( - _protocol_NSSecureCoding, - _sel_encodeWithCoder_, - objc.getProtocolMethodSignature( - _protocol_NSSecureCoding, - _sel_encodeWithCoder_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSCoder) func) => - ObjCBlock_ffiVoid_ffiVoid_NSCoder.fromFunction( - (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), - (void Function(objc.NSCoder) func) => - ObjCBlock_ffiVoid_ffiVoid_NSCoder.listener( - (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), - ); + /// descriptionWithLocale: + objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } - /// initWithCoder: - static final initWithCoder_ = - objc.ObjCProtocolMethod( - _protocol_NSSecureCoding, - _sel_initWithCoder_, - objc.getProtocolMethodSignature( - _protocol_NSSecureCoding, - _sel_initWithCoder_, - isRequired: true, - isInstanceMethod: true, - ), - (Dartinstancetype? Function(objc.NSCoder) func) => - ObjCBlock_instancetype_ffiVoid_NSCoder.fromFunction( - (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), - ); + /// timeIntervalSinceReferenceDate + static DartNSTimeInterval getTimeIntervalSinceReferenceDate() { + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret( + _class_NSDate, _sel_timeIntervalSinceReferenceDate) + : _objc_msgSend_1ukqyt8( + _class_NSDate, _sel_timeIntervalSinceReferenceDate); + } } -late final _class_NSObject = objc.getClass("NSObject"); -late final _sel_version = objc.registerName("version"); -final _objc_msgSend_1hz7y9r = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setVersion_ = objc.registerName("setVersion:"); -final _objc_msgSend_4sp4xj = objc.msgSendPointer +late final _sel_date = objc.registerName("date"); +late final _sel_dateWithTimeIntervalSinceNow_ = + objc.registerName("dateWithTimeIntervalSinceNow:"); +late final _sel_dateWithTimeIntervalSinceReferenceDate_ = + objc.registerName("dateWithTimeIntervalSinceReferenceDate:"); +late final _sel_dateWithTimeIntervalSince1970_ = + objc.registerName("dateWithTimeIntervalSince1970:"); +late final _sel_dateWithTimeInterval_sinceDate_ = + objc.registerName("dateWithTimeInterval:sinceDate:"); +final _objc_msgSend_xh7c7e = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>() + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Double, + ffi.Pointer)>>() .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_classForCoder = objc.registerName("classForCoder"); -late final _sel_replacementObjectForCoder_ = - objc.registerName("replacementObjectForCoder:"); -late final _sel_awakeAfterUsingCoder_ = - objc.registerName("awakeAfterUsingCoder:"); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer)>(); +late final _sel_distantFuture = objc.registerName("distantFuture"); +late final _sel_distantPast = objc.registerName("distantPast"); +late final _sel_now = objc.registerName("now"); +late final _sel_initWithTimeIntervalSinceNow_ = + objc.registerName("initWithTimeIntervalSinceNow:"); +late final _sel_initWithTimeIntervalSince1970_ = + objc.registerName("initWithTimeIntervalSince1970:"); +late final _sel_initWithTimeInterval_sinceDate_ = + objc.registerName("initWithTimeInterval:sinceDate:"); -/// NSCoderMethods -extension NSCoderMethods on objc.NSObject { - /// version - static DartNSInteger version() { - return _objc_msgSend_1hz7y9r(_class_NSObject, _sel_version); +/// NSDateCreation +extension NSDateCreation on objc.NSDate { + /// date + static objc.NSDate date() { + final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_date); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// setVersion: - static void setVersion_(DartNSInteger aVersion) { - _objc_msgSend_4sp4xj(_class_NSObject, _sel_setVersion_, aVersion); - } - - /// classForCoder - objc.ObjCObjectBase get classForCoder { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_classForCoder); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// replacementObjectForCoder: - objc.ObjCObjectBase? replacementObjectForCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_62nh5j( - this.ref.pointer, _sel_replacementObjectForCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); + /// dateWithTimeIntervalSinceNow: + static objc.NSDate dateWithTimeIntervalSinceNow_(DartNSTimeInterval secs) { + final _ret = _objc_msgSend_1x911p2( + _class_NSDate, _sel_dateWithTimeIntervalSinceNow_, secs); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// awakeAfterUsingCoder: - objc.ObjCObjectBase? awakeAfterUsingCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_awakeAfterUsingCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); + /// dateWithTimeIntervalSinceReferenceDate: + static objc.NSDate dateWithTimeIntervalSinceReferenceDate_( + DartNSTimeInterval ti) { + final _ret = _objc_msgSend_1x911p2( + _class_NSDate, _sel_dateWithTimeIntervalSinceReferenceDate_, ti); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } -} - -late final _sel_poseAsClass_ = objc.registerName("poseAsClass:"); -/// NSDeprecatedMethods -extension NSDeprecatedMethods on objc.NSObject { - /// poseAsClass: - static void poseAsClass_(objc.ObjCObjectBase aClass) { - _objc_msgSend_1jdvcbf( - _class_NSObject, _sel_poseAsClass_, aClass.ref.pointer); + /// dateWithTimeIntervalSince1970: + static objc.NSDate dateWithTimeIntervalSince1970_(DartNSTimeInterval secs) { + final _ret = _objc_msgSend_1x911p2( + _class_NSDate, _sel_dateWithTimeIntervalSince1970_, secs); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } -} - -late final _protocol_NSDiscardableContent = - objc.getProtocol("NSDiscardableContent"); -late final _sel_beginContentAccess = objc.registerName("beginContentAccess"); -late final _sel_endContentAccess = objc.registerName("endContentAccess"); -late final _sel_discardContentIfPossible = - objc.registerName("discardContentIfPossible"); -late final _sel_isContentDiscarded = objc.registerName("isContentDiscarded"); -/// NSDiscardableContent -abstract final class NSDiscardableContent { - /// Builds an object that implements the NSDiscardableContent protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required bool Function() beginContentAccess, - required void Function() endContentAccess, - required void Function() discardContentIfPossible, - required bool Function() isContentDiscarded}) { - final builder = objc.ObjCProtocolBuilder(); - NSDiscardableContent.beginContentAccess - .implement(builder, beginContentAccess); - NSDiscardableContent.endContentAccess.implement(builder, endContentAccess); - NSDiscardableContent.discardContentIfPossible - .implement(builder, discardContentIfPossible); - NSDiscardableContent.isContentDiscarded - .implement(builder, isContentDiscarded); - return builder.build(); + /// dateWithTimeInterval:sinceDate: + static objc.NSDate dateWithTimeInterval_sinceDate_( + DartNSTimeInterval secsToBeAdded, objc.NSDate date) { + final _ret = _objc_msgSend_xh7c7e(_class_NSDate, + _sel_dateWithTimeInterval_sinceDate_, secsToBeAdded, date.ref.pointer); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// Adds the implementation of the NSDiscardableContent protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required bool Function() beginContentAccess, - required void Function() endContentAccess, - required void Function() discardContentIfPossible, - required bool Function() isContentDiscarded}) { - NSDiscardableContent.beginContentAccess - .implement(builder, beginContentAccess); - NSDiscardableContent.endContentAccess.implement(builder, endContentAccess); - NSDiscardableContent.discardContentIfPossible - .implement(builder, discardContentIfPossible); - NSDiscardableContent.isContentDiscarded - .implement(builder, isContentDiscarded); - } - - /// Builds an object that implements the NSDiscardableContent protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required bool Function() beginContentAccess, - required void Function() endContentAccess, - required void Function() discardContentIfPossible, - required bool Function() isContentDiscarded}) { - final builder = objc.ObjCProtocolBuilder(); - NSDiscardableContent.beginContentAccess - .implement(builder, beginContentAccess); - NSDiscardableContent.endContentAccess - .implementAsListener(builder, endContentAccess); - NSDiscardableContent.discardContentIfPossible - .implementAsListener(builder, discardContentIfPossible); - NSDiscardableContent.isContentDiscarded - .implement(builder, isContentDiscarded); - return builder.build(); + /// distantFuture + static objc.NSDate getDistantFuture() { + final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_distantFuture); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// Adds the implementation of the NSDiscardableContent protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required bool Function() beginContentAccess, - required void Function() endContentAccess, - required void Function() discardContentIfPossible, - required bool Function() isContentDiscarded}) { - NSDiscardableContent.beginContentAccess - .implement(builder, beginContentAccess); - NSDiscardableContent.endContentAccess - .implementAsListener(builder, endContentAccess); - NSDiscardableContent.discardContentIfPossible - .implementAsListener(builder, discardContentIfPossible); - NSDiscardableContent.isContentDiscarded - .implement(builder, isContentDiscarded); - } - - /// beginContentAccess - static final beginContentAccess = objc.ObjCProtocolMethod( - _protocol_NSDiscardableContent, - _sel_beginContentAccess, - objc.getProtocolMethodSignature( - _protocol_NSDiscardableContent, - _sel_beginContentAccess, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function() func) => ObjCBlock_bool_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); - - /// endContentAccess - static final endContentAccess = - objc.ObjCProtocolListenableMethod( - _protocol_NSDiscardableContent, - _sel_endContentAccess, - objc.getProtocolMethodSignature( - _protocol_NSDiscardableContent, - _sel_endContentAccess, - isRequired: true, - isInstanceMethod: true, - ), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( - ffi.Pointer _, - ) => - func()), - ); - - /// discardContentIfPossible - static final discardContentIfPossible = - objc.ObjCProtocolListenableMethod( - _protocol_NSDiscardableContent, - _sel_discardContentIfPossible, - objc.getProtocolMethodSignature( - _protocol_NSDiscardableContent, - _sel_discardContentIfPossible, - isRequired: true, - isInstanceMethod: true, - ), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( - ffi.Pointer _, - ) => - func()), - ); - - /// isContentDiscarded - static final isContentDiscarded = objc.ObjCProtocolMethod( - _protocol_NSDiscardableContent, - _sel_isContentDiscarded, - objc.getProtocolMethodSignature( - _protocol_NSDiscardableContent, - _sel_isContentDiscarded, - isRequired: true, - isInstanceMethod: true, - ), - (bool Function() func) => ObjCBlock_bool_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); -} - -late final _sel_autoContentAccessingProxy = - objc.registerName("autoContentAccessingProxy"); - -/// NSDiscardableContentProxy -extension NSDiscardableContentProxy on objc.NSObject { - /// autoContentAccessingProxy - objc.ObjCObjectBase get autoContentAccessingProxy { - final _ret = - _objc_msgSend_1x359cv(this.ref.pointer, _sel_autoContentAccessingProxy); - return objc.ObjCObjectBase(_ret, retain: true, release: true); + /// distantPast + static objc.NSDate getDistantPast() { + final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_distantPast); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } -} - -/// ! -/// @enum NSURLCacheStoragePolicy -/// -/// @discussion The NSURLCacheStoragePolicy enum defines constants that -/// can be used to specify the type of storage that is allowable for an -/// NSCachedURLResponse object that is to be stored in an NSURLCache. -/// -/// @constant NSURLCacheStorageAllowed Specifies that storage in an -/// NSURLCache is allowed without restriction. -/// -/// @constant NSURLCacheStorageAllowedInMemoryOnly Specifies that -/// storage in an NSURLCache is allowed; however storage should be -/// done in memory only, no disk storage should be done. -/// -/// @constant NSURLCacheStorageNotAllowed Specifies that storage in an -/// NSURLCache is not allowed in any fashion, either in memory or on -/// disk. -enum NSURLCacheStoragePolicy { - NSURLCacheStorageAllowed(0), - NSURLCacheStorageAllowedInMemoryOnly(1), - NSURLCacheStorageNotAllowed(2); - - final int value; - const NSURLCacheStoragePolicy(this.value); - - static NSURLCacheStoragePolicy fromValue(int value) => switch (value) { - 0 => NSURLCacheStorageAllowed, - 1 => NSURLCacheStorageAllowedInMemoryOnly, - 2 => NSURLCacheStorageNotAllowed, - _ => throw ArgumentError( - "Unknown value for NSURLCacheStoragePolicy: $value"), - }; -} - -/// WARNING: NSCachedURLResponse is a stub. To generate bindings for this class, include -/// NSCachedURLResponse in your config's objc-interfaces list. -/// -/// ! -/// @class NSCachedURLResponse -/// NSCachedURLResponse is a class whose objects functions as a wrapper for -/// objects that are stored in the framework's caching system. -/// It is used to maintain characteristics and attributes of a cached -/// object. -class NSCachedURLResponse extends objc.NSObject { - NSCachedURLResponse._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSCachedURLResponse] that points to the same underlying object as [other]. - NSCachedURLResponse.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSCachedURLResponse] that wraps the given raw object pointer. - NSCachedURLResponse.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); -} - -late final _class_NSURLCache = objc.getClass("NSURLCache"); - -/// WARNING: NSURLSessionDataTask is a stub. To generate bindings for this class, include -/// NSURLSessionDataTask in your config's objc-interfaces list. -/// -/// NSURLSessionDataTask -class NSURLSessionDataTask extends NSURLSessionTask { - NSURLSessionDataTask._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSURLSessionDataTask] that points to the same underlying object as [other]. - NSURLSessionDataTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionDataTask] that wraps the given raw object pointer. - NSURLSessionDataTask.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); -} - -late final _sel_storeCachedResponse_forDataTask_ = - objc.registerName("storeCachedResponse:forDataTask:"); -final _objc_msgSend_wjvic9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -void _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable = ffi - .NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(NSCachedURLResponse?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable, - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSCachedURLResponse.castFromPointer(arg0, - retain: true, release: true))), - retain: false, - release: true); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(NSCachedURLResponse?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSCachedURLResponse.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); + /// now + static objc.NSDate getNow() { + final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_now); + return objc.NSDate.castFromPointer(_ret, retain: true, release: true); } -} -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSCachedURLResponse_CallExtension - on objc.ObjCBlock { - void call(NSCachedURLResponse? arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_getCachedResponseForDataTask_completionHandler_ = - objc.registerName("getCachedResponseForDataTask:completionHandler:"); -final _objc_msgSend_14pxqbs = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_removeCachedResponseForDataTask_ = - objc.registerName("removeCachedResponseForDataTask:"); - -/// NSURLSessionTaskAdditions -extension NSURLSessionTaskAdditions on NSURLCache { - /// storeCachedResponse:forDataTask: - void storeCachedResponse_forDataTask_( - NSCachedURLResponse cachedResponse, NSURLSessionDataTask dataTask) { - _objc_msgSend_wjvic9( - this.ref.pointer, - _sel_storeCachedResponse_forDataTask_, - cachedResponse.ref.pointer, - dataTask.ref.pointer); + /// initWithTimeIntervalSinceNow: + objc.NSDate initWithTimeIntervalSinceNow_(DartNSTimeInterval secs) { + final _ret = _objc_msgSend_1x911p2(this.ref.retainAndReturnPointer(), + _sel_initWithTimeIntervalSinceNow_, secs); + return objc.NSDate.castFromPointer(_ret, retain: false, release: true); } - /// getCachedResponseForDataTask:completionHandler: - void getCachedResponseForDataTask_completionHandler_( - NSURLSessionDataTask dataTask, - objc.ObjCBlock - completionHandler) { - _objc_msgSend_14pxqbs( - this.ref.pointer, - _sel_getCachedResponseForDataTask_completionHandler_, - dataTask.ref.pointer, - completionHandler.ref.pointer); + /// initWithTimeIntervalSince1970: + objc.NSDate initWithTimeIntervalSince1970_(DartNSTimeInterval secs) { + final _ret = _objc_msgSend_1x911p2(this.ref.retainAndReturnPointer(), + _sel_initWithTimeIntervalSince1970_, secs); + return objc.NSDate.castFromPointer(_ret, retain: false, release: true); } - /// removeCachedResponseForDataTask: - void removeCachedResponseForDataTask_(NSURLSessionDataTask dataTask) { - _objc_msgSend_1jdvcbf(this.ref.pointer, - _sel_removeCachedResponseForDataTask_, dataTask.ref.pointer); + /// initWithTimeInterval:sinceDate: + objc.NSDate initWithTimeInterval_sinceDate_( + DartNSTimeInterval secsToBeAdded, objc.NSDate date) { + final _ret = _objc_msgSend_xh7c7e(this.ref.retainAndReturnPointer(), + _sel_initWithTimeInterval_sinceDate_, secsToBeAdded, date.ref.pointer); + return objc.NSDate.castFromPointer(_ret, retain: false, release: true); } } -late final _sel_sharedURLCache = objc.registerName("sharedURLCache"); -late final _sel_setSharedURLCache_ = objc.registerName("setSharedURLCache:"); -late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_ = - objc.registerName("initWithMemoryCapacity:diskCapacity:diskPath:"); -final _objc_msgSend_1dlfwfh = objc.msgSendPointer +late final _class_NSMutableURLRequest = objc.getClass("NSMutableURLRequest"); +late final _sel_setHTTPMethod_ = objc.registerName("setHTTPMethod:"); +late final _sel_setAllHTTPHeaderFields_ = + objc.registerName("setAllHTTPHeaderFields:"); +late final _sel_setValue_forHTTPHeaderField_ = + objc.registerName("setValue:forHTTPHeaderField:"); +late final _sel_addValue_forHTTPHeaderField_ = + objc.registerName("addValue:forHTTPHeaderField:"); +late final _sel_setHTTPBody_ = objc.registerName("setHTTPBody:"); +late final _sel_setHTTPBodyStream_ = objc.registerName("setHTTPBodyStream:"); +late final _sel_setHTTPShouldHandleCookies_ = + objc.registerName("setHTTPShouldHandleCookies:"); +final _objc_msgSend_1s56lr9 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer)>>() + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>() .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer)>(); -late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_ = - objc.registerName("initWithMemoryCapacity:diskCapacity:directoryURL:"); -late final _class_NSURLRequest = objc.getClass("NSURLRequest"); -late final _sel_HTTPMethod = objc.registerName("HTTPMethod"); -late final _sel_allHTTPHeaderFields = objc.registerName("allHTTPHeaderFields"); -late final _sel_valueForHTTPHeaderField_ = - objc.registerName("valueForHTTPHeaderField:"); -late final _sel_HTTPBody = objc.registerName("HTTPBody"); -late final _sel_HTTPBodyStream = objc.registerName("HTTPBodyStream"); -late final _sel_HTTPShouldHandleCookies = - objc.registerName("HTTPShouldHandleCookies"); -late final _sel_HTTPShouldUsePipelining = - objc.registerName("HTTPShouldUsePipelining"); + void Function(ffi.Pointer, + ffi.Pointer, bool)>(); +late final _sel_setHTTPShouldUsePipelining_ = + objc.registerName("setHTTPShouldUsePipelining:"); /// ! -/// @category NSURLRequest(NSHTTPURLRequest) -/// The NSHTTPURLRequest on NSURLRequest provides methods for accessing -/// information specific to HTTP protocol requests. -extension NSHTTPURLRequest on NSURLRequest { +/// @category NSMutableURLRequest(NSMutableHTTPURLRequest) +/// The NSMutableHTTPURLRequest on NSMutableURLRequest provides methods +/// for configuring information specific to HTTP protocol requests. +extension NSMutableHTTPURLRequest on NSMutableURLRequest { /// ! - /// @abstract Returns the HTTP request method of the receiver. - /// @result the HTTP request method of the receiver. - objc.NSString? get HTTPMethod { + /// @abstract Sets the HTTP request method of the receiver. + objc.NSString get HTTPMethod { final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPMethod); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } /// ! - /// @abstract Returns a dictionary containing all the HTTP header fields - /// of the receiver. - /// @result a dictionary containing all the HTTP header fields of the - /// receiver. + /// @abstract Sets the HTTP request method of the receiver. + set HTTPMethod(objc.NSString value) { + return _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setHTTPMethod_, value.ref.pointer); + } + + /// ! + /// @abstract Sets the HTTP header fields of the receiver to the given + /// dictionary. + /// @discussion This method replaces all header fields that may have + /// existed before this method call. + ///

Since HTTP header fields must be string values, each object and + /// key in the dictionary passed to this method must answer YES when + /// sent an -isKindOfClass:[NSString class] message. If either + /// the key or value for a key-value pair answers NO when sent this + /// message, the key-value pair is skipped. objc.NSDictionary? get allHTTPHeaderFields { final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allHTTPHeaderFields); @@ -45998,44 +45111,79 @@ extension NSHTTPURLRequest on NSURLRequest { } /// ! - /// @method valueForHTTPHeaderField: - /// @abstract Returns the value which corresponds to the given header - /// field. Note that, in keeping with the HTTP RFC, HTTP header field - /// names are case-insensitive. - /// @param field the header field name to use for the lookup - /// (case-insensitive). - /// @result the value associated with the given header field, or nil if - /// there is no value associated with the given header field. - objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { - final _ret = _objc_msgSend_62nh5j( - this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + /// @abstract Sets the HTTP header fields of the receiver to the given + /// dictionary. + /// @discussion This method replaces all header fields that may have + /// existed before this method call. + ///

Since HTTP header fields must be string values, each object and + /// key in the dictionary passed to this method must answer YES when + /// sent an -isKindOfClass:[NSString class] message. If either + /// the key or value for a key-value pair answers NO when sent this + /// message, the key-value pair is skipped. + set allHTTPHeaderFields(objc.NSDictionary? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setAllHTTPHeaderFields_, + value?.ref.pointer ?? ffi.nullptr); } /// ! - /// @abstract Returns the request body data of the receiver. - /// @discussion This data is sent as the message body of the request, as - /// in done in an HTTP POST request. - /// @result The request body data of the receiver. - objc.NSData? get HTTPBody { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBody); - return _ret.address == 0 + /// @method setValue:forHTTPHeaderField: + /// @abstract Sets the value of the given HTTP header field. + /// @discussion If a value was previously set for the given header + /// field, that value is replaced with the given value. Note that, in + /// keeping with the HTTP RFC, HTTP header field names are + /// case-insensitive. + /// @param value the header field value. + /// @param field the header field name (case-insensitive). + void setValue_forHTTPHeaderField_(objc.NSString? value, objc.NSString field) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_setValue_forHTTPHeaderField_, + value?.ref.pointer ?? ffi.nullptr, field.ref.pointer); + } + + /// ! + /// @method addValue:forHTTPHeaderField: + /// @abstract Adds an HTTP header field in the current header + /// dictionary. + /// @discussion This method provides a way to add values to header + /// fields incrementally. If a value was previously set for the given + /// header field, the given value is appended to the previously-existing + /// value. The appropriate field delimiter, a comma in the case of HTTP, + /// is added by the implementation, and should not be added to the given + /// value by the caller. Note that, in keeping with the HTTP RFC, HTTP + /// header field names are case-insensitive. + /// @param value the header field value. + /// @param field the header field name (case-insensitive). + void addValue_forHTTPHeaderField_(objc.NSString value, objc.NSString field) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_addValue_forHTTPHeaderField_, + value.ref.pointer, field.ref.pointer); + } + + /// ! + /// @abstract Sets the request body data of the receiver. + /// @discussion This data is sent as the message body of the request, as + /// in done in an HTTP POST request. + objc.NSData? get HTTPBody { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBody); + return _ret.address == 0 ? null : objc.NSData.castFromPointer(_ret, retain: true, release: true); } /// ! - /// @abstract Returns the request body stream of the receiver - /// if any has been set - /// @discussion The stream is returned for examination only; it is - /// not safe for the caller to manipulate the stream in any way. Also - /// note that the HTTPBodyStream and HTTPBody are mutually exclusive - only - /// one can be set on a given request. Also note that the body stream is - /// preserved across copies, but is LOST when the request is coded via the - /// NSCoding protocol - /// @result The request body stream of the receiver. + /// @abstract Sets the request body data of the receiver. + /// @discussion This data is sent as the message body of the request, as + /// in done in an HTTP POST request. + set HTTPBody(objc.NSData? value) { + return _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setHTTPBody_, value?.ref.pointer ?? ffi.nullptr); + } + + /// ! + /// @abstract Sets the request body to be the contents of the given stream. + /// @discussion The provided stream should be unopened; the request will take + /// over the stream's delegate. The entire stream's contents will be + /// transmitted as the HTTP body of the request. Note that the body stream + /// and the body data (set by setHTTPBody:, above) are mutually exclusive + /// - setting one will clear the other. objc.NSInputStream? get HTTPBodyStream { final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBodyStream); return _ret.address == 0 @@ -46044,424 +45192,210 @@ extension NSHTTPURLRequest on NSURLRequest { } /// ! - /// @abstract Determine whether default cookie handling will happen for - /// this request. - /// @discussion NOTE: This value is not used prior to 10.3 - /// @result YES if cookies will be sent with and set for this request; - /// otherwise NO. + /// @abstract Sets the request body to be the contents of the given stream. + /// @discussion The provided stream should be unopened; the request will take + /// over the stream's delegate. The entire stream's contents will be + /// transmitted as the HTTP body of the request. Note that the body stream + /// and the body data (set by setHTTPBody:, above) are mutually exclusive + /// - setting one will clear the other. + set HTTPBodyStream(objc.NSInputStream? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setHTTPBodyStream_, + value?.ref.pointer ?? ffi.nullptr); + } + + /// ! + /// @abstract Decide whether default cookie handling will happen for + /// this request (YES if cookies should be sent with and set for this request; + /// otherwise NO). + /// @discussion The default is YES - in other words, cookies are sent from and + /// stored to the cookie manager by default. + /// NOTE: In releases prior to 10.3, this value is ignored bool get HTTPShouldHandleCookies { return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldHandleCookies); } /// ! - /// @abstract Reports whether the receiver is not expected to wait for the - /// previous response before transmitting. - /// @result YES if the receiver should transmit before the previous response - /// is received. NO if the receiver should wait for the previous response - /// before transmitting. + /// @abstract Decide whether default cookie handling will happen for + /// this request (YES if cookies should be sent with and set for this request; + /// otherwise NO). + /// @discussion The default is YES - in other words, cookies are sent from and + /// stored to the cookie manager by default. + /// NOTE: In releases prior to 10.3, this value is ignored + set HTTPShouldHandleCookies(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setHTTPShouldHandleCookies_, value); + } + + /// ! + /// @abstract Sets whether the request should not wait for the previous response + /// before transmitting (YES if the receiver should transmit before the previous response is + /// received. NO to wait for the previous response before transmitting) + /// @discussion Calling this method with a YES value does not guarantee HTTP + /// pipelining behavior. This method may have no effect if an HTTP proxy is + /// configured, or if the HTTP request uses an unsafe request method (e.g., POST + /// requests will not pipeline). Pipelining behavior also may not begin until + /// the second request on a given TCP connection. There may be other situations + /// where pipelining does not occur even though YES was set. + /// HTTP 1.1 allows the client to send multiple requests to the server without + /// waiting for a response. Though HTTP 1.1 requires support for pipelining, + /// some servers report themselves as being HTTP 1.1 but do not support + /// pipelining (disconnecting, sending resources misordered, omitting part of + /// a resource, etc.). bool get HTTPShouldUsePipelining { return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); } -} - -late final _sel_requestWithURL_ = objc.registerName("requestWithURL:"); -late final _sel_supportsSecureCoding = - objc.registerName("supportsSecureCoding"); - -/// ! -/// @enum NSURLRequestCachePolicy -/// -/// @discussion The NSURLRequestCachePolicy enum defines constants that -/// can be used to specify the type of interactions that take place with -/// the caching system when the URL loading system processes a request. -/// Specifically, these constants cover interactions that have to do -/// with whether already-existing cache data is returned to satisfy a -/// URL load request. -/// -/// @constant NSURLRequestUseProtocolCachePolicy Specifies that the -/// caching logic defined in the protocol implementation, if any, is -/// used for a particular URL load request. This is the default policy -/// for URL load requests. -/// -/// @constant NSURLRequestReloadIgnoringLocalCacheData Specifies that the -/// data for the URL load should be loaded from the origin source. No -/// existing local cache data, regardless of its freshness or validity, -/// should be used to satisfy a URL load request. -/// -/// @constant NSURLRequestReloadIgnoringLocalAndRemoteCacheData Specifies that -/// not only should the local cache data be ignored, but that proxies and -/// other intermediates should be instructed to disregard their caches -/// so far as the protocol allows. -/// -/// @constant NSURLRequestReloadIgnoringCacheData Older name for -/// NSURLRequestReloadIgnoringLocalCacheData. -/// -/// @constant NSURLRequestReturnCacheDataElseLoad Specifies that the -/// existing cache data should be used to satisfy a URL load request, -/// regardless of its age or expiration date. However, if there is no -/// existing data in the cache corresponding to a URL load request, -/// the URL is loaded from the origin source. -/// -/// @constant NSURLRequestReturnCacheDataDontLoad Specifies that the -/// existing cache data should be used to satisfy a URL load request, -/// regardless of its age or expiration date. However, if there is no -/// existing data in the cache corresponding to a URL load request, no -/// attempt is made to load the URL from the origin source, and the -/// load is considered to have failed. This constant specifies a -/// behavior that is similar to an "offline" mode. -/// -/// @constant NSURLRequestReloadRevalidatingCacheData Specifies that -/// the existing cache data may be used provided the origin source -/// confirms its validity, otherwise the URL is loaded from the -/// origin source. -enum NSURLRequestCachePolicy { - NSURLRequestUseProtocolCachePolicy(0), - NSURLRequestReloadIgnoringLocalCacheData(1), - NSURLRequestReloadIgnoringLocalAndRemoteCacheData(4), - NSURLRequestReturnCacheDataElseLoad(2), - NSURLRequestReturnCacheDataDontLoad(3), - NSURLRequestReloadRevalidatingCacheData(5); - - static const NSURLRequestReloadIgnoringCacheData = - NSURLRequestReloadIgnoringLocalCacheData; - - final int value; - const NSURLRequestCachePolicy(this.value); - - static NSURLRequestCachePolicy fromValue(int value) => switch (value) { - 0 => NSURLRequestUseProtocolCachePolicy, - 1 => NSURLRequestReloadIgnoringLocalCacheData, - 4 => NSURLRequestReloadIgnoringLocalAndRemoteCacheData, - 2 => NSURLRequestReturnCacheDataElseLoad, - 3 => NSURLRequestReturnCacheDataDontLoad, - 5 => NSURLRequestReloadRevalidatingCacheData, - _ => throw ArgumentError( - "Unknown value for NSURLRequestCachePolicy: $value"), - }; - @override - String toString() { - if (this == NSURLRequestReloadIgnoringLocalCacheData) - return "NSURLRequestCachePolicy.NSURLRequestReloadIgnoringLocalCacheData, NSURLRequestCachePolicy.NSURLRequestReloadIgnoringCacheData"; - return super.toString(); + /// ! + /// @abstract Sets whether the request should not wait for the previous response + /// before transmitting (YES if the receiver should transmit before the previous response is + /// received. NO to wait for the previous response before transmitting) + /// @discussion Calling this method with a YES value does not guarantee HTTP + /// pipelining behavior. This method may have no effect if an HTTP proxy is + /// configured, or if the HTTP request uses an unsafe request method (e.g., POST + /// requests will not pipeline). Pipelining behavior also may not begin until + /// the second request on a given TCP connection. There may be other situations + /// where pipelining does not occur even though YES was set. + /// HTTP 1.1 allows the client to send multiple requests to the server without + /// waiting for a response. Though HTTP 1.1 requires support for pipelining, + /// some servers report themselves as being HTTP 1.1 but do not support + /// pipelining (disconnecting, sending resources misordered, omitting part of + /// a resource, etc.). + set HTTPShouldUsePipelining(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setHTTPShouldUsePipelining_, value); } } -typedef NSTimeInterval = ffi.Double; -typedef DartNSTimeInterval = double; -late final _sel_requestWithURL_cachePolicy_timeoutInterval_ = - objc.registerName("requestWithURL:cachePolicy:timeoutInterval:"); -final _objc_msgSend_3phu9v = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Double)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - double)>(); -late final _sel_initWithURL_ = objc.registerName("initWithURL:"); -late final _sel_initWithURL_cachePolicy_timeoutInterval_ = - objc.registerName("initWithURL:cachePolicy:timeoutInterval:"); -late final _sel_URL = objc.registerName("URL"); -late final _sel_cachePolicy = objc.registerName("cachePolicy"); -final _objc_msgSend_8jm3uo = objc.msgSendPointer +late final _sel_setURL_ = objc.registerName("setURL:"); +late final _sel_setCachePolicy_ = objc.registerName("setCachePolicy:"); +final _objc_msgSend_1yjxuv2 = objc.msgSendPointer .cast< ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, - ffi.Pointer)>>() + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>() .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_timeoutInterval = objc.registerName("timeoutInterval"); -final _objc_msgSend_1ukqyt8 = objc.msgSendPointer + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_setTimeoutInterval_ = objc.registerName("setTimeoutInterval:"); +final _objc_msgSend_hwm8nu = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer)>>() + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>() .asFunction< - double Function( - ffi.Pointer, ffi.Pointer)>(); -final _objc_msgSend_1ukqyt8Fpret = objc.msgSendFpretPointer + void Function(ffi.Pointer, + ffi.Pointer, double)>(); +late final _sel_setMainDocumentURL_ = objc.registerName("setMainDocumentURL:"); +late final _sel_setNetworkServiceType_ = + objc.registerName("setNetworkServiceType:"); +final _objc_msgSend_1mse4s1 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer)>>() + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>() .asFunction< - double Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_mainDocumentURL = objc.registerName("mainDocumentURL"); - -/// ! -/// @enum NSURLRequestNetworkServiceType -/// -/// @discussion The NSURLRequestNetworkServiceType enum defines constants that -/// can be used to specify the service type to associate with this request. The -/// service type is used to provide the networking layers a hint of the purpose -/// of the request. -/// -/// @constant NSURLNetworkServiceTypeDefault Is the default value for an NSURLRequest -/// when created. This value should be left unchanged for the vast majority of requests. -/// -/// @constant NSURLNetworkServiceTypeVoIP Specifies that the request is for voice over IP -/// control traffic. -/// -/// @constant NSURLNetworkServiceTypeVideo Specifies that the request is for video -/// traffic. -/// -/// @constant NSURLNetworkServiceTypeBackground Specifies that the request is for background -/// traffic (such as a file download). -/// -/// @constant NSURLNetworkServiceTypeVoice Specifies that the request is for voice data. -/// -/// @constant NSURLNetworkServiceTypeResponsiveData Specifies that the request is for responsive (time sensitive) data. -/// -/// @constant NSURLNetworkServiceTypeAVStreaming Specifies that the request is streaming audio/video data. -/// -/// @constant NSURLNetworkServiceTypeResponsiveAV Specifies that the request is for responsive (time sensitive) audio/video data. -/// -/// @constant NSURLNetworkServiceTypeCallSignaling Specifies that the request is for call signaling. -enum NSURLRequestNetworkServiceType { - /// Standard internet traffic - NSURLNetworkServiceTypeDefault(0), - - /// Voice over IP control traffic - NSURLNetworkServiceTypeVoIP(1), - - /// Video traffic - NSURLNetworkServiceTypeVideo(2), - - /// Background traffic - NSURLNetworkServiceTypeBackground(3), - - /// Voice data - NSURLNetworkServiceTypeVoice(4), - - /// Responsive data - NSURLNetworkServiceTypeResponsiveData(6), - - /// Multimedia Audio/Video Streaming - NSURLNetworkServiceTypeAVStreaming(8), - - /// Responsive Multimedia Audio/Video - NSURLNetworkServiceTypeResponsiveAV(9), - - /// Call Signaling - NSURLNetworkServiceTypeCallSignaling(11); - - final int value; - const NSURLRequestNetworkServiceType(this.value); - - static NSURLRequestNetworkServiceType fromValue(int value) => switch (value) { - 0 => NSURLNetworkServiceTypeDefault, - 1 => NSURLNetworkServiceTypeVoIP, - 2 => NSURLNetworkServiceTypeVideo, - 3 => NSURLNetworkServiceTypeBackground, - 4 => NSURLNetworkServiceTypeVoice, - 6 => NSURLNetworkServiceTypeResponsiveData, - 8 => NSURLNetworkServiceTypeAVStreaming, - 9 => NSURLNetworkServiceTypeResponsiveAV, - 11 => NSURLNetworkServiceTypeCallSignaling, - _ => throw ArgumentError( - "Unknown value for NSURLRequestNetworkServiceType: $value"), - }; -} - -late final _sel_networkServiceType = objc.registerName("networkServiceType"); -final _objc_msgSend_t4uaw1 = objc.msgSendPointer + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_setAllowsCellularAccess_ = + objc.registerName("setAllowsCellularAccess:"); +late final _sel_setAllowsExpensiveNetworkAccess_ = + objc.registerName("setAllowsExpensiveNetworkAccess:"); +late final _sel_setAllowsConstrainedNetworkAccess_ = + objc.registerName("setAllowsConstrainedNetworkAccess:"); +late final _sel_setAssumesHTTP3Capable_ = + objc.registerName("setAssumesHTTP3Capable:"); +late final _sel_setAttribution_ = objc.registerName("setAttribution:"); +final _objc_msgSend_1nw1jep = objc.msgSendPointer .cast< ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, - ffi.Pointer)>>() + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>() .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_allowsCellularAccess = - objc.registerName("allowsCellularAccess"); -late final _sel_allowsExpensiveNetworkAccess = - objc.registerName("allowsExpensiveNetworkAccess"); -late final _sel_allowsConstrainedNetworkAccess = - objc.registerName("allowsConstrainedNetworkAccess"); -late final _sel_assumesHTTP3Capable = objc.registerName("assumesHTTP3Capable"); + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_setRequiresDNSSECValidation_ = + objc.registerName("setRequiresDNSSECValidation:"); /// ! -/// @enum NSURLRequestAttribution -/// -/// @discussion The NSURLRequestAttribution enum is used to indicate whether the -/// user or developer specified the URL. +/// @class NSMutableURLRequest /// -/// @constant NSURLRequestAttributionDeveloper Indicates that the URL was specified -/// by the developer. This is the default value for an NSURLRequest when created. +/// @abstract An NSMutableURLRequest object represents a mutable URL load +/// request in a manner independent of protocol and URL scheme. /// -/// @constant NSURLRequestAttributionUser Indicates that the URL was specified by -/// the user. -enum NSURLRequestAttribution { - NSURLRequestAttributionDeveloper(0), - NSURLRequestAttributionUser(1); - - final int value; - const NSURLRequestAttribution(this.value); - - static NSURLRequestAttribution fromValue(int value) => switch (value) { - 0 => NSURLRequestAttributionDeveloper, - 1 => NSURLRequestAttributionUser, - _ => throw ArgumentError( - "Unknown value for NSURLRequestAttribution: $value"), - }; -} - -late final _sel_attribution = objc.registerName("attribution"); -final _objc_msgSend_i3avs9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_requiresDNSSECValidation = - objc.registerName("requiresDNSSECValidation"); -late final _sel_init = objc.registerName("init"); -late final _sel_new = objc.registerName("new"); -late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); -final _objc_msgSend_hzlb60 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); -late final _sel_alloc = objc.registerName("alloc"); - -/// NSURLRequest -class NSURLRequest extends objc.NSObject { - NSURLRequest._(ffi.Pointer pointer, +/// @discussion This specialization of NSURLRequest is provided to aid +/// developers who may find it more convenient to mutate a single request +/// object for a series of URL loads instead of creating an immutable +/// NSURLRequest for each load. This programming model is supported by +/// the following contract stipulation between NSMutableURLRequest and +/// NSURLConnection: NSURLConnection makes a deep copy of each +/// NSMutableURLRequest object passed to one of its initializers. +///

NSMutableURLRequest is designed to be extended to support +/// protocol-specific data by adding categories to access a property +/// object provided in an interface targeted at protocol implementors. +///

    +///
  • Protocol implementors should direct their attention to the +/// NSMutableURLRequestExtensibility category on +/// NSMutableURLRequest for more information on how to provide +/// extensions on NSMutableURLRequest to support protocol-specific +/// request information. +///
  • Clients of this API who wish to create NSMutableURLRequest +/// objects to load URL content should consult the protocol-specific +/// NSMutableURLRequest categories that are available. The +/// NSMutableHTTPURLRequest category on NSMutableURLRequest is an +/// example. +///
+class NSMutableURLRequest extends NSURLRequest { + NSMutableURLRequest._(ffi.Pointer pointer, {bool retain = false, bool release = false}) : super.castFromPointer(pointer, retain: retain, release: release); - /// Constructs a [NSURLRequest] that points to the same underlying object as [other]. - NSURLRequest.castFrom(objc.ObjCObjectBase other) + /// Constructs a [NSMutableURLRequest] that points to the same underlying object as [other]. + NSMutableURLRequest.castFrom(objc.ObjCObjectBase other) : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSURLRequest] that wraps the given raw object pointer. - NSURLRequest.castFromPointer(ffi.Pointer other, + /// Constructs a [NSMutableURLRequest] that wraps the given raw object pointer. + NSMutableURLRequest.castFromPointer(ffi.Pointer other, {bool retain = false, bool release = false}) : this._(other, retain: retain, release: release); - /// Returns whether [obj] is an instance of [NSURLRequest]. + /// Returns whether [obj] is an instance of [NSMutableURLRequest]. static bool isInstance(objc.ObjCObjectBase obj) { return _objc_msgSend_69e0x1( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLRequest); + obj.ref.pointer, _sel_isKindOfClass_, _class_NSMutableURLRequest); } /// ! - /// @method requestWithURL: - /// @abstract Allocates and initializes an NSURLRequest with the given - /// URL. - /// @discussion Default values are used for cache policy - /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 - /// seconds). - /// @param URL The URL for the request. - /// @result A newly-created and autoreleased NSURLRequest instance. - static NSURLRequest requestWithURL_(objc.NSURL URL) { - final _ret = _objc_msgSend_62nh5j( - _class_NSURLRequest, _sel_requestWithURL_, URL.ref.pointer); - return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + /// @abstract The URL of the receiver. + objc.NSURL? get URL { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_URL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); } - /// supportsSecureCoding - static bool getSupportsSecureCoding() { - return _objc_msgSend_91o635(_class_NSURLRequest, _sel_supportsSecureCoding); + /// ! + /// @abstract The URL of the receiver. + set URL(objc.NSURL? value) { + return _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setURL_, value?.ref.pointer ?? ffi.nullptr); } /// ! - /// @method requestWithURL:cachePolicy:timeoutInterval: - /// @abstract Allocates and initializes a NSURLRequest with the given - /// URL and cache policy. - /// @param URL The URL for the request. - /// @param cachePolicy The cache policy for the request. - /// @param timeoutInterval The timeout interval for the request. See the - /// commentary for the timeoutInterval for more information on - /// timeout intervals. - /// @result A newly-created and autoreleased NSURLRequest instance. - static NSURLRequest requestWithURL_cachePolicy_timeoutInterval_( - objc.NSURL URL, - NSURLRequestCachePolicy cachePolicy, - DartNSTimeInterval timeoutInterval) { - final _ret = _objc_msgSend_3phu9v( - _class_NSURLRequest, - _sel_requestWithURL_cachePolicy_timeoutInterval_, - URL.ref.pointer, - cachePolicy.value, - timeoutInterval); - return NSURLRequest.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @method initWithURL: - /// @abstract Initializes an NSURLRequest with the given URL. - /// @discussion Default values are used for cache policy - /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 - /// seconds). - /// @param URL The URL for the request. - /// @result An initialized NSURLRequest. - NSURLRequest initWithURL_(objc.NSURL URL) { - final _ret = _objc_msgSend_62nh5j( - this.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); - } - - /// ! - /// @method initWithURL: - /// @abstract Initializes an NSURLRequest with the given URL and - /// cache policy. - /// @discussion This is the designated initializer for the - /// NSURLRequest class. - /// @param URL The URL for the request. - /// @param cachePolicy The cache policy for the request. - /// @param timeoutInterval The timeout interval for the request. See the - /// commentary for the timeoutInterval for more information on - /// timeout intervals. - /// @result An initialized NSURLRequest. - NSURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, - NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { - final _ret = _objc_msgSend_3phu9v( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_cachePolicy_timeoutInterval_, - URL.ref.pointer, - cachePolicy.value, - timeoutInterval); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); - } - - /// ! - /// @abstract Returns the URL of the receiver. - /// @result The URL of the receiver. - objc.NSURL? get URL { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_URL); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Returns the cache policy of the receiver. - /// @result The cache policy of the receiver. + /// @abstract The cache policy of the receiver. NSURLRequestCachePolicy get cachePolicy { final _ret = _objc_msgSend_8jm3uo(this.ref.pointer, _sel_cachePolicy); return NSURLRequestCachePolicy.fromValue(_ret); } /// ! - /// @abstract Returns the timeout interval of the receiver. + /// @abstract The cache policy of the receiver. + set cachePolicy(NSURLRequestCachePolicy value) { + return _objc_msgSend_1yjxuv2( + this.ref.pointer, _sel_setCachePolicy_, value.value); + } + + /// ! + /// @abstract Sets the timeout interval of the receiver. /// @discussion The timeout interval specifies the limit on the idle /// interval allotted to a request in the process of loading. The "idle /// interval" is defined as the period of time that has passed since the @@ -46472,7 +45406,6 @@ class NSURLRequest extends objc.NSObject { /// becomes greater than or equal to the timeout interval, the request /// is considered to have timed out. This timeout interval is measured /// in seconds. - /// @result The timeout interval of the receiver. DartNSTimeInterval get timeoutInterval { return objc.useMsgSendVariants ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_timeoutInterval) @@ -46480,12 +45413,31 @@ class NSURLRequest extends objc.NSObject { } /// ! - /// @abstract The main document URL associated with this load. - /// @discussion This URL is used for the cookie "same domain as main - /// document" policy, and attributing the request as a sub-resource - /// of a user-specified URL. There may also be other future uses. - /// See setMainDocumentURL: - /// @result The main document URL. + /// @abstract Sets the timeout interval of the receiver. + /// @discussion The timeout interval specifies the limit on the idle + /// interval allotted to a request in the process of loading. The "idle + /// interval" is defined as the period of time that has passed since the + /// last instance of load activity occurred for a request that is in the + /// process of loading. Hence, when an instance of load activity occurs + /// (e.g. bytes are received from the network for a request), the idle + /// interval for a request is reset to 0. If the idle interval ever + /// becomes greater than or equal to the timeout interval, the request + /// is considered to have timed out. This timeout interval is measured + /// in seconds. + set timeoutInterval(DartNSTimeInterval value) { + return _objc_msgSend_hwm8nu( + this.ref.pointer, _sel_setTimeoutInterval_, value); + } + + /// ! + /// @abstract Sets the main document URL + /// @discussion The caller should pass the URL for an appropriate main + /// document, if known. For example, when loading a web page, the URL + /// of the main html document for the top-level frame should be + /// passed. This main document is used to implement the cookie "only + /// from same domain as main document" policy, attributing this request + /// as a sub-resource of a user-specified URL, and possibly other things + /// in the future. objc.NSURL? get mainDocumentURL { final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_mainDocumentURL); return _ret.address == 0 @@ -46494,10 +45446,23 @@ class NSURLRequest extends objc.NSObject { } /// ! - /// @abstract Returns the NSURLRequestNetworkServiceType associated with this request. - /// @discussion This will return NSURLNetworkServiceTypeDefault for requests that have - /// not explicitly set a networkServiceType (using the setNetworkServiceType method). - /// @result The NSURLRequestNetworkServiceType associated with this request. + /// @abstract Sets the main document URL + /// @discussion The caller should pass the URL for an appropriate main + /// document, if known. For example, when loading a web page, the URL + /// of the main html document for the top-level frame should be + /// passed. This main document is used to implement the cookie "only + /// from same domain as main document" policy, attributing this request + /// as a sub-resource of a user-specified URL, and possibly other things + /// in the future. + set mainDocumentURL(objc.NSURL? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setMainDocumentURL_, + value?.ref.pointer ?? ffi.nullptr); + } + + /// ! + /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request + /// @discussion This method is used to provide the network layers with a hint as to the purpose + /// of the request. Most clients should not need to use this method. NSURLRequestNetworkServiceType get networkServiceType { final _ret = _objc_msgSend_t4uaw1(this.ref.pointer, _sel_networkServiceType); @@ -46505,34 +45470,73 @@ class NSURLRequest extends objc.NSObject { } /// ! - /// @abstract returns whether a connection created with this request is allowed to use + /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request + /// @discussion This method is used to provide the network layers with a hint as to the purpose + /// of the request. Most clients should not need to use this method. + set networkServiceType(NSURLRequestNetworkServiceType value) { + return _objc_msgSend_1mse4s1( + this.ref.pointer, _sel_setNetworkServiceType_, value.value); + } + + /// ! + /// @abstract sets whether a connection created with this request is allowed to use /// the built in cellular radios (if present). - /// @result YES if the receiver is allowed to use the built in cellular radios to - /// satisfy the request, NO otherwise. + /// @discussion NO if the receiver should not be allowed to use the built in + /// cellular radios to satisfy the request, YES otherwise. The default is YES. bool get allowsCellularAccess { return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); } /// ! - /// @abstract returns whether a connection created with this request is allowed to use + /// @abstract sets whether a connection created with this request is allowed to use + /// the built in cellular radios (if present). + /// @discussion NO if the receiver should not be allowed to use the built in + /// cellular radios to satisfy the request, YES otherwise. The default is YES. + set allowsCellularAccess(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setAllowsCellularAccess_, value); + } + + /// ! + /// @abstract sets whether a connection created with this request is allowed to use /// network interfaces which have been marked as expensive. - /// @result YES if the receiver is allowed to use an interface marked as expensive to - /// satisfy the request, NO otherwise. + /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to + /// satisfy the request, YES otherwise. bool get allowsExpensiveNetworkAccess { return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsExpensiveNetworkAccess); } /// ! - /// @abstract returns whether a connection created with this request is allowed to use + /// @abstract sets whether a connection created with this request is allowed to use + /// network interfaces which have been marked as expensive. + /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to + /// satisfy the request, YES otherwise. + set allowsExpensiveNetworkAccess(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setAllowsExpensiveNetworkAccess_, value); + } + + /// ! + /// @abstract sets whether a connection created with this request is allowed to use /// network interfaces which have been marked as constrained. - /// @result YES if the receiver is allowed to use an interface marked as constrained to - /// satisfy the request, NO otherwise. + /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to + /// satisfy the request, YES otherwise. bool get allowsConstrainedNetworkAccess { return _objc_msgSend_91o635( this.ref.pointer, _sel_allowsConstrainedNetworkAccess); } + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// network interfaces which have been marked as constrained. + /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to + /// satisfy the request, YES otherwise. + set allowsConstrainedNetworkAccess(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setAllowsConstrainedNetworkAccess_, value); + } + /// ! /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC /// racing without HTTP/3 service discovery. @@ -46543,15 +45547,33 @@ class NSURLRequest extends objc.NSObject { } /// ! - /// @abstract Returns the NSURLRequestAttribution associated with this request. - /// @discussion This will return NSURLRequestAttributionDeveloper for requests that - /// have not explicitly set an attribution. - /// @result The NSURLRequestAttribution associated with this request. + /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC + /// racing without HTTP/3 service discovery. + /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. + /// The default may be YES in a future OS update. + set assumesHTTP3Capable(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setAssumesHTTP3Capable_, value); + } + + /// ! + /// @abstract Sets the NSURLRequestAttribution to associate with this request. + /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the + /// user. Defaults to NSURLRequestAttributionDeveloper. NSURLRequestAttribution get attribution { final _ret = _objc_msgSend_i3avs9(this.ref.pointer, _sel_attribution); return NSURLRequestAttribution.fromValue(_ret); } + /// ! + /// @abstract Sets the NSURLRequestAttribution to associate with this request. + /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the + /// user. Defaults to NSURLRequestAttributionDeveloper. + set attribution(NSURLRequestAttribution value) { + return _objc_msgSend_1nw1jep( + this.ref.pointer, _sel_setAttribution_, value.value); + } + /// ! /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, @@ -46561,1508 +45583,1027 @@ class NSURLRequest extends objc.NSObject { this.ref.pointer, _sel_requiresDNSSECValidation); } + /// ! + /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. + /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, + /// No otherwise. Defaults to NO. + set requiresDNSSECValidation(bool value) { + return _objc_msgSend_1s56lr9( + this.ref.pointer, _sel_setRequiresDNSSECValidation_, value); + } + + /// ! + /// @method requestWithURL: + /// @abstract Allocates and initializes an NSURLRequest with the given + /// URL. + /// @discussion Default values are used for cache policy + /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 + /// seconds). + /// @param URL The URL for the request. + /// @result A newly-created and autoreleased NSURLRequest instance. + static NSMutableURLRequest requestWithURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_62nh5j( + _class_NSMutableURLRequest, _sel_requestWithURL_, URL.ref.pointer); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } + + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_91o635( + _class_NSMutableURLRequest, _sel_supportsSecureCoding); + } + + /// ! + /// @method requestWithURL:cachePolicy:timeoutInterval: + /// @abstract Allocates and initializes a NSURLRequest with the given + /// URL and cache policy. + /// @param URL The URL for the request. + /// @param cachePolicy The cache policy for the request. + /// @param timeoutInterval The timeout interval for the request. See the + /// commentary for the timeoutInterval for more information on + /// timeout intervals. + /// @result A newly-created and autoreleased NSURLRequest instance. + static NSMutableURLRequest requestWithURL_cachePolicy_timeoutInterval_( + objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, + DartNSTimeInterval timeoutInterval) { + final _ret = _objc_msgSend_3phu9v( + _class_NSMutableURLRequest, + _sel_requestWithURL_cachePolicy_timeoutInterval_, + URL.ref.pointer, + cachePolicy.value, + timeoutInterval); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } + + /// ! + /// @method initWithURL: + /// @abstract Initializes an NSURLRequest with the given URL. + /// @discussion Default values are used for cache policy + /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 + /// seconds). + /// @param URL The URL for the request. + /// @result An initialized NSURLRequest. + NSMutableURLRequest initWithURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_62nh5j( + this.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } + + /// ! + /// @method initWithURL: + /// @abstract Initializes an NSURLRequest with the given URL and + /// cache policy. + /// @discussion This is the designated initializer for the + /// NSURLRequest class. + /// @param URL The URL for the request. + /// @param cachePolicy The cache policy for the request. + /// @param timeoutInterval The timeout interval for the request. See the + /// commentary for the timeoutInterval for more information on + /// timeout intervals. + /// @result An initialized NSURLRequest. + NSMutableURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { + final _ret = _objc_msgSend_3phu9v( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_cachePolicy_timeoutInterval_, + URL.ref.pointer, + cachePolicy.value, + timeoutInterval); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } + /// init - NSURLRequest init() { + NSMutableURLRequest init() { final _ret = _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); } /// new - static NSURLRequest new1() { - final _ret = _objc_msgSend_1x359cv(_class_NSURLRequest, _sel_new); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + static NSMutableURLRequest new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSMutableURLRequest, _sel_new); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); } /// allocWithZone: - static NSURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_hzlb60(_class_NSURLRequest, _sel_allocWithZone_, zone); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + static NSMutableURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_hzlb60( + _class_NSMutableURLRequest, _sel_allocWithZone_, zone); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); } /// alloc - static NSURLRequest alloc() { - final _ret = _objc_msgSend_1x359cv(_class_NSURLRequest, _sel_alloc); - return NSURLRequest.castFromPointer(_ret, retain: false, release: true); + static NSMutableURLRequest alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSMutableURLRequest, _sel_alloc); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); } /// self - NSURLRequest self() { + NSMutableURLRequest self() { final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); - return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); } /// retain - NSURLRequest retain() { + NSMutableURLRequest retain() { final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); - return NSURLRequest.castFromPointer(_ret, retain: true, release: true); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); } /// autorelease - NSURLRequest autorelease() { + NSMutableURLRequest autorelease() { final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); - return NSURLRequest.castFromPointer(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); } /// initWithCoder: - NSURLRequest? initWithCoder_(objc.NSCoder coder) { + NSMutableURLRequest? initWithCoder_(objc.NSCoder coder) { final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), _sel_initWithCoder_, coder.ref.pointer); return _ret.address == 0 ? null - : NSURLRequest.castFromPointer(_ret, retain: false, release: true); + : NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); } } -late final _sel_cachedResponseForRequest_ = - objc.registerName("cachedResponseForRequest:"); -late final _sel_storeCachedResponse_forRequest_ = - objc.registerName("storeCachedResponse:forRequest:"); -late final _sel_removeCachedResponseForRequest_ = - objc.registerName("removeCachedResponseForRequest:"); -late final _sel_removeAllCachedResponses = - objc.registerName("removeAllCachedResponses"); -late final _sel_removeCachedResponsesSinceDate_ = - objc.registerName("removeCachedResponsesSinceDate:"); -late final _sel_memoryCapacity = objc.registerName("memoryCapacity"); -late final _sel_setMemoryCapacity_ = objc.registerName("setMemoryCapacity:"); -final _objc_msgSend_1i9r4xy = objc.msgSendPointer +enum NSHTTPCookieAcceptPolicy { + NSHTTPCookieAcceptPolicyAlways(0), + NSHTTPCookieAcceptPolicyNever(1), + NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain(2); + + final int value; + const NSHTTPCookieAcceptPolicy(this.value); + + static NSHTTPCookieAcceptPolicy fromValue(int value) => switch (value) { + 0 => NSHTTPCookieAcceptPolicyAlways, + 1 => NSHTTPCookieAcceptPolicyNever, + 2 => NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain, + _ => throw ArgumentError( + "Unknown value for NSHTTPCookieAcceptPolicy: $value"), + }; +} + +/// WARNING: NSHTTPCookieStorage is a stub. To generate bindings for this class, include +/// NSHTTPCookieStorage in your config's objc-interfaces list. +/// +/// NSHTTPCookieStorage +class NSHTTPCookieStorage extends objc.NSObject { + NSHTTPCookieStorage._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSHTTPCookieStorage] that points to the same underlying object as [other]. + NSHTTPCookieStorage.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSHTTPCookieStorage] that wraps the given raw object pointer. + NSHTTPCookieStorage.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +late final _class_NSHTTPCookieStorage = objc.getClass("NSHTTPCookieStorage"); +late final _class_NSURLSessionTask = objc.getClass("NSURLSessionTask"); +late final _sel_taskIdentifier = objc.registerName("taskIdentifier"); +late final _sel_originalRequest = objc.registerName("originalRequest"); +late final _sel_currentRequest = objc.registerName("currentRequest"); +late final _class_NSURLResponse = objc.getClass("NSURLResponse"); +late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_ = + objc.registerName( + "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); +final _objc_msgSend_13tl325 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>() + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Long, + ffi.Pointer)>>() .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_diskCapacity = objc.registerName("diskCapacity"); -late final _sel_setDiskCapacity_ = objc.registerName("setDiskCapacity:"); -late final _sel_currentMemoryUsage = objc.registerName("currentMemoryUsage"); -late final _sel_currentDiskUsage = objc.registerName("currentDiskUsage"); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_MIMEType = objc.registerName("MIMEType"); +late final _sel_expectedContentLength = + objc.registerName("expectedContentLength"); +final _objc_msgSend_1k101e3 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.LongLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_textEncodingName = objc.registerName("textEncodingName"); +late final _sel_suggestedFilename = objc.registerName("suggestedFilename"); -/// NSURLCache -class NSURLCache extends objc.NSObject { - NSURLCache._(ffi.Pointer pointer, +/// NSURLResponse +class NSURLResponse extends objc.NSObject { + NSURLResponse._(ffi.Pointer pointer, {bool retain = false, bool release = false}) : super.castFromPointer(pointer, retain: retain, release: release); - /// Constructs a [NSURLCache] that points to the same underlying object as [other]. - NSURLCache.castFrom(objc.ObjCObjectBase other) + /// Constructs a [NSURLResponse] that points to the same underlying object as [other]. + NSURLResponse.castFrom(objc.ObjCObjectBase other) : this._(other.ref.pointer, retain: true, release: true); - /// Constructs a [NSURLCache] that wraps the given raw object pointer. - NSURLCache.castFromPointer(ffi.Pointer other, + /// Constructs a [NSURLResponse] that wraps the given raw object pointer. + NSURLResponse.castFromPointer(ffi.Pointer other, {bool retain = false, bool release = false}) : this._(other, retain: retain, release: release); - /// Returns whether [obj] is an instance of [NSURLCache]. + /// Returns whether [obj] is an instance of [NSURLResponse]. static bool isInstance(objc.ObjCObjectBase obj) { return _objc_msgSend_69e0x1( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLCache); + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLResponse); } /// ! - /// @property sharedURLCache - /// @abstract Returns the shared NSURLCache instance or - /// sets the NSURLCache instance shared by all clients of - /// the current process. This will be the new object returned when - /// calls to the sharedURLCache method are made. - /// @discussion Unless set explicitly through a call to - /// +setSharedURLCache:, this method returns an NSURLCache - /// instance created with the following default values: - ///
    - ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) - ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) - ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) - ///
- ///

Users who do not have special caching requirements or - /// constraints should find the default shared cache instance - /// acceptable. If this default shared cache instance is not - /// acceptable, +setSharedURLCache: can be called to set a - /// different NSURLCache instance to be returned from this method. - /// Callers should take care to ensure that the setter is called - /// at a time when no other caller has a reference to the previously-set - /// shared URL cache. This is to prevent storing cache data from - /// becoming unexpectedly unretrievable. - /// @result the shared NSURLCache instance. - static NSURLCache getSharedURLCache() { - final _ret = _objc_msgSend_1x359cv(_class_NSURLCache, _sel_sharedURLCache); - return NSURLCache.castFromPointer(_ret, retain: true, release: true); + /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: + /// @abstract Initialize an NSURLResponse with the provided values. + /// @param URL the URL + /// @param MIMEType the MIME content type of the response + /// @param length the expected content length of the associated data + /// @param name the name of the text encoding for the associated data, if applicable, else nil + /// @result The initialized NSURLResponse. + /// @discussion This is the designated initializer for NSURLResponse. + NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( + objc.NSURL URL, + objc.NSString? MIMEType, + DartNSInteger length, + objc.NSString? name) { + final _ret = _objc_msgSend_13tl325( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, + URL.ref.pointer, + MIMEType?.ref.pointer ?? ffi.nullptr, + length, + name?.ref.pointer ?? ffi.nullptr); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } /// ! - /// @property sharedURLCache - /// @abstract Returns the shared NSURLCache instance or - /// sets the NSURLCache instance shared by all clients of - /// the current process. This will be the new object returned when - /// calls to the sharedURLCache method are made. - /// @discussion Unless set explicitly through a call to - /// +setSharedURLCache:, this method returns an NSURLCache - /// instance created with the following default values: - ///

    - ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) - ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) - ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) - ///
- ///

Users who do not have special caching requirements or - /// constraints should find the default shared cache instance - /// acceptable. If this default shared cache instance is not - /// acceptable, +setSharedURLCache: can be called to set a - /// different NSURLCache instance to be returned from this method. - /// Callers should take care to ensure that the setter is called - /// at a time when no other caller has a reference to the previously-set - /// shared URL cache. This is to prevent storing cache data from - /// becoming unexpectedly unretrievable. - /// @result the shared NSURLCache instance. - static void setSharedURLCache(NSURLCache value) { - return _objc_msgSend_1jdvcbf( - _class_NSURLCache, _sel_setSharedURLCache_, value.ref.pointer); - } - - /// ! - /// @method initWithMemoryCapacity:diskCapacity:diskPath: - /// @abstract Initializes an NSURLCache with the given capacity and - /// path. - /// @discussion The returned NSURLCache is backed by disk, so - /// developers can be more liberal with space when choosing the - /// capacity for this kind of cache. A disk cache measured in the tens - /// of megabytes should be acceptable in most cases. - /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. - /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. - /// @param path the path on disk where the cache data is stored. - /// @result an initialized NSURLCache, with the given capacity, backed - /// by disk. - NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( - DartNSUInteger memoryCapacity, - DartNSUInteger diskCapacity, - objc.NSString? path) { - final _ret = _objc_msgSend_1dlfwfh( - this.ref.retainAndReturnPointer(), - _sel_initWithMemoryCapacity_diskCapacity_diskPath_, - memoryCapacity, - diskCapacity, - path?.ref.pointer ?? ffi.nullptr); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// ! - /// @method initWithMemoryCapacity:diskCapacity:directoryURL: - /// @abstract Initializes an NSURLCache with the given capacity and directory. - /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. Or 0 to disable memory cache. - /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. Or 0 to disable disk cache. - /// @param directoryURL the path to a directory on disk where the cache data is stored. Or nil for default directory. - /// @result an initialized NSURLCache, with the given capacity, optionally backed by disk. - NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( - DartNSUInteger memoryCapacity, - DartNSUInteger diskCapacity, - objc.NSURL? directoryURL) { - final _ret = _objc_msgSend_1dlfwfh( - this.ref.retainAndReturnPointer(), - _sel_initWithMemoryCapacity_diskCapacity_directoryURL_, - memoryCapacity, - diskCapacity, - directoryURL?.ref.pointer ?? ffi.nullptr); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); - } - - /// ! - /// @method cachedResponseForRequest: - /// @abstract Returns the NSCachedURLResponse stored in the cache with - /// the given request. - /// @discussion The method returns nil if there is no - /// NSCachedURLResponse stored using the given request. - /// @param request the NSURLRequest to use as a key for the lookup. - /// @result The NSCachedURLResponse stored in the cache with the given - /// request, or nil if there is no NSCachedURLResponse stored with the - /// given request. - NSCachedURLResponse? cachedResponseForRequest_(NSURLRequest request) { - final _ret = _objc_msgSend_62nh5j( - this.ref.pointer, _sel_cachedResponseForRequest_, request.ref.pointer); + /// @abstract Returns the URL of the receiver. + /// @result The URL of the receiver. + objc.NSURL? get URL { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_URL); return _ret.address == 0 ? null - : NSCachedURLResponse.castFromPointer(_ret, - retain: true, release: true); - } - - /// ! - /// @method storeCachedResponse:forRequest: - /// @abstract Stores the given NSCachedURLResponse in the cache using - /// the given request. - /// @param cachedResponse The cached response to store. - /// @param request the NSURLRequest to use as a key for the storage. - void storeCachedResponse_forRequest_( - NSCachedURLResponse cachedResponse, NSURLRequest request) { - _objc_msgSend_wjvic9(this.ref.pointer, _sel_storeCachedResponse_forRequest_, - cachedResponse.ref.pointer, request.ref.pointer); - } - - /// ! - /// @method removeCachedResponseForRequest: - /// @abstract Removes the NSCachedURLResponse from the cache that is - /// stored using the given request. - /// @discussion No action is taken if there is no NSCachedURLResponse - /// stored with the given request. - /// @param request the NSURLRequest to use as a key for the lookup. - void removeCachedResponseForRequest_(NSURLRequest request) { - _objc_msgSend_1jdvcbf(this.ref.pointer, - _sel_removeCachedResponseForRequest_, request.ref.pointer); - } - - /// ! - /// @method removeAllCachedResponses - /// @abstract Clears the given cache, removing all NSCachedURLResponse - /// objects that it stores. - void removeAllCachedResponses() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllCachedResponses); - } - - /// ! - /// @method removeCachedResponsesSince: - /// @abstract Clears the given cache of any cached responses since the provided date. - void removeCachedResponsesSinceDate_(objc.NSDate date) { - _objc_msgSend_1jdvcbf(this.ref.pointer, - _sel_removeCachedResponsesSinceDate_, date.ref.pointer); - } - - /// ! - /// @abstract In-memory capacity of the receiver. - /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. - /// @result The in-memory capacity, measured in bytes, for the receiver. - DartNSUInteger get memoryCapacity { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_memoryCapacity); - } - - /// ! - /// @abstract In-memory capacity of the receiver. - /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. - /// @result The in-memory capacity, measured in bytes, for the receiver. - set memoryCapacity(DartNSUInteger value) { - return _objc_msgSend_1i9r4xy( - this.ref.pointer, _sel_setMemoryCapacity_, value); + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); } /// ! - /// @abstract The on-disk capacity of the receiver. - /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. - DartNSUInteger get diskCapacity { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_diskCapacity); + /// @abstract Returns the MIME type of the receiver. + /// @discussion The MIME type is based on the information provided + /// from an origin source. However, that value may be changed or + /// corrected by a protocol implementation if it can be determined + /// that the origin server or source reported the information + /// incorrectly or imprecisely. An attempt to guess the MIME type may + /// be made if the origin source did not report any such information. + /// @result The MIME type of the receiver. + objc.NSString? get MIMEType { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_MIMEType); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } /// ! - /// @abstract The on-disk capacity of the receiver. - /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. - set diskCapacity(DartNSUInteger value) { - return _objc_msgSend_1i9r4xy( - this.ref.pointer, _sel_setDiskCapacity_, value); + /// @abstract Returns the expected content length of the receiver. + /// @discussion Some protocol implementations report a content length + /// as part of delivering load metadata, but not all protocols + /// guarantee the amount of data that will be delivered in actuality. + /// Hence, this method returns an expected amount. Clients should use + /// this value as an advisory, and should be prepared to deal with + /// either more or less data. + /// @result The expected content length of the receiver, or -1 if + /// there is no expectation that can be arrived at regarding expected + /// content length. + int get expectedContentLength { + return _objc_msgSend_1k101e3(this.ref.pointer, _sel_expectedContentLength); } /// ! - /// @abstract Returns the current amount of space consumed by the - /// in-memory cache of the receiver. - /// @discussion This size, measured in bytes, indicates the current - /// usage of the in-memory cache. - /// @result the current usage of the in-memory cache of the receiver. - DartNSUInteger get currentMemoryUsage { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_currentMemoryUsage); + /// @abstract Returns the name of the text encoding of the receiver. + /// @discussion This name will be the actual string reported by the + /// origin source during the course of performing a protocol-specific + /// URL load. Clients can inspect this string and convert it to an + /// NSStringEncoding or CFStringEncoding using the methods and + /// functions made available in the appropriate framework. + /// @result The name of the text encoding of the receiver, or nil if no + /// text encoding was specified. + objc.NSString? get textEncodingName { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_textEncodingName); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } /// ! - /// @abstract Returns the current amount of space consumed by the - /// on-disk cache of the receiver. - /// @discussion This size, measured in bytes, indicates the current - /// usage of the on-disk cache. - /// @result the current usage of the on-disk cache of the receiver. - DartNSUInteger get currentDiskUsage { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_currentDiskUsage); + /// @abstract Returns a suggested filename if the resource were saved to disk. + /// @discussion The method first checks if the server has specified a filename using the + /// content disposition header. If no valid filename is specified using that mechanism, + /// this method checks the last path component of the URL. If no valid filename can be + /// obtained using the last path component, this method uses the URL's host as the filename. + /// If the URL's host can't be converted to a valid filename, the filename "unknown" is used. + /// In most cases, this method appends the proper file extension based on the MIME type. + /// This method always returns a valid filename. + /// @result A suggested filename to use if saving the resource to disk. + objc.NSString? get suggestedFilename { + final _ret = + _objc_msgSend_1x359cv(this.ref.pointer, _sel_suggestedFilename); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } /// init - NSURLCache init() { + NSURLResponse init() { final _ret = _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } /// new - static NSURLCache new1() { - final _ret = _objc_msgSend_1x359cv(_class_NSURLCache, _sel_new); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); + static NSURLResponse new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLResponse, _sel_new); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: - static NSURLCache allocWithZone_(ffi.Pointer<_NSZone> zone) { + static NSURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { final _ret = - _objc_msgSend_hzlb60(_class_NSURLCache, _sel_allocWithZone_, zone); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); + _objc_msgSend_hzlb60(_class_NSURLResponse, _sel_allocWithZone_, zone); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } /// alloc - static NSURLCache alloc() { - final _ret = _objc_msgSend_1x359cv(_class_NSURLCache, _sel_alloc); - return NSURLCache.castFromPointer(_ret, retain: false, release: true); + static NSURLResponse alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLResponse, _sel_alloc); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } /// self - NSURLCache self() { + NSURLResponse self() { final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); - return NSURLCache.castFromPointer(_ret, retain: true, release: true); + return NSURLResponse.castFromPointer(_ret, retain: true, release: true); } /// retain - NSURLCache retain() { + NSURLResponse retain() { final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); - return NSURLCache.castFromPointer(_ret, retain: true, release: true); + return NSURLResponse.castFromPointer(_ret, retain: true, release: true); } /// autorelease - NSURLCache autorelease() { + NSURLResponse autorelease() { final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); - return NSURLCache.castFromPointer(_ret, retain: true, release: true); + return NSURLResponse.castFromPointer(_ret, retain: true, release: true); } -} - -typedef NSNotificationName = ffi.Pointer; -typedef DartNSNotificationName = objc.NSString; -late final _class_NSNotification = objc.getClass("NSNotification"); -late final _sel_notificationWithName_object_ = - objc.registerName("notificationWithName:object:"); -final _objc_msgSend_rsfdlh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_notificationWithName_object_userInfo_ = - objc.registerName("notificationWithName:object:userInfo:"); -final _objc_msgSend_582s3n = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -/// NSNotificationCreation -extension NSNotificationCreation on objc.NSNotification { - /// notificationWithName:object: - static objc.NSNotification notificationWithName_object_( - DartNSNotificationName aName, objc.ObjCObjectBase? anObject) { - final _ret = _objc_msgSend_rsfdlh( - _class_NSNotification, - _sel_notificationWithName_object_, - aName.ref.pointer, - anObject?.ref.pointer ?? ffi.nullptr); - return objc.NSNotification.castFromPointer(_ret, - retain: true, release: true); + /// supportsSecureCoding + static bool getSupportsSecureCoding() { + return _objc_msgSend_91o635( + _class_NSURLResponse, _sel_supportsSecureCoding); } - /// notificationWithName:object:userInfo: - static objc.NSNotification notificationWithName_object_userInfo_( - DartNSNotificationName aName, - objc.ObjCObjectBase? anObject, - objc.NSDictionary? aUserInfo) { - final _ret = _objc_msgSend_582s3n( - _class_NSNotification, - _sel_notificationWithName_object_userInfo_, - aName.ref.pointer, - anObject?.ref.pointer ?? ffi.nullptr, - aUserInfo?.ref.pointer ?? ffi.nullptr); - return objc.NSNotification.castFromPointer(_ret, - retain: true, release: true); + /// encodeWithCoder: + void encodeWithCoder_(objc.NSCoder coder) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); } - /// init - objc.NSNotification init() { - final _ret = - _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); - return objc.NSNotification.castFromPointer(_ret, - retain: false, release: true); + /// initWithCoder: + NSURLResponse? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : NSURLResponse.castFromPointer(_ret, retain: false, release: true); } } -late final _class_NSDate = objc.getClass("NSDate"); -late final _sel_timeIntervalSinceDate_ = - objc.registerName("timeIntervalSinceDate:"); -final _objc_msgSend_hlyk7w = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -final _objc_msgSend_hlyk7wFpret = objc.msgSendFpretPointer - .cast< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_timeIntervalSinceNow = - objc.registerName("timeIntervalSinceNow"); -late final _sel_timeIntervalSince1970 = - objc.registerName("timeIntervalSince1970"); -late final _sel_addTimeInterval_ = objc.registerName("addTimeInterval:"); -final _objc_msgSend_1x911p2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, double)>(); -late final _sel_dateByAddingTimeInterval_ = - objc.registerName("dateByAddingTimeInterval:"); -late final _sel_earlierDate_ = objc.registerName("earlierDate:"); -late final _sel_laterDate_ = objc.registerName("laterDate:"); -late final _sel_compare_ = objc.registerName("compare:"); -final _objc_msgSend_1wpduvy = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_isEqualToDate_ = objc.registerName("isEqualToDate:"); -late final _sel_descriptionWithLocale_ = - objc.registerName("descriptionWithLocale:"); -late final _sel_timeIntervalSinceReferenceDate = - objc.registerName("timeIntervalSinceReferenceDate"); - -/// NSExtendedDate -extension NSExtendedDate on objc.NSDate { - /// timeIntervalSinceDate: - DartNSTimeInterval timeIntervalSinceDate_(objc.NSDate anotherDate) { - return objc.useMsgSendVariants - ? _objc_msgSend_hlyk7wFpret(this.ref.pointer, - _sel_timeIntervalSinceDate_, anotherDate.ref.pointer) - : _objc_msgSend_hlyk7w(this.ref.pointer, _sel_timeIntervalSinceDate_, - anotherDate.ref.pointer); - } - - /// timeIntervalSinceNow - DartNSTimeInterval get timeIntervalSinceNow { - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret( - this.ref.pointer, _sel_timeIntervalSinceNow) - : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeIntervalSinceNow); - } - - /// timeIntervalSince1970 - DartNSTimeInterval get timeIntervalSince1970 { - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret( - this.ref.pointer, _sel_timeIntervalSince1970) - : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeIntervalSince1970); - } +late final _sel_response = objc.registerName("response"); +late final _sel_delegate = objc.registerName("delegate"); +late final _sel_setDelegate_ = objc.registerName("setDelegate:"); - /// addTimeInterval: - objc.ObjCObjectBase addTimeInterval_(DartNSTimeInterval seconds) { - final _ret = - _objc_msgSend_1x911p2(this.ref.pointer, _sel_addTimeInterval_, seconds); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } +/// WARNING: NSProgress is a stub. To generate bindings for this class, include +/// NSProgress in your config's objc-interfaces list. +/// +/// NSProgress +class NSProgress extends objc.NSObject { + NSProgress._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// dateByAddingTimeInterval: - objc.NSDate dateByAddingTimeInterval_(DartNSTimeInterval ti) { - final _ret = _objc_msgSend_1x911p2( - this.ref.pointer, _sel_dateByAddingTimeInterval_, ti); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } + /// Constructs a [NSProgress] that points to the same underlying object as [other]. + NSProgress.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// earlierDate: - objc.NSDate earlierDate_(objc.NSDate anotherDate) { - final _ret = _objc_msgSend_62nh5j( - this.ref.pointer, _sel_earlierDate_, anotherDate.ref.pointer); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } + /// Constructs a [NSProgress] that wraps the given raw object pointer. + NSProgress.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} - /// laterDate: - objc.NSDate laterDate_(objc.NSDate anotherDate) { - final _ret = _objc_msgSend_62nh5j( - this.ref.pointer, _sel_laterDate_, anotherDate.ref.pointer); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } +late final _sel_progress = objc.registerName("progress"); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_closureTrampoline) + .cast(); - /// compare: - objc.NSComparisonResult compare_(objc.NSDate other) { - final _ret = _objc_msgSend_1wpduvy( - this.ref.pointer, _sel_compare_, other.ref.pointer); - return objc.NSComparisonResult.fromValue(_ret); - } +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSProgress_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>(pointer, + retain: retain, release: release); - /// isEqualToDate: - bool isEqualToDate_(objc.NSDate otherDate) { - return _objc_msgSend_69e0x1( - this.ref.pointer, _sel_isEqualToDate_, otherDate.ref.pointer); - } - - /// description - objc.NSString get description { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_description); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// descriptionWithLocale: - objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_62nh5j(this.ref.pointer, - _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> + fromFunction(NSProgress Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSProgress_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); +} - /// timeIntervalSinceReferenceDate - static DartNSTimeInterval getTimeIntervalSinceReferenceDate() { - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret( - _class_NSDate, _sel_timeIntervalSinceReferenceDate) - : _objc_msgSend_1ukqyt8( - _class_NSDate, _sel_timeIntervalSinceReferenceDate); - } +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_NSProgress_ffiVoid_CallExtension + on objc.ObjCBlock)> { + NSProgress call(ffi.Pointer arg0) => NSProgress.castFromPointer( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); } -late final _sel_date = objc.registerName("date"); -late final _sel_dateWithTimeIntervalSinceNow_ = - objc.registerName("dateWithTimeIntervalSinceNow:"); -late final _sel_dateWithTimeIntervalSinceReferenceDate_ = - objc.registerName("dateWithTimeIntervalSinceReferenceDate:"); -late final _sel_dateWithTimeIntervalSince1970_ = - objc.registerName("dateWithTimeIntervalSince1970:"); -late final _sel_dateWithTimeInterval_sinceDate_ = - objc.registerName("dateWithTimeInterval:sinceDate:"); -final _objc_msgSend_xh7c7e = objc.msgSendPointer +late final _sel_earliestBeginDate = objc.registerName("earliestBeginDate"); +late final _sel_setEarliestBeginDate_ = + objc.registerName("setEarliestBeginDate:"); +late final _sel_countOfBytesClientExpectsToSend = + objc.registerName("countOfBytesClientExpectsToSend"); +final _objc_msgSend_pysgoz = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer)>>() + ffi.Int64 Function(ffi.Pointer, + ffi.Pointer)>>() .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer)>(); -late final _sel_distantFuture = objc.registerName("distantFuture"); -late final _sel_distantPast = objc.registerName("distantPast"); -late final _sel_now = objc.registerName("now"); -late final _sel_initWithTimeIntervalSinceNow_ = - objc.registerName("initWithTimeIntervalSinceNow:"); -late final _sel_initWithTimeIntervalSince1970_ = - objc.registerName("initWithTimeIntervalSince1970:"); -late final _sel_initWithTimeInterval_sinceDate_ = - objc.registerName("initWithTimeInterval:sinceDate:"); + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setCountOfBytesClientExpectsToSend_ = + objc.registerName("setCountOfBytesClientExpectsToSend:"); +final _objc_msgSend_17gvxvj = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Int64)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_countOfBytesClientExpectsToReceive = + objc.registerName("countOfBytesClientExpectsToReceive"); +late final _sel_setCountOfBytesClientExpectsToReceive_ = + objc.registerName("setCountOfBytesClientExpectsToReceive:"); +late final _sel_countOfBytesSent = objc.registerName("countOfBytesSent"); +late final _sel_countOfBytesReceived = + objc.registerName("countOfBytesReceived"); +late final _sel_countOfBytesExpectedToSend = + objc.registerName("countOfBytesExpectedToSend"); +late final _sel_countOfBytesExpectedToReceive = + objc.registerName("countOfBytesExpectedToReceive"); +late final _sel_taskDescription = objc.registerName("taskDescription"); +late final _sel_setTaskDescription_ = objc.registerName("setTaskDescription:"); +late final _sel_cancel = objc.registerName("cancel"); -/// NSDateCreation -extension NSDateCreation on objc.NSDate { - /// date - static objc.NSDate date() { - final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_date); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } +enum NSURLSessionTaskState { + /// The task is currently being serviced by the session + NSURLSessionTaskStateRunning(0), + NSURLSessionTaskStateSuspended(1), - /// dateWithTimeIntervalSinceNow: - static objc.NSDate dateWithTimeIntervalSinceNow_(DartNSTimeInterval secs) { - final _ret = _objc_msgSend_1x911p2( - _class_NSDate, _sel_dateWithTimeIntervalSinceNow_, secs); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } + /// The task has been told to cancel. The session will receive a URLSession:task:didCompleteWithError: message. + NSURLSessionTaskStateCanceling(2), - /// dateWithTimeIntervalSinceReferenceDate: - static objc.NSDate dateWithTimeIntervalSinceReferenceDate_( - DartNSTimeInterval ti) { - final _ret = _objc_msgSend_1x911p2( - _class_NSDate, _sel_dateWithTimeIntervalSinceReferenceDate_, ti); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } + /// The task has completed and the session will receive no more delegate notifications + NSURLSessionTaskStateCompleted(3); - /// dateWithTimeIntervalSince1970: - static objc.NSDate dateWithTimeIntervalSince1970_(DartNSTimeInterval secs) { - final _ret = _objc_msgSend_1x911p2( - _class_NSDate, _sel_dateWithTimeIntervalSince1970_, secs); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } + final int value; + const NSURLSessionTaskState(this.value); - /// dateWithTimeInterval:sinceDate: - static objc.NSDate dateWithTimeInterval_sinceDate_( - DartNSTimeInterval secsToBeAdded, objc.NSDate date) { - final _ret = _objc_msgSend_xh7c7e(_class_NSDate, - _sel_dateWithTimeInterval_sinceDate_, secsToBeAdded, date.ref.pointer); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } + static NSURLSessionTaskState fromValue(int value) => switch (value) { + 0 => NSURLSessionTaskStateRunning, + 1 => NSURLSessionTaskStateSuspended, + 2 => NSURLSessionTaskStateCanceling, + 3 => NSURLSessionTaskStateCompleted, + _ => throw ArgumentError( + "Unknown value for NSURLSessionTaskState: $value"), + }; +} - /// distantFuture - static objc.NSDate getDistantFuture() { - final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_distantFuture); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } +late final _sel_state = objc.registerName("state"); +final _objc_msgSend_1vze0g9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_error = objc.registerName("error"); +late final _sel_suspend = objc.registerName("suspend"); +late final _sel_resume = objc.registerName("resume"); +late final _sel_priority = objc.registerName("priority"); +final _objc_msgSend_2cgrxl = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_2cgrxlFpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setPriority_ = objc.registerName("setPriority:"); +final _objc_msgSend_v5hmet = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, double)>(); +late final _sel_prefersIncrementalDelivery = + objc.registerName("prefersIncrementalDelivery"); +late final _sel_setPrefersIncrementalDelivery_ = + objc.registerName("setPrefersIncrementalDelivery:"); - /// distantPast - static objc.NSDate getDistantPast() { - final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_distantPast); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } +/// NSURLSessionTask - a cancelable object that refers to the lifetime +/// of processing a given request. +class NSURLSessionTask extends objc.NSObject { + NSURLSessionTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// now - static objc.NSDate getNow() { - final _ret = _objc_msgSend_1x359cv(_class_NSDate, _sel_now); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); + /// Constructs a [NSURLSessionTask] that points to the same underlying object as [other]. + NSURLSessionTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionTask] that wraps the given raw object pointer. + NSURLSessionTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionTask); } - /// initWithTimeIntervalSinceNow: - objc.NSDate initWithTimeIntervalSinceNow_(DartNSTimeInterval secs) { - final _ret = _objc_msgSend_1x911p2(this.ref.retainAndReturnPointer(), - _sel_initWithTimeIntervalSinceNow_, secs); - return objc.NSDate.castFromPointer(_ret, retain: false, release: true); + /// an identifier for this task, assigned by and unique to the owning session + DartNSUInteger get taskIdentifier { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_taskIdentifier); } - /// initWithTimeIntervalSince1970: - objc.NSDate initWithTimeIntervalSince1970_(DartNSTimeInterval secs) { - final _ret = _objc_msgSend_1x911p2(this.ref.retainAndReturnPointer(), - _sel_initWithTimeIntervalSince1970_, secs); - return objc.NSDate.castFromPointer(_ret, retain: false, release: true); + /// may be nil if this is a stream task + NSURLRequest? get originalRequest { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_originalRequest); + return _ret.address == 0 + ? null + : NSURLRequest.castFromPointer(_ret, retain: true, release: true); } - /// initWithTimeInterval:sinceDate: - objc.NSDate initWithTimeInterval_sinceDate_( - DartNSTimeInterval secsToBeAdded, objc.NSDate date) { - final _ret = _objc_msgSend_xh7c7e(this.ref.retainAndReturnPointer(), - _sel_initWithTimeInterval_sinceDate_, secsToBeAdded, date.ref.pointer); - return objc.NSDate.castFromPointer(_ret, retain: false, release: true); + /// may differ from originalRequest due to http server redirection + NSURLRequest? get currentRequest { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_currentRequest); + return _ret.address == 0 + ? null + : NSURLRequest.castFromPointer(_ret, retain: true, release: true); } -} -late final _class_NSMutableURLRequest = objc.getClass("NSMutableURLRequest"); -late final _sel_setHTTPMethod_ = objc.registerName("setHTTPMethod:"); -late final _sel_setAllHTTPHeaderFields_ = - objc.registerName("setAllHTTPHeaderFields:"); -late final _sel_setValue_forHTTPHeaderField_ = - objc.registerName("setValue:forHTTPHeaderField:"); -late final _sel_addValue_forHTTPHeaderField_ = - objc.registerName("addValue:forHTTPHeaderField:"); -late final _sel_setHTTPBody_ = objc.registerName("setHTTPBody:"); -late final _sel_setHTTPBodyStream_ = objc.registerName("setHTTPBodyStream:"); -late final _sel_setHTTPShouldHandleCookies_ = - objc.registerName("setHTTPShouldHandleCookies:"); -final _objc_msgSend_1s56lr9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, bool)>(); -late final _sel_setHTTPShouldUsePipelining_ = - objc.registerName("setHTTPShouldUsePipelining:"); + /// may be nil if no response has been received + NSURLResponse? get response { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_response); + return _ret.address == 0 + ? null + : NSURLResponse.castFromPointer(_ret, retain: true, release: true); + } -/// ! -/// @category NSMutableURLRequest(NSMutableHTTPURLRequest) -/// The NSMutableHTTPURLRequest on NSMutableURLRequest provides methods -/// for configuring information specific to HTTP protocol requests. -extension NSMutableHTTPURLRequest on NSMutableURLRequest { - /// ! - /// @abstract Sets the HTTP request method of the receiver. - objc.NSString get HTTPMethod { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPMethod); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); + /// Sets a task-specific delegate. Methods not implemented on this delegate will + /// still be forwarded to the session delegate. + /// + /// Cannot be modified after task resumes. Not supported on background session. + /// + /// Delegate is strongly referenced until the task completes, after which it is + /// reset to `nil`. + objc.ObjCObjectBase? get delegate { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_delegate); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// ! - /// @abstract Sets the HTTP request method of the receiver. - set HTTPMethod(objc.NSString value) { + /// Sets a task-specific delegate. Methods not implemented on this delegate will + /// still be forwarded to the session delegate. + /// + /// Cannot be modified after task resumes. Not supported on background session. + /// + /// Delegate is strongly referenced until the task completes, after which it is + /// reset to `nil`. + set delegate(objc.ObjCObjectBase? value) { return _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_setHTTPMethod_, value.ref.pointer); + this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); } - /// ! - /// @abstract Sets the HTTP header fields of the receiver to the given - /// dictionary. - /// @discussion This method replaces all header fields that may have - /// existed before this method call. - ///

Since HTTP header fields must be string values, each object and - /// key in the dictionary passed to this method must answer YES when - /// sent an -isKindOfClass:[NSString class] message. If either - /// the key or value for a key-value pair answers NO when sent this - /// message, the key-value pair is skipped. - objc.NSDictionary? get allHTTPHeaderFields { + /// progress + NSProgress get progress { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_progress); + return NSProgress.castFromPointer(_ret, retain: true, release: true); + } + + /// Start the network load for this task no earlier than the specified date. If + /// not specified, no start delay is used. + /// + /// Only applies to tasks created from background NSURLSession instances; has no + /// effect for tasks created from other session types. + objc.NSDate? get earliestBeginDate { final _ret = - _objc_msgSend_1x359cv(this.ref.pointer, _sel_allHTTPHeaderFields); + _objc_msgSend_1x359cv(this.ref.pointer, _sel_earliestBeginDate); return _ret.address == 0 ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + : objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract Sets the HTTP header fields of the receiver to the given - /// dictionary. - /// @discussion This method replaces all header fields that may have - /// existed before this method call. - ///

Since HTTP header fields must be string values, each object and - /// key in the dictionary passed to this method must answer YES when - /// sent an -isKindOfClass:[NSString class] message. If either - /// the key or value for a key-value pair answers NO when sent this - /// message, the key-value pair is skipped. - set allHTTPHeaderFields(objc.NSDictionary? value) { - return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setAllHTTPHeaderFields_, + /// Start the network load for this task no earlier than the specified date. If + /// not specified, no start delay is used. + /// + /// Only applies to tasks created from background NSURLSession instances; has no + /// effect for tasks created from other session types. + set earliestBeginDate(objc.NSDate? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setEarliestBeginDate_, value?.ref.pointer ?? ffi.nullptr); } - /// ! - /// @method setValue:forHTTPHeaderField: - /// @abstract Sets the value of the given HTTP header field. - /// @discussion If a value was previously set for the given header - /// field, that value is replaced with the given value. Note that, in - /// keeping with the HTTP RFC, HTTP header field names are - /// case-insensitive. - /// @param value the header field value. - /// @param field the header field name (case-insensitive). - void setValue_forHTTPHeaderField_(objc.NSString? value, objc.NSString field) { - _objc_msgSend_wjvic9(this.ref.pointer, _sel_setValue_forHTTPHeaderField_, - value?.ref.pointer ?? ffi.nullptr, field.ref.pointer); + /// The number of bytes that the client expects (a best-guess upper-bound) will + /// be sent and received by this task. These values are used by system scheduling + /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. + int get countOfBytesClientExpectsToSend { + return _objc_msgSend_pysgoz( + this.ref.pointer, _sel_countOfBytesClientExpectsToSend); } - /// ! - /// @method addValue:forHTTPHeaderField: - /// @abstract Adds an HTTP header field in the current header - /// dictionary. - /// @discussion This method provides a way to add values to header - /// fields incrementally. If a value was previously set for the given - /// header field, the given value is appended to the previously-existing - /// value. The appropriate field delimiter, a comma in the case of HTTP, - /// is added by the implementation, and should not be added to the given - /// value by the caller. Note that, in keeping with the HTTP RFC, HTTP - /// header field names are case-insensitive. - /// @param value the header field value. - /// @param field the header field name (case-insensitive). - void addValue_forHTTPHeaderField_(objc.NSString value, objc.NSString field) { - _objc_msgSend_wjvic9(this.ref.pointer, _sel_addValue_forHTTPHeaderField_, - value.ref.pointer, field.ref.pointer); + /// The number of bytes that the client expects (a best-guess upper-bound) will + /// be sent and received by this task. These values are used by system scheduling + /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. + set countOfBytesClientExpectsToSend(int value) { + return _objc_msgSend_17gvxvj( + this.ref.pointer, _sel_setCountOfBytesClientExpectsToSend_, value); } - /// ! - /// @abstract Sets the request body data of the receiver. - /// @discussion This data is sent as the message body of the request, as - /// in done in an HTTP POST request. - objc.NSData? get HTTPBody { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBody); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); + /// countOfBytesClientExpectsToReceive + int get countOfBytesClientExpectsToReceive { + return _objc_msgSend_pysgoz( + this.ref.pointer, _sel_countOfBytesClientExpectsToReceive); } - /// ! - /// @abstract Sets the request body data of the receiver. - /// @discussion This data is sent as the message body of the request, as - /// in done in an HTTP POST request. - set HTTPBody(objc.NSData? value) { - return _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_setHTTPBody_, value?.ref.pointer ?? ffi.nullptr); + /// setCountOfBytesClientExpectsToReceive: + set countOfBytesClientExpectsToReceive(int value) { + return _objc_msgSend_17gvxvj( + this.ref.pointer, _sel_setCountOfBytesClientExpectsToReceive_, value); } - /// ! - /// @abstract Sets the request body to be the contents of the given stream. - /// @discussion The provided stream should be unopened; the request will take - /// over the stream's delegate. The entire stream's contents will be - /// transmitted as the HTTP body of the request. Note that the body stream - /// and the body data (set by setHTTPBody:, above) are mutually exclusive - /// - setting one will clear the other. - objc.NSInputStream? get HTTPBodyStream { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_HTTPBodyStream); - return _ret.address == 0 - ? null - : objc.NSInputStream.castFromPointer(_ret, retain: true, release: true); + /// number of body bytes already sent + int get countOfBytesSent { + return _objc_msgSend_pysgoz(this.ref.pointer, _sel_countOfBytesSent); } - /// ! - /// @abstract Sets the request body to be the contents of the given stream. - /// @discussion The provided stream should be unopened; the request will take - /// over the stream's delegate. The entire stream's contents will be - /// transmitted as the HTTP body of the request. Note that the body stream - /// and the body data (set by setHTTPBody:, above) are mutually exclusive - /// - setting one will clear the other. - set HTTPBodyStream(objc.NSInputStream? value) { - return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setHTTPBodyStream_, - value?.ref.pointer ?? ffi.nullptr); + /// number of body bytes already received + int get countOfBytesReceived { + return _objc_msgSend_pysgoz(this.ref.pointer, _sel_countOfBytesReceived); } - /// ! - /// @abstract Decide whether default cookie handling will happen for - /// this request (YES if cookies should be sent with and set for this request; - /// otherwise NO). - /// @discussion The default is YES - in other words, cookies are sent from and - /// stored to the cookie manager by default. - /// NOTE: In releases prior to 10.3, this value is ignored - bool get HTTPShouldHandleCookies { - return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldHandleCookies); + /// number of body bytes we expect to send, derived from the Content-Length of the HTTP request + int get countOfBytesExpectedToSend { + return _objc_msgSend_pysgoz( + this.ref.pointer, _sel_countOfBytesExpectedToSend); } - /// ! - /// @abstract Decide whether default cookie handling will happen for - /// this request (YES if cookies should be sent with and set for this request; - /// otherwise NO). - /// @discussion The default is YES - in other words, cookies are sent from and - /// stored to the cookie manager by default. - /// NOTE: In releases prior to 10.3, this value is ignored - set HTTPShouldHandleCookies(bool value) { - return _objc_msgSend_1s56lr9( - this.ref.pointer, _sel_setHTTPShouldHandleCookies_, value); - } - - /// ! - /// @abstract Sets whether the request should not wait for the previous response - /// before transmitting (YES if the receiver should transmit before the previous response is - /// received. NO to wait for the previous response before transmitting) - /// @discussion Calling this method with a YES value does not guarantee HTTP - /// pipelining behavior. This method may have no effect if an HTTP proxy is - /// configured, or if the HTTP request uses an unsafe request method (e.g., POST - /// requests will not pipeline). Pipelining behavior also may not begin until - /// the second request on a given TCP connection. There may be other situations - /// where pipelining does not occur even though YES was set. - /// HTTP 1.1 allows the client to send multiple requests to the server without - /// waiting for a response. Though HTTP 1.1 requires support for pipelining, - /// some servers report themselves as being HTTP 1.1 but do not support - /// pipelining (disconnecting, sending resources misordered, omitting part of - /// a resource, etc.). - bool get HTTPShouldUsePipelining { - return _objc_msgSend_91o635(this.ref.pointer, _sel_HTTPShouldUsePipelining); - } - - /// ! - /// @abstract Sets whether the request should not wait for the previous response - /// before transmitting (YES if the receiver should transmit before the previous response is - /// received. NO to wait for the previous response before transmitting) - /// @discussion Calling this method with a YES value does not guarantee HTTP - /// pipelining behavior. This method may have no effect if an HTTP proxy is - /// configured, or if the HTTP request uses an unsafe request method (e.g., POST - /// requests will not pipeline). Pipelining behavior also may not begin until - /// the second request on a given TCP connection. There may be other situations - /// where pipelining does not occur even though YES was set. - /// HTTP 1.1 allows the client to send multiple requests to the server without - /// waiting for a response. Though HTTP 1.1 requires support for pipelining, - /// some servers report themselves as being HTTP 1.1 but do not support - /// pipelining (disconnecting, sending resources misordered, omitting part of - /// a resource, etc.). - set HTTPShouldUsePipelining(bool value) { - return _objc_msgSend_1s56lr9( - this.ref.pointer, _sel_setHTTPShouldUsePipelining_, value); - } -} - -late final _sel_setURL_ = objc.registerName("setURL:"); -late final _sel_setCachePolicy_ = objc.registerName("setCachePolicy:"); -final _objc_msgSend_1yjxuv2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_setTimeoutInterval_ = objc.registerName("setTimeoutInterval:"); -final _objc_msgSend_hwm8nu = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, double)>(); -late final _sel_setMainDocumentURL_ = objc.registerName("setMainDocumentURL:"); -late final _sel_setNetworkServiceType_ = - objc.registerName("setNetworkServiceType:"); -final _objc_msgSend_1mse4s1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_setAllowsCellularAccess_ = - objc.registerName("setAllowsCellularAccess:"); -late final _sel_setAllowsExpensiveNetworkAccess_ = - objc.registerName("setAllowsExpensiveNetworkAccess:"); -late final _sel_setAllowsConstrainedNetworkAccess_ = - objc.registerName("setAllowsConstrainedNetworkAccess:"); -late final _sel_setAssumesHTTP3Capable_ = - objc.registerName("setAssumesHTTP3Capable:"); -late final _sel_setAttribution_ = objc.registerName("setAttribution:"); -final _objc_msgSend_1nw1jep = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_setRequiresDNSSECValidation_ = - objc.registerName("setRequiresDNSSECValidation:"); - -/// ! -/// @class NSMutableURLRequest -/// -/// @abstract An NSMutableURLRequest object represents a mutable URL load -/// request in a manner independent of protocol and URL scheme. -/// -/// @discussion This specialization of NSURLRequest is provided to aid -/// developers who may find it more convenient to mutate a single request -/// object for a series of URL loads instead of creating an immutable -/// NSURLRequest for each load. This programming model is supported by -/// the following contract stipulation between NSMutableURLRequest and -/// NSURLConnection: NSURLConnection makes a deep copy of each -/// NSMutableURLRequest object passed to one of its initializers. -///

NSMutableURLRequest is designed to be extended to support -/// protocol-specific data by adding categories to access a property -/// object provided in an interface targeted at protocol implementors. -///

    -///
  • Protocol implementors should direct their attention to the -/// NSMutableURLRequestExtensibility category on -/// NSMutableURLRequest for more information on how to provide -/// extensions on NSMutableURLRequest to support protocol-specific -/// request information. -///
  • Clients of this API who wish to create NSMutableURLRequest -/// objects to load URL content should consult the protocol-specific -/// NSMutableURLRequest categories that are available. The -/// NSMutableHTTPURLRequest category on NSMutableURLRequest is an -/// example. -///
-class NSMutableURLRequest extends NSURLRequest { - NSMutableURLRequest._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSMutableURLRequest] that points to the same underlying object as [other]. - NSMutableURLRequest.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSMutableURLRequest] that wraps the given raw object pointer. - NSMutableURLRequest.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSMutableURLRequest]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_69e0x1( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSMutableURLRequest); + /// number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response. + int get countOfBytesExpectedToReceive { + return _objc_msgSend_pysgoz( + this.ref.pointer, _sel_countOfBytesExpectedToReceive); } - /// ! - /// @abstract The URL of the receiver. - objc.NSURL? get URL { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_URL); + /// The taskDescription property is available for the developer to + /// provide a descriptive label for the task. + objc.NSString? get taskDescription { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_taskDescription); return _ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract The URL of the receiver. - set URL(objc.NSURL? value) { - return _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_setURL_, value?.ref.pointer ?? ffi.nullptr); - } - - /// ! - /// @abstract The cache policy of the receiver. - NSURLRequestCachePolicy get cachePolicy { - final _ret = _objc_msgSend_8jm3uo(this.ref.pointer, _sel_cachePolicy); - return NSURLRequestCachePolicy.fromValue(_ret); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract The cache policy of the receiver. - set cachePolicy(NSURLRequestCachePolicy value) { - return _objc_msgSend_1yjxuv2( - this.ref.pointer, _sel_setCachePolicy_, value.value); + /// The taskDescription property is available for the developer to + /// provide a descriptive label for the task. + set taskDescription(objc.NSString? value) { + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setTaskDescription_, + value?.ref.pointer ?? ffi.nullptr); } - /// ! - /// @abstract Sets the timeout interval of the receiver. - /// @discussion The timeout interval specifies the limit on the idle - /// interval allotted to a request in the process of loading. The "idle - /// interval" is defined as the period of time that has passed since the - /// last instance of load activity occurred for a request that is in the - /// process of loading. Hence, when an instance of load activity occurs - /// (e.g. bytes are received from the network for a request), the idle - /// interval for a request is reset to 0. If the idle interval ever - /// becomes greater than or equal to the timeout interval, the request - /// is considered to have timed out. This timeout interval is measured - /// in seconds. - DartNSTimeInterval get timeoutInterval { - return objc.useMsgSendVariants - ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_timeoutInterval) - : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_timeoutInterval); + /// -cancel returns immediately, but marks a task as being canceled. + /// The task will signal -URLSession:task:didCompleteWithError: with an + /// error value of { NSURLErrorDomain, NSURLErrorCancelled }. In some + /// cases, the task may signal other work before it acknowledges the + /// cancelation. -cancel may be sent to a task that has been suspended. + void cancel() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_cancel); } - /// ! - /// @abstract Sets the timeout interval of the receiver. - /// @discussion The timeout interval specifies the limit on the idle - /// interval allotted to a request in the process of loading. The "idle - /// interval" is defined as the period of time that has passed since the - /// last instance of load activity occurred for a request that is in the - /// process of loading. Hence, when an instance of load activity occurs - /// (e.g. bytes are received from the network for a request), the idle - /// interval for a request is reset to 0. If the idle interval ever - /// becomes greater than or equal to the timeout interval, the request - /// is considered to have timed out. This timeout interval is measured - /// in seconds. - set timeoutInterval(DartNSTimeInterval value) { - return _objc_msgSend_hwm8nu( - this.ref.pointer, _sel_setTimeoutInterval_, value); + /// The current state of the task within the session. + NSURLSessionTaskState get state { + final _ret = _objc_msgSend_1vze0g9(this.ref.pointer, _sel_state); + return NSURLSessionTaskState.fromValue(_ret); } - /// ! - /// @abstract Sets the main document URL - /// @discussion The caller should pass the URL for an appropriate main - /// document, if known. For example, when loading a web page, the URL - /// of the main html document for the top-level frame should be - /// passed. This main document is used to implement the cookie "only - /// from same domain as main document" policy, attributing this request - /// as a sub-resource of a user-specified URL, and possibly other things - /// in the future. - objc.NSURL? get mainDocumentURL { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_mainDocumentURL); + /// The error, if any, delivered via -URLSession:task:didCompleteWithError: + /// This property will be nil in the event that no error occurred. + objc.NSError? get error { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_error); return _ret.address == 0 ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// ! - /// @abstract Sets the main document URL - /// @discussion The caller should pass the URL for an appropriate main - /// document, if known. For example, when loading a web page, the URL - /// of the main html document for the top-level frame should be - /// passed. This main document is used to implement the cookie "only - /// from same domain as main document" policy, attributing this request - /// as a sub-resource of a user-specified URL, and possibly other things - /// in the future. - set mainDocumentURL(objc.NSURL? value) { - return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setMainDocumentURL_, - value?.ref.pointer ?? ffi.nullptr); + : objc.NSError.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request - /// @discussion This method is used to provide the network layers with a hint as to the purpose - /// of the request. Most clients should not need to use this method. - NSURLRequestNetworkServiceType get networkServiceType { - final _ret = - _objc_msgSend_t4uaw1(this.ref.pointer, _sel_networkServiceType); - return NSURLRequestNetworkServiceType.fromValue(_ret); + /// Suspending a task will prevent the NSURLSession from continuing to + /// load data. There may still be delegate calls made on behalf of + /// this task (for instance, to report data received while suspending) + /// but no further transmissions will be made on behalf of the task + /// until -resume is sent. The timeout timer associated with the task + /// will be disabled while a task is suspended. -suspend and -resume are + /// nestable. + void suspend() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_suspend); } - /// ! - /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request - /// @discussion This method is used to provide the network layers with a hint as to the purpose - /// of the request. Most clients should not need to use this method. - set networkServiceType(NSURLRequestNetworkServiceType value) { - return _objc_msgSend_1mse4s1( - this.ref.pointer, _sel_setNetworkServiceType_, value.value); + /// resume + void resume() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_resume); } - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// the built in cellular radios (if present). - /// @discussion NO if the receiver should not be allowed to use the built in - /// cellular radios to satisfy the request, YES otherwise. The default is YES. - bool get allowsCellularAccess { - return _objc_msgSend_91o635(this.ref.pointer, _sel_allowsCellularAccess); + /// Sets a scaling factor for the priority of the task. The scaling factor is a + /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest + /// priority and 1.0 is considered the highest. + /// + /// The priority is a hint and not a hard requirement of task performance. The + /// priority of a task may be changed using this API at any time, but not all + /// protocols support this; in these cases, the last priority that took effect + /// will be used. + /// + /// If no priority is specified, the task will operate with the default priority + /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional + /// priority levels are provided: NSURLSessionTaskPriorityLow and + /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. + double get priority { + return objc.useMsgSendVariants + ? _objc_msgSend_2cgrxlFpret(this.ref.pointer, _sel_priority) + : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_priority); } - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// the built in cellular radios (if present). - /// @discussion NO if the receiver should not be allowed to use the built in - /// cellular radios to satisfy the request, YES otherwise. The default is YES. - set allowsCellularAccess(bool value) { - return _objc_msgSend_1s56lr9( - this.ref.pointer, _sel_setAllowsCellularAccess_, value); + /// Sets a scaling factor for the priority of the task. The scaling factor is a + /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest + /// priority and 1.0 is considered the highest. + /// + /// The priority is a hint and not a hard requirement of task performance. The + /// priority of a task may be changed using this API at any time, but not all + /// protocols support this; in these cases, the last priority that took effect + /// will be used. + /// + /// If no priority is specified, the task will operate with the default priority + /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional + /// priority levels are provided: NSURLSessionTaskPriorityLow and + /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. + set priority(double value) { + return _objc_msgSend_v5hmet(this.ref.pointer, _sel_setPriority_, value); } - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as expensive. - /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to - /// satisfy the request, YES otherwise. - bool get allowsExpensiveNetworkAccess { + /// Provides a hint indicating if incremental delivery of a partial response body + /// would be useful for the application, or if it cannot process the response + /// until it is complete. Indicating that incremental delivery is not desired may + /// improve task performance. For example, if a response cannot be decoded until + /// the entire content is received, set this property to false. + /// + /// Defaults to true unless this task is created with completion-handler based + /// convenience methods, or if it is a download task. + bool get prefersIncrementalDelivery { return _objc_msgSend_91o635( - this.ref.pointer, _sel_allowsExpensiveNetworkAccess); + this.ref.pointer, _sel_prefersIncrementalDelivery); } - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as expensive. - /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to - /// satisfy the request, YES otherwise. - set allowsExpensiveNetworkAccess(bool value) { + /// Provides a hint indicating if incremental delivery of a partial response body + /// would be useful for the application, or if it cannot process the response + /// until it is complete. Indicating that incremental delivery is not desired may + /// improve task performance. For example, if a response cannot be decoded until + /// the entire content is received, set this property to false. + /// + /// Defaults to true unless this task is created with completion-handler based + /// convenience methods, or if it is a download task. + set prefersIncrementalDelivery(bool value) { return _objc_msgSend_1s56lr9( - this.ref.pointer, _sel_setAllowsExpensiveNetworkAccess_, value); + this.ref.pointer, _sel_setPrefersIncrementalDelivery_, value); } - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as constrained. - /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to - /// satisfy the request, YES otherwise. - bool get allowsConstrainedNetworkAccess { - return _objc_msgSend_91o635( - this.ref.pointer, _sel_allowsConstrainedNetworkAccess); + /// init + NSURLSessionTask init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as constrained. - /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to - /// satisfy the request, YES otherwise. - set allowsConstrainedNetworkAccess(bool value) { - return _objc_msgSend_1s56lr9( - this.ref.pointer, _sel_setAllowsConstrainedNetworkAccess_, value); + /// new + static NSURLSessionTask new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLSessionTask, _sel_new); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } - /// ! - /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC - /// racing without HTTP/3 service discovery. - /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. - /// The default may be YES in a future OS update. - bool get assumesHTTP3Capable { - return _objc_msgSend_91o635(this.ref.pointer, _sel_assumesHTTP3Capable); + /// allocWithZone: + static NSURLSessionTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_hzlb60( + _class_NSURLSessionTask, _sel_allocWithZone_, zone); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } - /// ! - /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC - /// racing without HTTP/3 service discovery. - /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. - /// The default may be YES in a future OS update. - set assumesHTTP3Capable(bool value) { - return _objc_msgSend_1s56lr9( - this.ref.pointer, _sel_setAssumesHTTP3Capable_, value); + /// alloc + static NSURLSessionTask alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSURLSessionTask, _sel_alloc); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } - /// ! - /// @abstract Sets the NSURLRequestAttribution to associate with this request. - /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the - /// user. Defaults to NSURLRequestAttributionDeveloper. - NSURLRequestAttribution get attribution { - final _ret = _objc_msgSend_i3avs9(this.ref.pointer, _sel_attribution); - return NSURLRequestAttribution.fromValue(_ret); + /// self + NSURLSessionTask self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract Sets the NSURLRequestAttribution to associate with this request. - /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the - /// user. Defaults to NSURLRequestAttributionDeveloper. - set attribution(NSURLRequestAttribution value) { - return _objc_msgSend_1nw1jep( - this.ref.pointer, _sel_setAttribution_, value.value); + /// retain + NSURLSessionTask retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. - /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, - /// No otherwise. Defaults to NO. - bool get requiresDNSSECValidation { - return _objc_msgSend_91o635( - this.ref.pointer, _sel_requiresDNSSECValidation); + /// autorelease + NSURLSessionTask autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); } +} - /// ! - /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. - /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, - /// No otherwise. Defaults to NO. - set requiresDNSSECValidation(bool value) { - return _objc_msgSend_1s56lr9( - this.ref.pointer, _sel_setRequiresDNSSECValidation_, value); - } +late final _sel_storeCookies_forTask_ = + objc.registerName("storeCookies:forTask:"); +void _ObjCBlock_ffiVoid_objcObjCObject_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} - /// ! - /// @method requestWithURL: - /// @abstract Allocates and initializes an NSURLRequest with the given - /// URL. - /// @discussion Default values are used for cache policy - /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 - /// seconds). - /// @param URL The URL for the request. - /// @result A newly-created and autoreleased NSURLRequest instance. - static NSMutableURLRequest requestWithURL_(objc.NSURL URL) { - final _ret = _objc_msgSend_62nh5j( - _class_NSMutableURLRequest, _sel_requestWithURL_, URL.ref.pointer); - return NSMutableURLRequest.castFromPointer(_ret, - retain: true, release: true); - } +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject_listenerTrampoline) + ..keepIsolateAlive = false; - /// supportsSecureCoding - static bool getSupportsSecureCoding() { - return _objc_msgSend_91o635( - _class_NSMutableURLRequest, _sel_supportsSecureCoding); - } - - /// ! - /// @method requestWithURL:cachePolicy:timeoutInterval: - /// @abstract Allocates and initializes a NSURLRequest with the given - /// URL and cache policy. - /// @param URL The URL for the request. - /// @param cachePolicy The cache policy for the request. - /// @param timeoutInterval The timeout interval for the request. See the - /// commentary for the timeoutInterval for more information on - /// timeout intervals. - /// @result A newly-created and autoreleased NSURLRequest instance. - static NSMutableURLRequest requestWithURL_cachePolicy_timeoutInterval_( - objc.NSURL URL, - NSURLRequestCachePolicy cachePolicy, - DartNSTimeInterval timeoutInterval) { - final _ret = _objc_msgSend_3phu9v( - _class_NSMutableURLRequest, - _sel_requestWithURL_cachePolicy_timeoutInterval_, - URL.ref.pointer, - cachePolicy.value, - timeoutInterval); - return NSMutableURLRequest.castFromPointer(_ret, - retain: true, release: true); - } - - /// ! - /// @method initWithURL: - /// @abstract Initializes an NSURLRequest with the given URL. - /// @discussion Default values are used for cache policy - /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 - /// seconds). - /// @param URL The URL for the request. - /// @result An initialized NSURLRequest. - NSMutableURLRequest initWithURL_(objc.NSURL URL) { - final _ret = _objc_msgSend_62nh5j( - this.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer); - return NSMutableURLRequest.castFromPointer(_ret, - retain: false, release: true); - } - - /// ! - /// @method initWithURL: - /// @abstract Initializes an NSURLRequest with the given URL and - /// cache policy. - /// @discussion This is the designated initializer for the - /// NSURLRequest class. - /// @param URL The URL for the request. - /// @param cachePolicy The cache policy for the request. - /// @param timeoutInterval The timeout interval for the request. See the - /// commentary for the timeoutInterval for more information on - /// timeout intervals. - /// @result An initialized NSURLRequest. - NSMutableURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, - NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { - final _ret = _objc_msgSend_3phu9v( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_cachePolicy_timeoutInterval_, - URL.ref.pointer, - cachePolicy.value, - timeoutInterval); - return NSMutableURLRequest.castFromPointer(_ret, - retain: false, release: true); - } - - /// init - NSMutableURLRequest init() { - final _ret = - _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); - return NSMutableURLRequest.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSMutableURLRequest new1() { - final _ret = _objc_msgSend_1x359cv(_class_NSMutableURLRequest, _sel_new); - return NSMutableURLRequest.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSMutableURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_hzlb60( - _class_NSMutableURLRequest, _sel_allocWithZone_, zone); - return NSMutableURLRequest.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSMutableURLRequest alloc() { - final _ret = _objc_msgSend_1x359cv(_class_NSMutableURLRequest, _sel_alloc); - return NSMutableURLRequest.castFromPointer(_ret, - retain: false, release: true); - } - - /// self - NSMutableURLRequest self() { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); - return NSMutableURLRequest.castFromPointer(_ret, - retain: true, release: true); - } - - /// retain - NSMutableURLRequest retain() { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); - return NSMutableURLRequest.castFromPointer(_ret, - retain: true, release: true); - } - - /// autorelease - NSMutableURLRequest autorelease() { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); - return NSMutableURLRequest.castFromPointer(_ret, - retain: true, release: true); - } - - /// initWithCoder: - NSMutableURLRequest? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSMutableURLRequest.castFromPointer(_ret, - retain: false, release: true); - } -} - -enum NSHTTPCookieAcceptPolicy { - NSHTTPCookieAcceptPolicyAlways(0), - NSHTTPCookieAcceptPolicyNever(1), - NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain(2); - - final int value; - const NSHTTPCookieAcceptPolicy(this.value); - - static NSHTTPCookieAcceptPolicy fromValue(int value) => switch (value) { - 0 => NSHTTPCookieAcceptPolicyAlways, - 1 => NSHTTPCookieAcceptPolicyNever, - 2 => NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain, - _ => throw ArgumentError( - "Unknown value for NSHTTPCookieAcceptPolicy: $value"), - }; -} - -/// WARNING: NSHTTPCookieStorage is a stub. To generate bindings for this class, include -/// NSHTTPCookieStorage in your config's objc-interfaces list. -/// -/// NSHTTPCookieStorage -class NSHTTPCookieStorage extends objc.NSObject { - NSHTTPCookieStorage._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSHTTPCookieStorage] that points to the same underlying object as [other]. - NSHTTPCookieStorage.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSHTTPCookieStorage] that wraps the given raw object pointer. - NSHTTPCookieStorage.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); -} - -late final _class_NSHTTPCookieStorage = objc.getClass("NSHTTPCookieStorage"); -late final _class_NSURLSessionTask = objc.getClass("NSURLSessionTask"); -late final _protocol_NSProgressReporting = - objc.getProtocol("NSProgressReporting"); - -/// WARNING: NSProgress is a stub. To generate bindings for this class, include -/// NSProgress in your config's objc-interfaces list. -/// -/// NSProgress -class NSProgress extends objc.NSObject { - NSProgress._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSProgress] that points to the same underlying object as [other]. - NSProgress.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSProgress] that wraps the given raw object pointer. - NSProgress.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); -} - -late final _sel_progress = objc.registerName("progress"); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSProgress_ffiVoid_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_NSProgress_ffiVoid { +/// Construction methods for `objc.ObjCBlock?)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObject { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> + static objc.ObjCBlock?)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock)>(pointer, - retain: retain, release: release); + objc.ObjCBlock?)>( + pointer, + retain: retain, + release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock)> fromFunctionPointer( + static objc.ObjCBlock?)> fromFunctionPointer( ffi.Pointer< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> + ffi.Void Function(ffi.Pointer arg0)>> ptr) => - objc.ObjCBlock)>( + objc.ObjCBlock?)>( objc.newPointerBlock( - _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable, ptr.cast()), + _ObjCBlock_ffiVoid_objcObjCObject_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -48071,875 +46612,1129 @@ abstract final class ObjCBlock_NSProgress_ffiVoid { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(NSProgress Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( + static objc.ObjCBlock?)> + fromFunction(void Function(objc.ObjCObjectBase?) fn) => + objc.ObjCBlock?)>( objc.newClosureBlock( - _ObjCBlock_NSProgress_ffiVoid_closureCallable, - (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), + _ObjCBlock_ffiVoid_objcObjCObject_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.ObjCObjectBase(arg0, + retain: true, release: true))), retain: false, release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock?)> + listener(void Function(objc.ObjCObjectBase?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.ObjCObjectBase(arg0, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock?)>( + wrapper, + retain: false, + release: true); + } } -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_NSProgress_ffiVoid_CallExtension - on objc.ObjCBlock)> { - NSProgress call(ffi.Pointer arg0) => NSProgress.castFromPointer( - ref.pointer.ref.invoke +/// Call operator for `objc.ObjCBlock?)>`. +extension ObjCBlock_ffiVoid_objcObjCObject_CallExtension + on objc.ObjCBlock?)> { + void call(objc.ObjCObjectBase? arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0), - retain: true, - release: true); + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); } -/// NSProgressReporting -abstract final class NSProgressReporting { - /// Builds an object that implements the NSProgressReporting protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required NSProgress Function() progress}) { - final builder = objc.ObjCProtocolBuilder(); - NSProgressReporting.progress.implement(builder, progress); - return builder.build(); +late final _sel_getCookiesForTask_completionHandler_ = + objc.registerName("getCookiesForTask:completionHandler:"); + +/// NSURLSessionTaskAdditions +extension NSURLSessionTaskAdditions1 on NSHTTPCookieStorage { + /// storeCookies:forTask: + void storeCookies_forTask_( + objc.ObjCObjectBase cookies, NSURLSessionTask task) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_storeCookies_forTask_, + cookies.ref.pointer, task.ref.pointer); } - /// Adds the implementation of the NSProgressReporting protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required NSProgress Function() progress}) { - NSProgressReporting.progress.implement(builder, progress); + /// getCookiesForTask:completionHandler: + void getCookiesForTask_completionHandler_( + NSURLSessionTask task, + objc.ObjCBlock?)> + completionHandler) { + _objc_msgSend_14pxqbs( + this.ref.pointer, + _sel_getCookiesForTask_completionHandler_, + task.ref.pointer, + completionHandler.ref.pointer); } +} - /// progress - static final progress = objc.ObjCProtocolMethod( - _protocol_NSProgressReporting, - _sel_progress, - objc.getProtocolMethodSignature( - _protocol_NSProgressReporting, - _sel_progress, - isRequired: true, - isInstanceMethod: true, - ), - (NSProgress Function() func) => ObjCBlock_NSProgress_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); +late final _class_NSEnumerator = objc.getClass("NSEnumerator"); +late final _sel_allObjects = objc.registerName("allObjects"); + +/// NSExtendedEnumerator +extension NSExtendedEnumerator on objc.NSEnumerator { + /// allObjects + objc.ObjCObjectBase get allObjects { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allObjects); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } } -late final _sel_taskIdentifier = objc.registerName("taskIdentifier"); -late final _sel_originalRequest = objc.registerName("originalRequest"); -late final _sel_currentRequest = objc.registerName("currentRequest"); -late final _class_NSURLResponse = objc.getClass("NSURLResponse"); -late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_ = - objc.registerName( - "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); -final _objc_msgSend_13tl325 = objc.msgSendPointer +late final _class_NSDictionary = objc.getClass("NSDictionary"); +late final _sel_allKeys = objc.registerName("allKeys"); +late final _sel_allKeysForObject_ = objc.registerName("allKeysForObject:"); +late final _sel_allValues = objc.registerName("allValues"); +late final _sel_descriptionInStringsFileFormat = + objc.registerName("descriptionInStringsFileFormat"); +late final _sel_descriptionWithLocale_indent_ = + objc.registerName("descriptionWithLocale:indent:"); +final _objc_msgSend_dcd68g = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Pointer)>>() + ffi.UnsignedLong)>>() .asFunction< ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + int)>(); +late final _sel_isEqualToDictionary_ = + objc.registerName("isEqualToDictionary:"); +late final _sel_objectEnumerator = objc.registerName("objectEnumerator"); +late final _sel_objectsForKeys_notFoundMarker_ = + objc.registerName("objectsForKeys:notFoundMarker:"); +late final _sel_writeToURL_error_ = objc.registerName("writeToURL:error:"); +final _objc_msgSend_blqzg8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + bool Function( ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_MIMEType = objc.registerName("MIMEType"); -late final _sel_expectedContentLength = - objc.registerName("expectedContentLength"); -final _objc_msgSend_1k101e3 = objc.msgSendPointer + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_keysSortedByValueUsingSelector_ = + objc.registerName("keysSortedByValueUsingSelector:"); +final _objc_msgSend_19hbqky = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.LongLong Function(ffi.Pointer, + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>() .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_textEncodingName = objc.registerName("textEncodingName"); -late final _sel_suggestedFilename = objc.registerName("suggestedFilename"); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_getObjects_andKeys_count_ = + objc.registerName("getObjects:andKeys:count:"); +final _objc_msgSend_n2svg2 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.UnsignedLong)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + int)>(); +late final _sel_objectForKeyedSubscript_ = + objc.registerName("objectForKeyedSubscript:"); +void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} -/// NSURLResponse -class NSURLResponse extends objc.NSObject { - NSURLResponse._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerTrampoline) + ..keepIsolateAlive = false; - /// Constructs a [NSURLResponse] that points to the same underlying object as [other]. - NSURLResponse.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); +/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(pointer, + retain: retain, release: release); - /// Constructs a [NSURLResponse] that wraps the given raw object pointer. - NSURLResponse.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Returns whether [obj] is an instance of [NSURLResponse]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_69e0x1( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLResponse); - } + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.Pointer, ffi.Pointer)> + fromFunction(void Function(objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) fn) => + objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true), + arg2)), + retain: false, + release: true); - /// ! - /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: - /// @abstract Initialize an NSURLResponse with the provided values. - /// @param URL the URL - /// @param MIMEType the MIME content type of the response - /// @param length the expected content length of the associated data - /// @param name the name of the text encoding for the associated data, if applicable, else nil - /// @result The initialized NSURLResponse. - /// @discussion This is the designated initializer for NSURLResponse. - NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( - objc.NSURL URL, - objc.NSString? MIMEType, - DartNSInteger length, - objc.NSString? name) { - final _ret = _objc_msgSend_13tl325( - this.ref.retainAndReturnPointer(), - _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, - URL.ref.pointer, - MIMEType?.ref.pointer ?? ffi.nullptr, - length, - name?.ref.pointer ?? ffi.nullptr); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> listener( + void Function( + objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn(objc.ObjCObjectBase(arg0, retain: false, release: true), + objc.ObjCObjectBase(arg1, retain: false, release: true), arg2)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1krhfwz(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(wrapper, retain: false, release: true); } +} - /// ! - /// @abstract Returns the URL of the receiver. - /// @result The URL of the receiver. - objc.NSURL? get URL { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_URL); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +extension ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> { + void call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, + ffi.Pointer arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2); +} - /// ! - /// @abstract Returns the MIME type of the receiver. - /// @discussion The MIME type is based on the information provided - /// from an origin source. However, that value may be changed or - /// corrected by a protocol implementation if it can be determined - /// that the origin server or source reported the information - /// incorrectly or imprecisely. An attempt to guess the MIME type may - /// be made if the origin source did not report any such information. - /// @result The MIME type of the receiver. - objc.NSString? get MIMEType { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_MIMEType); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); +late final _sel_enumerateKeysAndObjectsUsingBlock_ = + objc.registerName("enumerateKeysAndObjectsUsingBlock:"); +final _objc_msgSend_f167m6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_enumerateKeysAndObjectsWithOptions_usingBlock_ = + objc.registerName("enumerateKeysAndObjectsWithOptions:usingBlock:"); +final _objc_msgSend_yx8yc6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_keysSortedByValueUsingComparator_ = + objc.registerName("keysSortedByValueUsingComparator:"); +final _objc_msgSend_cy99le = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_keysSortedByValueWithOptions_usingComparator_ = + objc.registerName("keysSortedByValueWithOptions:usingComparator:"); +final _objc_msgSend_1u2b7ut = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline, + false) + .cast(); +bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureTrampoline, + false) + .cast(); + +/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock, ffi.Pointer, ffi.Pointer)> + fromFunction(bool Function(objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) fn) => + objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true), + arg2)), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +extension ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_CallExtension + on objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> { + bool call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, + ffi.Pointer arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2); +} + +late final _sel_keysOfEntriesPassingTest_ = + objc.registerName("keysOfEntriesPassingTest:"); +late final _sel_keysOfEntriesWithOptions_passingTest_ = + objc.registerName("keysOfEntriesWithOptions:passingTest:"); +final _objc_msgSend_hd4f96 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + +/// NSExtendedDictionary +extension NSExtendedDictionary on objc.NSDictionary { + /// allKeys + objc.ObjCObjectBase get allKeys { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allKeys); + return objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// ! - /// @abstract Returns the expected content length of the receiver. - /// @discussion Some protocol implementations report a content length - /// as part of delivering load metadata, but not all protocols - /// guarantee the amount of data that will be delivered in actuality. - /// Hence, this method returns an expected amount. Clients should use - /// this value as an advisory, and should be prepared to deal with - /// either more or less data. - /// @result The expected content length of the receiver, or -1 if - /// there is no expectation that can be arrived at regarding expected - /// content length. - int get expectedContentLength { - return _objc_msgSend_1k101e3(this.ref.pointer, _sel_expectedContentLength); + /// allKeysForObject: + objc.ObjCObjectBase allKeysForObject_(objc.ObjCObjectBase anObject) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_allKeysForObject_, anObject.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// ! - /// @abstract Returns the name of the text encoding of the receiver. - /// @discussion This name will be the actual string reported by the - /// origin source during the course of performing a protocol-specific - /// URL load. Clients can inspect this string and convert it to an - /// NSStringEncoding or CFStringEncoding using the methods and - /// functions made available in the appropriate framework. - /// @result The name of the text encoding of the receiver, or nil if no - /// text encoding was specified. - objc.NSString? get textEncodingName { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_textEncodingName); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + /// allValues + objc.ObjCObjectBase get allValues { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allValues); + return objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// ! - /// @abstract Returns a suggested filename if the resource were saved to disk. - /// @discussion The method first checks if the server has specified a filename using the - /// content disposition header. If no valid filename is specified using that mechanism, - /// this method checks the last path component of the URL. If no valid filename can be - /// obtained using the last path component, this method uses the URL's host as the filename. - /// If the URL's host can't be converted to a valid filename, the filename "unknown" is used. - /// In most cases, this method appends the proper file extension based on the MIME type. - /// This method always returns a valid filename. - /// @result A suggested filename to use if saving the resource to disk. - objc.NSString? get suggestedFilename { - final _ret = - _objc_msgSend_1x359cv(this.ref.pointer, _sel_suggestedFilename); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); + /// description + objc.NSString get description { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_description); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// init - NSURLResponse init() { - final _ret = - _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + /// descriptionInStringsFileFormat + objc.NSString get descriptionInStringsFileFormat { + final _ret = _objc_msgSend_1x359cv( + this.ref.pointer, _sel_descriptionInStringsFileFormat); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// new - static NSURLResponse new1() { - final _ret = _objc_msgSend_1x359cv(_class_NSURLResponse, _sel_new); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + /// descriptionWithLocale: + objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { + final _ret = _objc_msgSend_62nh5j(this.ref.pointer, + _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// allocWithZone: - static NSURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_hzlb60(_class_NSURLResponse, _sel_allocWithZone_, zone); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + /// descriptionWithLocale:indent: + objc.NSString descriptionWithLocale_indent_( + objc.ObjCObjectBase? locale, DartNSUInteger level) { + final _ret = _objc_msgSend_dcd68g( + this.ref.pointer, + _sel_descriptionWithLocale_indent_, + locale?.ref.pointer ?? ffi.nullptr, + level); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// alloc - static NSURLResponse alloc() { - final _ret = _objc_msgSend_1x359cv(_class_NSURLResponse, _sel_alloc); - return NSURLResponse.castFromPointer(_ret, retain: false, release: true); + /// isEqualToDictionary: + bool isEqualToDictionary_(objc.NSDictionary otherDictionary) { + return _objc_msgSend_69e0x1(this.ref.pointer, _sel_isEqualToDictionary_, + otherDictionary.ref.pointer); } - /// self - NSURLResponse self() { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); - return NSURLResponse.castFromPointer(_ret, retain: true, release: true); + /// objectEnumerator + objc.NSEnumerator objectEnumerator() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_objectEnumerator); + return objc.NSEnumerator.castFromPointer(_ret, retain: true, release: true); } - /// retain - NSURLResponse retain() { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); - return NSURLResponse.castFromPointer(_ret, retain: true, release: true); + /// objectsForKeys:notFoundMarker: + objc.ObjCObjectBase objectsForKeys_notFoundMarker_( + objc.ObjCObjectBase keys, objc.ObjCObjectBase marker) { + final _ret = _objc_msgSend_rsfdlh( + this.ref.pointer, + _sel_objectsForKeys_notFoundMarker_, + keys.ref.pointer, + marker.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// autorelease - NSURLResponse autorelease() { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); - return NSURLResponse.castFromPointer(_ret, retain: true, release: true); + /// writeToURL:error: + bool writeToURL_error_( + objc.NSURL url, ffi.Pointer> error) { + return _objc_msgSend_blqzg8( + this.ref.pointer, _sel_writeToURL_error_, url.ref.pointer, error); } - /// supportsSecureCoding - static bool getSupportsSecureCoding() { - return _objc_msgSend_91o635( - _class_NSURLResponse, _sel_supportsSecureCoding); + /// keysSortedByValueUsingSelector: + objc.ObjCObjectBase keysSortedByValueUsingSelector_( + ffi.Pointer comparator) { + final _ret = _objc_msgSend_19hbqky( + this.ref.pointer, _sel_keysSortedByValueUsingSelector_, comparator); + return objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); + /// getObjects:andKeys:count: + void getObjects_andKeys_count_( + ffi.Pointer> objects, + ffi.Pointer> keys, + DartNSUInteger count) { + _objc_msgSend_n2svg2( + this.ref.pointer, _sel_getObjects_andKeys_count_, objects, keys, count); } - /// initWithCoder: - NSURLResponse? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); + /// objectForKeyedSubscript: + objc.ObjCObjectBase? objectForKeyedSubscript_(objc.ObjCObjectBase key) { + final _ret = _objc_msgSend_62nh5j( + this.ref.pointer, _sel_objectForKeyedSubscript_, key.ref.pointer); return _ret.address == 0 ? null - : NSURLResponse.castFromPointer(_ret, retain: false, release: true); + : objc.ObjCObjectBase(_ret, retain: true, release: true); } -} -late final _sel_response = objc.registerName("response"); -late final _sel_delegate = objc.registerName("delegate"); -late final _sel_setDelegate_ = objc.registerName("setDelegate:"); -late final _sel_earliestBeginDate = objc.registerName("earliestBeginDate"); -late final _sel_setEarliestBeginDate_ = - objc.registerName("setEarliestBeginDate:"); -late final _sel_countOfBytesClientExpectsToSend = - objc.registerName("countOfBytesClientExpectsToSend"); -final _objc_msgSend_pysgoz = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Int64 Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setCountOfBytesClientExpectsToSend_ = - objc.registerName("setCountOfBytesClientExpectsToSend:"); -final _objc_msgSend_17gvxvj = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Int64)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_countOfBytesClientExpectsToReceive = - objc.registerName("countOfBytesClientExpectsToReceive"); -late final _sel_setCountOfBytesClientExpectsToReceive_ = - objc.registerName("setCountOfBytesClientExpectsToReceive:"); -late final _sel_countOfBytesSent = objc.registerName("countOfBytesSent"); -late final _sel_countOfBytesReceived = - objc.registerName("countOfBytesReceived"); -late final _sel_countOfBytesExpectedToSend = - objc.registerName("countOfBytesExpectedToSend"); -late final _sel_countOfBytesExpectedToReceive = - objc.registerName("countOfBytesExpectedToReceive"); -late final _sel_taskDescription = objc.registerName("taskDescription"); -late final _sel_setTaskDescription_ = objc.registerName("setTaskDescription:"); -late final _sel_cancel = objc.registerName("cancel"); + /// enumerateKeysAndObjectsUsingBlock: + void enumerateKeysAndObjectsUsingBlock_( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + block) { + _objc_msgSend_f167m6(this.ref.pointer, + _sel_enumerateKeysAndObjectsUsingBlock_, block.ref.pointer); + } -enum NSURLSessionTaskState { - /// The task is currently being serviced by the session - NSURLSessionTaskStateRunning(0), - NSURLSessionTaskStateSuspended(1), + /// enumerateKeysAndObjectsWithOptions:usingBlock: + void enumerateKeysAndObjectsWithOptions_usingBlock_( + objc.NSEnumerationOptions opts, + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + block) { + _objc_msgSend_yx8yc6( + this.ref.pointer, + _sel_enumerateKeysAndObjectsWithOptions_usingBlock_, + opts.value, + block.ref.pointer); + } - /// The task has been told to cancel. The session will receive a URLSession:task:didCompleteWithError: message. - NSURLSessionTaskStateCanceling(2), + /// keysSortedByValueUsingComparator: + objc.ObjCObjectBase keysSortedByValueUsingComparator_( + DartNSComparator cmptr) { + final _ret = _objc_msgSend_cy99le(this.ref.pointer, + _sel_keysSortedByValueUsingComparator_, cmptr.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } - /// The task has completed and the session will receive no more delegate notifications - NSURLSessionTaskStateCompleted(3); + /// keysSortedByValueWithOptions:usingComparator: + objc.ObjCObjectBase keysSortedByValueWithOptions_usingComparator_( + objc.NSSortOptions opts, DartNSComparator cmptr) { + final _ret = _objc_msgSend_1u2b7ut( + this.ref.pointer, + _sel_keysSortedByValueWithOptions_usingComparator_, + opts.value, + cmptr.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } - final int value; - const NSURLSessionTaskState(this.value); + /// keysOfEntriesPassingTest: + objc.ObjCObjectBase keysOfEntriesPassingTest_( + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + predicate) { + final _ret = _objc_msgSend_cy99le(this.ref.pointer, + _sel_keysOfEntriesPassingTest_, predicate.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } - static NSURLSessionTaskState fromValue(int value) => switch (value) { - 0 => NSURLSessionTaskStateRunning, - 1 => NSURLSessionTaskStateSuspended, - 2 => NSURLSessionTaskStateCanceling, - 3 => NSURLSessionTaskStateCompleted, - _ => throw ArgumentError( - "Unknown value for NSURLSessionTaskState: $value"), - }; + /// keysOfEntriesWithOptions:passingTest: + objc.ObjCObjectBase keysOfEntriesWithOptions_passingTest_( + objc.NSEnumerationOptions opts, + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + predicate) { + final _ret = _objc_msgSend_hd4f96( + this.ref.pointer, + _sel_keysOfEntriesWithOptions_passingTest_, + opts.value, + predicate.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } } -late final _sel_state = objc.registerName("state"); -final _objc_msgSend_1vze0g9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_error = objc.registerName("error"); -late final _sel_suspend = objc.registerName("suspend"); -late final _sel_resume = objc.registerName("resume"); -late final _sel_priority = objc.registerName("priority"); -final _objc_msgSend_2cgrxl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function( - ffi.Pointer, ffi.Pointer)>(); -final _objc_msgSend_2cgrxlFpret = objc.msgSendFpretPointer +late final _sel_getObjects_andKeys_ = objc.registerName("getObjects:andKeys:"); +final _objc_msgSend_hefmm1 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer)>>() + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>() .asFunction< - double Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setPriority_ = objc.registerName("setPriority:"); -final _objc_msgSend_v5hmet = objc.msgSendPointer + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>(); +late final _sel_dictionaryWithContentsOfFile_ = + objc.registerName("dictionaryWithContentsOfFile:"); +late final _sel_dictionaryWithContentsOfURL_ = + objc.registerName("dictionaryWithContentsOfURL:"); +late final _sel_initWithContentsOfFile_ = + objc.registerName("initWithContentsOfFile:"); +late final _sel_initWithContentsOfURL_ = + objc.registerName("initWithContentsOfURL:"); +late final _sel_writeToFile_atomically_ = + objc.registerName("writeToFile:atomically:"); +final _objc_msgSend_w8pbfh = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>() + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, double)>(); -late final _sel_prefersIncrementalDelivery = - objc.registerName("prefersIncrementalDelivery"); -late final _sel_setPrefersIncrementalDelivery_ = - objc.registerName("setPrefersIncrementalDelivery:"); - -/// NSURLSessionTask - a cancelable object that refers to the lifetime -/// of processing a given request. -class NSURLSessionTask extends objc.NSObject { - NSURLSessionTask._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSURLSessionTask] that points to the same underlying object as [other]. - NSURLSessionTask.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLSessionTask] that wraps the given raw object pointer. - NSURLSessionTask.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSURLSessionTask]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_69e0x1( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionTask); - } + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_writeToURL_atomically_ = + objc.registerName("writeToURL:atomically:"); - /// an identifier for this task, assigned by and unique to the owning session - DartNSUInteger get taskIdentifier { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_taskIdentifier); +/// NSDeprecated +extension NSDeprecated on objc.NSDictionary { + /// getObjects:andKeys: + void getObjects_andKeys_(ffi.Pointer> objects, + ffi.Pointer> keys) { + _objc_msgSend_hefmm1( + this.ref.pointer, _sel_getObjects_andKeys_, objects, keys); } - /// may be nil if this is a stream task - NSURLRequest? get originalRequest { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_originalRequest); + /// dictionaryWithContentsOfFile: + static objc.NSDictionary? dictionaryWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(_class_NSDictionary, + _sel_dictionaryWithContentsOfFile_, path.ref.pointer); return _ret.address == 0 ? null - : NSURLRequest.castFromPointer(_ret, retain: true, release: true); + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// may differ from originalRequest due to http server redirection - NSURLRequest? get currentRequest { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_currentRequest); + /// dictionaryWithContentsOfURL: + static objc.NSDictionary? dictionaryWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(_class_NSDictionary, + _sel_dictionaryWithContentsOfURL_, url.ref.pointer); return _ret.address == 0 ? null - : NSURLRequest.castFromPointer(_ret, retain: true, release: true); + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// may be nil if no response has been received - NSURLResponse? get response { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_response); + /// initWithContentsOfFile: + objc.NSDictionary? initWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); return _ret.address == 0 ? null - : NSURLResponse.castFromPointer(_ret, retain: true, release: true); + : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); } - /// Sets a task-specific delegate. Methods not implemented on this delegate will - /// still be forwarded to the session delegate. - /// - /// Cannot be modified after task resumes. Not supported on background session. - /// - /// Delegate is strongly referenced until the task completes, after which it is - /// reset to `nil`. - objc.ObjCObjectBase? get delegate { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_delegate); + /// initWithContentsOfURL: + objc.NSDictionary? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); return _ret.address == 0 ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); + : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); } - /// Sets a task-specific delegate. Methods not implemented on this delegate will - /// still be forwarded to the session delegate. - /// - /// Cannot be modified after task resumes. Not supported on background session. - /// - /// Delegate is strongly referenced until the task completes, after which it is - /// reset to `nil`. - set delegate(objc.ObjCObjectBase? value) { - return _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); + /// writeToFile:atomically: + bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { + return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToFile_atomically_, + path.ref.pointer, useAuxiliaryFile); } - /// progress - NSProgress get progress { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_progress); - return NSProgress.castFromPointer(_ret, retain: true, release: true); + /// writeToURL:atomically: + bool writeToURL_atomically_(objc.NSURL url, bool atomically) { + return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToURL_atomically_, + url.ref.pointer, atomically); } +} - /// Start the network load for this task no earlier than the specified date. If - /// not specified, no start delay is used. - /// - /// Only applies to tasks created from background NSURLSession instances; has no - /// effect for tasks created from other session types. - objc.NSDate? get earliestBeginDate { - final _ret = - _objc_msgSend_1x359cv(this.ref.pointer, _sel_earliestBeginDate); - return _ret.address == 0 - ? null - : objc.NSDate.castFromPointer(_ret, retain: true, release: true); +late final _sel_dictionary = objc.registerName("dictionary"); +late final _sel_dictionaryWithObject_forKey_ = + objc.registerName("dictionaryWithObject:forKey:"); +late final _sel_dictionaryWithObjects_forKeys_count_ = + objc.registerName("dictionaryWithObjects:forKeys:count:"); +final _objc_msgSend_cfqbni = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + int)>(); +late final _sel_dictionaryWithObjectsAndKeys_ = + objc.registerName("dictionaryWithObjectsAndKeys:"); +late final _sel_dictionaryWithDictionary_ = + objc.registerName("dictionaryWithDictionary:"); +late final _sel_dictionaryWithObjects_forKeys_ = + objc.registerName("dictionaryWithObjects:forKeys:"); +late final _sel_initWithObjectsAndKeys_ = + objc.registerName("initWithObjectsAndKeys:"); +late final _sel_initWithDictionary_ = objc.registerName("initWithDictionary:"); +late final _sel_initWithDictionary_copyItems_ = + objc.registerName("initWithDictionary:copyItems:"); +final _objc_msgSend_1bdmr5f = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_initWithObjects_forKeys_ = + objc.registerName("initWithObjects:forKeys:"); +late final _sel_initWithContentsOfURL_error_ = + objc.registerName("initWithContentsOfURL:error:"); +final _objc_msgSend_1705co6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); +late final _sel_dictionaryWithContentsOfURL_error_ = + objc.registerName("dictionaryWithContentsOfURL:error:"); + +/// NSDictionaryCreation +extension NSDictionaryCreation on objc.NSDictionary { + /// dictionary + static objc.NSDictionary dictionary() { + final _ret = _objc_msgSend_1x359cv(_class_NSDictionary, _sel_dictionary); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// Start the network load for this task no earlier than the specified date. If - /// not specified, no start delay is used. - /// - /// Only applies to tasks created from background NSURLSession instances; has no - /// effect for tasks created from other session types. - set earliestBeginDate(objc.NSDate? value) { - return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setEarliestBeginDate_, - value?.ref.pointer ?? ffi.nullptr); + /// dictionaryWithObject:forKey: + static objc.NSDictionary dictionaryWithObject_forKey_( + objc.ObjCObjectBase object, objc.ObjCObjectBase key) { + final _ret = _objc_msgSend_rsfdlh(_class_NSDictionary, + _sel_dictionaryWithObject_forKey_, object.ref.pointer, key.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// The number of bytes that the client expects (a best-guess upper-bound) will - /// be sent and received by this task. These values are used by system scheduling - /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. - int get countOfBytesClientExpectsToSend { - return _objc_msgSend_pysgoz( - this.ref.pointer, _sel_countOfBytesClientExpectsToSend); + /// dictionaryWithObjects:forKeys:count: + static objc.NSDictionary dictionaryWithObjects_forKeys_count_( + ffi.Pointer> objects, + ffi.Pointer> keys, + DartNSUInteger cnt) { + final _ret = _objc_msgSend_cfqbni(_class_NSDictionary, + _sel_dictionaryWithObjects_forKeys_count_, objects, keys, cnt); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// The number of bytes that the client expects (a best-guess upper-bound) will - /// be sent and received by this task. These values are used by system scheduling - /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. - set countOfBytesClientExpectsToSend(int value) { - return _objc_msgSend_17gvxvj( - this.ref.pointer, _sel_setCountOfBytesClientExpectsToSend_, value); + /// dictionaryWithObjectsAndKeys: + static objc.NSDictionary dictionaryWithObjectsAndKeys_( + objc.ObjCObjectBase firstObject) { + final _ret = _objc_msgSend_62nh5j(_class_NSDictionary, + _sel_dictionaryWithObjectsAndKeys_, firstObject.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// countOfBytesClientExpectsToReceive - int get countOfBytesClientExpectsToReceive { - return _objc_msgSend_pysgoz( - this.ref.pointer, _sel_countOfBytesClientExpectsToReceive); + /// dictionaryWithDictionary: + static objc.NSDictionary dictionaryWithDictionary_(objc.NSDictionary dict) { + final _ret = _objc_msgSend_62nh5j( + _class_NSDictionary, _sel_dictionaryWithDictionary_, dict.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// setCountOfBytesClientExpectsToReceive: - set countOfBytesClientExpectsToReceive(int value) { - return _objc_msgSend_17gvxvj( - this.ref.pointer, _sel_setCountOfBytesClientExpectsToReceive_, value); + /// dictionaryWithObjects:forKeys: + static objc.NSDictionary dictionaryWithObjects_forKeys_( + objc.ObjCObjectBase objects, objc.ObjCObjectBase keys) { + final _ret = _objc_msgSend_rsfdlh( + _class_NSDictionary, + _sel_dictionaryWithObjects_forKeys_, + objects.ref.pointer, + keys.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - /// number of body bytes already sent - int get countOfBytesSent { - return _objc_msgSend_pysgoz(this.ref.pointer, _sel_countOfBytesSent); + /// initWithObjectsAndKeys: + objc.NSDictionary initWithObjectsAndKeys_(objc.ObjCObjectBase firstObject) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithObjectsAndKeys_, firstObject.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, + retain: false, release: true); } - /// number of body bytes already received - int get countOfBytesReceived { - return _objc_msgSend_pysgoz(this.ref.pointer, _sel_countOfBytesReceived); + /// initWithDictionary: + objc.NSDictionary initWithDictionary_(objc.NSDictionary otherDictionary) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithDictionary_, otherDictionary.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, + retain: false, release: true); } - /// number of body bytes we expect to send, derived from the Content-Length of the HTTP request - int get countOfBytesExpectedToSend { - return _objc_msgSend_pysgoz( - this.ref.pointer, _sel_countOfBytesExpectedToSend); + /// initWithDictionary:copyItems: + objc.NSDictionary initWithDictionary_copyItems_( + objc.NSDictionary otherDictionary, bool flag) { + final _ret = _objc_msgSend_1bdmr5f(this.ref.retainAndReturnPointer(), + _sel_initWithDictionary_copyItems_, otherDictionary.ref.pointer, flag); + return objc.NSDictionary.castFromPointer(_ret, + retain: false, release: true); } - /// number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response. - int get countOfBytesExpectedToReceive { - return _objc_msgSend_pysgoz( - this.ref.pointer, _sel_countOfBytesExpectedToReceive); + /// initWithObjects:forKeys: + objc.NSDictionary initWithObjects_forKeys_( + objc.ObjCObjectBase objects, objc.ObjCObjectBase keys) { + final _ret = _objc_msgSend_rsfdlh(this.ref.retainAndReturnPointer(), + _sel_initWithObjects_forKeys_, objects.ref.pointer, keys.ref.pointer); + return objc.NSDictionary.castFromPointer(_ret, + retain: false, release: true); } - /// The taskDescription property is available for the developer to - /// provide a descriptive label for the task. - objc.NSString? get taskDescription { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_taskDescription); + /// initWithContentsOfURL:error: + objc.NSDictionary? initWithContentsOfURL_error_( + objc.NSURL url, ffi.Pointer> error) { + final _ret = _objc_msgSend_1705co6(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_error_, url.ref.pointer, error); return _ret.address == 0 ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// The taskDescription property is available for the developer to - /// provide a descriptive label for the task. - set taskDescription(objc.NSString? value) { - return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setTaskDescription_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// -cancel returns immediately, but marks a task as being canceled. - /// The task will signal -URLSession:task:didCompleteWithError: with an - /// error value of { NSURLErrorDomain, NSURLErrorCancelled }. In some - /// cases, the task may signal other work before it acknowledges the - /// cancelation. -cancel may be sent to a task that has been suspended. - void cancel() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_cancel); - } - - /// The current state of the task within the session. - NSURLSessionTaskState get state { - final _ret = _objc_msgSend_1vze0g9(this.ref.pointer, _sel_state); - return NSURLSessionTaskState.fromValue(_ret); + : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); } - /// The error, if any, delivered via -URLSession:task:didCompleteWithError: - /// This property will be nil in the event that no error occurred. - objc.NSError? get error { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_error); + /// dictionaryWithContentsOfURL:error: + static objc.NSDictionary? dictionaryWithContentsOfURL_error_( + objc.NSURL url, ffi.Pointer> error) { + final _ret = _objc_msgSend_1705co6(_class_NSDictionary, + _sel_dictionaryWithContentsOfURL_error_, url.ref.pointer, error); return _ret.address == 0 ? null - : objc.NSError.castFromPointer(_ret, retain: true, release: true); + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } +} - /// Suspending a task will prevent the NSURLSession from continuing to - /// load data. There may still be delegate calls made on behalf of - /// this task (for instance, to report data received while suspending) - /// but no further transmissions will be made on behalf of the task - /// until -resume is sent. The timeout timer associated with the task - /// will be disabled while a task is suspended. -suspend and -resume are - /// nestable. - void suspend() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_suspend); - } - - /// resume - void resume() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_resume); - } +late final _class_NSMutableDictionary = objc.getClass("NSMutableDictionary"); +late final _sel_addEntriesFromDictionary_ = + objc.registerName("addEntriesFromDictionary:"); +late final _sel_removeAllObjects = objc.registerName("removeAllObjects"); +late final _sel_removeObjectsForKeys_ = + objc.registerName("removeObjectsForKeys:"); +late final _sel_setDictionary_ = objc.registerName("setDictionary:"); +late final _sel_setObject_forKeyedSubscript_ = + objc.registerName("setObject:forKeyedSubscript:"); - /// Sets a scaling factor for the priority of the task. The scaling factor is a - /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest - /// priority and 1.0 is considered the highest. - /// - /// The priority is a hint and not a hard requirement of task performance. The - /// priority of a task may be changed using this API at any time, but not all - /// protocols support this; in these cases, the last priority that took effect - /// will be used. - /// - /// If no priority is specified, the task will operate with the default priority - /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional - /// priority levels are provided: NSURLSessionTaskPriorityLow and - /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. - double get priority { - return objc.useMsgSendVariants - ? _objc_msgSend_2cgrxlFpret(this.ref.pointer, _sel_priority) - : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_priority); +/// NSExtendedMutableDictionary +extension NSExtendedMutableDictionary on objc.NSMutableDictionary { + /// addEntriesFromDictionary: + void addEntriesFromDictionary_(objc.NSDictionary otherDictionary) { + _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_addEntriesFromDictionary_, + otherDictionary.ref.pointer); } - /// Sets a scaling factor for the priority of the task. The scaling factor is a - /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest - /// priority and 1.0 is considered the highest. - /// - /// The priority is a hint and not a hard requirement of task performance. The - /// priority of a task may be changed using this API at any time, but not all - /// protocols support this; in these cases, the last priority that took effect - /// will be used. - /// - /// If no priority is specified, the task will operate with the default priority - /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional - /// priority levels are provided: NSURLSessionTaskPriorityLow and - /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. - set priority(double value) { - return _objc_msgSend_v5hmet(this.ref.pointer, _sel_setPriority_, value); + /// removeAllObjects + void removeAllObjects() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllObjects); } - /// Provides a hint indicating if incremental delivery of a partial response body - /// would be useful for the application, or if it cannot process the response - /// until it is complete. Indicating that incremental delivery is not desired may - /// improve task performance. For example, if a response cannot be decoded until - /// the entire content is received, set this property to false. - /// - /// Defaults to true unless this task is created with completion-handler based - /// convenience methods, or if it is a download task. - bool get prefersIncrementalDelivery { - return _objc_msgSend_91o635( - this.ref.pointer, _sel_prefersIncrementalDelivery); + /// removeObjectsForKeys: + void removeObjectsForKeys_(objc.ObjCObjectBase keyArray) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_removeObjectsForKeys_, keyArray.ref.pointer); } - /// Provides a hint indicating if incremental delivery of a partial response body - /// would be useful for the application, or if it cannot process the response - /// until it is complete. Indicating that incremental delivery is not desired may - /// improve task performance. For example, if a response cannot be decoded until - /// the entire content is received, set this property to false. - /// - /// Defaults to true unless this task is created with completion-handler based - /// convenience methods, or if it is a download task. - set prefersIncrementalDelivery(bool value) { - return _objc_msgSend_1s56lr9( - this.ref.pointer, _sel_setPrefersIncrementalDelivery_, value); + /// setDictionary: + void setDictionary_(objc.NSDictionary otherDictionary) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setDictionary_, otherDictionary.ref.pointer); } - /// init - NSURLSessionTask init() { - final _ret = - _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + /// setObject:forKeyedSubscript: + void setObject_forKeyedSubscript_( + objc.ObjCObjectBase? obj, objc.ObjCObjectBase key) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_setObject_forKeyedSubscript_, + obj?.ref.pointer ?? ffi.nullptr, key.ref.pointer); } +} - /// new - static NSURLSessionTask new1() { - final _ret = _objc_msgSend_1x359cv(_class_NSURLSessionTask, _sel_new); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); - } +late final _sel_dictionaryWithCapacity_ = + objc.registerName("dictionaryWithCapacity:"); +final _objc_msgSend_1qrcblu = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedLong)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); - /// allocWithZone: - static NSURLSessionTask allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_hzlb60( - _class_NSURLSessionTask, _sel_allocWithZone_, zone); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); +/// NSMutableDictionaryCreation +extension NSMutableDictionaryCreation on objc.NSMutableDictionary { + /// dictionaryWithCapacity: + static objc.NSMutableDictionary dictionaryWithCapacity_( + DartNSUInteger numItems) { + final _ret = _objc_msgSend_1qrcblu( + _class_NSMutableDictionary, _sel_dictionaryWithCapacity_, numItems); + return objc.NSMutableDictionary.castFromPointer(_ret, + retain: true, release: true); } - /// alloc - static NSURLSessionTask alloc() { - final _ret = _objc_msgSend_1x359cv(_class_NSURLSessionTask, _sel_alloc); - return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); + /// dictionaryWithContentsOfFile: + static objc.NSMutableDictionary? dictionaryWithContentsOfFile_( + objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(_class_NSMutableDictionary, + _sel_dictionaryWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableDictionary.castFromPointer(_ret, + retain: true, release: true); } - /// self - NSURLSessionTask self() { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); - return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); + /// dictionaryWithContentsOfURL: + static objc.NSMutableDictionary? dictionaryWithContentsOfURL_( + objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(_class_NSMutableDictionary, + _sel_dictionaryWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableDictionary.castFromPointer(_ret, + retain: true, release: true); } - /// retain - NSURLSessionTask retain() { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); - return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); + /// initWithContentsOfFile: + objc.NSMutableDictionary? initWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableDictionary.castFromPointer(_ret, + retain: false, release: true); } - /// autorelease - NSURLSessionTask autorelease() { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); - return NSURLSessionTask.castFromPointer(_ret, retain: true, release: true); + /// initWithContentsOfURL: + objc.NSMutableDictionary? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableDictionary.castFromPointer(_ret, + retain: false, release: true); } } -late final _sel_storeCookies_forTask_ = - objc.registerName("storeCookies:forTask:"); -void _ObjCBlock_ffiVoid_objcObjCObject_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock?)>`. -abstract final class ObjCBlock_ffiVoid_objcObjCObject { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock?)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock?)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock?)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock?)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_objcObjCObject_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock?)> - fromFunction(void Function(objc.ObjCObjectBase?) fn) => - objc.ObjCBlock?)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_closureCallable, - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : objc.ObjCObjectBase(arg0, - retain: true, release: true))), - retain: false, - release: true); +late final _sel_sharedKeySetForKeys_ = + objc.registerName("sharedKeySetForKeys:"); - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock?)> - listener(void Function(objc.ObjCObjectBase?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : objc.ObjCObjectBase(arg0, retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1jdvcbf(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock?)>( - wrapper, - retain: false, - release: true); +/// NSSharedKeySetDictionary +extension NSSharedKeySetDictionary on objc.NSDictionary { + /// sharedKeySetForKeys: + static objc.ObjCObjectBase sharedKeySetForKeys_(objc.ObjCObjectBase keys) { + final _ret = _objc_msgSend_62nh5j( + _class_NSDictionary, _sel_sharedKeySetForKeys_, keys.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); } } -/// Call operator for `objc.ObjCBlock?)>`. -extension ObjCBlock_ffiVoid_objcObjCObject_CallExtension - on objc.ObjCBlock?)> { - void call(objc.ObjCObjectBase? arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_getCookiesForTask_completionHandler_ = - objc.registerName("getCookiesForTask:completionHandler:"); - -/// NSURLSessionTaskAdditions -extension NSURLSessionTaskAdditions1 on NSHTTPCookieStorage { - /// storeCookies:forTask: - void storeCookies_forTask_( - objc.ObjCObjectBase cookies, NSURLSessionTask task) { - _objc_msgSend_wjvic9(this.ref.pointer, _sel_storeCookies_forTask_, - cookies.ref.pointer, task.ref.pointer); - } +late final _sel_dictionaryWithSharedKeySet_ = + objc.registerName("dictionaryWithSharedKeySet:"); - /// getCookiesForTask:completionHandler: - void getCookiesForTask_completionHandler_( - NSURLSessionTask task, - objc.ObjCBlock?)> - completionHandler) { - _objc_msgSend_14pxqbs( - this.ref.pointer, - _sel_getCookiesForTask_completionHandler_, - task.ref.pointer, - completionHandler.ref.pointer); +/// NSSharedKeySetDictionary +extension NSSharedKeySetDictionary1 on objc.NSMutableDictionary { + /// dictionaryWithSharedKeySet: + static objc.NSMutableDictionary dictionaryWithSharedKeySet_( + objc.ObjCObjectBase keyset) { + final _ret = _objc_msgSend_62nh5j(_class_NSMutableDictionary, + _sel_dictionaryWithSharedKeySet_, keyset.ref.pointer); + return objc.NSMutableDictionary.castFromPointer(_ret, + retain: true, release: true); } } -late final _protocol_NSFastEnumeration = objc.getProtocol("NSFastEnumeration"); late final _sel_countByEnumeratingWithState_objects_count_ = objc.registerName("countByEnumeratingWithState:objects:count:"); final _objc_msgSend_1b5ysjl = objc.msgSendPointer @@ -49106,1455 +47901,347 @@ extension ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSU int)>()(ref.pointer, arg0, arg1, arg2, arg3); } -/// NSFastEnumeration -abstract final class NSFastEnumeration { - /// Builds an object that implements the NSFastEnumeration protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required DartNSUInteger Function( - ffi.Pointer, - ffi.Pointer>, - DartNSUInteger) - countByEnumeratingWithState_objects_count_}) { - final builder = objc.ObjCProtocolBuilder(); - NSFastEnumeration.countByEnumeratingWithState_objects_count_ - .implement(builder, countByEnumeratingWithState_objects_count_); - return builder.build(); - } - - /// Adds the implementation of the NSFastEnumeration protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required DartNSUInteger Function( - ffi.Pointer, - ffi.Pointer>, - DartNSUInteger) - countByEnumeratingWithState_objects_count_}) { - NSFastEnumeration.countByEnumeratingWithState_objects_count_ - .implement(builder, countByEnumeratingWithState_objects_count_); - } - +/// NSGenericFastEnumeration +extension NSGenericFastEnumeration on objc.NSDictionary { /// countByEnumeratingWithState:objects:count: - static final countByEnumeratingWithState_objects_count_ = - objc.ObjCProtocolMethod< - DartNSUInteger Function(ffi.Pointer, - ffi.Pointer>, DartNSUInteger)>( - _protocol_NSFastEnumeration, - _sel_countByEnumeratingWithState_objects_count_, - objc.getProtocolMethodSignature( - _protocol_NSFastEnumeration, - _sel_countByEnumeratingWithState_objects_count_, - isRequired: true, - isInstanceMethod: true, - ), - (DartNSUInteger Function(ffi.Pointer, - ffi.Pointer>, DartNSUInteger) - func) => - ObjCBlock_NSUInteger_ffiVoid_NSFastEnumerationState_objcObjCObject_NSUInteger - .fromFunction((ffi.Pointer _, - ffi.Pointer arg1, - ffi.Pointer> arg2, - DartNSUInteger arg3) => - func(arg1, arg2, arg3)), - ); -} - -late final _class_NSEnumerator = objc.getClass("NSEnumerator"); -late final _sel_allObjects = objc.registerName("allObjects"); - -/// NSExtendedEnumerator -extension NSExtendedEnumerator on objc.NSEnumerator { - /// allObjects - objc.ObjCObjectBase get allObjects { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allObjects); - return objc.ObjCObjectBase(_ret, retain: true, release: true); + DartNSUInteger countByEnumeratingWithState_objects_count_( + ffi.Pointer state, + ffi.Pointer> buffer, + DartNSUInteger len) { + return _objc_msgSend_1b5ysjl(this.ref.pointer, + _sel_countByEnumeratingWithState_objects_count_, state, buffer, len); } } -late final _class_NSDictionary = objc.getClass("NSDictionary"); -late final _sel_allKeys = objc.registerName("allKeys"); -late final _sel_allKeysForObject_ = objc.registerName("allKeysForObject:"); -late final _sel_allValues = objc.registerName("allValues"); -late final _sel_descriptionInStringsFileFormat = - objc.registerName("descriptionInStringsFileFormat"); -late final _sel_descriptionWithLocale_indent_ = - objc.registerName("descriptionWithLocale:indent:"); -final _objc_msgSend_dcd68g = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_isEqualToDictionary_ = - objc.registerName("isEqualToDictionary:"); -late final _sel_objectEnumerator = objc.registerName("objectEnumerator"); -late final _sel_objectsForKeys_notFoundMarker_ = - objc.registerName("objectsForKeys:notFoundMarker:"); -late final _sel_writeToURL_error_ = objc.registerName("writeToURL:error:"); -final _objc_msgSend_blqzg8 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_keysSortedByValueUsingSelector_ = - objc.registerName("keysSortedByValueUsingSelector:"); -late final _sel_getObjects_andKeys_count_ = - objc.registerName("getObjects:andKeys:count:"); -final _objc_msgSend_n2svg2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.UnsignedLong)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - int)>(); -late final _sel_objectForKeyedSubscript_ = - objc.registerName("objectForKeyedSubscript:"); -void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); +typedef NSProgressKind = ffi.Pointer; +typedef DartNSProgressKind = objc.NSString; +typedef NSProgressUserInfoKey = ffi.Pointer; +typedef DartNSProgressUserInfoKey = objc.NSString; +typedef NSProgressFileOperationKind = ffi.Pointer; +typedef DartNSProgressFileOperationKind = objc.NSString; +typedef NSProgressUnpublishingHandler = ffi.Pointer; +typedef DartNSProgressUnpublishingHandler = objc.ObjCBlock; +NSProgressUnpublishingHandler + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer arg0)>>() + .asFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer)>()(arg0); ffi.Pointer - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrCallable = + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function( + NSProgressUnpublishingHandler Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline) + ffi.Pointer)>( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); +NSProgressUnpublishingHandler + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as NSProgressUnpublishingHandler Function( + ffi.Pointer))(arg0); ffi.Pointer - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureCallable = + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function( + NSProgressUnpublishingHandler Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureTrampoline) + ffi.Pointer)>( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerTrampoline) - ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. -abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool { +/// Construction methods for `objc.ObjCBlock? Function(NSProgress)>`. +abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> + static objc + .ObjCBlock? Function(NSProgress)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(pointer, - retain: retain, release: release); + objc.ObjCBlock? Function( + NSProgress)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + static objc.ObjCBlock? Function(NSProgress)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock? Function(NSProgress)>( + objc.newPointerBlock( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer, ffi.Pointer)> - fromFunction(void Function(objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) fn) => - objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true), - arg2)), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> listener( - void Function( - objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn(objc.ObjCObjectBase(arg0, retain: false, release: true), - objc.ObjCObjectBase(arg1, retain: false, release: true), arg2)); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1krhfwz(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(wrapper, retain: false, release: true); - } + objc.ObjCBlock? Function(NSProgress)> fromFunction( + DartNSProgressUnpublishingHandler? Function(NSProgress) fn) => + objc.ObjCBlock? Function(NSProgress)>( + objc.newClosureBlock( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable, + (ffi.Pointer arg0) => + fn(NSProgress.castFromPointer(arg0, retain: true, release: true)) + ?.ref + .retainAndAutorelease() ?? + ffi.nullptr), + retain: false, + release: true); } -/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. -extension ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> { - void call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, - ffi.Pointer arg2) => - ref.pointer.ref.invoke +/// Call operator for `objc.ObjCBlock? Function(NSProgress)>`. +extension ObjCBlock_NSProgressUnpublishingHandler_NSProgress_CallExtension + on objc + .ObjCBlock? Function(NSProgress)> { + DartNSProgressUnpublishingHandler? call(NSProgress arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Void Function( + NSProgressUnpublishingHandler Function( ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2); + ffi.Pointer arg0)>>() + .asFunction, ffi.Pointer)>() + (ref.pointer, arg0.ref.pointer) + .address == + 0 + ? null + : ObjCBlock_ffiVoid.castFromPointer( + ref.pointer.ref.invoke.cast block, ffi.Pointer arg0)>>().asFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0.ref.pointer), + retain: true, + release: true); } -late final _sel_enumerateKeysAndObjectsUsingBlock_ = - objc.registerName("enumerateKeysAndObjectsUsingBlock:"); -final _objc_msgSend_f167m6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_enumerateKeysAndObjectsWithOptions_usingBlock_ = - objc.registerName("enumerateKeysAndObjectsWithOptions:usingBlock:"); -final _objc_msgSend_yx8yc6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_keysSortedByValueUsingComparator_ = - objc.registerName("keysSortedByValueUsingComparator:"); -final _objc_msgSend_cy99le = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_keysSortedByValueWithOptions_usingComparator_ = - objc.registerName("keysSortedByValueWithOptions:usingComparator:"); -final _objc_msgSend_1u2b7ut = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline, - false) - .cast(); -bool _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureTrampoline, - false) - .cast(); +typedef NSProgressPublishingHandler = ffi.Pointer; +typedef DartNSProgressPublishingHandler + = objc.ObjCBlock? Function(NSProgress)>; +typedef CFArrayRetainCallBackFunction = ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFArrayRetainCallBack + = ffi.Pointer>; +typedef CFArrayReleaseCallBackFunction = ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef DartCFArrayReleaseCallBackFunction = void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFArrayReleaseCallBack + = ffi.Pointer>; +typedef CFArrayCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer value); +typedef CFArrayCopyDescriptionCallBack + = ffi.Pointer>; +typedef CFArrayEqualCallBackFunction = Boolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef DartCFArrayEqualCallBackFunction = DartBoolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef CFArrayEqualCallBack + = ffi.Pointer>; -/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. -abstract final class ObjCBlock_bool_objcObjCObject_objcObjCObject_bool { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(pointer, - retain: retain, release: release); +final class CFArrayCallBacks extends ffi.Struct { + @CFIndex() + external int version; - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + external CFArrayRetainCallBack retain; - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer, ffi.Pointer)> - fromFunction(bool Function(objc.ObjCObjectBase, objc.ObjCObjectBase, ffi.Pointer) fn) => - objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true), - arg2)), - retain: false, - release: true); -} + external CFArrayReleaseCallBack release; -/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. -extension ObjCBlock_bool_objcObjCObject_objcObjCObject_bool_CallExtension - on objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> { - bool call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, - ffi.Pointer arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2); + external CFArrayCopyDescriptionCallBack copyDescription; + + external CFArrayEqualCallBack equal; } -late final _sel_keysOfEntriesPassingTest_ = - objc.registerName("keysOfEntriesPassingTest:"); -late final _sel_keysOfEntriesWithOptions_passingTest_ = - objc.registerName("keysOfEntriesWithOptions:passingTest:"); -final _objc_msgSend_hd4f96 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); +typedef CFArrayApplierFunctionFunction = ffi.Void Function( + ffi.Pointer value, ffi.Pointer context); +typedef DartCFArrayApplierFunctionFunction = void Function( + ffi.Pointer value, ffi.Pointer context); +typedef CFArrayApplierFunction + = ffi.Pointer>; -/// NSExtendedDictionary -extension NSExtendedDictionary on objc.NSDictionary { - /// allKeys - objc.ObjCObjectBase get allKeys { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allKeys); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } +final class __CFArray extends ffi.Opaque {} - /// allKeysForObject: - objc.ObjCObjectBase allKeysForObject_(objc.ObjCObjectBase anObject) { - final _ret = _objc_msgSend_62nh5j( - this.ref.pointer, _sel_allKeysForObject_, anObject.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } +typedef CFArrayRef = ffi.Pointer<__CFArray>; +typedef CFMutableArrayRef = ffi.Pointer<__CFArray>; +typedef os_function_tFunction = ffi.Void Function(ffi.Pointer); +typedef Dartos_function_tFunction = void Function(ffi.Pointer); +typedef os_function_t = ffi.Pointer>; +typedef os_block_t = ffi.Pointer; +typedef Dartos_block_t = objc.ObjCBlock; - /// allValues - objc.ObjCObjectBase get allValues { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_allValues); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } +/// WARNING: OS_object is a stub. To generate bindings for this class, include +/// OS_object in your config's objc-interfaces list. +/// +/// OS_object +class OS_object extends objc.NSObject { + OS_object._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// description - objc.NSString get description { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_description); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } + /// Constructs a [OS_object] that points to the same underlying object as [other]. + OS_object.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// descriptionInStringsFileFormat - objc.NSString get descriptionInStringsFileFormat { - final _ret = _objc_msgSend_1x359cv( - this.ref.pointer, _sel_descriptionInStringsFileFormat); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } + /// Constructs a [OS_object] that wraps the given raw object pointer. + OS_object.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} - /// descriptionWithLocale: - objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_62nh5j(this.ref.pointer, - _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } +typedef sec_object_t = ffi.Pointer; +typedef Dartsec_object_t = objc.NSObject; - /// descriptionWithLocale:indent: - objc.NSString descriptionWithLocale_indent_( - objc.ObjCObjectBase? locale, DartNSUInteger level) { - final _ret = _objc_msgSend_dcd68g( - this.ref.pointer, - _sel_descriptionWithLocale_indent_, - locale?.ref.pointer ?? ffi.nullptr, - level); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } +final class __SecCertificate extends ffi.Opaque {} - /// isEqualToDictionary: - bool isEqualToDictionary_(objc.NSDictionary otherDictionary) { - return _objc_msgSend_69e0x1(this.ref.pointer, _sel_isEqualToDictionary_, - otherDictionary.ref.pointer); - } +typedef SecCertificateRef = ffi.Pointer<__SecCertificate>; +typedef OpaqueSecCertificateRef = __SecCertificate; - /// objectEnumerator - objc.NSEnumerator objectEnumerator() { - final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_objectEnumerator); - return objc.NSEnumerator.castFromPointer(_ret, retain: true, release: true); - } +final class __SecIdentity extends ffi.Opaque {} - /// objectsForKeys:notFoundMarker: - objc.ObjCObjectBase objectsForKeys_notFoundMarker_( - objc.ObjCObjectBase keys, objc.ObjCObjectBase marker) { - final _ret = _objc_msgSend_rsfdlh( - this.ref.pointer, - _sel_objectsForKeys_notFoundMarker_, - keys.ref.pointer, - marker.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } +typedef SecIdentityRef = ffi.Pointer<__SecIdentity>; +typedef OpaqueSecIdentityRef = __SecIdentity; - /// writeToURL:error: - bool writeToURL_error_( - objc.NSURL url, ffi.Pointer> error) { - return _objc_msgSend_blqzg8( - this.ref.pointer, _sel_writeToURL_error_, url.ref.pointer, error); - } +final class __SecKey extends ffi.Opaque {} - /// keysSortedByValueUsingSelector: - objc.ObjCObjectBase keysSortedByValueUsingSelector_( - ffi.Pointer comparator) { - final _ret = _objc_msgSend_19hbqky( - this.ref.pointer, _sel_keysSortedByValueUsingSelector_, comparator); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } +typedef SecKeyRef = ffi.Pointer<__SecKey>; +typedef OpaqueSecKeyRef = __SecKey; - /// getObjects:andKeys:count: - void getObjects_andKeys_count_( - ffi.Pointer> objects, - ffi.Pointer> keys, - DartNSUInteger count) { - _objc_msgSend_n2svg2( - this.ref.pointer, _sel_getObjects_andKeys_count_, objects, keys, count); - } +final class __SecPolicy extends ffi.Opaque {} - /// objectForKeyedSubscript: - objc.ObjCObjectBase? objectForKeyedSubscript_(objc.ObjCObjectBase key) { - final _ret = _objc_msgSend_62nh5j( - this.ref.pointer, _sel_objectForKeyedSubscript_, key.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } +typedef SecPolicyRef = ffi.Pointer<__SecPolicy>; - /// enumerateKeysAndObjectsUsingBlock: - void enumerateKeysAndObjectsUsingBlock_( - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - block) { - _objc_msgSend_f167m6(this.ref.pointer, - _sel_enumerateKeysAndObjectsUsingBlock_, block.ref.pointer); - } +final class __SecAccessControl extends ffi.Opaque {} - /// enumerateKeysAndObjectsWithOptions:usingBlock: - void enumerateKeysAndObjectsWithOptions_usingBlock_( - objc.NSEnumerationOptions opts, - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - block) { - _objc_msgSend_yx8yc6( - this.ref.pointer, - _sel_enumerateKeysAndObjectsWithOptions_usingBlock_, - opts.value, - block.ref.pointer); - } +typedef SecAccessControlRef = ffi.Pointer<__SecAccessControl>; - /// keysSortedByValueUsingComparator: - objc.ObjCObjectBase keysSortedByValueUsingComparator_( - DartNSComparator cmptr) { - final _ret = _objc_msgSend_cy99le(this.ref.pointer, - _sel_keysSortedByValueUsingComparator_, cmptr.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } +final class __SecKeychain extends ffi.Opaque {} - /// keysSortedByValueWithOptions:usingComparator: - objc.ObjCObjectBase keysSortedByValueWithOptions_usingComparator_( - objc.NSSortOptions opts, DartNSComparator cmptr) { - final _ret = _objc_msgSend_1u2b7ut( - this.ref.pointer, - _sel_keysSortedByValueWithOptions_usingComparator_, - opts.value, - cmptr.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } +typedef SecKeychainRef = ffi.Pointer<__SecKeychain>; - /// keysOfEntriesPassingTest: - objc.ObjCObjectBase keysOfEntriesPassingTest_( - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - predicate) { - final _ret = _objc_msgSend_cy99le(this.ref.pointer, - _sel_keysOfEntriesPassingTest_, predicate.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } +final class __SecKeychainItem extends ffi.Opaque {} - /// keysOfEntriesWithOptions:passingTest: - objc.ObjCObjectBase keysOfEntriesWithOptions_passingTest_( - objc.NSEnumerationOptions opts, - objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - predicate) { - final _ret = _objc_msgSend_hd4f96( - this.ref.pointer, - _sel_keysOfEntriesWithOptions_passingTest_, - opts.value, - predicate.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} +typedef SecKeychainItemRef = ffi.Pointer<__SecKeychainItem>; -late final _sel_getObjects_andKeys_ = objc.registerName("getObjects:andKeys:"); -final _objc_msgSend_hefmm1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); -late final _sel_dictionaryWithContentsOfFile_ = - objc.registerName("dictionaryWithContentsOfFile:"); -late final _sel_dictionaryWithContentsOfURL_ = - objc.registerName("dictionaryWithContentsOfURL:"); -late final _sel_initWithContentsOfFile_ = - objc.registerName("initWithContentsOfFile:"); -late final _sel_initWithContentsOfURL_ = - objc.registerName("initWithContentsOfURL:"); -late final _sel_writeToFile_atomically_ = - objc.registerName("writeToFile:atomically:"); -final _objc_msgSend_w8pbfh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_writeToURL_atomically_ = - objc.registerName("writeToURL:atomically:"); +final class __SecKeychainSearch extends ffi.Opaque {} -/// NSDeprecated -extension NSDeprecated on objc.NSDictionary { - /// getObjects:andKeys: - void getObjects_andKeys_(ffi.Pointer> objects, - ffi.Pointer> keys) { - _objc_msgSend_hefmm1( - this.ref.pointer, _sel_getObjects_andKeys_, objects, keys); - } +typedef SecKeychainSearchRef = ffi.Pointer<__SecKeychainSearch>; +typedef SecKeychainAttrType = OSType; - /// dictionaryWithContentsOfFile: - static objc.NSDictionary? dictionaryWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_62nh5j(_class_NSDictionary, - _sel_dictionaryWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } +final class SecKeychainAttribute extends ffi.Struct { + @SecKeychainAttrType() + external int tag; - /// dictionaryWithContentsOfURL: - static objc.NSDictionary? dictionaryWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_62nh5j(_class_NSDictionary, - _sel_dictionaryWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } + @UInt32() + external int length; - /// initWithContentsOfFile: - objc.NSDictionary? initWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); - } + external ffi.Pointer data; +} - /// initWithContentsOfURL: - objc.NSDictionary? initWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); - } +typedef SecKeychainAttributePtr = ffi.Pointer; - /// writeToFile:atomically: - bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { - return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToFile_atomically_, - path.ref.pointer, useAuxiliaryFile); - } +final class SecKeychainAttributeList extends ffi.Struct { + @UInt32() + external int count; - /// writeToURL:atomically: - bool writeToURL_atomically_(objc.NSURL url, bool atomically) { - return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToURL_atomically_, - url.ref.pointer, atomically); - } + external ffi.Pointer attr; } -late final _sel_dictionary = objc.registerName("dictionary"); -late final _sel_dictionaryWithObject_forKey_ = - objc.registerName("dictionaryWithObject:forKey:"); -late final _sel_dictionaryWithObjects_forKeys_count_ = - objc.registerName("dictionaryWithObjects:forKeys:count:"); -final _objc_msgSend_cfqbni = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - int)>(); -late final _sel_dictionaryWithObjectsAndKeys_ = - objc.registerName("dictionaryWithObjectsAndKeys:"); -late final _sel_dictionaryWithDictionary_ = - objc.registerName("dictionaryWithDictionary:"); -late final _sel_dictionaryWithObjects_forKeys_ = - objc.registerName("dictionaryWithObjects:forKeys:"); -late final _sel_initWithObjectsAndKeys_ = - objc.registerName("initWithObjectsAndKeys:"); -late final _sel_initWithDictionary_ = objc.registerName("initWithDictionary:"); -late final _sel_initWithDictionary_copyItems_ = - objc.registerName("initWithDictionary:copyItems:"); -final _objc_msgSend_1bdmr5f = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_initWithObjects_forKeys_ = - objc.registerName("initWithObjects:forKeys:"); -late final _sel_initWithContentsOfURL_error_ = - objc.registerName("initWithContentsOfURL:error:"); -final _objc_msgSend_1705co6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_dictionaryWithContentsOfURL_error_ = - objc.registerName("dictionaryWithContentsOfURL:error:"); - -/// NSDictionaryCreation -extension NSDictionaryCreation on objc.NSDictionary { - /// dictionary - static objc.NSDictionary dictionary() { - final _ret = _objc_msgSend_1x359cv(_class_NSDictionary, _sel_dictionary); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } +typedef SecKeychainStatus = UInt32; - /// dictionaryWithObject:forKey: - static objc.NSDictionary dictionaryWithObject_forKey_( - objc.ObjCObjectBase object, objc.ObjCObjectBase key) { - final _ret = _objc_msgSend_rsfdlh(_class_NSDictionary, - _sel_dictionaryWithObject_forKey_, object.ref.pointer, key.ref.pointer); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } +final class __SecTrustedApplication extends ffi.Opaque {} - /// dictionaryWithObjects:forKeys:count: - static objc.NSDictionary dictionaryWithObjects_forKeys_count_( - ffi.Pointer> objects, - ffi.Pointer> keys, - DartNSUInteger cnt) { - final _ret = _objc_msgSend_cfqbni(_class_NSDictionary, - _sel_dictionaryWithObjects_forKeys_count_, objects, keys, cnt); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } +typedef SecTrustedApplicationRef = ffi.Pointer<__SecTrustedApplication>; - /// dictionaryWithObjectsAndKeys: - static objc.NSDictionary dictionaryWithObjectsAndKeys_( - objc.ObjCObjectBase firstObject) { - final _ret = _objc_msgSend_62nh5j(_class_NSDictionary, - _sel_dictionaryWithObjectsAndKeys_, firstObject.ref.pointer); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } +final class __SecAccess extends ffi.Opaque {} - /// dictionaryWithDictionary: - static objc.NSDictionary dictionaryWithDictionary_(objc.NSDictionary dict) { - final _ret = _objc_msgSend_62nh5j( - _class_NSDictionary, _sel_dictionaryWithDictionary_, dict.ref.pointer); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } +typedef SecAccessRef = ffi.Pointer<__SecAccess>; +typedef OpaqueSecAccessRef = __SecAccess; - /// dictionaryWithObjects:forKeys: - static objc.NSDictionary dictionaryWithObjects_forKeys_( - objc.ObjCObjectBase objects, objc.ObjCObjectBase keys) { - final _ret = _objc_msgSend_rsfdlh( - _class_NSDictionary, - _sel_dictionaryWithObjects_forKeys_, - objects.ref.pointer, - keys.ref.pointer); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } +final class __SecACL extends ffi.Opaque {} - /// initWithObjectsAndKeys: - objc.NSDictionary initWithObjectsAndKeys_(objc.ObjCObjectBase firstObject) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithObjectsAndKeys_, firstObject.ref.pointer); - return objc.NSDictionary.castFromPointer(_ret, - retain: false, release: true); - } +typedef SecACLRef = ffi.Pointer<__SecACL>; - /// initWithDictionary: - objc.NSDictionary initWithDictionary_(objc.NSDictionary otherDictionary) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithDictionary_, otherDictionary.ref.pointer); - return objc.NSDictionary.castFromPointer(_ret, - retain: false, release: true); - } +final class __SecPassword extends ffi.Opaque {} - /// initWithDictionary:copyItems: - objc.NSDictionary initWithDictionary_copyItems_( - objc.NSDictionary otherDictionary, bool flag) { - final _ret = _objc_msgSend_1bdmr5f(this.ref.retainAndReturnPointer(), - _sel_initWithDictionary_copyItems_, otherDictionary.ref.pointer, flag); - return objc.NSDictionary.castFromPointer(_ret, - retain: false, release: true); - } +typedef SecPasswordRef = ffi.Pointer<__SecPassword>; - /// initWithObjects:forKeys: - objc.NSDictionary initWithObjects_forKeys_( - objc.ObjCObjectBase objects, objc.ObjCObjectBase keys) { - final _ret = _objc_msgSend_rsfdlh(this.ref.retainAndReturnPointer(), - _sel_initWithObjects_forKeys_, objects.ref.pointer, keys.ref.pointer); - return objc.NSDictionary.castFromPointer(_ret, - retain: false, release: true); - } +final class SecKeychainAttributeInfo extends ffi.Struct { + @UInt32() + external int count; - /// initWithContentsOfURL:error: - objc.NSDictionary? initWithContentsOfURL_error_( - objc.NSURL url, ffi.Pointer> error) { - final _ret = _objc_msgSend_1705co6(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_error_, url.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: false, release: true); - } + external ffi.Pointer tag; - /// dictionaryWithContentsOfURL:error: - static objc.NSDictionary? dictionaryWithContentsOfURL_error_( - objc.NSURL url, ffi.Pointer> error) { - final _ret = _objc_msgSend_1705co6(_class_NSDictionary, - _sel_dictionaryWithContentsOfURL_error_, url.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } + external ffi.Pointer format; } -late final _class_NSMutableDictionary = objc.getClass("NSMutableDictionary"); -late final _sel_addEntriesFromDictionary_ = - objc.registerName("addEntriesFromDictionary:"); -late final _sel_removeAllObjects = objc.registerName("removeAllObjects"); -late final _sel_removeObjectsForKeys_ = - objc.registerName("removeObjectsForKeys:"); -late final _sel_setDictionary_ = objc.registerName("setDictionary:"); -late final _sel_setObject_forKeyedSubscript_ = - objc.registerName("setObject:forKeyedSubscript:"); +typedef wint_t = __darwin_wint_t; -/// NSExtendedMutableDictionary -extension NSExtendedMutableDictionary on objc.NSMutableDictionary { - /// addEntriesFromDictionary: - void addEntriesFromDictionary_(objc.NSDictionary otherDictionary) { - _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_addEntriesFromDictionary_, - otherDictionary.ref.pointer); - } +final class _RuneEntry extends ffi.Struct { + @__darwin_rune_t() + external int __min; - /// removeAllObjects - void removeAllObjects() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllObjects); - } + @__darwin_rune_t() + external int __max; - /// removeObjectsForKeys: - void removeObjectsForKeys_(objc.ObjCObjectBase keyArray) { - _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_removeObjectsForKeys_, keyArray.ref.pointer); - } + @__darwin_rune_t() + external int __map; - /// setDictionary: - void setDictionary_(objc.NSDictionary otherDictionary) { - _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_setDictionary_, otherDictionary.ref.pointer); - } + external ffi.Pointer<__uint32_t> __types; +} - /// setObject:forKeyedSubscript: - void setObject_forKeyedSubscript_( - objc.ObjCObjectBase? obj, objc.ObjCObjectBase key) { - _objc_msgSend_wjvic9(this.ref.pointer, _sel_setObject_forKeyedSubscript_, - obj?.ref.pointer ?? ffi.nullptr, key.ref.pointer); - } +final class _RuneRange extends ffi.Struct { + @ffi.Int() + external int __nranges; + + external ffi.Pointer<_RuneEntry> __ranges; } -late final _sel_dictionaryWithCapacity_ = - objc.registerName("dictionaryWithCapacity:"); -final _objc_msgSend_1qrcblu = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); +final class _RuneCharClass extends ffi.Struct { + @ffi.Array.multi([14]) + external ffi.Array __name; -/// NSMutableDictionaryCreation -extension NSMutableDictionaryCreation on objc.NSMutableDictionary { - /// dictionaryWithCapacity: - static objc.NSMutableDictionary dictionaryWithCapacity_( - DartNSUInteger numItems) { - final _ret = _objc_msgSend_1qrcblu( - _class_NSMutableDictionary, _sel_dictionaryWithCapacity_, numItems); - return objc.NSMutableDictionary.castFromPointer(_ret, - retain: true, release: true); - } + @__uint32_t() + external int __mask; +} - /// dictionaryWithContentsOfFile: - static objc.NSMutableDictionary? dictionaryWithContentsOfFile_( - objc.NSString path) { - final _ret = _objc_msgSend_62nh5j(_class_NSMutableDictionary, - _sel_dictionaryWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableDictionary.castFromPointer(_ret, - retain: true, release: true); - } +final class _RuneLocale extends ffi.Struct { + @ffi.Array.multi([8]) + external ffi.Array __magic; - /// dictionaryWithContentsOfURL: - static objc.NSMutableDictionary? dictionaryWithContentsOfURL_( - objc.NSURL url) { - final _ret = _objc_msgSend_62nh5j(_class_NSMutableDictionary, - _sel_dictionaryWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableDictionary.castFromPointer(_ret, - retain: true, release: true); - } + @ffi.Array.multi([32]) + external ffi.Array __encoding; - /// initWithContentsOfFile: - objc.NSMutableDictionary? initWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableDictionary.castFromPointer(_ret, - retain: false, release: true); - } + external ffi.Pointer< + ffi.NativeFunction< + __darwin_rune_t Function(ffi.Pointer, __darwin_size_t, + ffi.Pointer>)>> __sgetrune; - /// initWithContentsOfURL: - objc.NSMutableDictionary? initWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableDictionary.castFromPointer(_ret, - retain: false, release: true); - } -} + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(__darwin_rune_t, ffi.Pointer, + __darwin_size_t, ffi.Pointer>)>> __sputrune; -late final _sel_sharedKeySetForKeys_ = - objc.registerName("sharedKeySetForKeys:"); + @__darwin_rune_t() + external int __invalid_rune; -/// NSSharedKeySetDictionary -extension NSSharedKeySetDictionary on objc.NSDictionary { - /// sharedKeySetForKeys: - static objc.ObjCObjectBase sharedKeySetForKeys_(objc.ObjCObjectBase keys) { - final _ret = _objc_msgSend_62nh5j( - _class_NSDictionary, _sel_sharedKeySetForKeys_, keys.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} + @ffi.Array.multi([256]) + external ffi.Array<__uint32_t> __runetype; -late final _sel_dictionaryWithSharedKeySet_ = - objc.registerName("dictionaryWithSharedKeySet:"); - -/// NSSharedKeySetDictionary -extension NSSharedKeySetDictionary1 on objc.NSMutableDictionary { - /// dictionaryWithSharedKeySet: - static objc.NSMutableDictionary dictionaryWithSharedKeySet_( - objc.ObjCObjectBase keyset) { - final _ret = _objc_msgSend_62nh5j(_class_NSMutableDictionary, - _sel_dictionaryWithSharedKeySet_, keyset.ref.pointer); - return objc.NSMutableDictionary.castFromPointer(_ret, - retain: true, release: true); - } -} - -/// NSGenericFastEnumeration -extension NSGenericFastEnumeration on objc.NSDictionary { - /// countByEnumeratingWithState:objects:count: - DartNSUInteger countByEnumeratingWithState_objects_count_( - ffi.Pointer state, - ffi.Pointer> buffer, - DartNSUInteger len) { - return _objc_msgSend_1b5ysjl(this.ref.pointer, - _sel_countByEnumeratingWithState_objects_count_, state, buffer, len); - } -} - -typedef NSProgressKind = ffi.Pointer; -typedef DartNSProgressKind = objc.NSString; -typedef NSProgressUserInfoKey = ffi.Pointer; -typedef DartNSProgressUserInfoKey = objc.NSString; -typedef NSProgressFileOperationKind = ffi.Pointer; -typedef DartNSProgressFileOperationKind = objc.NSString; -typedef NSProgressUnpublishingHandler = ffi.Pointer; -typedef DartNSProgressUnpublishingHandler = objc.ObjCBlock; -NSProgressUnpublishingHandler - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer arg0)>>() - .asFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer)>()(arg0); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable = - ffi.Pointer.fromFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline) - .cast(); -NSProgressUnpublishingHandler - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as NSProgressUnpublishingHandler Function( - ffi.Pointer))(arg0); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable = - ffi.Pointer.fromFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock? Function(NSProgress)>`. -abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock? Function(NSProgress)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - objc.ObjCBlock? Function( - NSProgress)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock? Function(NSProgress)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock? Function(NSProgress)>( - objc.newPointerBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - objc.ObjCBlock? Function(NSProgress)> fromFunction( - DartNSProgressUnpublishingHandler? Function(NSProgress) fn) => - objc.ObjCBlock? Function(NSProgress)>( - objc.newClosureBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable, - (ffi.Pointer arg0) => - fn(NSProgress.castFromPointer(arg0, retain: true, release: true)) - ?.ref - .retainAndAutorelease() ?? - ffi.nullptr), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock? Function(NSProgress)>`. -extension ObjCBlock_NSProgressUnpublishingHandler_NSProgress_CallExtension - on objc - .ObjCBlock? Function(NSProgress)> { - DartNSProgressUnpublishingHandler? call(NSProgress arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction, ffi.Pointer)>() - (ref.pointer, arg0.ref.pointer) - .address == - 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer( - ref.pointer.ref.invoke.cast block, ffi.Pointer arg0)>>().asFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0.ref.pointer), - retain: true, - release: true); -} - -typedef NSProgressPublishingHandler = ffi.Pointer; -typedef DartNSProgressPublishingHandler - = objc.ObjCBlock? Function(NSProgress)>; -typedef CFArrayRetainCallBackFunction = ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFArrayRetainCallBack - = ffi.Pointer>; -typedef CFArrayReleaseCallBackFunction = ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef DartCFArrayReleaseCallBackFunction = void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFArrayReleaseCallBack - = ffi.Pointer>; -typedef CFArrayCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer value); -typedef CFArrayCopyDescriptionCallBack - = ffi.Pointer>; -typedef CFArrayEqualCallBackFunction = Boolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef DartCFArrayEqualCallBackFunction = DartBoolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef CFArrayEqualCallBack - = ffi.Pointer>; - -final class CFArrayCallBacks extends ffi.Struct { - @CFIndex() - external int version; - - external CFArrayRetainCallBack retain; - - external CFArrayReleaseCallBack release; - - external CFArrayCopyDescriptionCallBack copyDescription; - - external CFArrayEqualCallBack equal; -} - -typedef CFArrayApplierFunctionFunction = ffi.Void Function( - ffi.Pointer value, ffi.Pointer context); -typedef DartCFArrayApplierFunctionFunction = void Function( - ffi.Pointer value, ffi.Pointer context); -typedef CFArrayApplierFunction - = ffi.Pointer>; - -final class __CFArray extends ffi.Opaque {} - -typedef CFArrayRef = ffi.Pointer<__CFArray>; -typedef CFMutableArrayRef = ffi.Pointer<__CFArray>; -typedef os_function_tFunction = ffi.Void Function(ffi.Pointer); -typedef Dartos_function_tFunction = void Function(ffi.Pointer); -typedef os_function_t = ffi.Pointer>; -typedef os_block_t = ffi.Pointer; -typedef Dartos_block_t = objc.ObjCBlock; - -/// WARNING: OS_object is a stub. To generate bindings for this class, include -/// OS_object in your config's objc-interfaces list. -/// -/// OS_object -class OS_object extends objc.NSObject { - OS_object._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [OS_object] that points to the same underlying object as [other]. - OS_object.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [OS_object] that wraps the given raw object pointer. - OS_object.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); -} - -late final _protocol_OS_sec_object = objc.getProtocol("OS_sec_object"); - -/// OS_sec_object -abstract final class OS_sec_object { - /// Builds an object that implements the OS_sec_object protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_sec_object protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - -typedef sec_object_t = ffi.Pointer; -typedef Dartsec_object_t = objc.NSObject; - -final class __SecCertificate extends ffi.Opaque {} - -typedef SecCertificateRef = ffi.Pointer<__SecCertificate>; -typedef OpaqueSecCertificateRef = __SecCertificate; - -final class __SecIdentity extends ffi.Opaque {} - -typedef SecIdentityRef = ffi.Pointer<__SecIdentity>; -typedef OpaqueSecIdentityRef = __SecIdentity; - -final class __SecKey extends ffi.Opaque {} - -typedef SecKeyRef = ffi.Pointer<__SecKey>; -typedef OpaqueSecKeyRef = __SecKey; - -final class __SecPolicy extends ffi.Opaque {} - -typedef SecPolicyRef = ffi.Pointer<__SecPolicy>; - -final class __SecAccessControl extends ffi.Opaque {} - -typedef SecAccessControlRef = ffi.Pointer<__SecAccessControl>; - -final class __SecKeychain extends ffi.Opaque {} - -typedef SecKeychainRef = ffi.Pointer<__SecKeychain>; - -final class __SecKeychainItem extends ffi.Opaque {} - -typedef SecKeychainItemRef = ffi.Pointer<__SecKeychainItem>; - -final class __SecKeychainSearch extends ffi.Opaque {} - -typedef SecKeychainSearchRef = ffi.Pointer<__SecKeychainSearch>; -typedef SecKeychainAttrType = OSType; - -final class SecKeychainAttribute extends ffi.Struct { - @SecKeychainAttrType() - external int tag; - - @UInt32() - external int length; - - external ffi.Pointer data; -} - -typedef SecKeychainAttributePtr = ffi.Pointer; - -final class SecKeychainAttributeList extends ffi.Struct { - @UInt32() - external int count; - - external ffi.Pointer attr; -} - -typedef SecKeychainStatus = UInt32; - -final class __SecTrustedApplication extends ffi.Opaque {} - -typedef SecTrustedApplicationRef = ffi.Pointer<__SecTrustedApplication>; - -final class __SecAccess extends ffi.Opaque {} - -typedef SecAccessRef = ffi.Pointer<__SecAccess>; -typedef OpaqueSecAccessRef = __SecAccess; - -final class __SecACL extends ffi.Opaque {} - -typedef SecACLRef = ffi.Pointer<__SecACL>; - -final class __SecPassword extends ffi.Opaque {} - -typedef SecPasswordRef = ffi.Pointer<__SecPassword>; - -final class SecKeychainAttributeInfo extends ffi.Struct { - @UInt32() - external int count; - - external ffi.Pointer tag; - - external ffi.Pointer format; -} - -typedef wint_t = __darwin_wint_t; - -final class _RuneEntry extends ffi.Struct { - @__darwin_rune_t() - external int __min; - - @__darwin_rune_t() - external int __max; - - @__darwin_rune_t() - external int __map; - - external ffi.Pointer<__uint32_t> __types; -} - -final class _RuneRange extends ffi.Struct { - @ffi.Int() - external int __nranges; - - external ffi.Pointer<_RuneEntry> __ranges; -} - -final class _RuneCharClass extends ffi.Struct { - @ffi.Array.multi([14]) - external ffi.Array __name; - - @__uint32_t() - external int __mask; -} - -final class _RuneLocale extends ffi.Struct { - @ffi.Array.multi([8]) - external ffi.Array __magic; - - @ffi.Array.multi([32]) - external ffi.Array __encoding; - - external ffi.Pointer< - ffi.NativeFunction< - __darwin_rune_t Function(ffi.Pointer, __darwin_size_t, - ffi.Pointer>)>> __sgetrune; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(__darwin_rune_t, ffi.Pointer, - __darwin_size_t, ffi.Pointer>)>> __sputrune; - - @__darwin_rune_t() - external int __invalid_rune; - - @ffi.Array.multi([256]) - external ffi.Array<__uint32_t> __runetype; - - @ffi.Array.multi([256]) - external ffi.Array<__darwin_rune_t> __maplower; + @ffi.Array.multi([256]) + external ffi.Array<__darwin_rune_t> __maplower; @ffi.Array.multi([256]) external ffi.Array<__darwin_rune_t> __mapupper; @@ -52662,51 +50349,11 @@ final class os_workgroup_max_parallel_threads_attr_s extends ffi.Opaque {} typedef os_workgroup_mpt_attr_s = os_workgroup_max_parallel_threads_attr_s; typedef os_workgroup_mpt_attr_t = ffi.Pointer; -late final _protocol_OS_os_workgroup_interval = - objc.getProtocol("OS_os_workgroup_interval"); - -/// OS_os_workgroup_interval -abstract final class OS_os_workgroup_interval { - /// Builds an object that implements the OS_os_workgroup_interval protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_os_workgroup_interval protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef os_workgroup_interval_t = ffi.Pointer; typedef Dartos_workgroup_interval_t = OS_os_workgroup; typedef os_workgroup_interval_data_s = os_workgroup_interval_data_opaque_s; typedef os_workgroup_interval_data_t = ffi.Pointer; -late final _protocol_OS_os_workgroup_parallel = - objc.getProtocol("OS_os_workgroup_parallel"); - -/// OS_os_workgroup_parallel -abstract final class OS_os_workgroup_parallel { - /// Builds an object that implements the OS_os_workgroup_parallel protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_os_workgroup_parallel protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef os_workgroup_parallel_t = ffi.Pointer; typedef Dartos_workgroup_parallel_t = OS_os_workgroup; typedef dispatch_function_tFunction = ffi.Void Function(ffi.Pointer); @@ -52769,159 +50416,20 @@ enum qos_class_t { }; } -late final _protocol_OS_dispatch_object = - objc.getProtocol("OS_dispatch_object"); - -/// OS_dispatch_object -abstract final class OS_dispatch_object { - /// Builds an object that implements the OS_dispatch_object protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_object protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_object_t = ffi.Pointer; typedef Dartdispatch_object_t = objc.NSObject; typedef dispatch_block_t = ffi.Pointer; typedef Dartdispatch_block_t = objc.ObjCBlock; -late final _protocol_OS_dispatch_queue = objc.getProtocol("OS_dispatch_queue"); - -/// OS_dispatch_queue -abstract final class OS_dispatch_queue { - /// Builds an object that implements the OS_dispatch_queue protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_queue protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_queue_t = ffi.Pointer; typedef Dartdispatch_queue_t = objc.NSObject; -late final _protocol_OS_dispatch_queue_global = - objc.getProtocol("OS_dispatch_queue_global"); - -/// OS_dispatch_queue_global -abstract final class OS_dispatch_queue_global { - /// Builds an object that implements the OS_dispatch_queue_global protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_queue_global protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_queue_global_t = ffi.Pointer; typedef Dartdispatch_queue_global_t = objc.NSObject; -late final _protocol_OS_dispatch_queue_serial_executor = - objc.getProtocol("OS_dispatch_queue_serial_executor"); - -/// OS_dispatch_queue_serial_executor -abstract final class OS_dispatch_queue_serial_executor { - /// Builds an object that implements the OS_dispatch_queue_serial_executor protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_queue_serial_executor protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_queue_serial_executor_t = ffi.Pointer; typedef Dartdispatch_queue_serial_executor_t = objc.NSObject; -late final _protocol_OS_dispatch_queue_serial = - objc.getProtocol("OS_dispatch_queue_serial"); - -/// OS_dispatch_queue_serial -abstract final class OS_dispatch_queue_serial { - /// Builds an object that implements the OS_dispatch_queue_serial protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_queue_serial protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_queue_serial_t = ffi.Pointer; typedef Dartdispatch_queue_serial_t = objc.NSObject; -late final _protocol_OS_dispatch_queue_main = - objc.getProtocol("OS_dispatch_queue_main"); - -/// OS_dispatch_queue_main -abstract final class OS_dispatch_queue_main { - /// Builds an object that implements the OS_dispatch_queue_main protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_queue_main protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_queue_main_t = ffi.Pointer; typedef Dartdispatch_queue_main_t = objc.NSObject; -late final _protocol_OS_dispatch_queue_concurrent = - objc.getProtocol("OS_dispatch_queue_concurrent"); - -/// OS_dispatch_queue_concurrent -abstract final class OS_dispatch_queue_concurrent { - /// Builds an object that implements the OS_dispatch_queue_concurrent protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_queue_concurrent protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_queue_concurrent_t = ffi.Pointer; typedef Dartdispatch_queue_concurrent_t = objc.NSObject; void _ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline( @@ -53028,26 +50536,6 @@ final class dispatch_queue_s extends ffi.Opaque {} typedef dispatch_queue_priority_t = ffi.Long; typedef Dartdispatch_queue_priority_t = int; -late final _protocol_OS_dispatch_queue_attr = - objc.getProtocol("OS_dispatch_queue_attr"); - -/// OS_dispatch_queue_attr -abstract final class OS_dispatch_queue_attr { - /// Builds an object that implements the OS_dispatch_queue_attr protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_queue_attr protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_queue_attr_t = ffi.Pointer; typedef Dartdispatch_queue_attr_t = objc.NSObject; @@ -53305,26 +50793,6 @@ typedef mach_msg_type_size_t = natural_t; typedef mach_msg_type_number_t = natural_t; typedef mach_msg_option_t = integer_t; typedef mach_msg_return_t = kern_return_t; -late final _protocol_OS_dispatch_source = - objc.getProtocol("OS_dispatch_source"); - -/// OS_dispatch_source -abstract final class OS_dispatch_source { - /// Builds an object that implements the OS_dispatch_source protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_source protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_source_t = ffi.Pointer; typedef Dartdispatch_source_t = objc.NSObject; @@ -53343,70 +50811,12 @@ typedef dispatch_source_vnode_flags_t = ffi.UnsignedLong; typedef Dartdispatch_source_vnode_flags_t = int; typedef dispatch_source_timer_flags_t = ffi.UnsignedLong; typedef Dartdispatch_source_timer_flags_t = int; -late final _protocol_OS_dispatch_group = objc.getProtocol("OS_dispatch_group"); - -/// OS_dispatch_group -abstract final class OS_dispatch_group { - /// Builds an object that implements the OS_dispatch_group protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_group protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_group_t = ffi.Pointer; typedef Dartdispatch_group_t = objc.NSObject; -late final _protocol_OS_dispatch_semaphore = - objc.getProtocol("OS_dispatch_semaphore"); - -/// OS_dispatch_semaphore -abstract final class OS_dispatch_semaphore { - /// Builds an object that implements the OS_dispatch_semaphore protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_semaphore protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_semaphore_t = ffi.Pointer; typedef Dartdispatch_semaphore_t = objc.NSObject; typedef dispatch_once_t = ffi.IntPtr; typedef Dartdispatch_once_t = int; -late final _protocol_OS_dispatch_data = objc.getProtocol("OS_dispatch_data"); - -/// OS_dispatch_data -abstract final class OS_dispatch_data { - /// Builds an object that implements the OS_dispatch_data protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_data protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_data_t = ffi.Pointer; typedef Dartdispatch_data_t = objc.NSObject; @@ -53788,25 +51198,6 @@ extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt1_CallExtension int)>()(ref.pointer, arg0?.ref.pointer ?? ffi.nullptr, arg1); } -late final _protocol_OS_dispatch_io = objc.getProtocol("OS_dispatch_io"); - -/// OS_dispatch_io -abstract final class OS_dispatch_io { - /// Builds an object that implements the OS_dispatch_io protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_io protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_io_t = ffi.Pointer; typedef Dartdispatch_io_t = objc.NSObject; typedef dispatch_io_type_t = ffi.UnsignedLong; @@ -54063,26 +51454,6 @@ typedef dispatch_io_close_flags_t = ffi.UnsignedLong; typedef Dartdispatch_io_close_flags_t = int; typedef dispatch_io_interval_flags_t = ffi.UnsignedLong; typedef Dartdispatch_io_interval_flags_t = int; -late final _protocol_OS_dispatch_workloop = - objc.getProtocol("OS_dispatch_workloop"); - -/// OS_dispatch_workloop -abstract final class OS_dispatch_workloop { - /// Builds an object that implements the OS_dispatch_workloop protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_dispatch_workloop protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef dispatch_workloop_t = ffi.Pointer; typedef Dartdispatch_workloop_t = objc.NSObject; @@ -58001,68 +55372,10 @@ enum SSLCiphersuiteGroup { }; } -late final _protocol_OS_sec_trust = objc.getProtocol("OS_sec_trust"); - -/// OS_sec_trust -abstract final class OS_sec_trust { - /// Builds an object that implements the OS_sec_trust protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_sec_trust protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef sec_trust_t = ffi.Pointer; typedef Dartsec_trust_t = objc.NSObject; -late final _protocol_OS_sec_identity = objc.getProtocol("OS_sec_identity"); - -/// OS_sec_identity -abstract final class OS_sec_identity { - /// Builds an object that implements the OS_sec_identity protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_sec_identity protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef sec_identity_t = ffi.Pointer; typedef Dartsec_identity_t = objc.NSObject; -late final _protocol_OS_sec_certificate = - objc.getProtocol("OS_sec_certificate"); - -/// OS_sec_certificate -abstract final class OS_sec_certificate { - /// Builds an object that implements the OS_sec_certificate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_sec_certificate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef sec_certificate_t = ffi.Pointer; typedef Dartsec_certificate_t = objc.NSObject; @@ -58318,26 +55631,6 @@ extension ObjCBlock_ffiVoid_seccertificatet_CallExtension sec_certificate_t)>()(ref.pointer, arg0.ref.pointer); } -late final _protocol_OS_sec_protocol_metadata = - objc.getProtocol("OS_sec_protocol_metadata"); - -/// OS_sec_protocol_metadata -abstract final class OS_sec_protocol_metadata { - /// Builds an object that implements the OS_sec_protocol_metadata protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_sec_protocol_metadata protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef sec_protocol_metadata_t = ffi.Pointer; typedef Dartsec_protocol_metadata_t = objc.NSObject; void _ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline( @@ -58577,26 +55870,6 @@ extension ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_CallExtension ref.pointer, arg0.ref.pointer, arg1.ref.pointer); } -late final _protocol_OS_sec_protocol_options = - objc.getProtocol("OS_sec_protocol_options"); - -/// OS_sec_protocol_options -abstract final class OS_sec_protocol_options { - /// Builds an object that implements the OS_sec_protocol_options protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); - - return builder.build(); - } - - /// Adds the implementation of the OS_sec_protocol_options protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} -} - typedef sec_protocol_options_t = ffi.Pointer; typedef Dartsec_protocol_options_t = objc.NSObject; void _ObjCBlock_ffiVoid_dispatchdatat_fnPtrTrampoline( @@ -63066,63 +60339,197 @@ enum NSURLSessionResponseDisposition { }; } -late final _protocol_NSURLSessionDelegate = - objc.getProtocol("NSURLSessionDelegate"); -late final _sel_URLSession_didBecomeInvalidWithError_ = - objc.registerName("URLSession:didBecomeInvalidWithError:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => +late final _protocol_NSURLSessionDataDelegate = + objc.getProtocol("NSURLSessionDataDelegate"); +void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline( + ffi.Pointer block, int arg0) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); + .cast>() + .asFunction()(arg0); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable = + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger)>( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline( + ffi.Pointer block, int arg0) => + (objc.getBlockClosure(block) as void Function(int))(arg0); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger)>( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline( + ffi.Pointer block, int arg0) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger)> + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, NSInteger)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(NSURLSessionResponseDisposition) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable, + (int arg0) => + fn(NSURLSessionResponseDisposition.fromValue(arg0))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock listener( + void Function(NSURLSessionResponseDisposition) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable + .nativeFunction + .cast(), + (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_16sve1d(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_CallExtension + on objc.ObjCBlock { + void call(NSURLSessionResponseDisposition arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, NSInteger arg0)>>() + .asFunction, int)>()( + ref.pointer, arg0.value); +} + +late final _sel_URLSession_dataTask_didReceiveResponse_completionHandler_ = objc + .registerName("URLSession:dataTask:didReceiveResponse:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline) + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline) + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline) .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); objc.objectRelease(block.cast()); } @@ -63131,60 +60538,80 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable = ffi - .NativeCallable< + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable = + ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline) + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - objc.NSError?)>(pointer, retain: retain, release: release); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock, NSURLSession, objc.NSError?)> - fromFunctionPointer( - ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> - ptr) => - objc.ObjCBlock, NSURLSession, objc.NSError?)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc - .ObjCBlock, NSURLSession, objc.NSError?)> - fromFunction(void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) => - objc.ObjCBlock, NSURLSession, objc.NSError?)>( + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSURLResponse.castFromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer(arg4, retain: true, release: true))), retain: false, release: true); @@ -63199,36 +60626,61 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { /// blocks do not keep the isolate alive. static objc.ObjCBlock< ffi.Void Function( - ffi.Pointer, NSURLSession, objc.NSError?)> listener( - void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) { + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + NSURLResponse, objc.ObjCBlock) + fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - arg2.address == 0 - ? null - : objc.NSError.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSURLResponse.castFromPointer(arg3, + retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition + .castFromPointer(arg4, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1f43wec(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - objc.NSError?)>(wrapper, retain: false, release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)>(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> { + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> { void call( - ffi.Pointer arg0, NSURLSession arg1, objc.NSError? arg2) => + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -63236,119 +60688,127 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_CallExtension ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>>() + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2?.ref.pointer ?? ffi.nullptr); -} - -/// WARNING: NSURLAuthenticationChallenge is a stub. To generate bindings for this class, include -/// NSURLAuthenticationChallenge in your config's objc-interfaces list. -/// -/// NSURLAuthenticationChallenge -class NSURLAuthenticationChallenge extends objc.ObjCObjectBase { - NSURLAuthenticationChallenge._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super(pointer, retain: retain, release: release); - - /// Constructs a [NSURLAuthenticationChallenge] that points to the same underlying object as [other]. - NSURLAuthenticationChallenge.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLAuthenticationChallenge] that wraps the given raw object pointer. - NSURLAuthenticationChallenge.castFromPointer( - ffi.Pointer other, - {bool retain = false, - bool release = false}) - : this._(other, retain: retain, release: release); -} - -/// WARNING: NSURLCredential is a stub. To generate bindings for this class, include -/// NSURLCredential in your config's objc-interfaces list. -/// -/// NSURLCredential -class NSURLCredential extends objc.ObjCObjectBase { - NSURLCredential._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super(pointer, retain: retain, release: release); - - /// Constructs a [NSURLCredential] that points to the same underlying object as [other]. - NSURLCredential.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSURLCredential] that wraps the given raw object pointer. - NSURLCredential.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer); } +late final _sel_URLSession_dataTask_didBecomeDownloadTask_ = + objc.registerName("URLSession:dataTask:didBecomeDownloadTask:"); void - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline( ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(NSInteger arg0, - ffi.Pointer arg1)>>() - .asFunction)>()( - arg0, arg1); + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline( ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline( ffi.Pointer block, - int arg0, - ffi.Pointer arg1) { + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => - objc.ObjCBlock( - pointer, - retain: retain, - release: release); + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)>(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -63356,33 +60816,36 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> fromFunctionPointer( - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock - fromFunction(void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable, - (int arg0, ffi.Pointer arg1) => fn( - NSURLSessionAuthChallengeDisposition.fromValue(arg0), - arg1.address == 0 - ? null - : NSURLCredential.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -63393,53 +60856,74 @@ abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSUR /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock - listener( - void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) - fn) { + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + NSURLSessionDownloadTask) + fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable .nativeFunction .cast(), - (int arg0, ffi.Pointer arg1) => fn( - NSURLSessionAuthChallengeDisposition.fromValue(arg0), - arg1.address == 0 - ? null - : NSURLCredential.castFromPointer(arg1, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg3, retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_37btrl(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLSessionDownloadTask)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_CallExtension - on objc.ObjCBlock { - void call(NSURLSessionAuthChallengeDisposition arg0, NSURLCredential? arg1) => +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - NSInteger arg0, ffi.Pointer arg1)>>() + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() .asFunction< - void Function(ffi.Pointer, int, - ffi.Pointer)>()( - ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); } -late final _sel_URLSession_didReceiveChallenge_completionHandler_ = - objc.registerName("URLSession:didReceiveChallenge:completionHandler:"); +late final _sel_URLSession_dataTask_didBecomeStreamTask_ = + objc.registerName("URLSession:dataTask:didBecomeStreamTask:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3) => + ffi.Pointer arg3) => block.ref.target .cast< ffi.NativeFunction< @@ -63447,59 +60931,59 @@ void ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3)>>() + ffi.Pointer arg3)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); + ffi.Pointer)>()(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3) => + ffi.Pointer arg3) => (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + ffi.Pointer))(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3) { + ffi.Pointer arg3) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); + ffi.Pointer))(arg0, arg1, arg2, arg3); objc.objectRelease(block.cast()); } @@ -63509,34 +60993,29 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable = + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline) + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>(pointer, + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. @@ -63545,16 +61024,13 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable, - ptr.cast()), + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -63563,19 +61039,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3) => + ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLAuthenticationChallenge.castFromPointer(arg2, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg3, retain: true, release: true))), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSURLSessionStreamTask.castFromPointer(arg3, retain: true, release: true))), retain: false, release: true); @@ -63589,61 +61065,45 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationC /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)>)> listener( - void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock) + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + NSURLSessionStreamTask) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable .nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3) => + ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLAuthenticationChallenge.castFromPointer(arg2, + NSURLSessionDataTask.castFromPointer(arg2, retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential - .castFromPointer(arg3, retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_12nszru(raw); + NSURLSessionStreamTask.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)>)>(wrapper, - retain: false, release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLSessionStreamTask)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_CallExtension on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLAuthenticationChallenge, - objc.ObjCBlock)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock - arg3) => + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -63652,390 +61112,86 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ff ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3)>>() + ffi.Pointer arg3)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); } -late final _sel_URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.registerName("URLSessionDidFinishEventsForBackgroundURLSession:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable = ffi - .NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, NSURLSession)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock, NSURLSession)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - NSURLSession)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, NSURLSession)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession)> - fromFunction(void Function(ffi.Pointer, NSURLSession) fn) => - objc.ObjCBlock, NSURLSession)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock, NSURLSession)> - listener(void Function(ffi.Pointer, NSURLSession) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjovn7(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession)>(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, NSURLSession)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_CallExtension - on objc.ObjCBlock, NSURLSession)> { - void call(ffi.Pointer arg0, NSURLSession arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer); -} - -/// Messages related to the URL session as a whole -abstract final class NSURLSessionDelegate { - /// Builds an object that implements the NSURLSessionDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? - URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } - - /// Adds the implementation of the NSURLSessionDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? - URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } - - /// Builds an object that implements the NSURLSessionDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? - URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } - - /// Adds the implementation of the NSURLSessionDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, objc.NSError?)? - URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? - URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } - - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = objc - .ObjCProtocolListenableMethod( - _protocol_NSURLSessionDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - ); - - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _protocol_NSURLSessionDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - ); - - /// If an application has received an - /// -application:handleEventsForBackgroundURLSession:completionHandler: - /// message, the session delegate will receive this message to indicate - /// that all messages previously enqueued for this session have been - /// delivered. At this time it is safe to invoke the previously stored - /// completion handler, or to begin any internal updates that will - /// result in invoking the completion handler. - static final URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.ObjCProtocolListenableMethod( - _protocol_NSURLSessionDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - ); -} - -late final _protocol_NSURLSessionTaskDelegate = - objc.getProtocol("NSURLSessionTaskDelegate"); -late final _sel_URLSession_didCreateTask_ = - objc.registerName("URLSession:didCreateTask:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); +late final _sel_URLSession_dataTask_didReceiveData_ = + objc.registerName("URLSession:dataTask:didReceiveData:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline) .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) { + ffi.Pointer arg2, + ffi.Pointer arg3) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); objc.objectRelease(block.cast()); } @@ -64044,66 +61200,70 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, NSURLSessionTask)> + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask)>(pointer, retain: retain, release: release); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + objc.NSData)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + objc.NSData.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -64115,36 +61275,45 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, NSURLSessionTask)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) { + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + objc.NSData) + fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + objc.NSData.castFromPointer(arg3, retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask)>(wrapper, retain: false, release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + objc.NSData)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_CallExtension on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, NSURLSessionTask)> { + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> { void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionTask arg2) => + NSURLSessionDataTask arg2, objc.NSData arg3) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -64152,56 +61321,502 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_CallExtension ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>>() + ffi.Pointer arg2, + ffi.Pointer arg3)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); } +late final _sel_URLSession_dataTask_willCacheResponse_completionHandler_ = objc + .registerName("URLSession:dataTask:willCacheResponse:completionHandler:"); void - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline( ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => block.ref.target .cast< ffi.NativeFunction< - ffi.Void Function(NSInteger arg0, - ffi.Pointer arg1)>>() - .asFunction)>()( - arg0, arg1); + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline) + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline( ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline) + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline( ffi.Pointer block, - int arg0, - ffi.Pointer arg1) { + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) { (objc.getBlockClosure(block) as void Function( - int, ffi.Pointer))(arg0, arg1); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSCachedURLResponse.castFromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSCachedURLResponse.castFromPointer(arg3, + retain: false, release: true), + ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1f43wec(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSCachedURLResponse arg3, + objc.ObjCBlock arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer); +} + +late final _sel_URLSession_didCreateTask_ = + objc.registerName("URLSession:didCreateTask:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionTask)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionTask)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); +} + +void + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSInteger arg0, + ffi.Pointer arg1)>>() + .asFunction)>()( + arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); objc.objectRelease(block.cast()); } @@ -65199,6 +62814,191 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLRespo arg5.ref.pointer); } +/// WARNING: NSURLAuthenticationChallenge is a stub. To generate bindings for this class, include +/// NSURLAuthenticationChallenge in your config's objc-interfaces list. +/// +/// NSURLAuthenticationChallenge +class NSURLAuthenticationChallenge extends objc.ObjCObjectBase { + NSURLAuthenticationChallenge._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSURLAuthenticationChallenge] that points to the same underlying object as [other]. + NSURLAuthenticationChallenge.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLAuthenticationChallenge] that wraps the given raw object pointer. + NSURLAuthenticationChallenge.castFromPointer( + ffi.Pointer other, + {bool retain = false, + bool release = false}) + : this._(other, retain: retain, release: release); +} + +/// WARNING: NSURLCredential is a stub. To generate bindings for this class, include +/// NSURLCredential in your config's objc-interfaces list. +/// +/// NSURLCredential +class NSURLCredential extends objc.ObjCObjectBase { + NSURLCredential._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSURLCredential] that points to the same underlying object as [other]. + NSURLCredential.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLCredential] that wraps the given raw object pointer. + NSURLCredential.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); +} + +void + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSInteger arg0, + ffi.Pointer arg1)>>() + .asFunction)>()( + arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock( + pointer, + retain: retain, + release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> fromFunctionPointer( + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock + fromFunction(void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable, + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionAuthChallengeDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLCredential.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock + listener( + void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable + .nativeFunction + .cast(), + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionAuthChallengeDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLCredential.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_37btrl(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_CallExtension + on objc.ObjCBlock { + void call(NSURLSessionAuthChallengeDisposition arg0, NSURLCredential? arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + NSInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, int, + ffi.Pointer)>()( + ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); +} + late final _sel_URLSession_task_didReceiveChallenge_completionHandler_ = objc.registerName("URLSession:task:didReceiveChallenge:completionHandler:"); void @@ -66589,3414 +64389,154 @@ void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSURLSessionTaskMetrics)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSURLSessionTaskMetrics)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSURLSessionTaskMetrics)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, NSURLSessionTaskMetrics)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - NSURLSessionTaskMetrics.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSURLSessionTaskMetrics)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSURLSessionTaskMetrics) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - NSURLSessionTaskMetrics.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSURLSessionTaskMetrics)>(wrapper, retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - NSURLSessionTaskMetrics)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); -} - -late final _sel_URLSession_task_didCompleteWithError_ = - objc.registerName("URLSession:task:didCompleteWithError:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, objc.NSError?)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionTask, - objc.NSError?)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, objc.NSError?)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionTask, objc.NSError?)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), - arg3.address == 0 ? null : objc.NSError.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - objc.NSError?)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - objc.NSError?) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionTask.castFromPointer(arg2, - retain: false, release: true), - arg3.address == 0 - ? null - : objc.NSError.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - objc.NSError?)>(wrapper, retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, - objc.NSError?)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3?.ref.pointer ?? ffi.nullptr); -} - -/// Messages related to the operation of a specific task. -abstract final class NSURLSessionTaskDelegate { - /// Builds an object that implements the NSURLSessionTaskDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function( - NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionTaskDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionTaskDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_.implement( - builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionTaskDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionTaskDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } - - /// Adds the implementation of the NSURLSessionTaskDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)? - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionTaskDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionTaskDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_.implement( - builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionTaskDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionTaskDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } - - /// Builds an object that implements the NSURLSessionTaskDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function( - NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionTaskDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionTaskDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionTaskDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionTaskDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } - - /// Adds the implementation of the NSURLSessionTaskDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)? - URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionTaskDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionTaskDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionTaskDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionTaskDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionTaskDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } - - /// Notification that a task has been created. This method is the first message - /// a task sends, providing a place to configure the task before it is resumed. - /// - /// This delegate callback is *NOT* dispatched to the delegate queue. It is - /// invoked synchronously before the task creation method returns. - static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_didCreateTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_didCreateTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); - - /// Sent when the system is ready to begin work for a task with a delayed start - /// time set (using the earliestBeginDate property). The completionHandler must - /// be invoked in order for loading to proceed. The disposition provided to the - /// completion handler continues the load with the original request provided to - /// the task, replaces the request with the specified task, or cancels the task. - /// If this delegate is not implemented, loading will proceed with the original - /// request. - /// - /// Recommendation: only implement this delegate if tasks that have the - /// earliestBeginDate property set may become stale and require alteration prior - /// to starting the network load. - /// - /// If a new request is specified, the allowsExpensiveNetworkAccess, - /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties - /// from the new request will not be used; the properties from the - /// original request will continue to be used. - /// - /// Canceling the task is equivalent to calling the task's cancel method; the - /// URLSession:task:didCompleteWithError: task delegate will be called with error - /// NSURLErrorCancelled. - static final URLSession_task_willBeginDelayedRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent when a task cannot start the network loading process because the current - /// network connectivity is not available or sufficient for the task's request. - /// - /// This delegate will be called at most one time per task, and is only called if - /// the waitsForConnectivity property in the NSURLSessionConfiguration has been - /// set to YES. - /// - /// This delegate callback will never be called for background sessions, because - /// the waitForConnectivity property is ignored by those sessions. - static final URLSession_taskIsWaitingForConnectivity_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); - - /// An HTTP request is attempting to perform a redirection to a different - /// URL. You must invoke the completion routine to allow the - /// redirection, allow the redirection with a modified request, or - /// pass nil to the completionHandler to cause the body of the redirection - /// response to be delivered as the payload of this request. The default - /// is to follow redirections. - /// - /// For tasks in background sessions, redirections will always be followed and this method will not be called. - static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); - - /// The task has received a request specific authentication challenge. - /// If this delegate is not implemented, the session specific authentication challenge - /// will *NOT* be called and the behavior will be the same as using the default handling - /// disposition. - static final URLSession_task_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent if a task requires a new, unopened body stream. This may be - /// necessary when authentication has failed for any request that - /// involves a body stream. - static final URLSession_task_needNewBodyStream_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_needNewBodyStream_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_needNewBodyStream_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - ); - - /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be - /// necessary when resuming a failed upload task. - /// - /// - Parameter session: The session containing the task that needs a new body stream from the given offset. - /// - Parameter task: The task that needs a new body stream. - /// - Parameter offset: The starting offset required for the body stream. - /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent periodically to notify the delegate of upload progress. This - /// information is also available as properties of the task. - static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, int, int)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); - - /// Sent for each informational response received except 101 switching protocols. - static final URLSession_task_didReceiveInformationalResponse_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - ); - - /// Sent when complete statistics information has been collected for the task. - static final URLSession_task_didFinishCollectingMetrics_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - ); - - /// Sent as the last message related to a specific task. Error may be - /// nil, which implies that no error occurred and this task is complete. - static final URLSession_task_didCompleteWithError_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didCompleteWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_task_didCompleteWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - ); - - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = objc - .ObjCProtocolListenableMethod( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - ); - - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - ); - - /// If an application has received an - /// -application:handleEventsForBackgroundURLSession:completionHandler: - /// message, the session delegate will receive this message to indicate - /// that all messages previously enqueued for this session have been - /// delivered. At this time it is safe to invoke the previously stored - /// completion handler, or to begin any internal updates that will - /// result in invoking the completion handler. - static final URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.ObjCProtocolListenableMethod( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionTaskDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - ); -} - -late final _protocol_NSURLSessionDataDelegate = - objc.getProtocol("NSURLSessionDataDelegate"); -void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline( - ffi.Pointer block, int arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger)>( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline( - ffi.Pointer block, int arg0) => - (objc.getBlockClosure(block) as void Function(int))(arg0); -ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, NSInteger)>( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline( - ffi.Pointer block, int arg0) { - (objc.getBlockClosure(block) as void Function(int))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, NSInteger)> - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, NSInteger)>.listener( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(NSURLSessionResponseDisposition) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable, - (int arg0) => - fn(NSURLSessionResponseDisposition.fromValue(arg0))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(NSURLSessionResponseDisposition) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable - .nativeFunction - .cast(), - (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_16sve1d(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_CallExtension - on objc.ObjCBlock { - void call(NSURLSessionResponseDisposition arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, NSInteger arg0)>>() - .asFunction, int)>()( - ref.pointer, arg0.value); -} - -late final _sel_URLSession_dataTask_didReceiveResponse_completionHandler_ = objc - .registerName("URLSession:dataTask:didReceiveResponse:completionHandler:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - NSURLResponse.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer(arg4, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, - NSURLResponse, objc.ObjCBlock) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionDataTask.castFromPointer(arg2, - retain: false, release: true), - NSURLResponse.castFromPointer(arg3, - retain: false, release: true), - ObjCBlock_ffiVoid_NSURLSessionResponseDisposition - .castFromPointer(arg4, retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1f43wec(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)>(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLResponse, - objc.ObjCBlock)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSURLResponse arg3, - objc.ObjCBlock arg4) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, - arg0, - arg1.ref.pointer, - arg2.ref.pointer, - arg3.ref.pointer, - arg4.ref.pointer); -} - -late final _sel_URLSession_dataTask_didBecomeDownloadTask_ = - objc.registerName("URLSession:dataTask:didBecomeDownloadTask:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, - NSURLSessionDownloadTask) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionDataTask.castFromPointer(arg2, - retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLSessionDownloadTask)>(wrapper, retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionDownloadTask)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); -} - -late final _sel_URLSession_dataTask_didBecomeStreamTask_ = - objc.registerName("URLSession:dataTask:didBecomeStreamTask:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - NSURLSessionStreamTask.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, - NSURLSessionStreamTask) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionDataTask.castFromPointer(arg2, - retain: false, release: true), - NSURLSessionStreamTask.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSURLSessionStreamTask)>(wrapper, retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, NSURLSessionStreamTask)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); -} - -late final _sel_URLSession_dataTask_didReceiveData_ = - objc.registerName("URLSession:dataTask:didReceiveData:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, objc.NSData)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - objc.NSData)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, objc.NSData)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, objc.NSData)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - objc.NSData.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, objc.NSData)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, - objc.NSData) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionDataTask.castFromPointer(arg2, - retain: false, release: true), - objc.NSData.castFromPointer(arg3, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - objc.NSData)>(wrapper, retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDataTask, objc.NSData)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDataTask arg2, objc.NSData arg3) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); -} - -late final _sel_URLSession_dataTask_willCacheResponse_completionHandler_ = objc - .registerName("URLSession:dataTask:willCacheResponse:completionHandler:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), - NSCachedURLResponse.castFromPointer(arg3, retain: true, release: true), - ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)> listener( - void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionDataTask.castFromPointer(arg2, - retain: false, release: true), - NSCachedURLResponse.castFromPointer(arg3, - retain: false, release: true), - ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1f43wec(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)>( - wrapper, - retain: false, - release: true); - } -} - -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDataTask, - NSCachedURLResponse, - objc.ObjCBlock)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSCachedURLResponse arg3, - objc.ObjCBlock arg4) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, - arg0, - arg1.ref.pointer, - arg2.ref.pointer, - arg3.ref.pointer, - arg4.ref.pointer); -} - -/// Messages related to the operation of a task that delivers data -/// directly to the delegate. -abstract final class NSURLSessionDataDelegate { - /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? - URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, - void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock)? - URLSession_dataTask_willCacheResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_ - .implement( - builder, URLSession_dataTask_didReceiveResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ - .implement(builder, URLSession_dataTask_didBecomeDownloadTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( - builder, URLSession_dataTask_didBecomeStreamTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( - builder, URLSession_dataTask_didReceiveData_); - NSURLSessionDataDelegate - .URLSession_dataTask_willCacheResponse_completionHandler_ - .implement( - builder, URLSession_dataTask_willCacheResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( - builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } - - /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? - URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, - void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock)? - URLSession_dataTask_willCacheResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_ - .implement( - builder, URLSession_dataTask_didReceiveResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ - .implement(builder, URLSession_dataTask_didBecomeDownloadTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( - builder, URLSession_dataTask_didBecomeStreamTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( - builder, URLSession_dataTask_didReceiveData_); - NSURLSessionDataDelegate - .URLSession_dataTask_willCacheResponse_completionHandler_ - .implement( - builder, URLSession_dataTask_willCacheResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( - builder, URLSession_didCreateTask_); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implement(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( - builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implement(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implement( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( - builder, URLSession_task_needNewBodyStream_); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implement(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implement(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ - .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ - .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } - - /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? - URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, - void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock)? - URLSession_dataTask_willCacheResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_ - .implementAsListener( - builder, URLSession_dataTask_didReceiveResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ - .implementAsListener( - builder, URLSession_dataTask_didBecomeDownloadTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_ - .implementAsListener(builder, URLSession_dataTask_didBecomeStreamTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ - .implementAsListener(builder, URLSession_dataTask_didReceiveData_); - NSURLSessionDataDelegate - .URLSession_dataTask_willCacheResponse_completionHandler_ - .implementAsListener( - builder, URLSession_dataTask_willCacheResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - return builder.build(); - } - - /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? - URLSession_dataTask_didReceiveResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? - URLSession_dataTask_didBecomeDownloadTask_, - void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? - URLSession_dataTask_didBecomeStreamTask_, - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? - URLSession_dataTask_didReceiveData_, - void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock)? - URLSession_dataTask_willCacheResponse_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? - URLSession_task_willBeginDelayedRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask)? - URLSession_taskIsWaitingForConnectivity_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)? - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, - void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, - void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, - void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, - void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, - void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDataDelegate - .URLSession_dataTask_didReceiveResponse_completionHandler_ - .implementAsListener( - builder, URLSession_dataTask_didReceiveResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ - .implementAsListener( - builder, URLSession_dataTask_didBecomeDownloadTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_ - .implementAsListener(builder, URLSession_dataTask_didBecomeStreamTask_); - NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ - .implementAsListener(builder, URLSession_dataTask_didReceiveData_); - NSURLSessionDataDelegate - .URLSession_dataTask_willCacheResponse_completionHandler_ - .implementAsListener( - builder, URLSession_dataTask_willCacheResponse_completionHandler_); - NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( - builder, URLSession_didCreateTask_); - NSURLSessionDataDelegate - .URLSession_task_willBeginDelayedRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_ - .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDataDelegate - .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ - .implementAsListener(builder, - URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_ - .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionDataDelegate - .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ - .implementAsListener(builder, - URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDataDelegate - .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ - .implementAsListener(builder, - URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ - .implementAsListener( - builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ - .implementAsListener( - builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ - .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_ - .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ - .implementAsListener( - builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ - .implementAsListener( - builder, URLSessionDidFinishEventsForBackgroundURLSession_); - } - - /// The task has received a response and no further messages will be - /// received until the completion block is called. The disposition - /// allows you to cancel a request or to turn a data task into a - /// download task. This delegate message is optional - if you do not - /// implement it, you can get the response as a property of the task. - /// - /// This method will not be called for background upload tasks (which cannot be converted to download tasks). - static final URLSession_dataTask_didReceiveResponse_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, - objc.ObjCBlock)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSURLResponse arg3, - objc.ObjCBlock arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSURLResponse arg3, - objc.ObjCBlock arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Notification that a data task has become a download task. No - /// future messages will be sent to the data task. - static final URLSession_dataTask_didBecomeDownloadTask_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didBecomeDownloadTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didBecomeDownloadTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => - func(arg1, arg2, arg3)), - ); - - /// Notification that a data task has become a bidirectional stream - /// task. No future messages will be sent to the data task. The newly - /// created streamTask will carry the original request and response as - /// properties. - /// - /// For requests that were pipelined, the stream object will only allow - /// reading, and the object will immediately issue a - /// -URLSession:writeClosedForStream:. Pipelining can be disabled for - /// all requests in a session, or by the NSURLRequest - /// HTTPShouldUsePipelining property. - /// - /// The underlying connection is no longer considered part of the HTTP - /// connection cache and won't count against the total number of - /// connections per host. - static final URLSession_dataTask_didBecomeStreamTask_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didBecomeStreamTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didBecomeStreamTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => - func(arg1, arg2, arg3)), - ); - - /// Sent when data is available for the delegate to consume. As the - /// data may be discontiguous, you should use - /// [NSData enumerateByteRangesUsingBlock:] to access it. - static final URLSession_dataTask_didReceiveData_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didReceiveData_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_didReceiveData_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDataTask, objc.NSData) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, objc.NSData arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionDataTask, objc.NSData) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDataTask arg2, objc.NSData arg3) => - func(arg1, arg2, arg3)), - ); - - /// Invoke the completion routine with a valid NSCachedURLResponse to - /// allow the resulting data to be cached, or pass nil to prevent - /// caching. Note that there is no guarantee that caching will be - /// attempted for a given resource, and you should not rely on this - /// message to receive the resource data. - static final URLSession_dataTask_willCacheResponse_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_willCacheResponse_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_dataTask_willCacheResponse_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSCachedURLResponse arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDataTask arg2, - NSCachedURLResponse arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Notification that a task has been created. This method is the first message - /// a task sends, providing a place to configure the task before it is resumed. - /// - /// This delegate callback is *NOT* dispatched to the delegate queue. It is - /// invoked synchronously before the task creation method returns. - static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didCreateTask_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didCreateTask_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); - - /// Sent when the system is ready to begin work for a task with a delayed start - /// time set (using the earliestBeginDate property). The completionHandler must - /// be invoked in order for loading to proceed. The disposition provided to the - /// completion handler continues the load with the original request provided to - /// the task, replaces the request with the specified task, or cancels the task. - /// If this delegate is not implemented, loading will proceed with the original - /// request. - /// - /// Recommendation: only implement this delegate if tasks that have the - /// earliestBeginDate property set may become stale and require alteration prior - /// to starting the network load. - /// - /// If a new request is specified, the allowsExpensiveNetworkAccess, - /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties - /// from the new request will not be used; the properties from the - /// original request will continue to be used. - /// - /// Canceling the task is equivalent to calling the task's cancel method; the - /// URLSession:task:didCompleteWithError: task delegate will be called with error - /// NSURLErrorCancelled. - static final URLSession_task_willBeginDelayedRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLRequest arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent when a task cannot start the network loading process because the current - /// network connectivity is not available or sufficient for the task's request. - /// - /// This delegate will be called at most one time per task, and is only called if - /// the waitsForConnectivity property in the NSURLSessionConfiguration has been - /// set to YES. - /// - /// This delegate callback will never be called for background sessions, because - /// the waitForConnectivity property is ignored by those sessions. - static final URLSession_taskIsWaitingForConnectivity_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_taskIsWaitingForConnectivity_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2) => - func(arg1, arg2)), - ); - - /// An HTTP request is attempting to perform a redirection to a different - /// URL. You must invoke the completion routine to allow the - /// redirection, allow the redirection with a modified request, or - /// pass nil to the completionHandler to cause the body of the redirection - /// response to be delivered as the payload of this request. The default - /// is to follow redirections. - /// - /// For tasks in background sessions, redirections will always be followed and this method will not be called. - static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, - NSURLRequest, objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSHTTPURLResponse arg3, - NSURLRequest arg4, - objc.ObjCBlock arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); - - /// The task has received a request specific authentication challenge. - /// If this delegate is not implemented, the session specific authentication challenge - /// will *NOT* be called and the behavior will be the same as using the default handling - /// disposition. - static final URLSession_task_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - NSURLAuthenticationChallenge arg3, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent if a task requires a new, unopened body stream. This may be - /// necessary when authentication has failed for any request that - /// involves a body stream. - static final URLSession_task_needNewBodyStream_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_needNewBodyStream_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_needNewBodyStream_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - objc.ObjCBlock - arg3) => - func(arg1, arg2, arg3)), - ); - - /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be - /// necessary when resuming a failed upload task. - /// - /// - Parameter session: The session containing the task that needs a new body stream from the given offset. - /// - Parameter task: The task that needs a new body stream. - /// - Parameter offset: The starting offset required for the body stream. - /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionTask, int, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionTask arg2, - int arg3, - objc.ObjCBlock - arg4) => - func(arg1, arg2, arg3, arg4)), - ); - - /// Sent periodically to notify the delegate of upload progress. This - /// information is also available as properties of the task. - static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, int, int, int)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, int arg3, int arg4, int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - ); + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} - /// Sent for each informational response received except 101 switching protocols. - static final URLSession_task_didReceiveInformationalResponse_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didReceiveInformationalResponse_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSHTTPURLResponse arg3) => - func(arg1, arg2, arg3)), - ); +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline) + ..keepIsolateAlive = false; - /// Sent when complete statistics information has been collected for the task. - static final URLSession_task_didFinishCollectingMetrics_ = - objc.ObjCProtocolListenableMethod< - void Function( - NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didFinishCollectingMetrics_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => - func(arg1, arg2, arg3)), - ); +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)>(pointer, + retain: retain, release: release); - /// Sent as the last message related to a specific task. Error may be - /// nil, which implies that no error occurred and this task is complete. - static final URLSession_task_didCompleteWithError_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didCompleteWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_task_didCompleteWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionTask arg2, objc.NSError? arg3) => - func(arg1, arg2, arg3)), - ); + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// The last message a session receives. A session will only become - /// invalid because of a systemic error or when it has been - /// explicitly invalidated, in which case the error parameter will be nil. - static final URLSession_didBecomeInvalidWithError_ = objc - .ObjCProtocolListenableMethod( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didBecomeInvalidWithError_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, objc.NSError?) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( - (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => - func(arg1, arg2)), - ); + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLSessionTaskMetrics.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); - /// If implemented, when a connection level authentication challenge - /// has occurred, this delegate will be given the opportunity to - /// provide authentication credentials to the underlying - /// connection. Some types of authentication will apply to more than - /// one request on a given connection to a server (SSL Server Trust - /// challenges). If this delegate message is not implemented, the - /// behavior will be to use the default handling, which may involve user - /// interaction. - static final URLSession_didReceiveChallenge_completionHandler_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock)>( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSession_didReceiveChallenge_completionHandler_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLAuthenticationChallenge, - objc.ObjCBlock) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLAuthenticationChallenge arg2, - objc.ObjCBlock< - ffi.Void Function(NSInteger, NSURLCredential?)> - arg3) => - func(arg1, arg2, arg3)), - ); + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + NSURLSessionTaskMetrics.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics)>(wrapper, retain: false, release: true); + } +} - /// If an application has received an - /// -application:handleEventsForBackgroundURLSession:completionHandler: - /// message, the session delegate will receive this message to indicate - /// that all messages previously enqueued for this session have been - /// delivered. At this time it is safe to invoke the previously stored - /// completion handler, or to begin any internal updates that will - /// result in invoking the completion handler. - static final URLSessionDidFinishEventsForBackgroundURLSession_ = - objc.ObjCProtocolListenableMethod( - _protocol_NSURLSessionDataDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionDataDelegate, - _sel_URLSessionDidFinishEventsForBackgroundURLSession_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - (void Function(NSURLSession) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( - (ffi.Pointer _, NSURLSession arg1) => func(arg1)), - ); +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); } -late final _protocol_NSURLSessionDownloadDelegate = - objc.getProtocol("NSURLSessionDownloadDelegate"); -late final _sel_URLSession_downloadTask_didFinishDownloadingToURL_ = - objc.registerName("URLSession:downloadTask:didFinishDownloadingToURL:"); +late final _sel_URLSession_task_didCompleteWithError_ = + objc.registerName("URLSession:task:didCompleteWithError:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, @@ -70017,7 +64557,7 @@ void ffi.Pointer, ffi.Pointer)>()(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, @@ -70025,10 +64565,10 @@ ffi.Pointer ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, @@ -70040,7 +64580,7 @@ void ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, @@ -70048,10 +64588,10 @@ ffi.Pointer ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, @@ -70072,45 +64612,235 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable = - ffi.NativeCallable< + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, objc.NSError?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.NSError?)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, objc.NSError?)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, objc.NSError?)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + arg3.address == 0 ? null : objc.NSError.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + arg3.address == 0 + ? null + : objc.NSError.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_URLSession_didBecomeInvalidWithError_ = + objc.registerName("URLSession:didBecomeInvalidWithError:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable = ffi + .NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL { +/// Construction methods for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)> + ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - objc.NSURL)>(pointer, retain: retain, release: release); + ffi.Void Function(ffi.Pointer, NSURLSession, + objc.NSError?)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable, ptr.cast()), + static objc + .ObjCBlock, NSURLSession, objc.NSError?)> + fromFunctionPointer( + ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock, NSURLSession, objc.NSError?)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable, + ptr.cast()), retain: false, release: true); @@ -70119,21 +64849,18 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => - fn( + static objc + .ObjCBlock, NSURLSession, objc.NSError?)> + fromFunction(void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) => + objc.ObjCBlock, NSURLSession, objc.NSError?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), - objc.NSURL.castFromPointer(arg3, retain: true, release: true))), - retain: false, - release: true); + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -70145,45 +64872,37 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)> listener( - void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL) - fn) { + ffi.Void Function( + ffi.Pointer, NSURLSession, objc.NSError?)> listener( + void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3) => + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, - retain: false, release: true), - objc.NSURL - .castFromPointer(arg3, retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + arg2.address == 0 + ? null + : objc.NSError.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - objc.NSURL)>(wrapper, retain: false, release: true); + ffi.Void Function(ffi.Pointer, NSURLSession, + objc.NSError?)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, objc.NSURL)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> { + void call( + ffi.Pointer arg0, NSURLSession arg1, objc.NSError? arg2) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -70191,30 +64910,25 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_ ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3)>>() + ffi.Pointer arg2)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, - arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); + arg1.ref.pointer, arg2?.ref.pointer ?? ffi.nullptr); } -late final _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = - objc.registerName( - "URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:"); +late final _sel_URLSession_didReceiveChallenge_completionHandler_ = + objc.registerName("URLSession:didReceiveChallenge:completionHandler:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => + ffi.Pointer arg3) => block.ref.target .cast< ffi.NativeFunction< @@ -70222,75 +64936,59 @@ void ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4, - ffi.Int64 arg5)>>() + ffi.Pointer arg3)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - int, - int, - int)>()(arg0, arg1, arg2, arg3, arg4, arg5); + ffi.Pointer)>()(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => + ffi.Pointer arg3) => (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - int, - int, - int))(arg0, arg1, arg2, arg3, arg4, arg5); + ffi.Pointer))(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline) + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) { + ffi.Pointer arg3) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - int, - int, - int))(arg0, arg1, arg2, arg3, arg4, arg5); + ffi.Pointer))(arg0, arg1, arg2, arg3); objc.objectRelease(block.cast()); } @@ -70300,38 +64998,35 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable = + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int64, - ffi.Int64, - ffi.Int64)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline) + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ffi.Int64)>(pointer, retain: retain, release: release); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -70339,42 +65034,37 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ffi.Int64)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// Creates a block from a Dart function. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int, int) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + static objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable, + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => + ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), - arg3, - arg4, - arg5)), + NSURLAuthenticationChallenge.castFromPointer(arg2, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg3, retain: true, release: true))), retain: false, release: true); @@ -70388,50 +65078,61 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> listener( - void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, int, int, int) + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)>)> listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable .nativeFunction .cast(), (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - int arg3, - int arg4, - int arg5) => + ffi.Pointer arg3) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, + NSURLAuthenticationChallenge.castFromPointer(arg2, retain: false, release: true), - arg3, - arg4, - arg5)); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1uuez7b(raw); + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential + .castFromPointer(arg3, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_12nszru(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64, - ffi.Int64)>(wrapper, retain: false, release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)>)>(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_CallExtension on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDownloadTask arg2, int arg3, int arg4, int arg5) => + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -70440,152 +65141,92 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_ ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4, - ffi.Int64 arg5)>>() + ffi.Pointer arg3)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - int, - int, - int)>()(ref.pointer, arg0, arg1.ref.pointer, - arg2.ref.pointer, arg3, arg4, arg5); + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); } -late final _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = - objc.registerName( - "URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:"); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int)>()(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline) - .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int))(arg0, arg1, arg2, arg3, arg4); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable = +late final _sel_URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.registerName("URLSessionDidFinishEventsForBackgroundURLSession:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline) + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline) .cast(); -void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline( +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4) { + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int))(arg0, arg1, arg2, arg3, arg4); + ffi.Pointer, ffi.Pointer))(arg0, arg1); objc.objectRelease(block.cast()); } ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable = - ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Int64)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline) + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 { +/// Construction methods for `objc.ObjCBlock, NSURLSession)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + static objc.ObjCBlock, NSURLSession)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64)>(pointer, retain: retain, release: release); + ffi.Void Function(ffi.Pointer, + NSURLSession)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4)>> ptr) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable, ptr.cast()), + static objc.ObjCBlock, NSURLSession)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, NSURLSession)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -70594,17 +65235,16 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( + static objc.ObjCBlock, NSURLSession)> + fromFunction(void Function(ffi.Pointer, NSURLSession) fn) => + objc.ObjCBlock, NSURLSession)>( objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, int arg4) => fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), - arg3, - arg4)), + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: true, release: true))), retain: false, release: true); @@ -70617,96 +65257,66 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownload /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> listener( - void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, int, int) - fn) { + static objc.ObjCBlock, NSURLSession)> + listener(void Function(ffi.Pointer, NSURLSession) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable - .nativeFunction + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable.nativeFunction .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, int arg3, int arg4) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, - retain: false, release: true), - NSURLSessionDownloadTask.castFromPointer(arg2, - retain: false, release: true), - arg3, - arg4)); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_9qxjkl(raw); + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjovn7(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionDownloadTask, - ffi.Int64, - ffi.Int64)>(wrapper, retain: false, release: true); + ffi.Void Function(ffi.Pointer, NSURLSession)>(wrapper, + retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_CallExtension - on objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> { - void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionDownloadTask arg2, int arg3, int arg4) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Int64 arg3, - ffi.Int64 arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3, arg4); +/// Call operator for `objc.ObjCBlock, NSURLSession)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_CallExtension + on objc.ObjCBlock, NSURLSession)> { + void call(ffi.Pointer arg0, NSURLSession arg1) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer); } -/// Messages related to the operation of a task that writes data to a -/// file and notifies the delegate upon completion. -abstract final class NSURLSessionDownloadDelegate { - /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement +/// Messages related to the operation of a task that delivers data +/// directly to the delegate. +abstract final class NSURLSessionDataDelegate { + /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. static objc.ObjCObjectBase implement( - {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? URLSession_task_willBeginDelayedRequest_completionHandler_, void Function(NSURLSession, NSURLSessionTask)? URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)? URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, @@ -70716,88 +65326,85 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_ - .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ - .implement(builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ - .implement(builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implement(builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( + builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( + builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( builder, URLSession_didCreateTask_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_willBeginDelayedRequest_completionHandler_ .implement(builder, URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ - .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDataDelegate .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ .implement(builder, URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_didReceiveChallenge_completionHandler_ .implement( builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( builder, URLSession_task_needNewBodyStream_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ .implement(builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ .implement(builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_ + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ - .implement(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ - .implement(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_ + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); return builder.build(); } - /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing + /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? URLSession_task_willBeginDelayedRequest_completionHandler_, void Function(NSURLSession, NSURLSessionTask)? URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)? URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, @@ -70806,88 +65413,85 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_ - .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ - .implement(builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ - .implement(builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implement(builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( + builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( + builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( builder, URLSession_didCreateTask_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_willBeginDelayedRequest_completionHandler_ .implement(builder, URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ - .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDataDelegate .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ .implement(builder, URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_didReceiveChallenge_completionHandler_ .implement( builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( builder, URLSession_task_needNewBodyStream_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ .implement(builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ .implement(builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_ + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ - .implement(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ - .implement(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_ + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); } - /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement + /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All /// methods that can be implemented as listeners will be. static objc.ObjCObjectBase implementAsListener( - {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? URLSession_task_willBeginDelayedRequest_completionHandler_, void Function(NSURLSession, NSURLSessionTask)? URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)? URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, @@ -70897,94 +65501,91 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { final builder = objc.ObjCProtocolBuilder(); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_ + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ .implementAsListener( - builder, URLSession_downloadTask_didFinishDownloadingToURL_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ - .implementAsListener(builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ - .implementAsListener(builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implementAsListener( + builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_ + .implementAsListener(builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ + .implementAsListener(builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implementAsListener( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( builder, URLSession_didCreateTask_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_willBeginDelayedRequest_completionHandler_ .implementAsListener(builder, URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_ .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ .implementAsListener(builder, URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_didReceiveChallenge_completionHandler_ .implementAsListener( builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_ + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_ .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ .implementAsListener(builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ .implementAsListener(builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_ + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ .implementAsListener( builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ .implementAsListener( builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_ .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_ + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ .implementAsListener( builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_); return builder.build(); } - /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing + /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will /// be. static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) - URLSession_downloadTask_didFinishDownloadingToURL_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, - void Function(NSURLSession, NSURLSessionTask, NSURLRequest, - objc.ObjCBlock)? + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? URLSession_task_willBeginDelayedRequest_completionHandler_, void Function(NSURLSession, NSURLSessionTask)? URLSession_taskIsWaitingForConnectivity_, void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)? URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, - void Function( - NSURLSession, - NSURLSessionTask, - NSURLAuthenticationChallenge, - objc.ObjCBlock)? - URLSession_task_didReceiveChallenge_completionHandler_, - void Function(NSURLSession, NSURLSessionTask, - objc.ObjCBlock)? - URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, @@ -70993,150 +65594,238 @@ abstract final class NSURLSessionDownloadDelegate { void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didFinishDownloadingToURL_ + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ .implementAsListener( - builder, URLSession_downloadTask_didFinishDownloadingToURL_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ - .implementAsListener(builder, - URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); - NSURLSessionDownloadDelegate - .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ - .implementAsListener(builder, - URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); - NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implementAsListener( + builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_ + .implementAsListener(builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ + .implementAsListener(builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implementAsListener( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( builder, URLSession_didCreateTask_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_willBeginDelayedRequest_completionHandler_ .implementAsListener(builder, URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_ .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ .implementAsListener(builder, URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_didReceiveChallenge_completionHandler_ .implementAsListener( builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_ + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_ .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ .implementAsListener(builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionDownloadDelegate + NSURLSessionDataDelegate .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ .implementAsListener(builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionDownloadDelegate - .URLSession_task_didReceiveInformationalResponse_ + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ .implementAsListener( builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ .implementAsListener( builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_ .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionDownloadDelegate - .URLSession_didReceiveChallenge_completionHandler_ + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ .implementAsListener( builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionDownloadDelegate - .URLSessionDidFinishEventsForBackgroundURLSession_ + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_); } - /// Sent when a download task that has completed a download. The delegate should - /// copy or move the file at the given location to a new location as it will be - /// removed when the delegate message returns. URLSession:task:didCompleteWithError: will - /// still be called. - static final URLSession_downloadTask_didFinishDownloadingToURL_ = + /// The task has received a response and no further messages will be + /// received until the completion block is called. The disposition + /// allows you to cancel a request or to turn a data task into a + /// download task. This delegate message is optional - if you do not + /// implement it, you can get the response as a property of the task. + /// + /// This method will not be called for background upload tasks (which cannot be converted to download tasks). + static final URLSession_dataTask_didReceiveResponse_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, + objc.ObjCBlock)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a data task has become a download task. No + /// future messages will be sent to the data task. + static final URLSession_dataTask_didBecomeDownloadTask_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didBecomeDownloadTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didBecomeDownloadTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => + func(arg1, arg2, arg3)), + ); + + /// Notification that a data task has become a bidirectional stream + /// task. No future messages will be sent to the data task. The newly + /// created streamTask will carry the original request and response as + /// properties. + /// + /// For requests that were pipelined, the stream object will only allow + /// reading, and the object will immediately issue a + /// -URLSession:writeClosedForStream:. Pipelining can be disabled for + /// all requests in a session, or by the NSURLRequest + /// HTTPShouldUsePipelining property. + /// + /// The underlying connection is no longer considered part of the HTTP + /// connection cache and won't count against the total number of + /// connections per host. + static final URLSession_dataTask_didBecomeStreamTask_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didFinishDownloadingToURL_, + void Function( + NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didBecomeStreamTask_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didFinishDownloadingToURL_, - isRequired: true, + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didBecomeStreamTask_, + isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => func(arg1, arg2, arg3)), - (void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => func(arg1, arg2, arg3)), ); - /// Sent periodically to notify the delegate of download progress. - static final URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = + /// Sent when data is available for the delegate to consume. As the + /// data may be discontiguous, you should use + /// [NSData enumerateByteRangesUsingBlock:] to access it. + static final URLSession_dataTask_didReceiveData_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)>( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveData_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveData_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDownloadTask arg2, - int arg3, - int arg4, - int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), - (void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionDownloadTask arg2, - int arg3, - int arg4, - int arg5) => - func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionDataTask, objc.NSData) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, objc.NSData arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDataTask, objc.NSData) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, objc.NSData arg3) => + func(arg1, arg2, arg3)), ); - /// Sent when a download has been resumed. If a download failed with an - /// error, the -userInfo dictionary of the error will contain an - /// NSURLSessionDownloadTaskResumeData key, whose value is the resume - /// data. - static final URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = + /// Invoke the completion routine with a valid NSCachedURLResponse to + /// allow the resulting data to be cached, or pass nil to prevent + /// caching. Note that there is no guarantee that caching will be + /// attempted for a given resource, and you should not rely on this + /// message to receive the resource data. + static final URLSession_dataTask_willCacheResponse_completionHandler_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionDownloadTask, int, int)>( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)>( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_willCacheResponse_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, - _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_willCacheResponse_completionHandler_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionDownloadTask, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, int arg3, int arg4) => + (void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSCachedURLResponse arg3, + objc.ObjCBlock + arg4) => func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionDownloadTask, int, int) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 - .listener((ffi.Pointer _, NSURLSession arg1, - NSURLSessionDownloadTask arg2, int arg3, int arg4) => + (void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSCachedURLResponse arg3, + objc.ObjCBlock + arg4) => func(arg1, arg2, arg3, arg4)), ); @@ -71147,10 +65836,10 @@ abstract final class NSURLSessionDownloadDelegate { /// invoked synchronously before the task creation method returns. static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_didCreateTask_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_didCreateTask_, isRequired: false, isInstanceMethod: true, @@ -71191,10 +65880,10 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, isRequired: false, isInstanceMethod: true, @@ -71235,10 +65924,10 @@ abstract final class NSURLSessionDownloadDelegate { static final URLSession_taskIsWaitingForConnectivity_ = objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_taskIsWaitingForConnectivity_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_taskIsWaitingForConnectivity_, isRequired: false, isInstanceMethod: true, @@ -71267,10 +65956,10 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, isRequired: false, isInstanceMethod: true, @@ -71310,10 +65999,10 @@ abstract final class NSURLSessionDownloadDelegate { NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didReceiveChallenge_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didReceiveChallenge_completionHandler_, isRequired: false, isInstanceMethod: true, @@ -71351,10 +66040,10 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_needNewBodyStream_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_needNewBodyStream_, isRequired: false, isInstanceMethod: true, @@ -71392,10 +66081,10 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, isRequired: false, isInstanceMethod: true, @@ -71429,10 +66118,10 @@ abstract final class NSURLSessionDownloadDelegate { static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, int, int, int)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, isRequired: false, isInstanceMethod: true, @@ -71453,10 +66142,10 @@ abstract final class NSURLSessionDownloadDelegate { static final URLSession_task_didReceiveInformationalResponse_ = objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didReceiveInformationalResponse_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didReceiveInformationalResponse_, isRequired: false, isInstanceMethod: true, @@ -71478,10 +66167,10 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCProtocolListenableMethod< void Function( NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didFinishCollectingMetrics_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didFinishCollectingMetrics_, isRequired: false, isInstanceMethod: true, @@ -71505,10 +66194,10 @@ abstract final class NSURLSessionDownloadDelegate { static final URLSession_task_didCompleteWithError_ = objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didCompleteWithError_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_task_didCompleteWithError_, isRequired: false, isInstanceMethod: true, @@ -71530,10 +66219,10 @@ abstract final class NSURLSessionDownloadDelegate { /// explicitly invalidated, in which case the error parameter will be nil. static final URLSession_didBecomeInvalidWithError_ = objc .ObjCProtocolListenableMethod( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_didBecomeInvalidWithError_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_didBecomeInvalidWithError_, isRequired: false, isInstanceMethod: true, @@ -71560,10 +66249,10 @@ abstract final class NSURLSessionDownloadDelegate { objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_didReceiveChallenge_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSession_didReceiveChallenge_completionHandler_, isRequired: false, isInstanceMethod: true, @@ -71601,10 +66290,10 @@ abstract final class NSURLSessionDownloadDelegate { /// result in invoking the completion handler. static final URLSessionDidFinishEventsForBackgroundURLSession_ = objc.ObjCProtocolListenableMethod( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSessionDidFinishEventsForBackgroundURLSession_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionDownloadDelegate, + _protocol_NSURLSessionDataDelegate, _sel_URLSessionDidFinishEventsForBackgroundURLSession_, isRequired: false, isInstanceMethod: true, @@ -71618,68 +66307,77 @@ abstract final class NSURLSessionDownloadDelegate { ); } -late final _protocol_NSURLSessionStreamDelegate = - objc.getProtocol("NSURLSessionStreamDelegate"); -late final _sel_URLSession_readClosedForStreamTask_ = - objc.registerName("URLSession:readClosedForStreamTask:"); +late final _protocol_NSURLSessionDownloadDelegate = + objc.getProtocol("NSURLSessionDownloadDelegate"); +late final _sel_URLSession_downloadTask_didFinishDownloadingToURL_ = + objc.registerName("URLSession:downloadTask:didFinishDownloadingToURL:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => + ffi.Pointer arg2, + ffi.Pointer arg3) => block.ref.target .cast< ffi.NativeFunction< ffi.Void Function( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>>() + ffi.Pointer arg2, + ffi.Pointer arg3)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => + ffi.Pointer arg2, + ffi.Pointer arg3) => (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) { + ffi.Pointer arg2, + ffi.Pointer arg3) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); objc.objectRelease(block.cast()); } @@ -71688,68 +66386,314 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerTrampoline) + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, NSURLSessionStreamTask)> + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask)>(pointer, - retain: retain, release: release); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + objc.NSURL)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)> fromFunctionPointer( - ffi.Pointer< + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + objc.NSURL.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, + retain: false, release: true), + objc.NSURL + .castFromPointer(arg3, retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1r3kn8f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + objc.NSURL)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + ref.pointer.ref.invoke + .cast< ffi.NativeFunction< ffi.Void Function( + ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) => - objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrCallable, ptr.cast()), + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} + +late final _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = + objc.registerName( + "URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int)>()(arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int))(arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int))(arg0, arg1, arg2, arg3, arg4, arg5); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int, int) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + arg3, + arg4, + arg5)), retain: false, release: true); - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)> - fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, - NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionStreamTask.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); - /// Creates a listener block from a Dart function. /// /// This is based on FFI's NativeCallable.listener, and has the same @@ -71761,36 +66705,49 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTa /// blocks do not keep the isolate alive. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask) + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, int, int, int) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionStreamTask.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); + NSURLSessionDownloadTask.castFromPointer(arg2, + retain: false, release: true), + arg3, + arg4, + arg5)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_1uuez7b(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask)>(wrapper, retain: false, release: true); + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_CallExtension on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, NSURLSession, NSURLSessionStreamTask)> { + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> { void call(ffi.Pointer arg0, NSURLSession arg1, - NSURLSessionStreamTask arg2) => + NSURLSessionDownloadTask arg2, int arg3, int arg4, int arg5) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -71798,99 +66755,101 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_CallExte ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2)>>() + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); + ffi.Pointer, + int, + int, + int)>()(ref.pointer, arg0, arg1.ref.pointer, + arg2.ref.pointer, arg3, arg4, arg5); } -late final _sel_URLSession_writeClosedForStreamTask_ = - objc.registerName("URLSession:writeClosedForStreamTask:"); -late final _sel_URLSession_betterRouteDiscoveredForStreamTask_ = - objc.registerName("URLSession:betterRouteDiscoveredForStreamTask:"); -late final _sel_URLSession_streamTask_didBecomeInputStream_outputStream_ = objc - .registerName("URLSession:streamTask:didBecomeInputStream:outputStream:"); +late final _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = + objc.registerName( + "URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:"); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => + int arg3, + int arg4) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - arg0, arg1, arg2, arg3, arg4); + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int)>()(arg0, arg1, arg2, arg3, arg4); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrTrampoline) + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => + int arg3, + int arg4) => (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + int, + int))(arg0, arg1, arg2, arg3, arg4); ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureCallable = + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable = ffi.Pointer.fromFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureTrampoline) + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline) .cast(); void - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerTrampoline( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) { + int arg3, + int arg4) { (objc.getBlockClosure(block) as void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + int, + int))(arg0, arg1, arg2, arg3, arg4); objc.objectRelease(block.cast()); } @@ -71900,35 +66859,35 @@ ffi.NativeCallable< ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerCallable = + ffi.Int64, + ffi.Int64)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable = ffi.NativeCallable< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerTrampoline) + ffi.Int64, + ffi.Int64)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline) ..keepIsolateAlive = false; -/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream { +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionStreamTask, - objc.NSInputStream, - objc.NSOutputStream)>(pointer, retain: retain, release: release); + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64)>(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -71937,16 +66896,12 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTa /// will result in a crash. static objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4)>> ptr) => objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionStreamTask, - objc.NSInputStream, - objc.NSOutputStream)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrCallable, ptr.cast()), + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -71955,23 +66910,19 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTa /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream) fn) => - objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => - fn( + static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, int arg4) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: true, release: true), - NSURLSessionStreamTask.castFromPointer(arg2, retain: true, release: true), - objc.NSInputStream.castFromPointer(arg3, retain: true, release: true), - objc.NSOutputStream.castFromPointer(arg4, retain: true, release: true))), - retain: false, - release: true); + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + arg3, + arg4)), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -71983,57 +66934,44 @@ abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTa /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, - NSURLSession, - NSURLSessionStreamTask, - objc.NSInputStream, - objc.NSOutputStream)> listener( - void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask, - objc.NSInputStream, objc.NSOutputStream) + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, int, int) fn) { final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerCallable + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable .nativeFunction .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4) => + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4) => fn( arg0, NSURLSession.castFromPointer(arg1, retain: false, release: true), - NSURLSessionStreamTask.castFromPointer(arg2, - retain: false, release: true), - objc.NSInputStream.castFromPointer(arg3, + NSURLSessionDownloadTask.castFromPointer(arg2, retain: false, release: true), - objc.NSOutputStream.castFromPointer(arg4, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_62mtml(raw); + arg3, + arg4)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_9qxjkl(raw); objc.objectRelease(raw.cast()); return objc.ObjCBlock< ffi.Void Function( ffi.Pointer, NSURLSession, - NSURLSessionStreamTask, - objc.NSInputStream, - objc.NSOutputStream)>(wrapper, retain: false, release: true); + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64)>(wrapper, retain: false, release: true); } } -/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_CallExtension +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_CallExtension on objc.ObjCBlock< ffi.Void Function(ffi.Pointer, NSURLSession, - NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> { - void call( - ffi.Pointer arg0, - NSURLSession arg1, - NSURLSessionStreamTask arg2, - objc.NSInputStream arg3, - objc.NSOutputStream arg4) => + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDownloadTask arg2, int arg3, int arg4) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< @@ -72042,37 +66980,31 @@ extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputS ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4)>>() + ffi.Int64 arg3, + ffi.Int64 arg4)>>() .asFunction< void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, - arg0, - arg1.ref.pointer, - arg2.ref.pointer, - arg3.ref.pointer, - arg4.ref.pointer); + int, + int)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3, arg4); } -/// NSURLSessionStreamDelegate -abstract final class NSURLSessionStreamDelegate { - /// Builds an object that implements the NSURLSessionStreamDelegate protocol. To implement +/// Messages related to the operation of a task that writes data to a +/// file and notifies the delegate upon completion. +abstract final class NSURLSessionDownloadDelegate { + /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. static objc.ObjCObjectBase implement( - {void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_readClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_writeClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_betterRouteDiscoveredForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? - URLSession_streamTask_didBecomeInputStream_outputStream_, + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? @@ -72088,8 +67020,8 @@ abstract final class NSURLSessionStreamDelegate { NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? URLSession_task_needNewBodyStream_, void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, @@ -72100,68 +67032,70 @@ abstract final class NSURLSessionStreamDelegate { void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { final builder = objc.ObjCProtocolBuilder(); - NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_.implement( - builder, URLSession_readClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_.implement( - builder, URLSession_writeClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ - .implement(builder, URLSession_betterRouteDiscoveredForStreamTask_); - NSURLSessionStreamDelegate - .URLSession_streamTask_didBecomeInputStream_outputStream_ - .implement( - builder, URLSession_streamTask_didBecomeInputStream_outputStream_); - NSURLSessionStreamDelegate.URLSession_didCreateTask_.implement( + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ + .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implement(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implement(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( builder, URLSession_didCreateTask_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_willBeginDelayedRequest_completionHandler_ .implement(builder, URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ .implement(builder, URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_didReceiveChallenge_completionHandler_ .implement( builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_.implement( + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( builder, URLSession_task_needNewBodyStream_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ .implement(builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ .implement(builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); return builder.build(); } - /// Adds the implementation of the NSURLSessionStreamDelegate protocol to an existing + /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. static void addToBuilder(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_readClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_writeClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_betterRouteDiscoveredForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? - URLSession_streamTask_didBecomeInputStream_outputStream_, + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? @@ -72177,8 +67111,8 @@ abstract final class NSURLSessionStreamDelegate { NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? URLSession_task_needNewBodyStream_, void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, @@ -72188,68 +67122,70 @@ abstract final class NSURLSessionStreamDelegate { void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_.implement( - builder, URLSession_readClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_.implement( - builder, URLSession_writeClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ - .implement(builder, URLSession_betterRouteDiscoveredForStreamTask_); - NSURLSessionStreamDelegate - .URLSession_streamTask_didBecomeInputStream_outputStream_ - .implement( - builder, URLSession_streamTask_didBecomeInputStream_outputStream_); - NSURLSessionStreamDelegate.URLSession_didCreateTask_.implement( + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ + .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implement(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implement(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( builder, URLSession_didCreateTask_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_willBeginDelayedRequest_completionHandler_ .implement(builder, URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ .implement(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ .implement(builder, URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_didReceiveChallenge_completionHandler_ .implement( builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_.implement( + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( builder, URLSession_task_needNewBodyStream_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ .implement(builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ .implement(builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ .implement(builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ .implement(builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_.implement( - builder, URLSession_task_didCompleteWithError_); - NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_.implement( - builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ .implement(builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); } - /// Builds an object that implements the NSURLSessionStreamDelegate protocol. To implement + /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All /// methods that can be implemented as listeners will be. static objc.ObjCObjectBase implementAsListener( - {void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_readClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_writeClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_betterRouteDiscoveredForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? - URLSession_streamTask_didBecomeInputStream_outputStream_, + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? @@ -72265,8 +67201,8 @@ abstract final class NSURLSessionStreamDelegate { NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? URLSession_task_needNewBodyStream_, void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, @@ -72277,74 +67213,76 @@ abstract final class NSURLSessionStreamDelegate { void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { final builder = objc.ObjCProtocolBuilder(); - NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_ - .implementAsListener(builder, URLSession_readClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_ - .implementAsListener(builder, URLSession_writeClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ - .implementAsListener( - builder, URLSession_betterRouteDiscoveredForStreamTask_); - NSURLSessionStreamDelegate - .URLSession_streamTask_didBecomeInputStream_outputStream_ + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ .implementAsListener( - builder, URLSession_streamTask_didBecomeInputStream_outputStream_); - NSURLSessionStreamDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implementAsListener(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implementAsListener(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( builder, URLSession_didCreateTask_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_willBeginDelayedRequest_completionHandler_ .implementAsListener(builder, URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ .implementAsListener(builder, URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_didReceiveChallenge_completionHandler_ .implementAsListener( builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_ + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_ .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ .implementAsListener(builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ .implementAsListener(builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ .implementAsListener( builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ .implementAsListener( builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_ + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_ + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ .implementAsListener( builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_); return builder.build(); } - /// Adds the implementation of the NSURLSessionStreamDelegate protocol to an existing + /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will /// be. static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_readClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_writeClosedForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask)? - URLSession_betterRouteDiscoveredForStreamTask_, - void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? - URLSession_streamTask_didBecomeInputStream_outputStream_, + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? @@ -72360,8 +67298,8 @@ abstract final class NSURLSessionStreamDelegate { NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, - void Function( - NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? URLSession_task_needNewBodyStream_, void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, @@ -72371,182 +67309,150 @@ abstract final class NSURLSessionStreamDelegate { void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { - NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_ - .implementAsListener(builder, URLSession_readClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_ - .implementAsListener(builder, URLSession_writeClosedForStreamTask_); - NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ - .implementAsListener( - builder, URLSession_betterRouteDiscoveredForStreamTask_); - NSURLSessionStreamDelegate - .URLSession_streamTask_didBecomeInputStream_outputStream_ + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ .implementAsListener( - builder, URLSession_streamTask_didBecomeInputStream_outputStream_); - NSURLSessionStreamDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implementAsListener(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implementAsListener(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( builder, URLSession_didCreateTask_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_willBeginDelayedRequest_completionHandler_ .implementAsListener(builder, URLSession_task_willBeginDelayedRequest_completionHandler_); - NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ .implementAsListener(builder, URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_didReceiveChallenge_completionHandler_ .implementAsListener( builder, URLSession_task_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_ + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_ .implementAsListener(builder, URLSession_task_needNewBodyStream_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ .implementAsListener(builder, URLSession_task_needNewBodyStreamFromOffset_completionHandler_); - NSURLSessionStreamDelegate + NSURLSessionDownloadDelegate .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ .implementAsListener(builder, URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); - NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ .implementAsListener( builder, URLSession_task_didReceiveInformationalResponse_); - NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ .implementAsListener( builder, URLSession_task_didFinishCollectingMetrics_); - NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_ + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ .implementAsListener(builder, URLSession_task_didCompleteWithError_); - NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_ + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); - NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ .implementAsListener( builder, URLSession_didReceiveChallenge_completionHandler_); - NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ .implementAsListener( builder, URLSessionDidFinishEventsForBackgroundURLSession_); } - /// Indicates that the read side of a connection has been closed. Any - /// outstanding reads complete, but future reads will immediately fail. - /// This may be sent even when no reads are in progress. However, when - /// this delegate message is received, there may still be bytes - /// available. You only know that no more bytes are available when you - /// are able to read until EOF. - static final URLSession_readClosedForStreamTask_ = + /// Sent when a download task that has completed a download. The delegate should + /// copy or move the file at the given location to a new location as it will be + /// removed when the delegate message returns. URLSession:task:didCompleteWithError: will + /// still be called. + static final URLSession_downloadTask_didFinishDownloadingToURL_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionStreamTask)>( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_readClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didFinishDownloadingToURL_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_readClosedForStreamTask_, - isRequired: false, + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didFinishDownloadingToURL_, + isRequired: true, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask + (void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), + NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + func(arg1, arg2, arg3)), ); - /// Indicates that the write side of a connection has been closed. - /// Any outstanding writes complete, but future writes will immediately - /// fail. - static final URLSession_writeClosedForStreamTask_ = + /// Sent periodically to notify the delegate of download progress. + static final URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionStreamTask)>( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_writeClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_writeClosedForStreamTask_, + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask - .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDownloadTask arg2, + int arg3, + int arg4, + int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDownloadTask arg2, + int arg3, + int arg4, + int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), ); - /// A notification that the system has determined that a better route - /// to the host has been detected (eg, a wi-fi interface becoming - /// available.) This is a hint to the delegate that it may be - /// desirable to create a new task for subsequent work. Note that - /// there is no guarantee that the future task will be able to connect - /// to the host, so callers should should be prepared for failure of - /// reads and writes over any new interface. - static final URLSession_betterRouteDiscoveredForStreamTask_ = + /// Sent when a download has been resumed. If a download failed with an + /// error, the -userInfo dictionary of the error will contain an + /// NSURLSessionDownloadTaskResumeData key, whose value is the resume + /// data. + static final URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionStreamTask)>( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_betterRouteDiscoveredForStreamTask_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)>( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_betterRouteDiscoveredForStreamTask_, + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, isRequired: false, isInstanceMethod: true, ), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 .fromFunction((ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), - (void Function(NSURLSession, NSURLSessionStreamTask) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( - (ffi.Pointer _, NSURLSession arg1, - NSURLSessionStreamTask arg2) => - func(arg1, arg2)), - ); - - /// The given task has been completed, and unopened NSInputStream and - /// NSOutputStream objects are created from the underlying network - /// connection. This will only be invoked after all enqueued IO has - /// completed (including any necessary handshakes.) The streamTask - /// will not receive any further delegate messages. - static final URLSession_streamTask_didBecomeInputStream_outputStream_ = - objc.ObjCProtocolListenableMethod< - void Function(NSURLSession, NSURLSessionStreamTask, - objc.NSInputStream, objc.NSOutputStream)>( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_streamTask_didBecomeInputStream_outputStream_, - objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, - _sel_URLSession_streamTask_didBecomeInputStream_outputStream_, - isRequired: false, - isInstanceMethod: true, - ), - (void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, - objc.NSOutputStream) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream - .fromFunction((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionStreamTask arg2, - objc.NSInputStream arg3, - objc.NSOutputStream arg4) => + NSURLSessionDownloadTask arg2, int arg3, int arg4) => func(arg1, arg2, arg3, arg4)), - (void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, - objc.NSOutputStream) - func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream - .listener((ffi.Pointer _, - NSURLSession arg1, - NSURLSessionStreamTask arg2, - objc.NSInputStream arg3, - objc.NSOutputStream arg4) => + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDownloadTask arg2, int arg3, int arg4) => func(arg1, arg2, arg3, arg4)), ); @@ -72557,10 +67463,10 @@ abstract final class NSURLSessionStreamDelegate { /// invoked synchronously before the task creation method returns. static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didCreateTask_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didCreateTask_, isRequired: false, isInstanceMethod: true, @@ -72601,10 +67507,10 @@ abstract final class NSURLSessionStreamDelegate { objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, isRequired: false, isInstanceMethod: true, @@ -72645,10 +67551,10 @@ abstract final class NSURLSessionStreamDelegate { static final URLSession_taskIsWaitingForConnectivity_ = objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_taskIsWaitingForConnectivity_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_taskIsWaitingForConnectivity_, isRequired: false, isInstanceMethod: true, @@ -72677,10 +67583,10 @@ abstract final class NSURLSessionStreamDelegate { objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, isRequired: false, isInstanceMethod: true, @@ -72720,10 +67626,10 @@ abstract final class NSURLSessionStreamDelegate { NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didReceiveChallenge_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didReceiveChallenge_completionHandler_, isRequired: false, isInstanceMethod: true, @@ -72761,10 +67667,10 @@ abstract final class NSURLSessionStreamDelegate { objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_needNewBodyStream_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_needNewBodyStream_, isRequired: false, isInstanceMethod: true, @@ -72802,10 +67708,10 @@ abstract final class NSURLSessionStreamDelegate { objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, isRequired: false, isInstanceMethod: true, @@ -72839,10 +67745,10 @@ abstract final class NSURLSessionStreamDelegate { static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, int, int, int)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, isRequired: false, isInstanceMethod: true, @@ -72863,10 +67769,10 @@ abstract final class NSURLSessionStreamDelegate { static final URLSession_task_didReceiveInformationalResponse_ = objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didReceiveInformationalResponse_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didReceiveInformationalResponse_, isRequired: false, isInstanceMethod: true, @@ -72888,10 +67794,10 @@ abstract final class NSURLSessionStreamDelegate { objc.ObjCProtocolListenableMethod< void Function( NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didFinishCollectingMetrics_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didFinishCollectingMetrics_, isRequired: false, isInstanceMethod: true, @@ -72915,10 +67821,10 @@ abstract final class NSURLSessionStreamDelegate { static final URLSession_task_didCompleteWithError_ = objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didCompleteWithError_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_task_didCompleteWithError_, isRequired: false, isInstanceMethod: true, @@ -72940,10 +67846,10 @@ abstract final class NSURLSessionStreamDelegate { /// explicitly invalidated, in which case the error parameter will be nil. static final URLSession_didBecomeInvalidWithError_ = objc .ObjCProtocolListenableMethod( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didBecomeInvalidWithError_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didBecomeInvalidWithError_, isRequired: false, isInstanceMethod: true, @@ -72970,10 +67876,10 @@ abstract final class NSURLSessionStreamDelegate { objc.ObjCProtocolListenableMethod< void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didReceiveChallenge_completionHandler_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSession_didReceiveChallenge_completionHandler_, isRequired: false, isInstanceMethod: true, @@ -73011,10 +67917,10 @@ abstract final class NSURLSessionStreamDelegate { /// result in invoking the completion handler. static final URLSessionDidFinishEventsForBackgroundURLSession_ = objc.ObjCProtocolListenableMethod( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSessionDidFinishEventsForBackgroundURLSession_, objc.getProtocolMethodSignature( - _protocol_NSURLSessionStreamDelegate, + _protocol_NSURLSessionDownloadDelegate, _sel_URLSessionDidFinishEventsForBackgroundURLSession_, isRequired: false, isInstanceMethod: true, @@ -76232,821 +71138,203 @@ extension NSExtendedMutableArray on objc.NSMutableArray { } /// removeAllObjects - void removeAllObjects() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllObjects); - } - - /// removeObject:inRange: - void removeObject_inRange_(objc.ObjCObjectBase anObject, NSRange range) { - _objc_msgSend_16f6m81(this.ref.pointer, _sel_removeObject_inRange_, - anObject.ref.pointer, range); - } - - /// removeObject: - void removeObject_(objc.ObjCObjectBase anObject) { - _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_removeObject_, anObject.ref.pointer); - } - - /// removeObjectIdenticalTo:inRange: - void removeObjectIdenticalTo_inRange_( - objc.ObjCObjectBase anObject, NSRange range) { - _objc_msgSend_16f6m81(this.ref.pointer, - _sel_removeObjectIdenticalTo_inRange_, anObject.ref.pointer, range); - } - - /// removeObjectIdenticalTo: - void removeObjectIdenticalTo_(objc.ObjCObjectBase anObject) { - _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_removeObjectIdenticalTo_, anObject.ref.pointer); - } - - /// removeObjectsFromIndices:numIndices: - void removeObjectsFromIndices_numIndices_( - ffi.Pointer indices, DartNSUInteger cnt) { - _objc_msgSend_swohtd(this.ref.pointer, - _sel_removeObjectsFromIndices_numIndices_, indices, cnt); - } - - /// removeObjectsInArray: - void removeObjectsInArray_(objc.NSArray otherArray) { - _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_removeObjectsInArray_, otherArray.ref.pointer); - } - - /// removeObjectsInRange: - void removeObjectsInRange_(NSRange range) { - _objc_msgSend_1e3pm0z(this.ref.pointer, _sel_removeObjectsInRange_, range); - } - - /// replaceObjectsInRange:withObjectsFromArray:range: - void replaceObjectsInRange_withObjectsFromArray_range_( - NSRange range, objc.NSArray otherArray, NSRange otherRange) { - _objc_msgSend_169h6dj( - this.ref.pointer, - _sel_replaceObjectsInRange_withObjectsFromArray_range_, - range, - otherArray.ref.pointer, - otherRange); - } - - /// replaceObjectsInRange:withObjectsFromArray: - void replaceObjectsInRange_withObjectsFromArray_( - NSRange range, objc.NSArray otherArray) { - _objc_msgSend_i4ny2p( - this.ref.pointer, - _sel_replaceObjectsInRange_withObjectsFromArray_, - range, - otherArray.ref.pointer); - } - - /// setArray: - void setArray_(objc.NSArray otherArray) { - _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_setArray_, otherArray.ref.pointer); - } - - /// sortUsingFunction:context: - void sortUsingFunction_context_( - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - compare, - ffi.Pointer context) { - _objc_msgSend_1bvics1( - this.ref.pointer, _sel_sortUsingFunction_context_, compare, context); - } - - /// sortUsingSelector: - void sortUsingSelector_(ffi.Pointer comparator) { - _objc_msgSend_1d9e4oe( - this.ref.pointer, _sel_sortUsingSelector_, comparator); - } - - /// insertObjects:atIndexes: - void insertObjects_atIndexes_(objc.NSArray objects, objc.NSIndexSet indexes) { - _objc_msgSend_wjvic9(this.ref.pointer, _sel_insertObjects_atIndexes_, - objects.ref.pointer, indexes.ref.pointer); - } - - /// removeObjectsAtIndexes: - void removeObjectsAtIndexes_(objc.NSIndexSet indexes) { - _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_removeObjectsAtIndexes_, indexes.ref.pointer); - } - - /// replaceObjectsAtIndexes:withObjects: - void replaceObjectsAtIndexes_withObjects_( - objc.NSIndexSet indexes, objc.NSArray objects) { - _objc_msgSend_wjvic9( - this.ref.pointer, - _sel_replaceObjectsAtIndexes_withObjects_, - indexes.ref.pointer, - objects.ref.pointer); - } - - /// setObject:atIndexedSubscript: - void setObject_atIndexedSubscript_( - objc.ObjCObjectBase obj, DartNSUInteger idx) { - _objc_msgSend_10i1axw(this.ref.pointer, _sel_setObject_atIndexedSubscript_, - obj.ref.pointer, idx); - } - - /// sortUsingComparator: - void sortUsingComparator_(DartNSComparator cmptr) { - _objc_msgSend_f167m6( - this.ref.pointer, _sel_sortUsingComparator_, cmptr.ref.pointer); - } - - /// sortWithOptions:usingComparator: - void sortWithOptions_usingComparator_( - objc.NSSortOptions opts, DartNSComparator cmptr) { - _objc_msgSend_jjgvjt(this.ref.pointer, - _sel_sortWithOptions_usingComparator_, opts.value, cmptr.ref.pointer); - } -} - -late final _sel_arrayWithCapacity_ = objc.registerName("arrayWithCapacity:"); - -/// NSMutableArrayCreation -extension NSMutableArrayCreation on objc.NSMutableArray { - /// arrayWithCapacity: - static objc.NSMutableArray arrayWithCapacity_(DartNSUInteger numItems) { - final _ret = _objc_msgSend_1qrcblu( - _class_NSMutableArray, _sel_arrayWithCapacity_, numItems); - return objc.NSMutableArray.castFromPointer(_ret, - retain: true, release: true); - } - - /// arrayWithContentsOfFile: - static objc.NSMutableArray? arrayWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_62nh5j( - _class_NSMutableArray, _sel_arrayWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableArray.castFromPointer(_ret, - retain: true, release: true); - } - - /// arrayWithContentsOfURL: - static objc.NSMutableArray? arrayWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_62nh5j( - _class_NSMutableArray, _sel_arrayWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableArray.castFromPointer(_ret, - retain: true, release: true); - } - - /// initWithContentsOfFile: - objc.NSMutableArray? initWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableArray.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithContentsOfURL: - objc.NSMutableArray? initWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSMutableArray.castFromPointer(_ret, - retain: false, release: true); - } -} - -late final _sel_applyDifference_ = objc.registerName("applyDifference:"); - -/// NSMutableArrayDiffing -extension NSMutableArrayDiffing on objc.NSMutableArray { - /// applyDifference: - void applyDifference_(objc.NSOrderedCollectionDifference difference) { - _objc_msgSend_1jdvcbf( - this.ref.pointer, _sel_applyDifference_, difference.ref.pointer); - } -} - -late final _protocol_NSItemProviderWriting = - objc.getProtocol("NSItemProviderWriting"); -late final _sel_writableTypeIdentifiersForItemProvider = - objc.registerName("writableTypeIdentifiersForItemProvider"); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSArray_ffiVoid_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_NSArray_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_NSArray_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunction(objc.NSArray Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_NSArray_ffiVoid_closureCallable, - (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_NSArray_ffiVoid_CallExtension - on objc.ObjCBlock)> { - objc.NSArray call(ffi.Pointer arg0) => objc.NSArray.castFromPointer( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0), - retain: true, - release: true); -} - -late final _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_ = - objc.registerName( - "itemProviderVisibilityForRepresentationWithTypeIdentifier:"); -final _objc_msgSend_96wwe1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -int _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable = - ffi.Pointer.fromFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline, - 0) - .cast(); -int _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as int Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable = - ffi.Pointer.fromFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline, - 0) - .cast(); - -/// Construction methods for `objc.ObjCBlock, objc.NSString)>`. -abstract final class ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - NSInteger Function(ffi.Pointer, objc.NSString)> castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock, objc.NSString)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSString)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, objc.NSString)>( - objc.newPointerBlock(_ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + void removeAllObjects() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_removeAllObjects); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSString)> fromFunction( - objc.NSItemProviderRepresentationVisibility Function( - ffi.Pointer, objc.NSString) - fn) => - objc.ObjCBlock, objc.NSString)>( - objc.newClosureBlock( - _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true)) - .value), - retain: false, - release: true); -} + /// removeObject:inRange: + void removeObject_inRange_(objc.ObjCObjectBase anObject, NSRange range) { + _objc_msgSend_16f6m81(this.ref.pointer, _sel_removeObject_inRange_, + anObject.ref.pointer, range); + } -/// Call operator for `objc.ObjCBlock, objc.NSString)>`. -extension ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_CallExtension - on objc - .ObjCBlock, objc.NSString)> { - objc.NSItemProviderRepresentationVisibility call( - ffi.Pointer arg0, objc.NSString arg1) => - objc.NSItemProviderRepresentationVisibility.fromValue(ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - NSInteger Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer)); -} + /// removeObject: + void removeObject_(objc.ObjCObjectBase anObject) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_removeObject_, anObject.ref.pointer); + } -void _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} + /// removeObjectIdenticalTo:inRange: + void removeObjectIdenticalTo_inRange_( + objc.ObjCObjectBase anObject, NSRange range) { + _objc_msgSend_16f6m81(this.ref.pointer, + _sel_removeObjectIdenticalTo_inRange_, anObject.ref.pointer, range); + } -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable = ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline) - ..keepIsolateAlive = false; + /// removeObjectIdenticalTo: + void removeObjectIdenticalTo_(objc.ObjCObjectBase anObject) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_removeObjectIdenticalTo_, anObject.ref.pointer); + } -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSData_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock( - pointer, - retain: retain, - release: release); + /// removeObjectsFromIndices:numIndices: + void removeObjectsFromIndices_numIndices_( + ffi.Pointer indices, DartNSUInteger cnt) { + _objc_msgSend_swohtd(this.ref.pointer, + _sel_removeObjectsFromIndices_numIndices_, indices, cnt); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + /// removeObjectsInArray: + void removeObjectsInArray_(objc.NSArray otherArray) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_removeObjectsInArray_, otherArray.ref.pointer); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSData?, objc.NSError?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSError_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, - retain: true, release: true), - arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); + /// removeObjectsInRange: + void removeObjectsInRange_(NSRange range) { + _objc_msgSend_1e3pm0z(this.ref.pointer, _sel_removeObjectsInRange_, range); + } - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock - listener(void Function(objc.NSData?, objc.NSError?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn( - arg0.address == 0 - ? null - : objc.NSData.castFromPointer(arg0, - retain: false, release: true), - arg1.address == 0 - ? null - : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjvic9(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true); + /// replaceObjectsInRange:withObjectsFromArray:range: + void replaceObjectsInRange_withObjectsFromArray_range_( + NSRange range, objc.NSArray otherArray, NSRange otherRange) { + _objc_msgSend_169h6dj( + this.ref.pointer, + _sel_replaceObjectsInRange_withObjectsFromArray_range_, + range, + otherArray.ref.pointer, + otherRange); } -} -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSData_NSError_CallExtension - on objc.ObjCBlock { - void call(objc.NSData? arg0, objc.NSError? arg1) => ref.pointer.ref.invoke - .cast< + /// replaceObjectsInRange:withObjectsFromArray: + void replaceObjectsInRange_withObjectsFromArray_( + NSRange range, objc.NSArray otherArray) { + _objc_msgSend_i4ny2p( + this.ref.pointer, + _sel_replaceObjectsInRange_withObjectsFromArray_, + range, + otherArray.ref.pointer); + } + + /// setArray: + void setArray_(objc.NSArray otherArray) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setArray_, otherArray.ref.pointer); + } + + /// sortUsingFunction:context: + void sortUsingFunction_context_( + ffi.Pointer< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); -} + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + compare, + ffi.Pointer context) { + _objc_msgSend_1bvics1( + this.ref.pointer, _sel_sortUsingFunction_context_, compare, context); + } -late final _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = - objc.registerName( - "loadDataWithTypeIdentifier:forItemProviderCompletionHandler:"); -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline) - .cast(); + /// sortUsingSelector: + void sortUsingSelector_(ffi.Pointer comparator) { + _objc_msgSend_1d9e4oe( + this.ref.pointer, _sel_sortUsingSelector_, comparator); + } -/// Construction methods for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. -abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - NSProgress? Function(ffi.Pointer, objc.NSString, - objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - NSProgress? Function(ffi.Pointer, objc.NSString, - objc.ObjCBlock)>(pointer, - retain: retain, release: release); + /// insertObjects:atIndexes: + void insertObjects_atIndexes_(objc.NSArray objects, objc.NSIndexSet indexes) { + _objc_msgSend_wjvic9(this.ref.pointer, _sel_insertObjects_atIndexes_, + objects.ref.pointer, indexes.ref.pointer); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - NSProgress? Function(ffi.Pointer, objc.NSString, - objc.ObjCBlock)> - fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - NSProgress? Function(ffi.Pointer, objc.NSString, - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); + /// removeObjectsAtIndexes: + void removeObjectsAtIndexes_(objc.NSIndexSet indexes) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_removeObjectsAtIndexes_, indexes.ref.pointer); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSString, objc.ObjCBlock)> - fromFunction(NSProgress? Function(ffi.Pointer, objc.NSString, objc.ObjCBlock) fn) => - objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>( - objc.newClosureBlock( - _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true), ObjCBlock_ffiVoid_NSData_NSError.castFromPointer(arg2, retain: true, release: true)) - ?.ref - .retainAndAutorelease() ?? - ffi.nullptr), - retain: false, - release: true); -} + /// replaceObjectsAtIndexes:withObjects: + void replaceObjectsAtIndexes_withObjects_( + objc.NSIndexSet indexes, objc.NSArray objects) { + _objc_msgSend_wjvic9( + this.ref.pointer, + _sel_replaceObjectsAtIndexes_withObjects_, + indexes.ref.pointer, + objects.ref.pointer); + } -/// Call operator for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. -extension ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_CallExtension - on objc.ObjCBlock< - NSProgress? Function(ffi.Pointer, objc.NSString, - objc.ObjCBlock)> { - NSProgress? call(ffi.Pointer arg0, objc.NSString arg1, objc.ObjCBlock arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>() - (ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer) - .address == - 0 - ? null - : NSProgress.castFromPointer( - ref.pointer.ref.invoke.cast Function(ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>>().asFunction Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer), - retain: true, - release: true); -} + /// setObject:atIndexedSubscript: + void setObject_atIndexedSubscript_( + objc.ObjCObjectBase obj, DartNSUInteger idx) { + _objc_msgSend_10i1axw(this.ref.pointer, _sel_setObject_atIndexedSubscript_, + obj.ref.pointer, idx); + } -/// NSItemProviderWriting -abstract final class NSItemProviderWriting { - /// Builds an object that implements the NSItemProviderWriting protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {objc.NSArray Function()? writableTypeIdentifiersForItemProvider, - objc.NSItemProviderRepresentationVisibility Function(objc.NSString)? - itemProviderVisibilityForRepresentationWithTypeIdentifier_, - required NSProgress? Function(objc.NSString, - objc.ObjCBlock) - loadDataWithTypeIdentifier_forItemProviderCompletionHandler_}) { - final builder = objc.ObjCProtocolBuilder(); - NSItemProviderWriting.writableTypeIdentifiersForItemProvider - .implement(builder, writableTypeIdentifiersForItemProvider); - NSItemProviderWriting - .itemProviderVisibilityForRepresentationWithTypeIdentifier_ - .implement(builder, - itemProviderVisibilityForRepresentationWithTypeIdentifier_); - NSItemProviderWriting - .loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ - .implement(builder, - loadDataWithTypeIdentifier_forItemProviderCompletionHandler_); - return builder.build(); + /// sortUsingComparator: + void sortUsingComparator_(DartNSComparator cmptr) { + _objc_msgSend_f167m6( + this.ref.pointer, _sel_sortUsingComparator_, cmptr.ref.pointer); } - /// Adds the implementation of the NSItemProviderWriting protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {objc.NSArray Function()? writableTypeIdentifiersForItemProvider, - objc.NSItemProviderRepresentationVisibility Function(objc.NSString)? - itemProviderVisibilityForRepresentationWithTypeIdentifier_, - required NSProgress? Function(objc.NSString, - objc.ObjCBlock) - loadDataWithTypeIdentifier_forItemProviderCompletionHandler_}) { - NSItemProviderWriting.writableTypeIdentifiersForItemProvider - .implement(builder, writableTypeIdentifiersForItemProvider); - NSItemProviderWriting - .itemProviderVisibilityForRepresentationWithTypeIdentifier_ - .implement(builder, - itemProviderVisibilityForRepresentationWithTypeIdentifier_); - NSItemProviderWriting - .loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ - .implement(builder, - loadDataWithTypeIdentifier_forItemProviderCompletionHandler_); + /// sortWithOptions:usingComparator: + void sortWithOptions_usingComparator_( + objc.NSSortOptions opts, DartNSComparator cmptr) { + _objc_msgSend_jjgvjt(this.ref.pointer, + _sel_sortWithOptions_usingComparator_, opts.value, cmptr.ref.pointer); } +} - /// writableTypeIdentifiersForItemProvider - static final writableTypeIdentifiersForItemProvider = - objc.ObjCProtocolMethod( - _protocol_NSItemProviderWriting, - _sel_writableTypeIdentifiersForItemProvider, - objc.getProtocolMethodSignature( - _protocol_NSItemProviderWriting, - _sel_writableTypeIdentifiersForItemProvider, - isRequired: false, - isInstanceMethod: true, - ), - (objc.NSArray Function() func) => ObjCBlock_NSArray_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - ); +late final _sel_arrayWithCapacity_ = objc.registerName("arrayWithCapacity:"); - /// itemProviderVisibilityForRepresentationWithTypeIdentifier: - static final itemProviderVisibilityForRepresentationWithTypeIdentifier_ = - objc.ObjCProtocolMethod< - objc.NSItemProviderRepresentationVisibility Function(objc.NSString)>( - _protocol_NSItemProviderWriting, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - objc.getProtocolMethodSignature( - _protocol_NSItemProviderWriting, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - isRequired: false, - isInstanceMethod: true, - ), - (objc.NSItemProviderRepresentationVisibility Function(objc.NSString) - func) => - ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString - .fromFunction( - (ffi.Pointer _, objc.NSString arg1) => func(arg1)), - ); +/// NSMutableArrayCreation +extension NSMutableArrayCreation on objc.NSMutableArray { + /// arrayWithCapacity: + static objc.NSMutableArray arrayWithCapacity_(DartNSUInteger numItems) { + final _ret = _objc_msgSend_1qrcblu( + _class_NSMutableArray, _sel_arrayWithCapacity_, numItems); + return objc.NSMutableArray.castFromPointer(_ret, + retain: true, release: true); + } - /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: - static final loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = - objc.ObjCProtocolMethod< - NSProgress? Function(objc.NSString, - objc.ObjCBlock)>( - _protocol_NSItemProviderWriting, - _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, - objc.getProtocolMethodSignature( - _protocol_NSItemProviderWriting, - _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, - isRequired: true, - isInstanceMethod: true, - ), - (NSProgress? Function(objc.NSString, - objc.ObjCBlock) - func) => - ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError.fromFunction( - (ffi.Pointer _, - objc.NSString arg1, - objc.ObjCBlock< - ffi.Void Function(objc.NSData?, objc.NSError?)> - arg2) => - func(arg1, arg2)), - ); -} + /// arrayWithContentsOfFile: + static objc.NSMutableArray? arrayWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j( + _class_NSMutableArray, _sel_arrayWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: true, release: true); + } -late final _protocol_NSItemProviderReading = - objc.getProtocol("NSItemProviderReading"); + /// arrayWithContentsOfURL: + static objc.NSMutableArray? arrayWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j( + _class_NSMutableArray, _sel_arrayWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: true, release: true); + } -/// NSItemProviderReading -abstract final class NSItemProviderReading { - /// Builds an object that implements the NSItemProviderReading protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement() { - final builder = objc.ObjCProtocolBuilder(); + /// initWithContentsOfFile: + objc.NSMutableArray? initWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: false, release: true); + } - return builder.build(); + /// initWithContentsOfURL: + objc.NSMutableArray? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSMutableArray.castFromPointer(_ret, + retain: false, release: true); } +} - /// Adds the implementation of the NSItemProviderReading protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder( - objc.ObjCProtocolBuilder builder, - ) {} +late final _sel_applyDifference_ = objc.registerName("applyDifference:"); + +/// NSMutableArrayDiffing +extension NSMutableArrayDiffing on objc.NSMutableArray { + /// applyDifference: + void applyDifference_(objc.NSOrderedCollectionDifference difference) { + _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_applyDifference_, difference.ref.pointer); + } } void _ObjCBlock_ffiVoid_objcObjCObject_NSError_fnPtrTrampoline( @@ -78357,6 +72645,7 @@ final _objc_msgSend_1140663 = objc.msgSendPointer ffi.Pointer>)>(); late final _sel_writeToFile_atomically_encoding_error_ = objc.registerName("writeToFile:atomically:encoding:error:"); +late final _sel_hash = objc.registerName("hash"); late final _sel_initWithCharactersNoCopy_length_freeWhenDone_ = objc.registerName("initWithCharactersNoCopy:length:freeWhenDone:"); final _objc_msgSend_zsd8q9 = objc.msgSendPointer @@ -80063,6 +74352,93 @@ extension NSStringEncodingDetection on objc.NSString { late final _sel_readableTypeIdentifiersForItemProvider = objc.registerName("readableTypeIdentifiersForItemProvider"); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSArray_ffiVoid_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSArray_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>(pointer, + retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_NSArray_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> + fromFunction(objc.NSArray Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSArray_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_NSArray_ffiVoid_CallExtension + on objc.ObjCBlock)> { + objc.NSArray call(ffi.Pointer arg0) => objc.NSArray.castFromPointer( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); +} + late final _sel_objectWithItemProviderData_typeIdentifier_error_ = objc.registerName("objectWithItemProviderData:typeIdentifier:error:"); instancetype @@ -80095,50 +74471,458 @@ ffi.Pointer ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>( - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline) + ffi.Pointer>)>( + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline) + .cast(); +instancetype + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3) => + (objc.getBlockClosure(block) as instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>( + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. +abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3)>> ptr) => + objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)>( + objc.newPointerBlock(_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> + fromFunction(Dartinstancetype? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>) fn) => + objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>( + objc.newClosureBlock( + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3) => + fn(arg0, objc.NSData.castFromPointer(arg1, retain: true, release: true), objc.NSString.castFromPointer(arg2, retain: true, release: true), arg3)?.ref.retainAndAutorelease() ?? + ffi.nullptr), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. +extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_CallExtension + on objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)> { + Dartinstancetype? call(ffi.Pointer arg0, objc.NSData arg1, objc.NSString arg2, ffi.Pointer> arg3) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>() + (ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3) + .address == + 0 + ? null + : objc.ObjCObjectBase( + ref.pointer.ref.invoke.cast block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3)>>().asFunction, ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3), + retain: true, + release: true); +} + +late final _sel_writableTypeIdentifiersForItemProvider = + objc.registerName("writableTypeIdentifiersForItemProvider"); +late final _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_ = + objc.registerName( + "itemProviderVisibilityForRepresentationWithTypeIdentifier:"); +final _objc_msgSend_96wwe1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +int _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable = + ffi.Pointer.fromFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline, + 0) + .cast(); +int _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as int Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable = + ffi.Pointer.fromFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline, + 0) + .cast(); + +/// Construction methods for `objc.ObjCBlock, objc.NSString)>`. +abstract final class ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + NSInteger Function(ffi.Pointer, objc.NSString)> castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock, objc.NSString)>( + pointer, + retain: retain, + release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, objc.NSString)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, objc.NSString)>( + objc.newPointerBlock(_ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock, objc.NSString)> fromFunction( + objc.NSItemProviderRepresentationVisibility Function( + ffi.Pointer, objc.NSString) + fn) => + objc.ObjCBlock, objc.NSString)>( + objc.newClosureBlock( + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true)) + .value), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, objc.NSString)>`. +extension ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_CallExtension + on objc + .ObjCBlock, objc.NSString)> { + objc.NSItemProviderRepresentationVisibility call( + ffi.Pointer arg0, objc.NSString arg1) => + objc.NSItemProviderRepresentationVisibility.fromValue(ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction, ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer)); +} + +void _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable = ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSData_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock( + pointer, + retain: retain, + release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock fromFunction( + void Function(objc.NSData?, objc.NSError?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, + retain: true, release: true), + arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock + listener(void Function(objc.NSData?, objc.NSError?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1) => + fn( + arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, + retain: false, release: true), + arg1.address == 0 + ? null + : objc.NSError.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjvic9(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSData_NSError_CallExtension + on objc.ObjCBlock { + void call(objc.NSData? arg0, objc.NSError? arg1) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = + objc.registerName( + "loadDataWithTypeIdentifier:forItemProviderCompletionHandler:"); +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline) .cast(); -instancetype - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline( +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline( ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3) => - (objc.getBlockClosure(block) as instancetype Function( + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer>))(arg0, arg1, arg2, arg3); + ffi.Pointer))(arg0, arg1, arg2); ffi.Pointer - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable = + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable = ffi.Pointer.fromFunction< - instancetype Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>( - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline) + ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline) .cast(); -/// Construction methods for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. -abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { +/// Construction methods for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError { /// Returns a block that wraps the given raw block pointer. static objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - objc.NSData, - objc.NSString, - ffi.Pointer>)> + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)> castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - objc.NSData, - objc.NSString, - ffi.Pointer>)>(pointer, retain: retain, release: release); + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); /// Creates a block from a C function pointer. /// @@ -80146,16 +74930,13 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. static objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3)>> ptr) => + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - objc.NSData, - objc.NSString, - ffi.Pointer>)>( - objc.newPointerBlock(_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrCallable, ptr.cast()), + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable, ptr.cast()), retain: false, release: true); @@ -80164,54 +74945,50 @@ abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> - fromFunction(Dartinstancetype? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>) fn) => - objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>( + static objc.ObjCBlock, objc.NSString, objc.ObjCBlock)> + fromFunction(NSProgress? Function(ffi.Pointer, objc.NSString, objc.ObjCBlock) fn) => + objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>( objc.newClosureBlock( - _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable, + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable, (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3) => - fn(arg0, objc.NSData.castFromPointer(arg1, retain: true, release: true), objc.NSString.castFromPointer(arg2, retain: true, release: true), arg3)?.ref.retainAndAutorelease() ?? + ffi.Pointer arg2) => + fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true), ObjCBlock_ffiVoid_NSData_NSError.castFromPointer(arg2, retain: true, release: true)) + ?.ref + .retainAndAutorelease() ?? ffi.nullptr), retain: false, release: true); } -/// Call operator for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. -extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_CallExtension +/// Call operator for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. +extension ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_CallExtension on objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - objc.NSData, - objc.NSString, - ffi.Pointer>)> { - Dartinstancetype? call(ffi.Pointer arg0, objc.NSData arg1, objc.NSString arg2, ffi.Pointer> arg3) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>() - (ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3) - .address == - 0 - ? null - : objc.ObjCObjectBase( - ref.pointer.ref.invoke.cast block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3)>>().asFunction, ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3), - retain: true, - release: true); + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)> { + NSProgress? call(ffi.Pointer arg0, objc.NSString arg1, objc.ObjCBlock arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>() + (ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer) + .address == + 0 + ? null + : NSProgress.castFromPointer( + ref.pointer.ref.invoke.cast Function(ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>>().asFunction Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer), + retain: true, + release: true); } /// NSItemProvider @@ -80247,7 +75024,7 @@ extension NSItemProvider on objc.NSString { } /// writableTypeIdentifiersForItemProvider - objc.NSArray get writableTypeIdentifiersForItemProvider { + objc.NSArray get writableTypeIdentifiersForItemProvider1 { if (!objc.respondsToSelector( this.ref.pointer, _sel_writableTypeIdentifiersForItemProvider)) { throw objc.UnimplementedOptionalMethodException( @@ -80544,869 +75321,150 @@ final _objc_msgSend_g3kdhc = objc.msgSendPointer ffi.Pointer, ffi.Pointer)>(); /// NSStringDeprecated -extension NSStringDeprecated on objc.NSString { - /// cString - ffi.Pointer cString() { - return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_cString); - } - - /// lossyCString - ffi.Pointer lossyCString() { - return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_lossyCString); - } - - /// cStringLength - DartNSUInteger cStringLength() { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_cStringLength); - } - - /// getCString: - void getCString_(ffi.Pointer bytes) { - _objc_msgSend_1r7ue5f(this.ref.pointer, _sel_getCString_, bytes); - } - - /// getCString:maxLength: - void getCString_maxLength_( - ffi.Pointer bytes, DartNSUInteger maxLength) { - _objc_msgSend_1h3mito( - this.ref.pointer, _sel_getCString_maxLength_, bytes, maxLength); - } - - /// getCString:maxLength:range:remainingRange: - void getCString_maxLength_range_remainingRange_(ffi.Pointer bytes, - DartNSUInteger maxLength, NSRange aRange, NSRangePointer leftoverRange) { - _objc_msgSend_3gpdva( - this.ref.pointer, - _sel_getCString_maxLength_range_remainingRange_, - bytes, - maxLength, - aRange, - leftoverRange); - } - - /// writeToFile:atomically: - bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { - return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToFile_atomically_, - path.ref.pointer, useAuxiliaryFile); - } - - /// writeToURL:atomically: - bool writeToURL_atomically_(objc.NSURL url, bool atomically) { - return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToURL_atomically_, - url.ref.pointer, atomically); - } - - /// initWithContentsOfFile: - objc.ObjCObjectBase? initWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// initWithContentsOfURL: - objc.ObjCObjectBase? initWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), - _sel_initWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// stringWithContentsOfFile: - static objc.ObjCObjectBase? stringWithContentsOfFile_(objc.NSString path) { - final _ret = _objc_msgSend_62nh5j( - _class_NSString, _sel_stringWithContentsOfFile_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// stringWithContentsOfURL: - static objc.ObjCObjectBase? stringWithContentsOfURL_(objc.NSURL url) { - final _ret = _objc_msgSend_62nh5j( - _class_NSString, _sel_stringWithContentsOfURL_, url.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// initWithCStringNoCopy:length:freeWhenDone: - objc.ObjCObjectBase? initWithCStringNoCopy_length_freeWhenDone_( - ffi.Pointer bytes, DartNSUInteger length, bool freeBuffer) { - final _ret = _objc_msgSend_fjj4b8( - this.ref.retainAndReturnPointer(), - _sel_initWithCStringNoCopy_length_freeWhenDone_, - bytes, - length, - freeBuffer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// initWithCString:length: - objc.ObjCObjectBase? initWithCString_length_( - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _objc_msgSend_a15xhc(this.ref.retainAndReturnPointer(), - _sel_initWithCString_length_, bytes, length); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// initWithCString: - objc.ObjCObjectBase? initWithCString_(ffi.Pointer bytes) { - final _ret = _objc_msgSend_rqwdif( - this.ref.retainAndReturnPointer(), _sel_initWithCString_, bytes); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// stringWithCString:length: - static objc.ObjCObjectBase? stringWithCString_length_( - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _objc_msgSend_a15xhc( - _class_NSString, _sel_stringWithCString_length_, bytes, length); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// stringWithCString: - static objc.ObjCObjectBase? stringWithCString_(ffi.Pointer bytes) { - final _ret = - _objc_msgSend_rqwdif(_class_NSString, _sel_stringWithCString_, bytes); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// getCharacters: - void getCharacters_(ffi.Pointer buffer) { - _objc_msgSend_g3kdhc(this.ref.pointer, _sel_getCharacters_, buffer); - } -} - -late final _protocol_NSURLHandleClient = objc.getProtocol("NSURLHandleClient"); -late final _sel_URLHandle_resourceDataDidBecomeAvailable_ = - objc.registerName("URLHandle:resourceDataDidBecomeAvailable:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSData)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSURLHandle, - objc.NSData)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, objc.NSURLHandle, objc.NSData)> - fromFunctionPointer( - ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> - ptr) => - objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, objc.NSURLHandle, objc.NSData)> - fromFunction(void Function(ffi.Pointer, objc.NSURLHandle, objc.NSData) fn) => - objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, retain: true, release: true), - objc.NSData.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSData)> listener( - void Function(ffi.Pointer, objc.NSURLHandle, objc.NSData) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, - retain: false, release: true), - objc.NSData.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSURLHandle, - objc.NSData)>(wrapper, retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSData)> { - void call(ffi.Pointer arg0, objc.NSURLHandle arg1, - objc.NSData arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); -} - -late final _sel_URLHandleResourceDidBeginLoading_ = - objc.registerName("URLHandleResourceDidBeginLoading:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerCallable = ffi - .NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock, objc.NSURLHandle)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - objc.NSURLHandle)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSURLHandle)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, objc.NSURLHandle)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSURLHandle)> - fromFunction(void Function(ffi.Pointer, objc.NSURLHandle) fn) => - objc.ObjCBlock, objc.NSURLHandle)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, - retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc - .ObjCBlock, objc.NSURLHandle)> - listener(void Function(ffi.Pointer, objc.NSURLHandle) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_wjovn7(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSURLHandle)>(wrapper, - retain: false, release: true); +extension NSStringDeprecated on objc.NSString { + /// cString + ffi.Pointer cString() { + return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_cString); } -} -/// Call operator for `objc.ObjCBlock, objc.NSURLHandle)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_CallExtension on objc - .ObjCBlock, objc.NSURLHandle)> { - void call(ffi.Pointer arg0, objc.NSURLHandle arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer); -} + /// lossyCString + ffi.Pointer lossyCString() { + return _objc_msgSend_1fuqfwb(this.ref.pointer, _sel_lossyCString); + } -late final _sel_URLHandleResourceDidFinishLoading_ = - objc.registerName("URLHandleResourceDidFinishLoading:"); -late final _sel_URLHandleResourceDidCancelLoading_ = - objc.registerName("URLHandleResourceDidCancelLoading:"); -late final _sel_URLHandle_resourceDidFailLoadingWithReason_ = - objc.registerName("URLHandle:resourceDidFailLoadingWithReason:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); -ffi.Pointer - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer))(arg0, arg1, arg2); - objc.objectRelease(block.cast()); -} + /// cStringLength + DartNSUInteger cStringLength() { + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_cStringLength); + } -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerTrampoline) - ..keepIsolateAlive = false; + /// getCString: + void getCString_(ffi.Pointer bytes) { + _objc_msgSend_1r7ue5f(this.ref.pointer, _sel_getCString_, bytes); + } -/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSString)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSURLHandle, - objc.NSString)>(pointer, retain: retain, release: release); + /// getCString:maxLength: + void getCString_maxLength_( + ffi.Pointer bytes, DartNSUInteger maxLength) { + _objc_msgSend_1h3mito( + this.ref.pointer, _sel_getCString_maxLength_, bytes, maxLength); + } - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, objc.NSURLHandle, objc.NSString)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => - objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSString)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); + /// getCString:maxLength:range:remainingRange: + void getCString_maxLength_range_remainingRange_(ffi.Pointer bytes, + DartNSUInteger maxLength, NSRange aRange, NSRangePointer leftoverRange) { + _objc_msgSend_3gpdva( + this.ref.pointer, + _sel_getCString_maxLength_range_remainingRange_, + bytes, + maxLength, + aRange, + leftoverRange); + } - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, objc.NSURLHandle, objc.NSString)> - fromFunction(void Function(ffi.Pointer, objc.NSURLHandle, objc.NSString) fn) => - objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, retain: true, release: true), - objc.NSString.castFromPointer(arg2, retain: true, release: true))), - retain: false, - release: true); + /// writeToFile:atomically: + bool writeToFile_atomically_(objc.NSString path, bool useAuxiliaryFile) { + return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToFile_atomically_, + path.ref.pointer, useAuxiliaryFile); + } - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSString)> listener( - void Function(ffi.Pointer, objc.NSURLHandle, objc.NSString) - fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerCallable - .nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0, - objc.NSURLHandle.castFromPointer(arg1, - retain: false, release: true), - objc.NSString.castFromPointer(arg2, - retain: false, release: true))); - final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ao4xm9(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSURLHandle, - objc.NSString)>(wrapper, retain: false, release: true); + /// writeToURL:atomically: + bool writeToURL_atomically_(objc.NSURL url, bool atomically) { + return _objc_msgSend_w8pbfh(this.ref.pointer, _sel_writeToURL_atomically_, + url.ref.pointer, atomically); } -} -/// Call operator for `objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_CallExtension - on objc.ObjCBlock< - ffi.Void Function( - ffi.Pointer, objc.NSURLHandle, objc.NSString)> { - void call(ffi.Pointer arg0, objc.NSURLHandle arg1, - objc.NSString arg2) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); -} + /// initWithContentsOfFile: + objc.ObjCObjectBase? initWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } -/// NSURLHandleClient -abstract final class NSURLHandleClient { - /// Builds an object that implements the NSURLHandleClient protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required void Function(objc.NSURLHandle, objc.NSData) - URLHandle_resourceDataDidBecomeAvailable_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidBeginLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidFinishLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidCancelLoading_, - required void Function(objc.NSURLHandle, objc.NSString) - URLHandle_resourceDidFailLoadingWithReason_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_.implement( - builder, URLHandle_resourceDataDidBecomeAvailable_); - NSURLHandleClient.URLHandleResourceDidBeginLoading_.implement( - builder, URLHandleResourceDidBeginLoading_); - NSURLHandleClient.URLHandleResourceDidFinishLoading_.implement( - builder, URLHandleResourceDidFinishLoading_); - NSURLHandleClient.URLHandleResourceDidCancelLoading_.implement( - builder, URLHandleResourceDidCancelLoading_); - NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_.implement( - builder, URLHandle_resourceDidFailLoadingWithReason_); - return builder.build(); + /// initWithContentsOfURL: + objc.ObjCObjectBase? initWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j(this.ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); } - /// Adds the implementation of the NSURLHandleClient protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required void Function(objc.NSURLHandle, objc.NSData) - URLHandle_resourceDataDidBecomeAvailable_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidBeginLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidFinishLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidCancelLoading_, - required void Function(objc.NSURLHandle, objc.NSString) - URLHandle_resourceDidFailLoadingWithReason_}) { - NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_.implement( - builder, URLHandle_resourceDataDidBecomeAvailable_); - NSURLHandleClient.URLHandleResourceDidBeginLoading_.implement( - builder, URLHandleResourceDidBeginLoading_); - NSURLHandleClient.URLHandleResourceDidFinishLoading_.implement( - builder, URLHandleResourceDidFinishLoading_); - NSURLHandleClient.URLHandleResourceDidCancelLoading_.implement( - builder, URLHandleResourceDidCancelLoading_); - NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_.implement( - builder, URLHandle_resourceDidFailLoadingWithReason_); - } - - /// Builds an object that implements the NSURLHandleClient protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required void Function(objc.NSURLHandle, objc.NSData) - URLHandle_resourceDataDidBecomeAvailable_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidBeginLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidFinishLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidCancelLoading_, - required void Function(objc.NSURLHandle, objc.NSString) - URLHandle_resourceDidFailLoadingWithReason_}) { - final builder = objc.ObjCProtocolBuilder(); - NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_ - .implementAsListener( - builder, URLHandle_resourceDataDidBecomeAvailable_); - NSURLHandleClient.URLHandleResourceDidBeginLoading_.implementAsListener( - builder, URLHandleResourceDidBeginLoading_); - NSURLHandleClient.URLHandleResourceDidFinishLoading_.implementAsListener( - builder, URLHandleResourceDidFinishLoading_); - NSURLHandleClient.URLHandleResourceDidCancelLoading_.implementAsListener( - builder, URLHandleResourceDidCancelLoading_); - NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_ - .implementAsListener( - builder, URLHandle_resourceDidFailLoadingWithReason_); - return builder.build(); + /// stringWithContentsOfFile: + static objc.ObjCObjectBase? stringWithContentsOfFile_(objc.NSString path) { + final _ret = _objc_msgSend_62nh5j( + _class_NSString, _sel_stringWithContentsOfFile_, path.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// Adds the implementation of the NSURLHandleClient protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required void Function(objc.NSURLHandle, objc.NSData) - URLHandle_resourceDataDidBecomeAvailable_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidBeginLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidFinishLoading_, - required void Function(objc.NSURLHandle) - URLHandleResourceDidCancelLoading_, - required void Function(objc.NSURLHandle, objc.NSString) - URLHandle_resourceDidFailLoadingWithReason_}) { - NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_ - .implementAsListener( - builder, URLHandle_resourceDataDidBecomeAvailable_); - NSURLHandleClient.URLHandleResourceDidBeginLoading_.implementAsListener( - builder, URLHandleResourceDidBeginLoading_); - NSURLHandleClient.URLHandleResourceDidFinishLoading_.implementAsListener( - builder, URLHandleResourceDidFinishLoading_); - NSURLHandleClient.URLHandleResourceDidCancelLoading_.implementAsListener( - builder, URLHandleResourceDidCancelLoading_); - NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_ - .implementAsListener( - builder, URLHandle_resourceDidFailLoadingWithReason_); + /// stringWithContentsOfURL: + static objc.ObjCObjectBase? stringWithContentsOfURL_(objc.NSURL url) { + final _ret = _objc_msgSend_62nh5j( + _class_NSString, _sel_stringWithContentsOfURL_, url.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// URLHandle:resourceDataDidBecomeAvailable: - static final URLHandle_resourceDataDidBecomeAvailable_ = - objc.ObjCProtocolListenableMethod< - void Function(objc.NSURLHandle, objc.NSData)>( - _protocol_NSURLHandleClient, - _sel_URLHandle_resourceDataDidBecomeAvailable_, - objc.getProtocolMethodSignature( - _protocol_NSURLHandleClient, - _sel_URLHandle_resourceDataDidBecomeAvailable_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSURLHandle, objc.NSData) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData.fromFunction( - (ffi.Pointer _, objc.NSURLHandle arg1, - objc.NSData arg2) => - func(arg1, arg2)), - (void Function(objc.NSURLHandle, objc.NSData) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData.listener( - (ffi.Pointer _, objc.NSURLHandle arg1, - objc.NSData arg2) => - func(arg1, arg2)), - ); + /// initWithCStringNoCopy:length:freeWhenDone: + objc.ObjCObjectBase? initWithCStringNoCopy_length_freeWhenDone_( + ffi.Pointer bytes, DartNSUInteger length, bool freeBuffer) { + final _ret = _objc_msgSend_fjj4b8( + this.ref.retainAndReturnPointer(), + _sel_initWithCStringNoCopy_length_freeWhenDone_, + bytes, + length, + freeBuffer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } - /// URLHandleResourceDidBeginLoading: - static final URLHandleResourceDidBeginLoading_ = - objc.ObjCProtocolListenableMethod( - _protocol_NSURLHandleClient, - _sel_URLHandleResourceDidBeginLoading_, - objc.getProtocolMethodSignature( - _protocol_NSURLHandleClient, - _sel_URLHandleResourceDidBeginLoading_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - ); + /// initWithCString:length: + objc.ObjCObjectBase? initWithCString_length_( + ffi.Pointer bytes, DartNSUInteger length) { + final _ret = _objc_msgSend_a15xhc(this.ref.retainAndReturnPointer(), + _sel_initWithCString_length_, bytes, length); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } - /// URLHandleResourceDidFinishLoading: - static final URLHandleResourceDidFinishLoading_ = - objc.ObjCProtocolListenableMethod( - _protocol_NSURLHandleClient, - _sel_URLHandleResourceDidFinishLoading_, - objc.getProtocolMethodSignature( - _protocol_NSURLHandleClient, - _sel_URLHandleResourceDidFinishLoading_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - ); + /// initWithCString: + objc.ObjCObjectBase? initWithCString_(ffi.Pointer bytes) { + final _ret = _objc_msgSend_rqwdif( + this.ref.retainAndReturnPointer(), _sel_initWithCString_, bytes); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: false, release: true); + } - /// URLHandleResourceDidCancelLoading: - static final URLHandleResourceDidCancelLoading_ = - objc.ObjCProtocolListenableMethod( - _protocol_NSURLHandleClient, - _sel_URLHandleResourceDidCancelLoading_, - objc.getProtocolMethodSignature( - _protocol_NSURLHandleClient, - _sel_URLHandleResourceDidCancelLoading_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - (void Function(objc.NSURLHandle) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( - (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), - ); + /// stringWithCString:length: + static objc.ObjCObjectBase? stringWithCString_length_( + ffi.Pointer bytes, DartNSUInteger length) { + final _ret = _objc_msgSend_a15xhc( + _class_NSString, _sel_stringWithCString_length_, bytes, length); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } - /// URLHandle:resourceDidFailLoadingWithReason: - static final URLHandle_resourceDidFailLoadingWithReason_ = - objc.ObjCProtocolListenableMethod< - void Function(objc.NSURLHandle, objc.NSString)>( - _protocol_NSURLHandleClient, - _sel_URLHandle_resourceDidFailLoadingWithReason_, - objc.getProtocolMethodSignature( - _protocol_NSURLHandleClient, - _sel_URLHandle_resourceDidFailLoadingWithReason_, - isRequired: true, - isInstanceMethod: true, - ), - (void Function(objc.NSURLHandle, objc.NSString) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString.fromFunction( - (ffi.Pointer _, objc.NSURLHandle arg1, - objc.NSString arg2) => - func(arg1, arg2)), - (void Function(objc.NSURLHandle, objc.NSString) func) => - ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString.listener( - (ffi.Pointer _, objc.NSURLHandle arg1, - objc.NSString arg2) => - func(arg1, arg2)), - ); + /// stringWithCString: + static objc.ObjCObjectBase? stringWithCString_(ffi.Pointer bytes) { + final _ret = + _objc_msgSend_rqwdif(_class_NSString, _sel_stringWithCString_, bytes); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } + + /// getCharacters: + void getCharacters_(ffi.Pointer buffer) { + _objc_msgSend_g3kdhc(this.ref.pointer, _sel_getCharacters_, buffer); + } } typedef NSURLResourceKey = ffi.Pointer; @@ -81535,7 +75593,7 @@ extension NSItemProvider1 on objc.NSURL { } /// writableTypeIdentifiersForItemProvider - objc.NSArray get writableTypeIdentifiersForItemProvider { + objc.NSArray get writableTypeIdentifiersForItemProvider1 { if (!objc.respondsToSelector( this.ref.pointer, _sel_writableTypeIdentifiersForItemProvider)) { throw objc.UnimplementedOptionalMethodException( @@ -81966,94 +76024,122 @@ extension NSURLLoading on objc.NSURL { } } -late final _protocol_NSLocking = objc.getProtocol("NSLocking"); +late final _class_NSCondition = objc.getClass("NSCondition"); +late final _sel_wait = objc.registerName("wait"); +late final _sel_waitUntilDate_ = objc.registerName("waitUntilDate:"); +late final _sel_signal = objc.registerName("signal"); +late final _sel_broadcast = objc.registerName("broadcast"); late final _sel_lock = objc.registerName("lock"); -late final _sel_unlock = objc.registerName("unlock"); +void _ObjCBlock_ffiVoid_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} -/// NSLocking -abstract final class NSLocking { - /// Builds an object that implements the NSLocking protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. - static objc.ObjCObjectBase implement( - {required void Function() lock, required void Function() unlock}) { - final builder = objc.ObjCProtocolBuilder(); - NSLocking.lock.implement(builder, lock); - NSLocking.unlock.implement(builder, unlock); - return builder.build(); - } +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_listenerTrampoline) + ..keepIsolateAlive = false; - /// Adds the implementation of the NSLocking protocol to an existing - /// [objc.ObjCProtocolBuilder]. - static void addToBuilder(objc.ObjCProtocolBuilder builder, - {required void Function() lock, required void Function() unlock}) { - NSLocking.lock.implement(builder, lock); - NSLocking.unlock.implement(builder, unlock); - } +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>(pointer, + retain: retain, release: release); - /// Builds an object that implements the NSLocking protocol. To implement - /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All - /// methods that can be implemented as listeners will be. - static objc.ObjCObjectBase implementAsListener( - {required void Function() lock, required void Function() unlock}) { - final builder = objc.ObjCProtocolBuilder(); - NSLocking.lock.implementAsListener(builder, lock); - NSLocking.unlock.implementAsListener(builder, unlock); - return builder.build(); - } + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Adds the implementation of the NSLocking protocol to an existing - /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will - /// be. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, - {required void Function() lock, required void Function() unlock}) { - NSLocking.lock.implementAsListener(builder, lock); - NSLocking.unlock.implementAsListener(builder, unlock); - } + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock)> fromFunction( + void Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiVoid_closureCallable, + (ffi.Pointer arg0) => fn(arg0)), + retain: false, + release: true); - /// lock - static final lock = objc.ObjCProtocolListenableMethod( - _protocol_NSLocking, - _sel_lock, - objc.getProtocolMethodSignature( - _protocol_NSLocking, - _sel_lock, - isRequired: true, - isInstanceMethod: true, - ), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( - ffi.Pointer _, - ) => - func()), - ); + /// Creates a listener block from a Dart function. + /// + /// This is based on FFI's NativeCallable.listener, and has the same + /// capabilities and limitations. This block can be invoked from any thread, + /// but only supports void functions, and is not run synchronously. See + /// NativeCallable.listener for more details. + /// + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock)> listener( + void Function(ffi.Pointer) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn(arg0)); + final wrapper = _NativeCupertinoHttp_wrapListenerBlock_ovsamd(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock)>(wrapper, + retain: false, release: true); + } +} - /// unlock - static final unlock = objc.ObjCProtocolListenableMethod( - _protocol_NSLocking, - _sel_unlock, - objc.getProtocolMethodSignature( - _protocol_NSLocking, - _sel_unlock, - isRequired: true, - isInstanceMethod: true, - ), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( - ffi.Pointer _, - ) => - func()), - (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( - ffi.Pointer _, - ) => - func()), - ); +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_CallExtension + on objc.ObjCBlock)> { + void call(ffi.Pointer arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0); } -/// WARNING: NSCondition is a stub. To generate bindings for this class, include -/// NSCondition in your config's objc-interfaces list. -/// +late final _sel_unlock = objc.registerName("unlock"); + /// NSCondition class NSCondition extends objc.NSObject { NSCondition._(ffi.Pointer pointer, @@ -82068,6 +76154,101 @@ class NSCondition extends objc.NSObject { NSCondition.castFromPointer(ffi.Pointer other, {bool retain = false, bool release = false}) : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSCondition]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_69e0x1( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSCondition); + } + + /// wait + void wait1() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_wait); + } + + /// waitUntilDate: + bool waitUntilDate_(objc.NSDate limit) { + return _objc_msgSend_69e0x1( + this.ref.pointer, _sel_waitUntilDate_, limit.ref.pointer); + } + + /// signal + void signal() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_signal); + } + + /// broadcast + void broadcast() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_broadcast); + } + + /// name + objc.NSString? get name { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_name); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } + + /// setName: + set name(objc.NSString? value) { + return _objc_msgSend_1jdvcbf( + this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); + } + + /// init + NSCondition init() { + final _ret = + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); + return NSCondition.castFromPointer(_ret, retain: false, release: true); + } + + /// new + static NSCondition new1() { + final _ret = _objc_msgSend_1x359cv(_class_NSCondition, _sel_new); + return NSCondition.castFromPointer(_ret, retain: false, release: true); + } + + /// allocWithZone: + static NSCondition allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_hzlb60(_class_NSCondition, _sel_allocWithZone_, zone); + return NSCondition.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSCondition alloc() { + final _ret = _objc_msgSend_1x359cv(_class_NSCondition, _sel_alloc); + return NSCondition.castFromPointer(_ret, retain: false, release: true); + } + + /// self + NSCondition self() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); + return NSCondition.castFromPointer(_ret, retain: true, release: true); + } + + /// retain + NSCondition retain() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); + return NSCondition.castFromPointer(_ret, retain: true, release: true); + } + + /// autorelease + NSCondition autorelease() { + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); + return NSCondition.castFromPointer(_ret, retain: true, release: true); + } + + /// lock + void lock() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_lock); + } + + /// unlock + void unlock() { + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_unlock); + } } typedef NSProgressKind1 = ffi.Pointer; From 15c058afca7db72a5b15acbb3b08fd402c65dd45 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Thu, 14 Nov 2024 15:47:36 -0800 Subject: [PATCH 3/6] Fix pubspec --- pkgs/cupertino_http/CHANGELOG.md | 4 ++++ pkgs/cupertino_http/pubspec.yaml | 12 +++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/pkgs/cupertino_http/CHANGELOG.md b/pkgs/cupertino_http/CHANGELOG.md index e903e336a3..0878800a33 100644 --- a/pkgs/cupertino_http/CHANGELOG.md +++ b/pkgs/cupertino_http/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.2-wip + +* Upgrade to `package:objective_c` 4.0. + ## 2.0.1 * Fix a [bug](https://github.com/dart-lang/http/issues/1398) where diff --git a/pkgs/cupertino_http/pubspec.yaml b/pkgs/cupertino_http/pubspec.yaml index 28456bf214..a463092423 100644 --- a/pkgs/cupertino_http/pubspec.yaml +++ b/pkgs/cupertino_http/pubspec.yaml @@ -1,5 +1,5 @@ name: cupertino_http -version: 2.0.1 +version: 2.0.2-wip description: >- A macOS/iOS Flutter plugin that provides access to the Foundation URL Loading System. @@ -16,12 +16,12 @@ dependencies: sdk: flutter http: ^1.2.0 http_profile: ^0.1.0 - objective_c: ^3.0.0 + objective_c: ^4.0.0 web_socket: ^0.1.0 dev_dependencies: dart_flutter_team_lints: ^3.0.0 - ffigen: ^15.0.0 + ffigen: ^16.0.0 flutter: plugin: @@ -32,9 +32,3 @@ flutter: macos: ffiPlugin: true sharedDarwinSource: true - -dependency_overrides: - ffi: - path: /Users/bquinlan/dart/native/pkgs/ffi - objective_c: - path: /Users/bquinlan/dart/native/pkgs/objective_c \ No newline at end of file From b86c6d9d2096c3fe4191a2d156cee9935328d768 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Thu, 14 Nov 2024 15:48:27 -0800 Subject: [PATCH 4/6] Fix pubspec --- pkgs/cupertino_http/example/pubspec.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/cupertino_http/example/pubspec.yaml b/pkgs/cupertino_http/example/pubspec.yaml index d52e1151ea..153a11826e 100644 --- a/pkgs/cupertino_http/example/pubspec.yaml +++ b/pkgs/cupertino_http/example/pubspec.yaml @@ -38,9 +38,3 @@ dev_dependencies: flutter: uses-material-design: true - -dependency_overrides: - ffi: - path: /Users/bquinlan/dart/native/pkgs/ffi - objective_c: - path: /Users/bquinlan/dart/native/pkgs/objective_c \ No newline at end of file From ebe9876c8bd3e966f099cf5cfc6f6ba4e08aec2f Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Fri, 15 Nov 2024 11:22:29 -0800 Subject: [PATCH 5/6] Update example --- pkgs/cupertino_http/example/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/cupertino_http/example/pubspec.yaml b/pkgs/cupertino_http/example/pubspec.yaml index 153a11826e..b302ff3aec 100644 --- a/pkgs/cupertino_http/example/pubspec.yaml +++ b/pkgs/cupertino_http/example/pubspec.yaml @@ -31,7 +31,7 @@ dev_dependencies: http_profile: ^0.1.0 integration_test: sdk: flutter - objective_c: ^3.0.0 + objective_c: ^4.0.0 test: ^1.21.1 web_socket_conformance_tests: path: ../../web_socket_conformance_tests/ From 2290ef640ff3109b7a036ca790b20befbd6bc7c5 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Fri, 15 Nov 2024 11:27:52 -0800 Subject: [PATCH 6/6] Update utils_test.dart --- pkgs/cupertino_http/example/integration_test/utils_test.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/cupertino_http/example/integration_test/utils_test.dart b/pkgs/cupertino_http/example/integration_test/utils_test.dart index d075927863..80c2c1caad 100644 --- a/pkgs/cupertino_http/example/integration_test/utils_test.dart +++ b/pkgs/cupertino_http/example/integration_test/utils_test.dart @@ -36,14 +36,14 @@ void main() { test('non-string value', () { final d = objc.NSMutableDictionary.new1() ..setObject_forKey_( - objc.NSNumber.numberWithInteger_(5), 'key'.toNSString()); + objc.NSNumberCreation.numberWithInteger_(5), 'key'.toNSString()); expect(() => stringNSDictionaryToMap(d), throwsUnsupportedError); }); test('non-string key', () { final d = objc.NSMutableDictionary.new1() ..setObject_forKey_( - 'value'.toNSString(), objc.NSNumber.numberWithInteger_(5)); + 'value'.toNSString(), objc.NSNumberCreation.numberWithInteger_(5)); expect(() => stringNSDictionaryToMap(d), throwsUnsupportedError); }); });