aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-14 18:49:19 +0000
committerGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-14 18:49:19 +0000
commit7af56bee17764a0c118c8856a035bb3d27766969 (patch)
tree403db31d9a78f6102707544e334361dd92ac99d7 /src/ports
parent50dd41017ad121b5f40f063d813ba517668fcfbc (diff)
Runtime configuration system for skia. This will allow developers to control settings at launch time without relying on compile-time flags or recompilation. It can be used to turn features on and off, as well as to control numeric quantities to 'tune' algorithms. Once I make sure it's working across all platforms I'll send out a quick tutorial on its use.
Review URL: https://codereview.appspot.com/7098051 git-svn-id: http://skia.googlecode.com/svn/trunk@7158 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkOSFile_stdio.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ports/SkOSFile_stdio.cpp b/src/ports/SkOSFile_stdio.cpp
index 9100f6d122..e7f65cd499 100644
--- a/src/ports/SkOSFile_stdio.cpp
+++ b/src/ports/SkOSFile_stdio.cpp
@@ -41,6 +41,23 @@ SkFILE* sk_fopen(const char path[], SkFILE_Flags flags)
return f;
}
+ptrdiff_t sk_getline(char **lineptr, size_t *n, SkFILE *f) {
+ bool make_private_copy = (NULL == *lineptr);
+
+ ptrdiff_t ret = ::getline(lineptr, n, (FILE *) f);
+ if (make_private_copy) {
+ char *local_copy = (char *) sk_malloc_throw(strlen(*lineptr) + 1);
+ ::memcpy(local_copy, *lineptr, strlen(*lineptr));
+ ::free(*lineptr);
+ *lineptr = local_copy;
+ }
+ return ret;
+}
+
+int sk_feof(SkFILE *f) {
+ return ::feof((FILE *)f);
+}
+
size_t sk_fgetsize(SkFILE* f)
{
SkASSERT(f);