aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-11-20 13:47:49 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-20 13:47:49 -0800
commitd76be9c79baa1530d3dc95c58022e83607a1bb2a (patch)
treeebab3adf39a9eee73f1284517eba04d1ca82fa47 /include
parent90ba095c459e38581353073826785074b5953b8c (diff)
Eliminate SkFILE: it always is the same as FILE.
Diffstat (limited to 'include')
-rw-r--r--include/core/SkData.h13
-rw-r--r--include/core/SkOSFile.h34
-rw-r--r--include/core/SkStream.h6
3 files changed, 26 insertions, 27 deletions
diff --git a/include/core/SkData.h b/include/core/SkData.h
index 28bf515347..60a98e00f0 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 @@ public:
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 3ee3aa44a0..39a1646458 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 = '\\';
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_fdmmap(int fd, size_t* length);
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_exists(const char *path, SkFILE_Flags = (SkFILE_Flags)0);
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 6767778343..2279f9ff10 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -224,8 +224,6 @@ public:
#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 @@ public:
const void* getMemoryBase() override;
private:
- SkFILE* fFILE;
+ FILE* fFILE;
SkString fName;
Ownership fOwnership;
// fData is lazilly initialized when needed.
@@ -364,7 +362,7 @@ public:
size_t bytesWritten() const override;
private:
- SkFILE* fFILE;
+ FILE* fFILE;
typedef SkWStream INHERITED;
};