From c2419764856e5666bfa9e3c1b87de29ec93babe1 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Mon, 21 Dec 2009 10:48:01 -0800 Subject: In the midst of a major refactoring. --- src/upb_string.c | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/upb_string.c (limited to 'src/upb_string.c') 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 -#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; -} -- cgit v1.2.3