objc2_system_configuration/generated/
SCPreferencesSetSpecific.rs1use core::ptr::NonNull;
4use objc2_core_foundation::*;
5
6use crate::*;
7
8#[cfg(feature = "SCPreferences")]
9impl SCPreferences {
10 #[doc(alias = "SCPreferencesSetComputerName")]
25 #[cfg(feature = "SCPreferences")]
26 #[inline]
27 pub fn set_computer_name(
28 &self,
29 name: Option<&CFString>,
30 name_encoding: CFStringEncoding,
31 ) -> bool {
32 extern "C-unwind" {
33 fn SCPreferencesSetComputerName(
34 prefs: &SCPreferences,
35 name: Option<&CFString>,
36 name_encoding: CFStringEncoding,
37 ) -> Boolean;
38 }
39 let ret = unsafe { SCPreferencesSetComputerName(self, name, name_encoding) };
40 ret != 0
41 }
42
43 #[doc(alias = "SCPreferencesSetLocalHostName")]
59 #[cfg(feature = "SCPreferences")]
60 #[inline]
61 pub fn set_local_host_name(&self, name: Option<&CFString>) -> bool {
62 extern "C-unwind" {
63 fn SCPreferencesSetLocalHostName(
64 prefs: &SCPreferences,
65 name: Option<&CFString>,
66 ) -> Boolean;
67 }
68 let ret = unsafe { SCPreferencesSetLocalHostName(self, name) };
69 ret != 0
70 }
71}
72
73#[cfg(feature = "SCPreferences")]
74#[deprecated = "renamed to `SCPreferences::set_computer_name`"]
75#[inline]
76pub extern "C-unwind" fn SCPreferencesSetComputerName(
77 prefs: &SCPreferences,
78 name: Option<&CFString>,
79 name_encoding: CFStringEncoding,
80) -> bool {
81 extern "C-unwind" {
82 fn SCPreferencesSetComputerName(
83 prefs: &SCPreferences,
84 name: Option<&CFString>,
85 name_encoding: CFStringEncoding,
86 ) -> Boolean;
87 }
88 let ret = unsafe { SCPreferencesSetComputerName(prefs, name, name_encoding) };
89 ret != 0
90}
91
92#[cfg(feature = "SCPreferences")]
93#[deprecated = "renamed to `SCPreferences::set_local_host_name`"]
94#[inline]
95pub extern "C-unwind" fn SCPreferencesSetLocalHostName(
96 prefs: &SCPreferences,
97 name: Option<&CFString>,
98) -> bool {
99 extern "C-unwind" {
100 fn SCPreferencesSetLocalHostName(prefs: &SCPreferences, name: Option<&CFString>)
101 -> Boolean;
102 }
103 let ret = unsafe { SCPreferencesSetLocalHostName(prefs, name) };
104 ret != 0
105}