objc2_foundation/generated/
NSDebug.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern "C" {
9    /// **************    General        ***************
10    ///
11    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdebugenabled?language=objc)
12    pub static NSDebugEnabled: Bool;
13}
14
15extern "C" {
16    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nszombieenabled?language=objc)
17    pub static NSZombieEnabled: Bool;
18}
19
20extern "C" {
21    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdeallocatezombies?language=objc)
22    pub static NSDeallocateZombies: Bool;
23}
24
25/// # Safety
26///
27/// - `an_object` should be of the correct type.
28/// - `an_object` might not allow `None`.
29#[inline]
30pub unsafe extern "C-unwind" fn NSIsFreedObject(an_object: Option<&AnyObject>) -> bool {
31    extern "C-unwind" {
32        fn NSIsFreedObject(an_object: Option<&AnyObject>) -> Bool;
33    }
34    unsafe { NSIsFreedObject(an_object) }.as_bool()
35}
36
37/// **************    Stack processing    ***************
38#[inline]
39pub extern "C-unwind" fn NSFrameAddress(frame: NSUInteger) -> *mut c_void {
40    extern "C-unwind" {
41        fn NSFrameAddress(frame: NSUInteger) -> *mut c_void;
42    }
43    unsafe { NSFrameAddress(frame) }
44}
45
46#[inline]
47pub extern "C-unwind" fn NSReturnAddress(frame: NSUInteger) -> *mut c_void {
48    extern "C-unwind" {
49        fn NSReturnAddress(frame: NSUInteger) -> *mut c_void;
50    }
51    unsafe { NSReturnAddress(frame) }
52}
53
54#[inline]
55pub extern "C-unwind" fn NSCountFrames() -> NSUInteger {
56    extern "C-unwind" {
57        fn NSCountFrames() -> NSUInteger;
58    }
59    unsafe { NSCountFrames() }
60}
61
62/// NSAutoreleasePoolDebugging.
63#[cfg(feature = "NSAutoreleasePool")]
64impl NSAutoreleasePool {
65    extern_methods!(
66        #[unsafe(method(showPools))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn showPools();
69    );
70}
71
72extern "C" {
73    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nskeepallocationstatistics?language=objc)
74    pub static NSKeepAllocationStatistics: Bool;
75}
76
77extern "C-unwind" {
78    /// # Safety
79    ///
80    /// - `object` should be of the correct type.
81    /// - `object` might not allow `None`.
82    pub fn NSRecordAllocationEvent(event_type: c_int, object: Option<&AnyObject>);
83}