Patch from Samuel Cormier-Iijima <sciyoshi@gmail.com>:
[cascardo/gnio.git] / gnio / ginet4address.h
1 #ifndef G_INET4_ADDRESS_H
2 #define G_INET4_ADDRESS_H
3
4 #include <glib-object.h>
5 #include <gnio/ginetaddress.h>
6
7 G_BEGIN_DECLS
8
9 #define G_TYPE_INET4_ADDRESS         (g_inet4_address_get_type ())
10 #define G_INET4_ADDRESS(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_INET4_ADDRESS, GInet4Address))
11 #define G_INET4_ADDRESS_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_INET4_ADDRESS, GInet4AddressClass))
12 #define G_IS_INET4_ADDRESS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_INET4_ADDRESS))
13 #define G_IS_INET4_ADDRESS_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_INET4_ADDRESS))
14 #define G_INET4_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_INET4_ADDRESS, GInet4AddressClass))
15
16 typedef struct _GInet4Address        GInet4Address;
17 typedef struct _GInet4AddressClass   GInet4AddressClass;
18 typedef struct _GInet4AddressPrivate GInet4AddressPrivate;
19
20 struct _GInet4Address
21 {
22   GInetAddress parent;
23
24   GInet4AddressPrivate *priv;
25 };
26
27 struct _GInet4AddressClass
28 {
29   GInetAddressClass parent_class;
30 };
31
32 GType           g_inet4_address_get_type     (void) G_GNUC_CONST;
33
34 GInet4Address * g_inet4_address_from_string  (const char *string);
35
36 char *          g_inet4_address_to_string    (GInet4Address *address);
37
38 GInet4Address * g_inet4_address_from_bytes   (guint8 bytes[]);
39
40 const guint8 *  g_inet4_address_to_bytes     (GInet4Address *address);
41
42 GInet4Address * g_inet4_address_new_loopback (void);
43
44 GInet4Address * g_inet4_address_new_any      (void);
45
46 G_END_DECLS
47
48 #endif /* G_INET4_ADDRESS_H */