1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2003, Ximian, Inc.
9 #include <glib/gtypes.h>
10 #include <glib-object.h>
12 #include <libsoup/soup-status.h>
14 typedef struct SoupAddress SoupAddress;
15 typedef struct SoupConnection SoupConnection;
16 typedef struct SoupMessage SoupMessage;
17 typedef struct SoupMessageFilter SoupMessageFilter;
18 typedef struct SoupServer SoupServer;
19 typedef union SoupServerAuth SoupServerAuth;
20 typedef struct SoupServerAuthContext SoupServerAuthContext;
21 typedef struct SoupServerMessage SoupServerMessage;
22 typedef struct SoupSession SoupSession;
23 typedef struct SoupSessionAsync SoupSessionAsync;
24 typedef struct SoupSessionSync SoupSessionSync;
25 typedef struct SoupSocket SoupSocket;
26 typedef struct SoupUri SoupUri;
28 #define SOUP_MAKE_TYPE(type_name,TypeName,class_init,init,parent) \
29 GType type_name##_get_type(void)\
31 static GType type = 0; \
33 static GTypeInfo const object_info = { \
34 sizeof (TypeName##Class), \
36 (GBaseInitFunc) NULL, \
37 (GBaseFinalizeFunc) NULL, \
39 (GClassInitFunc) class_init, \
40 (GClassFinalizeFunc) NULL, \
41 NULL, /* class_data */ \
44 0, /* n_preallocs */ \
45 (GInstanceInitFunc) init, \
47 type = g_type_register_static (parent, #TypeName, &object_info, 0); \
52 #define SOUP_MAKE_INTERFACE(type_name,TypeName,base_init) \
53 GType type_name##_get_type(void)\
55 static GType type = 0; \
57 static GTypeInfo const object_info = { \
58 sizeof (TypeName##Class), \
60 (GBaseInitFunc) base_init, \
61 (GBaseFinalizeFunc) NULL, \
63 (GClassInitFunc) NULL, \
64 (GClassFinalizeFunc) NULL, \
65 NULL, /* class_data */ \
68 0, /* n_preallocs */ \
69 (GInstanceInitFunc) NULL, \
71 type = g_type_register_static (G_TYPE_INTERFACE, #TypeName, &object_info, 0); \
76 #define SOUP_MAKE_TYPE_WITH_IFACE(type_name,TypeName,class_init,init,parent,iface_init,iparent) \
77 GType type_name##_get_type(void)\
79 static GType type = 0; \
81 static GTypeInfo const object_info = { \
82 sizeof (TypeName##Class), \
84 (GBaseInitFunc) NULL, \
85 (GBaseFinalizeFunc) NULL, \
87 (GClassInitFunc) class_init, \
88 (GClassFinalizeFunc) NULL, \
89 NULL, /* class_data */ \
92 0, /* n_preallocs */ \
93 (GInstanceInitFunc) init, \
95 static GInterfaceInfo const iface_info = { \
96 (GInterfaceInitFunc) iface_init, \
100 type = g_type_register_static (parent, #TypeName, &object_info, 0); \
101 g_type_add_interface_static (type, iparent, &iface_info); \