From 873b451cd3a08f89d632c3fac4c5abb02a0e6081 Mon Sep 17 00:00:00 2001 From: Alexander Kojevnikov Date: Wed, 22 Aug 2012 09:35:28 -0700 Subject: [PATCH] Remove obsolete file --- src/spek-platform.c | 76 --------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 src/spek-platform.c diff --git a/src/spek-platform.c b/src/spek-platform.c deleted file mode 100644 index d70d514..0000000 --- a/src/spek-platform.c +++ /dev/null @@ -1,76 +0,0 @@ -/* spek-platform.c - * - * Copyright (C) 2010,2011 Alexander Kojevnikov - * - * Spek is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Spek is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Spek. If not, see . - */ - -#include -#include - -#ifdef G_OS_WIN32 -#include -#include -#endif - -#ifdef G_OS_DARWIN -#include -#include -#include -#endif - -#include "spek-platform.h" - -gchar *spek_platform_read_line (const gchar *uri) { -#ifdef G_OS_DARWIN - /* GIO doesn't work on OS X */ - CFStringRef str = NULL; - CFURLRef url = NULL; - CFDataRef data = NULL; - CFIndex length = 0; - gchar *buf = NULL; - - str = CFStringCreateWithCString (NULL, uri, kCFStringEncodingASCII); - url = CFURLCreateWithString (NULL, str, NULL); - if (CFURLCreateDataAndPropertiesFromResource (NULL, url, &data, NULL, NULL, NULL)) { - length = CFDataGetLength (data); - buf = (gchar *) g_malloc (length + 1); - CFDataGetBytes (data, CFRangeMake (0, length), (UInt8 *) buf); - buf[length] = '\0'; - g_strchomp (buf); - CFRelease (data); - } - CFRelease (url); - CFRelease (str); - return buf; -#else - gchar *line = NULL; - GFile *file = NULL; - GFileInputStream *file_stream = NULL; - - file = g_file_new_for_uri (uri); - file_stream = g_file_read (file, NULL, NULL); - if (file_stream) { - GDataInputStream *data_stream = NULL; - - data_stream = g_data_input_stream_new (G_INPUT_STREAM (file_stream)); - line = g_data_input_stream_read_line (data_stream, NULL, NULL, NULL); - - g_object_unref (data_stream); - g_object_unref (file_stream); - } - g_object_unref (file); - return line; -#endif -}