From 462b26c1cc041a8fa26deb62cf12f1f351a5b2f6 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 8 Jul 2009 12:06:47 -0700 Subject: Directory restructuring. --- upb_string.c | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 upb_string.c (limited to 'upb_string.c') diff --git a/upb_string.c b/upb_string.c deleted file mode 100644 index 733bafe..0000000 --- a/upb_string.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * upb - a minimalist implementation of protocol buffers. - * - * Copyright (c) 2009 Joshua Haberman. See LICENSE for details. - */ - -#include "upb_string.h" - -bool upb_strreadfile(const char *filename, struct upb_string *data) { - FILE *f = fopen(filename, "rb"); - if(!f) return false; - if(fseek(f, 0, SEEK_END) != 0) return false; - long size = ftell(f); - if(size < 0) return false; - if(fseek(f, 0, SEEK_SET) != 0) return false; - data->ptr = (char*)malloc(size); - data->byte_len = size; - if(fread(data->ptr, size, 1, f) != 1) { - free(data->ptr); - return false; - } - fclose(f); - return true; -} -- cgit v1.2.3