0f904ccabdfda58c7b137f562cd998fe2d06681d
[cascardo/gnio.git] / gnio / gsocketaddress.c
1 /* GNIO - GLib Network Layer of GIO
2  *
3  * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Authors: Christian Kellner <gicmo@gnome.org>
21  *          Samuel Cormier-Iijima <sciyoshi@gmail.com>
22  */
23
24 #include <config.h>
25 #include <glib.h>
26
27 #include "gsocketaddress.h"
28
29 G_DEFINE_ABSTRACT_TYPE (GSocketAddress, g_socket_address, G_TYPE_OBJECT);
30
31 static void
32 g_socket_address_class_init (GSocketAddressClass *klass)
33 {
34   GObjectClass *gobject_class G_GNUC_UNUSED = G_OBJECT_CLASS (klass);
35 }
36
37 static void
38 g_socket_address_init (GSocketAddress *address)
39 {
40
41 }
42
43 gssize
44 g_socket_address_native_size (GSocketAddress *address)
45 {
46   g_return_val_if_fail (G_IS_SOCKET_ADDRESS (address), -1);
47
48   return G_SOCKET_ADDRESS_GET_CLASS (address)->native_size (address);
49 }
50
51 gboolean
52 g_socket_address_to_native (GSocketAddress *address, gpointer dest)
53 {
54   g_return_val_if_fail (G_IS_SOCKET_ADDRESS (address), FALSE);
55
56   return G_SOCKET_ADDRESS_GET_CLASS (address)->to_native (address, dest);
57 }