Auto merge of #329 - fry:master, r=jdm

add shared_support_url to CFBundle

This adds access to CFBundleCopySharedSupportURL from the CFBundle struct

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/329)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo
2019-08-05 10:16:56 -04:00
committed by GitHub
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -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;
}
+11
View File
@@ -89,6 +89,17 @@ impl CFBundle {
}
}
}
pub fn shared_support_url(&self) -> Option<CFURL> {
unsafe {
let fw_url = CFBundleCopySharedSupportURL(self.0);
if fw_url.is_null() {
None
} else {
Some(TCFType::wrap_under_create_rule(fw_url))
}
}
}
}