]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_utilities/lib/cfutilities.h
Security-58286.1.32.tar.gz
[apple/security.git] / OSX / libsecurity_utilities / lib / cfutilities.h
index b53e2c86a23903b589e0e369473eafa1747b8ee8..888de1c050cc7132a417262cfebd3ba98f48483b 100644 (file)
@@ -555,6 +555,9 @@ void cfDictionaryApplyBlock(CFDictionaryRef source, CFDictionaryApplierBlock blo
 
 //
 // CFURLAccess wrappers for specific purposes
+// cfLoadFile family will use mmap(2) when appropriate
+// cfReadFile will read the data into memory
+// cfMapFile will mmap(2) the file
 //
 CFDataRef CF_RETURNS_RETAINED cfLoadFile(CFURLRef url);
 CFDataRef CF_RETURNS_RETAINED cfLoadFile(int fd, size_t bytes);
@@ -563,6 +566,19 @@ inline CFDataRef CF_RETURNS_RETAINED cfLoadFile(const std::string &path) { retur
 inline CFDataRef CF_RETURNS_RETAINED cfLoadFile(const char *path) { return cfLoadFile(CFTempURL(path)); }
 
 
+CFDataRef cfReadFile(CFURLRef url) CF_RETURNS_RETAINED;
+CFDataRef cfReadFile(int fd, size_t bytes) CF_RETURNS_RETAINED;
+inline CFDataRef cfReadFile(CFStringRef path) { return cfReadFile(CFTempURL(path)); }
+inline CFDataRef cfReadFile(const std::string &path) { return cfReadFile(CFTempURL(path)); }
+inline CFDataRef cfReadFile(const char *path) { return cfReadFile(CFTempURL(path)); }
+
+CFDataRef cfMapFile(CFURLRef url) CF_RETURNS_RETAINED;
+CFDataRef cfMapFile(int fd, size_t bytes) CF_RETURNS_RETAINED;
+inline CFDataRef cfMapFile(CFStringRef path) { return cfMapFile(CFTempURL(path)); }
+inline CFDataRef cfMapFile(const std::string &path) { return cfMapFile(CFTempURL(path)); }
+inline CFDataRef cfMapFile(const char *path) { return cfMapFile(CFTempURL(path)); }
+
+
 //
 // Internally used STL adapters. Should probably be in utilities.h.
 //