projects
/
platform
/
upstream
/
glib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[kdbus] Add RequestName and ReleaseName to new API
[platform/upstream/glib.git]
/
gio
/
gwin32inputstream.c
diff --git
a/gio/gwin32inputstream.c
b/gio/gwin32inputstream.c
index
25c2315
..
179e139
100644
(file)
--- a/
gio/gwin32inputstream.c
+++ b/
gio/gwin32inputstream.c
@@
-13,9
+13,7
@@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Alexander Larsson <alexl@redhat.com>
* Author: Tor Lillqvist <tml@iki.fi>
*
* Author: Alexander Larsson <alexl@redhat.com>
* Author: Tor Lillqvist <tml@iki.fi>
@@
-31,6
+29,7
@@
#include "gioerror.h"
#include "gsimpleasyncresult.h"
#include "gwin32inputstream.h"
#include "gioerror.h"
#include "gsimpleasyncresult.h"
#include "gwin32inputstream.h"
+#include "giowin32-priv.h"
#include "gcancellable.h"
#include "gasynchelper.h"
#include "glibintl.h"
#include "gcancellable.h"
#include "gasynchelper.h"
#include "glibintl.h"
@@
-45,9
+44,9
@@
* #GWin32InputStream implements #GInputStream for reading from a
* Windows file handle.
*
* #GWin32InputStream implements #GInputStream for reading from a
* Windows file handle.
*
- * Note that
<filename><gio/gwin32inputstream.h></filename> belongs
- *
to the Windows-specific GIO interfaces, thus you have to use th
e
- *
<filename>gio-windows-2.0.pc</filename> pkg-config file
when using it.
+ * Note that
`<gio/gwin32inputstream.h>` belongs to the Windows-specific GIO
+ *
interfaces, thus you have to use the `gio-windows-2.0.pc` pkg-config fil
e
+ * when using it.
*/
enum {
*/
enum {
@@
-56,14
+55,14
@@
enum {
PROP_CLOSE_HANDLE
};
PROP_CLOSE_HANDLE
};
-G_DEFINE_TYPE (GWin32InputStream, g_win32_input_stream, G_TYPE_INPUT_STREAM);
-
struct _GWin32InputStreamPrivate {
HANDLE handle;
gboolean close_handle;
gint fd;
};
struct _GWin32InputStreamPrivate {
HANDLE handle;
gboolean close_handle;
gint fd;
};
+G_DEFINE_TYPE_WITH_PRIVATE (GWin32InputStream, g_win32_input_stream, G_TYPE_INPUT_STREAM)
+
static void g_win32_input_stream_set_property (GObject *object,
guint prop_id,
const GValue *value,
static void g_win32_input_stream_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@
-82,22
+81,13
@@
static gboolean g_win32_input_stream_close (GInputStream *stream,
GError **error);
static void
GError **error);
static void
-g_win32_input_stream_finalize (GObject *object)
-{
- G_OBJECT_CLASS (g_win32_input_stream_parent_class)->finalize (object);
-}
-
-static void
g_win32_input_stream_class_init (GWin32InputStreamClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (klass);
g_win32_input_stream_class_init (GWin32InputStreamClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (klass);
- g_type_class_add_private (klass, sizeof (GWin32InputStreamPrivate));
-
gobject_class->get_property = g_win32_input_stream_get_property;
gobject_class->set_property = g_win32_input_stream_set_property;
gobject_class->get_property = g_win32_input_stream_get_property;
gobject_class->set_property = g_win32_input_stream_set_property;
- gobject_class->finalize = g_win32_input_stream_finalize;
stream_class->read_fn = g_win32_input_stream_read;
stream_class->close_fn = g_win32_input_stream_close;
stream_class->read_fn = g_win32_input_stream_read;
stream_class->close_fn = g_win32_input_stream_close;
@@
-182,10
+172,7
@@
g_win32_input_stream_get_property (GObject *object,
static void
g_win32_input_stream_init (GWin32InputStream *win32_stream)
{
static void
g_win32_input_stream_init (GWin32InputStream *win32_stream)
{
- win32_stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (win32_stream,
- G_TYPE_WIN32_INPUT_STREAM,
- GWin32InputStreamPrivate);
-
+ win32_stream->priv = g_win32_input_stream_get_instance_private (win32_stream);
win32_stream->priv->handle = NULL;
win32_stream->priv->close_handle = TRUE;
win32_stream->priv->fd = -1;
win32_stream->priv->handle = NULL;
win32_stream->priv->close_handle = TRUE;
win32_stream->priv->fd = -1;
@@
-253,7
+240,7
@@
g_win32_input_stream_set_close_handle (GWin32InputStream *stream,
* Returns whether the handle of @stream will be
* closed when the stream is closed.
*
* Returns whether the handle of @stream will be
* closed when the stream is closed.
*
- * Return
value
: %TRUE if the handle is closed when done
+ * Return
s
: %TRUE if the handle is closed when done
*
* Since: 2.26
*/
*
* Since: 2.26
*/
@@
-271,7
+258,7
@@
g_win32_input_stream_get_close_handle (GWin32InputStream *stream)
*
* Return the Windows file handle that the stream reads from.
*
*
* Return the Windows file handle that the stream reads from.
*
- * Return
value
: The file handle of @stream
+ * Return
s
: The file handle of @stream
*
* Since: 2.26
*/
*
* Since: 2.26
*/
@@
-380,12
+367,11
@@
g_win32_input_stream_close (GInputStream *stream,
if (win32_stream->priv->fd != -1)
{
if (win32_stream->priv->fd != -1)
{
- int errsv = errno;
if (close (win32_stream->priv->fd) < 0)
{
g_set_error_literal (error, G_IO_ERROR,
if (close (win32_stream->priv->fd) < 0)
{
g_set_error_literal (error, G_IO_ERROR,
- g_io_error_from_errno (err
sv
),
- g_strerror (err
sv
));
+ g_io_error_from_errno (err
no
),
+ g_strerror (err
no
));
return FALSE;
}
}
return FALSE;
}
}