Index: include/core/SkOSFile.h |
=================================================================== |
--- include/core/SkOSFile.h (revision 9384) |
+++ include/core/SkOSFile.h (working copy) |
@@ -54,10 +54,17 @@ |
/** Maps a file into memory. Returns the address and length on success, NULL otherwise. |
* The mapping is read only. |
+ * When finished with the mapping, free the returned pointer with sk_fmunmap. |
*/ |
void* sk_fmmap(SkFILE* f, size_t* length); |
-/** Unmaps a file previously mapped by sk_fmmap. |
+/** Maps a file descriptor into memory. Returns the address and length on success, NULL otherwise. |
+ * The mapping is read only. |
+ * When finished with the mapping, free the returned pointer with sk_fmunmap. |
+ */ |
+void* sk_fdmmap(int fd, size_t* length); |
+ |
+/** Unmaps a file previously mapped by sk_fmmap or sk_fdmmap. |
* The length parameter must be the same as returned from sk_fmmap. |
*/ |
void sk_fmunmap(const void* addr, size_t length); |
@@ -65,6 +72,11 @@ |
/** Returns true if the two point at the exact same filesystem object. */ |
bool sk_fidentical(SkFILE* a, SkFILE* b); |
+/** Returns the underlying file descriptor for the given file. |
+ * The return value will be < 0 on failure. |
+ */ |
+int sk_fileno(SkFILE* f); |
+ |
// Returns true if something (file, directory, ???) exists at this path. |
bool sk_exists(const char *path); |