1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5 * Copyright (C) 2002-2003 Jody Goldberg (jody@gnome.org)
6 * Copyright (C) 2005-2006 Morten Welinder (terra@gnome.org)
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of version 2.1 of the GNU Lesser General Public
10 * License as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 #include <gsf/gsf-input-stdio.h>
24 #include <gsf/gsf-utils.h>
25 #include <gsf/gsf-input-gzip.h>
30 test (int argc, char *argv[])
37 for (i = 1 ; i < argc ; i++) {
39 input = gsf_input_stdio_new (argv[i], &err);
42 g_return_val_if_fail (err != NULL, 1);
44 g_warning ("'%s' error: %s", argv[i], err->message);
51 * We must know the length of the uncompressed file in advance.
52 * test-out-gzip2's output uncompresses to 90 bytes.
54 gzip = g_object_new (GSF_INPUT_GZIP_TYPE,
57 "uncompressed_size", (gsf_off_t)90,
60 g_warning ("'%s' Not a GZip file: %s", argv[i], "???" /* err->message */);
63 g_object_unref (G_OBJECT (input));
66 gsf_input_dump (gzip, FALSE);
68 g_object_unref (G_OBJECT (gzip));
69 g_object_unref (G_OBJECT (input));
76 main (int argc, char *argv[])
81 res = test (argc, argv);