objc2_cf_network/generated/
CFProxySupport.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2_core_foundation::*;
6
7use crate::*;
8
9/// Returns a CFDictionary containing the current system internet proxy settings.
10///
11/// Returns: Returns a dictionary containing key-value pairs that represent
12/// the current internet proxy settings.  See below for definitions of the keys and
13/// values.
14/// NULL if no proxy settings have been defined or if an error
15/// was encountered.
16/// The caller is responsible for releasing the returned dictionary.
17#[inline]
18pub unsafe extern "C-unwind" fn CFNetworkCopySystemProxySettings(
19) -> Option<CFRetained<CFDictionary>> {
20    extern "C-unwind" {
21        fn CFNetworkCopySystemProxySettings() -> Option<NonNull<CFDictionary>>;
22    }
23    let ret = unsafe { CFNetworkCopySystemProxySettings() };
24    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
25}
26
27/// # Safety
28///
29/// `proxy_settings` generics must be of the correct type.
30#[inline]
31pub unsafe extern "C-unwind" fn CFNetworkCopyProxiesForURL(
32    url: &CFURL,
33    proxy_settings: &CFDictionary,
34) -> CFRetained<CFArray> {
35    extern "C-unwind" {
36        fn CFNetworkCopyProxiesForURL(
37            url: &CFURL,
38            proxy_settings: &CFDictionary,
39        ) -> Option<NonNull<CFArray>>;
40    }
41    let ret = unsafe { CFNetworkCopyProxiesForURL(url, proxy_settings) };
42    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
43    unsafe { CFRetained::from_raw(ret) }
44}
45
46/// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/cfproxyautoconfigurationresultcallback?language=objc)
47pub type CFProxyAutoConfigurationResultCallback =
48    Option<unsafe extern "C-unwind" fn(NonNull<c_void>, NonNull<CFArray>, *mut CFError)>;
49
50/// # Safety
51///
52/// `error` must be a valid pointer or null.
53#[inline]
54pub unsafe extern "C-unwind" fn CFNetworkCopyProxiesForAutoConfigurationScript(
55    proxy_auto_configuration_script: &CFString,
56    target_url: &CFURL,
57    error: *mut *mut CFError,
58) -> Option<CFRetained<CFArray>> {
59    extern "C-unwind" {
60        fn CFNetworkCopyProxiesForAutoConfigurationScript(
61            proxy_auto_configuration_script: &CFString,
62            target_url: &CFURL,
63            error: *mut *mut CFError,
64        ) -> Option<NonNull<CFArray>>;
65    }
66    let ret = unsafe {
67        CFNetworkCopyProxiesForAutoConfigurationScript(
68            proxy_auto_configuration_script,
69            target_url,
70            error,
71        )
72    };
73    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
74}
75
76/// # Safety
77///
78/// - `cb` must be implemented correctly.
79/// - `client_context` must be a valid pointer.
80#[inline]
81pub unsafe extern "C-unwind" fn CFNetworkExecuteProxyAutoConfigurationScript(
82    proxy_auto_configuration_script: &CFString,
83    target_url: &CFURL,
84    cb: CFProxyAutoConfigurationResultCallback,
85    client_context: NonNull<CFStreamClientContext>,
86) -> CFRetained<CFRunLoopSource> {
87    extern "C-unwind" {
88        fn CFNetworkExecuteProxyAutoConfigurationScript(
89            proxy_auto_configuration_script: &CFString,
90            target_url: &CFURL,
91            cb: CFProxyAutoConfigurationResultCallback,
92            client_context: NonNull<CFStreamClientContext>,
93        ) -> Option<NonNull<CFRunLoopSource>>;
94    }
95    let ret = unsafe {
96        CFNetworkExecuteProxyAutoConfigurationScript(
97            proxy_auto_configuration_script,
98            target_url,
99            cb,
100            client_context,
101        )
102    };
103    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
104    unsafe { CFRetained::from_raw(ret) }
105}
106
107/// # Safety
108///
109/// - `cb` must be implemented correctly.
110/// - `client_context` must be a valid pointer.
111#[inline]
112pub unsafe extern "C-unwind" fn CFNetworkExecuteProxyAutoConfigurationURL(
113    proxy_auto_config_url: &CFURL,
114    target_url: &CFURL,
115    cb: CFProxyAutoConfigurationResultCallback,
116    client_context: NonNull<CFStreamClientContext>,
117) -> CFRetained<CFRunLoopSource> {
118    extern "C-unwind" {
119        fn CFNetworkExecuteProxyAutoConfigurationURL(
120            proxy_auto_config_url: &CFURL,
121            target_url: &CFURL,
122            cb: CFProxyAutoConfigurationResultCallback,
123            client_context: NonNull<CFStreamClientContext>,
124        ) -> Option<NonNull<CFRunLoopSource>>;
125    }
126    let ret = unsafe {
127        CFNetworkExecuteProxyAutoConfigurationURL(
128            proxy_auto_config_url,
129            target_url,
130            cb,
131            client_context,
132        )
133    };
134    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
135    unsafe { CFRetained::from_raw(ret) }
136}
137
138extern "C" {
139    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxytypekey?language=objc)
140    pub static kCFProxyTypeKey: &'static CFString;
141}
142
143extern "C" {
144    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxyhostnamekey?language=objc)
145    pub static kCFProxyHostNameKey: &'static CFString;
146}
147
148extern "C" {
149    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxyportnumberkey?language=objc)
150    pub static kCFProxyPortNumberKey: &'static CFString;
151}
152
153extern "C" {
154    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxyautoconfigurationurlkey?language=objc)
155    pub static kCFProxyAutoConfigurationURLKey: &'static CFString;
156}
157
158extern "C" {
159    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxyautoconfigurationjavascriptkey?language=objc)
160    pub static kCFProxyAutoConfigurationJavaScriptKey: &'static CFString;
161}
162
163extern "C" {
164    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxyusernamekey?language=objc)
165    pub static kCFProxyUsernameKey: &'static CFString;
166}
167
168extern "C" {
169    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxypasswordkey?language=objc)
170    pub static kCFProxyPasswordKey: &'static CFString;
171}
172
173extern "C" {
174    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxytypenone?language=objc)
175    pub static kCFProxyTypeNone: &'static CFString;
176}
177
178extern "C" {
179    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxytypehttp?language=objc)
180    pub static kCFProxyTypeHTTP: &'static CFString;
181}
182
183extern "C" {
184    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxytypehttps?language=objc)
185    pub static kCFProxyTypeHTTPS: &'static CFString;
186}
187
188extern "C" {
189    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxytypesocks?language=objc)
190    pub static kCFProxyTypeSOCKS: &'static CFString;
191}
192
193extern "C" {
194    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxytypeftp?language=objc)
195    pub static kCFProxyTypeFTP: &'static CFString;
196}
197
198extern "C" {
199    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxytypeautoconfigurationurl?language=objc)
200    pub static kCFProxyTypeAutoConfigurationURL: &'static CFString;
201}
202
203extern "C" {
204    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxytypeautoconfigurationjavascript?language=objc)
205    pub static kCFProxyTypeAutoConfigurationJavaScript: &'static CFString;
206}
207
208extern "C" {
209    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfproxyautoconfigurationhttpresponsekey?language=objc)
210    pub static kCFProxyAutoConfigurationHTTPResponseKey: &'static CFString;
211}
212
213extern "C" {
214    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesexceptionslist?language=objc)
215    pub static kCFNetworkProxiesExceptionsList: &'static CFString;
216}
217
218extern "C" {
219    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesexcludesimplehostnames?language=objc)
220    pub static kCFNetworkProxiesExcludeSimpleHostnames: &'static CFString;
221}
222
223extern "C" {
224    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesftpenable?language=objc)
225    pub static kCFNetworkProxiesFTPEnable: &'static CFString;
226}
227
228extern "C" {
229    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesftppassive?language=objc)
230    pub static kCFNetworkProxiesFTPPassive: &'static CFString;
231}
232
233extern "C" {
234    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesftpport?language=objc)
235    pub static kCFNetworkProxiesFTPPort: &'static CFString;
236}
237
238extern "C" {
239    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesftpproxy?language=objc)
240    pub static kCFNetworkProxiesFTPProxy: &'static CFString;
241}
242
243extern "C" {
244    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesgopherenable?language=objc)
245    pub static kCFNetworkProxiesGopherEnable: &'static CFString;
246}
247
248extern "C" {
249    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesgopherport?language=objc)
250    pub static kCFNetworkProxiesGopherPort: &'static CFString;
251}
252
253extern "C" {
254    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesgopherproxy?language=objc)
255    pub static kCFNetworkProxiesGopherProxy: &'static CFString;
256}
257
258extern "C" {
259    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxieshttpenable?language=objc)
260    pub static kCFNetworkProxiesHTTPEnable: &'static CFString;
261}
262
263extern "C" {
264    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxieshttpport?language=objc)
265    pub static kCFNetworkProxiesHTTPPort: &'static CFString;
266}
267
268extern "C" {
269    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxieshttpproxy?language=objc)
270    pub static kCFNetworkProxiesHTTPProxy: &'static CFString;
271}
272
273extern "C" {
274    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxieshttpsenable?language=objc)
275    pub static kCFNetworkProxiesHTTPSEnable: &'static CFString;
276}
277
278extern "C" {
279    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxieshttpsport?language=objc)
280    pub static kCFNetworkProxiesHTTPSPort: &'static CFString;
281}
282
283extern "C" {
284    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxieshttpsproxy?language=objc)
285    pub static kCFNetworkProxiesHTTPSProxy: &'static CFString;
286}
287
288extern "C" {
289    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesrtspenable?language=objc)
290    pub static kCFNetworkProxiesRTSPEnable: &'static CFString;
291}
292
293extern "C" {
294    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesrtspport?language=objc)
295    pub static kCFNetworkProxiesRTSPPort: &'static CFString;
296}
297
298extern "C" {
299    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesrtspproxy?language=objc)
300    pub static kCFNetworkProxiesRTSPProxy: &'static CFString;
301}
302
303extern "C" {
304    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiessocksenable?language=objc)
305    pub static kCFNetworkProxiesSOCKSEnable: &'static CFString;
306}
307
308extern "C" {
309    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiessocksport?language=objc)
310    pub static kCFNetworkProxiesSOCKSPort: &'static CFString;
311}
312
313extern "C" {
314    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiessocksproxy?language=objc)
315    pub static kCFNetworkProxiesSOCKSProxy: &'static CFString;
316}
317
318extern "C" {
319    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesproxyautoconfigenable?language=objc)
320    pub static kCFNetworkProxiesProxyAutoConfigEnable: &'static CFString;
321}
322
323extern "C" {
324    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesproxyautoconfigurlstring?language=objc)
325    pub static kCFNetworkProxiesProxyAutoConfigURLString: &'static CFString;
326}
327
328extern "C" {
329    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesproxyautoconfigjavascript?language=objc)
330    pub static kCFNetworkProxiesProxyAutoConfigJavaScript: &'static CFString;
331}
332
333extern "C" {
334    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfnetworkproxiesproxyautodiscoveryenable?language=objc)
335    pub static kCFNetworkProxiesProxyAutoDiscoveryEnable: &'static CFString;
336}