summaryrefslogtreecommitdiff
path: root/src/upb_string.c
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-12-21 10:48:01 -0800
committerJoshua Haberman <joshua@reverberate.org>2009-12-21 10:48:01 -0800
commitc2419764856e5666bfa9e3c1b87de29ec93babe1 (patch)
tree7771bf0bbcf9b1103a55b963831385b07705b739 /src/upb_string.c
parentc6cba2af37638cc47ff69aed866669567ef365d9 (diff)
In the midst of a major refactoring.
Diffstat (limited to 'src/upb_string.c')
-rw-r--r--src/upb_string.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/upb_string.c b/src/upb_string.c
deleted file mode 100644
index 54df4f1..0000000
--- a/src/upb_string.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * upb - a minimalist implementation of protocol buffers.
- *
- * Copyright (c) 2009 Joshua Haberman. See LICENSE for details.
- */
-
-#include <stdio.h>
-#include "upb_string.h"
-
-struct upb_string *upb_strreadfile(const char *filename) {
- FILE *f = fopen(filename, "rb");
- if(!f) return false;
- if(fseek(f, 0, SEEK_END) != 0) goto error;
- long size = ftell(f);
- if(size < 0) goto error;
- if(fseek(f, 0, SEEK_SET) != 0) goto error;
- struct upb_string *s = upb_string_new();
- upb_string_resize(s, size);
- if(fread(s->ptr, size, 1, f) != 1) goto error;
- fclose(f);
- return s;
-
-error:
- fclose(f);
- return NULL;
-}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback