objc_sys/
property.rs

1use std::os::raw::c_char;
2#[cfg(any(doc, not(feature = "unstable-objfw")))]
3use std::os::raw::c_uint;
4
5use crate::OpaqueData;
6
7/// An opaque type that describes a property in a class.
8#[repr(C)]
9pub struct objc_property {
10    _priv: [u8; 0],
11    _p: OpaqueData,
12}
13
14/// Describes an Objective-C property attribute.
15#[repr(C)]
16#[derive(Debug, Copy, Clone)]
17pub struct objc_property_attribute_t {
18    /// The name of the attribute.
19    pub name: *const c_char,
20    /// The value of the attribute
21    ///
22    /// Usually NULL.
23    pub value: *const c_char,
24}
25
26extern_c! {
27    #[cfg(any(doc, not(feature = "unstable-objfw")))]
28    /// The returned array is deallocated with [`free`][crate::free].
29    pub fn property_copyAttributeList(
30        property: *const objc_property,
31        out_len: *mut c_uint,
32    ) -> *mut objc_property_attribute_t;
33    #[cfg(any(doc, not(feature = "unstable-objfw")))]
34    pub fn property_copyAttributeValue(
35        property: *const objc_property,
36        attribute_name: *const c_char,
37    ) -> *mut c_char;
38    #[cfg(any(doc, not(feature = "unstable-objfw")))]
39    pub fn property_getAttributes(property: *const objc_property) -> *const c_char;
40    #[cfg(any(doc, not(feature = "unstable-objfw")))]
41    pub fn property_getName(property: *const objc_property) -> *const c_char;
42}