1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * test-input1.c:
4  *
5  * Copyright (C) 2002-2006 Jody Goldberg (jody@gnome.org)
6  *
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.
10  *
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.
15  *
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
19  * USA
20  */
21 
22 #include <gsf/gsf-utils.h>
23 #include <gsf/gsf-input-stdio.h>
24 
25 #include <stdio.h>
26 
27 static int
test(int argc,char * argv[])28 test (int argc, char *argv[])
29 {
30 	GsfInput *input;
31 	GError   *err = NULL;
32 
33 	if (argc != 3) {
34 		fprintf (stderr, "Usage : %s infile outfile\n", argv[0]);
35 		return 1;
36 	}
37 
38 	input = gsf_input_stdio_new (argv[1], &err);
39 	if (input == NULL) {
40 
41 		g_return_val_if_fail (err != NULL, 1);
42 
43 		g_warning ("'%s' error: %s", argv[1], err->message);
44 		g_error_free (err);
45 		return 1;
46 	} else
47 		g_object_unref (G_OBJECT (input));
48 
49 	return 0;
50 }
51 
52 int
main(int argc,char * argv[])53 main (int argc, char *argv[])
54 {
55 	int res;
56 
57 	gsf_init ();
58 	res = test (argc, argv);
59 	gsf_shutdown ();
60 
61 	return res;
62 }
63