diff options
author | Dom Lachowicz <doml@src.gnome.org> | 2003-01-30 00:38:01 +0000 |
---|---|---|
committer | Dom Lachowicz <doml@src.gnome.org> | 2003-01-30 00:38:01 +0000 |
commit | 49521f283e68e357596ff01f108288a14ab60952 (patch) | |
tree | f5ecb7d3cd6926338b739b7b212beb581881e02b | |
parent | 4cdcce2c8571f444630fa1ddf73930535ab5a861 (diff) | |
download | librsvg-49521f283e68e357596ff01f108288a14ab60952.tar.gz |
fix gz build, remove GNOME VFS based code
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | rsvg-file-util.c | 27 | ||||
-rw-r--r-- | rsvg-gz.c | 3 |
3 files changed, 8 insertions, 27 deletions
@@ -1,3 +1,8 @@ +2003-01-29 Dom Lachowicz <cinamod@hotmail.com> + + * rsvg-gz.c: Fix build + * rsvg-file-util.c: Remove GNOME VFS code. + 2003-01-28 Dom Lachowicz <cinamod@hotmail.com> * rsvg-gz.[ch]: New handle type, capable of reading SVGZ files. diff --git a/rsvg-file-util.c b/rsvg-file-util.c index 543ccb67..1effd863 100644 --- a/rsvg-file-util.c +++ b/rsvg-file-util.c @@ -30,10 +30,6 @@ #include <stdlib.h> #include <math.h> -#if ENABLE_GNOME_VFS -#include <libgnomevfs/gnome-vfs.h> -#endif - #define SVG_BUFFER_SIZE (1024 * 8) typedef enum { @@ -117,47 +113,28 @@ rsvg_pixbuf_from_file_with_size_data (const gchar * file_name, GError ** error) { char chars[SVG_BUFFER_SIZE]; - gint result; GdkPixbuf *retval; RsvgHandle *handle; - -#if ENABLE_GNOME_VFS - GnomeVFSHandle * f = NULL; - if (GNOME_VFS_OK != gnome_vfs_open (&handle, file_name, GNOME_VFS_OPEN_READ)) - { - /* FIXME: Set up error. */ - return NULL; - } -#else + gint result; FILE *f = fopen (file_name, "r"); + if (!f) { /* FIXME: Set up error. */ return NULL; } -#endif handle = rsvg_handle_new (); rsvg_handle_set_size_callback (handle, rsvg_size_callback, data, NULL); -#if ENABLE_GNOME_VFS - while (GNOME_VFS_OK == gnome_vfs_read (f,chars, SVG_BUFFER_SIZE, &result)) - rsvg_handle_write (handle, chars, result, error); -#else while ((result = fread (chars, 1, SVG_BUFFER_SIZE, f)) > 0) rsvg_handle_write (handle, chars, result, error); -#endif rsvg_handle_close (handle, error); retval = rsvg_handle_get_pixbuf (handle); -#if ENABLE_GNOME_VFS - gnome_vfs_close (f); -#else fclose (f); -#endif - rsvg_handle_free (handle); return retval; @@ -60,14 +60,13 @@ rsvg_handle_gz_close_impl (RsvgHandle *handle, bytes = gsf_output_memory_get_bytes (GSF_OUTPUT_MEMORY (me->mem)); size = gsf_output_size (me->mem); - gzip = GSF_INPUT (gsf_input_gzip_new (GSF_INPUT (gsf_input_memory_new (bytes, size, FALSE), error))); + gzip = GSF_INPUT (gsf_input_gzip_new (GSF_INPUT (gsf_input_memory_new (bytes, size, FALSE)), error)); while ((size = MIN (gsf_input_remaining (gzip), 1024)) > 0) { /* write to parent */ rsvg_handle_write_impl (&(me->super), gsf_input_read (gzip, size, NULL), size, error); } - gsf_input_close (gzip); g_object_unref (G_OBJECT (gzip)); /* close parent */ |