objc2_system_configuration/generated/
DHCPClientPreferences.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2_core_foundation::*;
5
6use crate::*;
7
8/// Updates the DHCP client preferences to include the
9/// given list of options for the given application ID.
10///
11/// Parameter `applicationID`: The application's preference ID, for example:
12/// "com.apple.SystemPreferences".
13///
14/// Parameter `options`: An array of 8-bit values containing the
15/// DHCP option codes (see RFC 2132) for this application ID.
16/// A NULL value will clear the list of options for this
17/// application ID.
18///
19/// Parameter `count`: The number of elements in the options parameter.
20///
21/// Returns: Returns TRUE if the operation succeeded, FALSE otherwise.
22///
23/// # Safety
24///
25/// `options` must be a valid pointer or null.
26#[inline]
27pub unsafe extern "C-unwind" fn DHCPClientPreferencesSetApplicationOptions(
28    application_id: &CFString,
29    options: *const u8,
30    count: CFIndex,
31) -> bool {
32    extern "C-unwind" {
33        fn DHCPClientPreferencesSetApplicationOptions(
34            application_id: &CFString,
35            options: *const u8,
36            count: CFIndex,
37        ) -> Boolean;
38    }
39    let ret = unsafe { DHCPClientPreferencesSetApplicationOptions(application_id, options, count) };
40    ret != 0
41}
42
43extern "C-unwind" {
44    /// Copies the requested DHCP options for the
45    /// given application ID.
46    ///
47    /// Parameter `applicationID`: The application's preference ID, for example
48    /// "com.apple.SystemPreferences".
49    ///
50    /// Parameter `count`: The number of elements in the returned array.
51    ///
52    /// Returns: Returns the list of options for the given application ID, or
53    /// NULL if no options are defined or an error occurred.
54    ///
55    /// When you are finished, use free() to release a non-NULL return value.
56    ///
57    /// # Safety
58    ///
59    /// `count` must be a valid pointer.
60    pub fn DHCPClientPreferencesCopyApplicationOptions(
61        application_id: &CFString,
62        count: NonNull<CFIndex>,
63    ) -> *mut u8;
64}