/* automatically generated by rust-bindgen 0.66.1 */

// Generated using:
// bindgen 0.66.1
// macOS SDK 13.3.

use core::ffi::c_void;
use core_foundation_sys::array::CFArrayRef;
use core_foundation_sys::base::{Boolean, CFAllocatorRef, CFIndex, CFTypeID};
use core_foundation_sys::data::CFDataRef;
use core_foundation_sys::propertylist::CFPropertyListRef;
use core_foundation_sys::runloop::CFRunLoopRef;
use core_foundation_sys::string::CFStringRef;

use crate::dispatch_queue_t;

pub type AuthorizationOpaqueRef = c_void;
pub type __SCPreferences = c_void;

pub type AuthorizationRef = *const AuthorizationOpaqueRef;
pub type SCPreferencesRef = *const __SCPreferences;
pub type SCPreferencesNotification = u32;
#[repr(C)]
pub struct SCPreferencesContext {
    pub version: CFIndex,
    pub info: *mut ::core::ffi::c_void,
    pub retain: Option<
        unsafe extern "C" fn(info: *const ::core::ffi::c_void) -> *const ::core::ffi::c_void,
    >,
    pub release: Option<unsafe extern "C" fn(info: *const ::core::ffi::c_void)>,
    pub copyDescription:
        Option<unsafe extern "C" fn(info: *const ::core::ffi::c_void) -> CFStringRef>,
}
pub type SCPreferencesCallBack = Option<
    unsafe extern "C" fn(
        prefs: SCPreferencesRef,
        notificationType: SCPreferencesNotification,
        info: *mut ::core::ffi::c_void,
    ),
>;
extern "C" {
    pub fn SCPreferencesGetTypeID() -> CFTypeID;

    pub fn SCPreferencesCreate(
        allocator: CFAllocatorRef,
        name: CFStringRef,
        prefsID: CFStringRef,
    ) -> SCPreferencesRef;

    pub fn SCPreferencesCreateWithAuthorization(
        allocator: CFAllocatorRef,
        name: CFStringRef,
        prefsID: CFStringRef,
        authorization: AuthorizationRef,
    ) -> SCPreferencesRef;

    pub fn SCPreferencesLock(prefs: SCPreferencesRef, wait: Boolean) -> Boolean;

    pub fn SCPreferencesCommitChanges(prefs: SCPreferencesRef) -> Boolean;

    pub fn SCPreferencesApplyChanges(prefs: SCPreferencesRef) -> Boolean;

    pub fn SCPreferencesUnlock(prefs: SCPreferencesRef) -> Boolean;

    pub fn SCPreferencesGetSignature(prefs: SCPreferencesRef) -> CFDataRef;

    pub fn SCPreferencesCopyKeyList(prefs: SCPreferencesRef) -> CFArrayRef;

    pub fn SCPreferencesGetValue(prefs: SCPreferencesRef, key: CFStringRef) -> CFPropertyListRef;

    pub fn SCPreferencesAddValue(
        prefs: SCPreferencesRef,
        key: CFStringRef,
        value: CFPropertyListRef,
    ) -> Boolean;

    pub fn SCPreferencesSetValue(
        prefs: SCPreferencesRef,
        key: CFStringRef,
        value: CFPropertyListRef,
    ) -> Boolean;

    pub fn SCPreferencesRemoveValue(prefs: SCPreferencesRef, key: CFStringRef) -> Boolean;

    pub fn SCPreferencesSetCallback(
        prefs: SCPreferencesRef,
        callout: SCPreferencesCallBack,
        context: *mut SCPreferencesContext,
    ) -> Boolean;

    pub fn SCPreferencesScheduleWithRunLoop(
        prefs: SCPreferencesRef,
        runLoop: CFRunLoopRef,
        runLoopMode: CFStringRef,
    ) -> Boolean;

    pub fn SCPreferencesUnscheduleFromRunLoop(
        prefs: SCPreferencesRef,
        runLoop: CFRunLoopRef,
        runLoopMode: CFStringRef,
    ) -> Boolean;

    pub fn SCPreferencesSetDispatchQueue(
        prefs: SCPreferencesRef,
        queue: dispatch_queue_t,
    ) -> Boolean;

    pub fn SCPreferencesSynchronize(prefs: SCPreferencesRef);
}
