g_file_make_directory_with_parents: refix error propagation
[glib.git] / tests / gobject / deftype.c
blobb6aabb449a79fa759eab5c8fedd84faa39ed02b5
1 /* deftype.c
2 * Copyright (C) 2006 Behdad Esfahbod
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General
15 * Public License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17 * Boston, MA 02111-1307, USA.
19 #include <glib-object.h>
21 /* see http://bugzilla.gnome.org/show_bug.cgi?id=337128 for the purpose of this test */
23 #define MY_G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) { \
24 const GInterfaceInfo g_implement_interface_info = { \
25 (GInterfaceInitFunc) iface_init, \
26 NULL, \
27 NULL \
28 }; \
29 g_type_add_interface_static (g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \
32 #define MY_DEFINE_TYPE(TN, t_n, T_P) \
33 G_DEFINE_TYPE_WITH_CODE (TN, t_n, T_P, \
34 MY_G_IMPLEMENT_INTERFACE (G_TYPE_INTERFACE, NULL))
36 typedef struct _TypeName {
37 GObject parent_instance;
38 const char *name;
39 } TypeName;
41 typedef struct _TypeNameClass {
42 GObjectClass parent_parent;
43 } TypeNameClass;
45 MY_DEFINE_TYPE (TypeName, type_name, G_TYPE_OBJECT)
47 static void type_name_init (TypeName *self)
51 static void type_name_class_init (TypeNameClass *klass)
55 int
56 main (void)
58 return 0;