Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Unified Diff: include/core/SkOSFile.h

Issue 15941025: Add SkData::NewFromFD. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Remove an indentation level. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkData.h ('k') | include/core/SkTemplates.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « include/core/SkData.h ('k') | include/core/SkTemplates.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698