"Initial commit to Gerrit"
[profile/ivi/libgsf.git] / gsf / gsf-outfile.c
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * gsf-outfile.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-config.h>
23 #include <gsf/gsf-outfile-impl.h>
24 #include <gsf/gsf-impl-utils.h>
25
26 #define GET_CLASS(instance) G_TYPE_INSTANCE_GET_CLASS (instance, GSF_OUTFILE_TYPE, GsfOutfileClass)
27
28 /**
29  * gsf_outfile_new_child :
30  * @outfile : A #GsfOutfile
31  * @name : The name of the new child to create
32  * @is_dir : %TRUE to create a directory, %FALSE to create a plain file
33  *
34  * Returns: a newly created child
35  **/
36 GsfOutput *
37 gsf_outfile_new_child (GsfOutfile *outfile,
38                        char const *name, gboolean is_dir)
39 {
40         return gsf_outfile_new_child_full (outfile, name, is_dir, NULL);
41 }
42
43 /**
44  * gsf_outfile_new_child_full :
45  * @outfile : A #GsfOutfile
46  * @name : The name of the new child to create
47  * @is_dir : TRUE to create a directory, FALSE to create a plain file
48  * @first_property_name :
49  * @Varargs :
50  *
51  * Returns: a newly created child
52  **/
53 GsfOutput *
54 gsf_outfile_new_child_full (GsfOutfile *outfile,
55                             char const *name, gboolean is_dir,
56                             char const *first_property_name,
57                             ...)
58 {
59         GsfOutput *res;
60         va_list    args;
61
62         g_return_val_if_fail (outfile != NULL, NULL);
63
64         va_start (args, first_property_name);
65         res = gsf_outfile_new_child_varg (outfile, name, is_dir,
66                                           first_property_name, args);
67         va_end (args);
68
69         return res;
70 }
71
72 GsfOutput *
73 gsf_outfile_new_child_varg (GsfOutfile *outfile,
74                             char const *name, gboolean is_dir,
75                             char const *first_property_name,
76                             va_list args)
77 {
78         g_return_val_if_fail (outfile != NULL, NULL);
79         return GET_CLASS (outfile)->new_child (outfile, name, is_dir,
80                                                first_property_name, args);
81 }
82
83 GSF_CLASS_ABSTRACT (GsfOutfile, gsf_outfile, NULL, NULL, GSF_OUTPUT_TYPE)