Doc improvements
[platform/upstream/glib.git] / gio / gfiledescriptorbased.c
1 /* GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright (C) 2010 Christian Kellner
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  * Author: Christian Kellner <gicmo@gnome.org>
21  */
22
23 #include "config.h"
24 #include "gfiledescriptorbased.h"
25 #include "glibintl.h"
26
27 #include "gioalias.h"
28
29 /**
30  * SECTION:gfiledescriptorbased
31  * @short_description: Interface for file descriptor based IO
32  * @include: gio/gfiledescriptorbased.h
33  * @see_also: #GInputStream, #GOutputStream
34  *
35  * #GFileDescriptorBased is implemented by streams (implementations of
36  * #GInputStream or #GOutputStream) that are based on file descriptors.
37  *
38  * Note that <filename>&lt;gio/gfiledescriptorbased.h&gt;</filename> belongs to
39  * the UNIX-specific GIO interfaces, thus you have to use the
40  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
41  *
42  * Since: 2.24
43  *
44  **/
45
46 typedef GFileDescriptorBasedIface GFileDescriptorBasedInterface;
47 G_DEFINE_INTERFACE (GFileDescriptorBased, g_file_descriptor_based, G_TYPE_OBJECT)
48
49 static void
50 g_file_descriptor_based_default_init (GFileDescriptorBasedInterface *iface)
51 {
52 }
53
54 /**
55  * g_file_descriptor_based_get_fd:
56  * @fd_based: a #GFileDescriptorBased.
57  *
58  * Gets the underlying file descriptor.
59  *
60  * Returns: The file descriptor
61  *
62  * Since: 2.24
63  **/
64 int
65 g_file_descriptor_based_get_fd (GFileDescriptorBased *fd_based)
66 {
67   GFileDescriptorBasedIface *iface;
68
69   g_return_val_if_fail (G_IS_FILE_DESCRIPTOR_BASED (fd_based), 0);
70
71   iface = G_FILE_DESCRIPTOR_BASED_GET_IFACE (fd_based);
72
73   return (* iface->get_fd) (fd_based);
74 }
75
76
77 #define __G_FILE_DESCRIPTOR_BASED_C__
78 #include "gioaliasdef.c"