diff --git a/core-foundation-sys/src/bundle.rs b/core-foundation-sys/src/bundle.rs index 687b00e..b4045d0 100644 --- a/core-foundation-sys/src/bundle.rs +++ b/core-foundation-sys/src/bundle.rs @@ -33,4 +33,5 @@ extern { pub fn CFBundleGetTypeID() -> CFTypeID; pub fn CFBundleCopyExecutableURL(bundle: CFBundleRef) -> CFURLRef; pub fn CFBundleCopyPrivateFrameworksURL(bundle: CFBundleRef) -> CFURLRef; + pub fn CFBundleCopySharedSupportURL(bundle: CFBundleRef) -> CFURLRef; } diff --git a/core-foundation/src/bundle.rs b/core-foundation/src/bundle.rs index f23f9ae..7d051ff 100644 --- a/core-foundation/src/bundle.rs +++ b/core-foundation/src/bundle.rs @@ -89,6 +89,17 @@ impl CFBundle { } } } + + pub fn shared_support_url(&self) -> Option { + unsafe { + let fw_url = CFBundleCopySharedSupportURL(self.0); + if fw_url.is_null() { + None + } else { + Some(TCFType::wrap_under_create_rule(fw_url)) + } + } + } }