1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * test-cp-zip.c: Test gsf_input_copy
5 * Copyright (C) 2002-2006 Dom Lachowicz <cinamod@hotmail.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of version 2.1 of the GNU Lesser General Public
9 * License as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 #include <gsf/gsf-utils.h>
24 #include <gsf/gsf-input-stdio.h>
25 #include <gsf/gsf-infile.h>
26 #include <gsf/gsf-output-stdio.h>
27 #include <gsf/gsf-outfile.h>
37 input = gsf_input_stdio_new (argv[1], &err);
40 g_return_val_if_fail (err != NULL, 1);
42 g_warning ("'%s' error: %s\n", argv[1], err->message);
47 output = gsf_output_stdio_new (argv[2], &err);
50 g_return_val_if_fail (err != NULL, 1);
52 g_warning ("'%s' error: %s\n", argv[2], err->message);
55 g_object_unref (G_OBJECT (input));
59 if (gsf_input_copy (input, output) == FALSE) {
61 err = (GError*) gsf_output_error (output);
63 g_warning ("'%s' error: %s\n", argv[2], err->message);
67 g_object_unref (G_OBJECT (input));
69 gsf_output_close (output);
70 g_object_unref (G_OBJECT (output));
76 main (int argc, char *argv[])
81 fprintf (stderr, "%s : infile outfile\n", argv [0]);