Eliminate SkFILE: it always is the same as FILE.
Review URL: https://codereview.chromium.org/1467533003
diff --git a/include/core/SkData.h b/include/core/SkData.h
index 28bf515..60a98e0 100644
--- a/include/core/SkData.h
+++ b/include/core/SkData.h
@@ -8,9 +8,10 @@
#ifndef SkData_DEFINED
#define SkData_DEFINED
+#include <stdio.h>
+
#include "SkRefCnt.h"
-struct SkFILE;
class SkStream;
/**
@@ -119,13 +120,13 @@
static SkData* NewFromFileName(const char path[]);
/**
- * Create a new dataref from a SkFILE.
- * This does not take ownership of the SkFILE, nor close it.
- * The caller is free to close the SkFILE at its convenience.
- * The SkFILE must be open for reading only.
+ * Create a new dataref from a stdio FILE.
+ * This does not take ownership of the FILE, nor close it.
+ * The caller is free to close the FILE at its convenience.
+ * The FILE must be open for reading only.
* Returns NULL on failure.
*/
- static SkData* NewFromFILE(SkFILE* f);
+ static SkData* NewFromFILE(FILE* f);
/**
* Create a new dataref from a file descriptor.
diff --git a/include/core/SkOSFile.h b/include/core/SkOSFile.h
index 3ee3aa4..39a1646 100644
--- a/include/core/SkOSFile.h
+++ b/include/core/SkOSFile.h
@@ -12,9 +12,9 @@
#ifndef SkOSFile_DEFINED
#define SkOSFile_DEFINED
-#include "SkString.h"
+#include <stdio.h>
-struct SkFILE;
+#include "SkString.h"
enum SkFILE_Flags {
kRead_SkFILE_Flag = 0x01,
@@ -27,30 +27,30 @@
const static char SkPATH_SEPARATOR = '/';
#endif
-SkFILE* sk_fopen(const char path[], SkFILE_Flags);
-void sk_fclose(SkFILE*);
+FILE* sk_fopen(const char path[], SkFILE_Flags);
+void sk_fclose(FILE*);
-size_t sk_fgetsize(SkFILE*);
+size_t sk_fgetsize(FILE*);
/** Return true if the file could seek back to the beginning
*/
-bool sk_frewind(SkFILE*);
+bool sk_frewind(FILE*);
-size_t sk_fread(void* buffer, size_t byteCount, SkFILE*);
-size_t sk_fwrite(const void* buffer, size_t byteCount, SkFILE*);
+size_t sk_fread(void* buffer, size_t byteCount, FILE*);
+size_t sk_fwrite(const void* buffer, size_t byteCount, FILE*);
-char* sk_fgets(char* str, int size, SkFILE* f);
+char* sk_fgets(char* str, int size, FILE* f);
-void sk_fflush(SkFILE*);
+void sk_fflush(FILE*);
-bool sk_fseek(SkFILE*, size_t);
-bool sk_fmove(SkFILE*, long);
-size_t sk_ftell(SkFILE*);
+bool sk_fseek(FILE*, size_t);
+bool sk_fmove(FILE*, long);
+size_t sk_ftell(FILE*);
/** 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);
+void* sk_fmmap(FILE* f, size_t* length);
/** Maps a file descriptor into memory. Returns the address and length on success, NULL otherwise.
* The mapping is read only.
@@ -64,12 +64,12 @@
void sk_fmunmap(const void* addr, size_t length);
/** Returns true if the two point at the exact same filesystem object. */
-bool sk_fidentical(SkFILE* a, SkFILE* b);
+bool sk_fidentical(FILE* a, FILE* b);
/** Returns the underlying file descriptor for the given file.
* The return value will be < 0 on failure.
*/
-int sk_fileno(SkFILE* f);
+int sk_fileno(FILE* f);
/** Returns true if something (file, directory, ???) exists at this path,
* and has the specified access flags.
@@ -80,7 +80,7 @@
bool sk_isdir(const char *path);
// Have we reached the end of the file?
-int sk_feof(SkFILE *);
+int sk_feof(FILE *);
// Create a new directory at this path; returns true if successful.
diff --git a/include/core/SkStream.h b/include/core/SkStream.h
index 6767778..2279f9f 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -224,8 +224,6 @@
#include "SkString.h"
#include <stdio.h>
-struct SkFILE;
-
/** A stream that wraps a C FILE* file stream. */
class SK_API SkFILEStream : public SkStreamAsset {
public:
@@ -271,7 +269,7 @@
const void* getMemoryBase() override;
private:
- SkFILE* fFILE;
+ FILE* fFILE;
SkString fName;
Ownership fOwnership;
// fData is lazilly initialized when needed.
@@ -364,7 +362,7 @@
size_t bytesWritten() const override;
private:
- SkFILE* fFILE;
+ FILE* fFILE;
typedef SkWStream INHERITED;
};