gio2 0.90.5 → 0.90.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +41 -0
- data/Rakefile +9 -70
- data/ext/gio2/Makefile +162 -0
- data/ext/gio2/extconf.rb +9 -9
- data/ext/gio2/gappinfo.o +0 -0
- data/ext/gio2/gapplaunchcontext.o +0 -0
- data/ext/gio2/gasyncinitable.c +0 -1
- data/ext/gio2/gasyncinitable.o +0 -0
- data/ext/gio2/gasyncresult.o +0 -0
- data/ext/gio2/gbufferedinputstream.c +0 -19
- data/ext/gio2/gbufferedinputstream.o +0 -0
- data/ext/gio2/gbufferedoutputstream.c +0 -34
- data/ext/gio2/gbufferedoutputstream.o +0 -0
- data/ext/gio2/gcancellable.o +0 -0
- data/ext/gio2/gcharsetconverter.c +0 -17
- data/ext/gio2/gcharsetconverter.o +0 -0
- data/ext/gio2/gcontenttype.c +1 -8
- data/ext/gio2/gcontenttype.o +0 -0
- data/ext/gio2/gconverter.o +0 -0
- data/ext/gio2/gconverterinputstream.c +0 -7
- data/ext/gio2/gconverterinputstream.o +0 -0
- data/ext/gio2/gconverteroutputstream.c +0 -7
- data/ext/gio2/gconverteroutputstream.o +0 -0
- data/ext/gio2/gdatainputstream.c +34 -57
- data/ext/gio2/gdatainputstream.o +0 -0
- data/ext/gio2/gdataoutputstream.c +0 -18
- data/ext/gio2/gdataoutputstream.o +0 -0
- data/ext/gio2/gdesktopappinfo.c +0 -2
- data/ext/gio2/gdesktopappinfo.o +0 -0
- data/ext/gio2/gdrive.o +0 -0
- data/ext/gio2/gemblem.c +0 -19
- data/ext/gio2/gemblem.o +0 -0
- data/ext/gio2/gemblemedicon.o +0 -0
- data/ext/gio2/gfile.c +4 -6
- data/ext/gio2/gfile.o +0 -0
- data/ext/gio2/gfileattribute.c +3 -155
- data/ext/gio2/gfileattribute.o +0 -0
- data/ext/gio2/gfileattributeinfo.c +89 -0
- data/ext/gio2/gfileattributeinfo.o +0 -0
- data/ext/gio2/gfileattributeinfolist.c +109 -0
- data/ext/gio2/gfileattributeinfolist.o +0 -0
- data/ext/gio2/gfileattributematcher.o +0 -0
- data/ext/gio2/gfiledescriptorbased.o +0 -0
- data/ext/gio2/gfileenumerator.c +0 -2
- data/ext/gio2/gfileenumerator.o +0 -0
- data/ext/gio2/gfileicon.c +0 -7
- data/ext/gio2/gfileicon.o +0 -0
- data/ext/gio2/gfileinfo.c +4 -11
- data/ext/gio2/gfileinfo.o +0 -0
- data/ext/gio2/gfileinputstream.c +0 -2
- data/ext/gio2/gfileinputstream.o +0 -0
- data/ext/gio2/gfileiostream.c +0 -2
- data/ext/gio2/gfileiostream.o +0 -0
- data/ext/gio2/gfilemonitor.c +0 -19
- data/ext/gio2/gfilemonitor.o +0 -0
- data/ext/gio2/gfilenamecompleter.o +0 -0
- data/ext/gio2/gfileoutputstream.c +1 -5
- data/ext/gio2/gfileoutputstream.o +0 -0
- data/ext/gio2/gfilterinputstream.c +1 -30
- data/ext/gio2/gfilterinputstream.o +0 -0
- data/ext/gio2/gfilteroutputstream.c +1 -30
- data/ext/gio2/gfilteroutputstream.o +0 -0
- data/ext/gio2/gicon.c +0 -2
- data/ext/gio2/gicon.o +0 -0
- data/ext/gio2/ginetaddress.c +0 -72
- data/ext/gio2/ginetaddress.o +0 -0
- data/ext/gio2/ginetsocketaddress.c +0 -16
- data/ext/gio2/ginetsocketaddress.o +0 -0
- data/ext/gio2/ginitable.o +0 -0
- data/ext/gio2/ginputstream.c +0 -2
- data/ext/gio2/ginputstream.o +0 -0
- data/ext/gio2/gio2.c +11 -1
- data/ext/gio2/gio2.h +9 -1
- data/ext/gio2/gio2.o +0 -0
- data/ext/gio2/gio2.so +0 -0
- data/ext/gio2/gioerror.c +4 -1
- data/ext/gio2/gioerror.o +0 -0
- data/ext/gio2/giomodule.c +2 -2
- data/ext/gio2/giomodule.o +0 -0
- data/ext/gio2/gioscheduler.c +4 -6
- data/ext/gio2/gioscheduler.o +0 -0
- data/ext/gio2/giostream.c +0 -23
- data/ext/gio2/giostream.o +0 -0
- data/ext/gio2/gloadableicon.c +0 -1
- data/ext/gio2/gloadableicon.o +0 -0
- data/ext/gio2/gmemoryinputstream.o +0 -0
- data/ext/gio2/gmemoryoutputstream.c +0 -24
- data/ext/gio2/gmemoryoutputstream.o +0 -0
- data/ext/gio2/gmount.c +1 -0
- data/ext/gio2/gmount.o +0 -0
- data/ext/gio2/gmountoperation.c +1 -103
- data/ext/gio2/gmountoperation.o +0 -0
- data/ext/gio2/gnetworkaddress.c +0 -14
- data/ext/gio2/gnetworkaddress.o +0 -0
- data/ext/gio2/gnetworkservice.c +0 -21
- data/ext/gio2/gnetworkservice.o +0 -0
- data/ext/gio2/goutputstream.c +8 -18
- data/ext/gio2/goutputstream.o +0 -0
- data/ext/gio2/gresolver.c +0 -2
- data/ext/gio2/gresolver.o +0 -0
- data/ext/gio2/gseekable.o +0 -0
- data/ext/gio2/gsimpleasyncresult.o +0 -0
- data/ext/gio2/gsocket.c +2 -80
- data/ext/gio2/gsocket.o +0 -0
- data/ext/gio2/gsocketaddress.c +1 -13
- data/ext/gio2/gsocketaddress.o +0 -0
- data/ext/gio2/gsocketclient.c +0 -68
- data/ext/gio2/gsocketclient.o +0 -0
- data/ext/gio2/gsocketconnectable.o +0 -0
- data/ext/gio2/gsocketconnection.c +1 -8
- data/ext/gio2/gsocketconnection.o +0 -0
- data/ext/gio2/gsocketcontrolmessage.c +0 -2
- data/ext/gio2/gsocketcontrolmessage.o +0 -0
- data/ext/gio2/gsocketlistener.c +27 -21
- data/ext/gio2/gsocketlistener.o +0 -0
- data/ext/gio2/gsocketservice.o +0 -0
- data/ext/gio2/gsrvtarget.o +0 -0
- data/ext/gio2/gtcpconnection.c +1 -22
- data/ext/gio2/gtcpconnection.o +0 -0
- data/ext/gio2/gthemedicon.o +0 -0
- data/ext/gio2/gthreadedsocketservice.c +6 -5
- data/ext/gio2/gthreadedsocketservice.o +0 -0
- data/ext/gio2/gunixconnection.o +0 -0
- data/ext/gio2/gunixfdlist.c +1 -1
- data/ext/gio2/gunixfdlist.o +0 -0
- data/ext/gio2/gunixfdmessage.c +0 -9
- data/ext/gio2/gunixfdmessage.o +0 -0
- data/ext/gio2/gunixinputstream.c +0 -24
- data/ext/gio2/gunixinputstream.o +0 -0
- data/ext/gio2/gunixmounts.c +1 -4
- data/ext/gio2/gunixmounts.o +0 -0
- data/ext/gio2/gunixoutputstream.c +0 -24
- data/ext/gio2/gunixoutputstream.o +0 -0
- data/ext/gio2/gunixsocketaddress.c +5 -17
- data/ext/gio2/gunixsocketaddress.o +0 -0
- data/ext/gio2/gvfs.c +0 -2
- data/ext/gio2/gvfs.o +0 -0
- data/ext/gio2/gvolume.o +0 -0
- data/ext/gio2/gvolumemonitor.c +0 -2
- data/ext/gio2/gvolumemonitor.o +0 -0
- data/ext/gio2/gzlibcompressor.c +3 -0
- data/ext/gio2/gzlibcompressor.o +0 -0
- data/ext/gio2/gzlibdecompressor.o +0 -0
- data/ext/gio2/ruby-gio2.pc +3 -0
- data/ext/gio2/util.c +3 -0
- data/ext/gio2/util.o +0 -0
- data/lib/gio2.rb +19 -1
- data/test/load-test.rb +14 -0
- data/test/test_bufferedinputstream.rb +2 -0
- data/test/test_charsetconverter.rb +2 -0
- data/test/test_datainputstream.rb +7 -0
- data/test/test_fileenumerator.rb +8 -0
- data/test/test_filemonitor.rb +2 -0
- data/test/test_inetaddress.rb +8 -0
- metadata +173 -79
data/ext/gio2/giostream.c
CHANGED
|
@@ -22,18 +22,6 @@
|
|
|
22
22
|
|
|
23
23
|
#define _SELF(value) G_IO_STREAM(RVAL2GOBJ(value))
|
|
24
24
|
|
|
25
|
-
static VALUE
|
|
26
|
-
iostream_get_input_stream(VALUE self)
|
|
27
|
-
{
|
|
28
|
-
return GOBJ2RVAL(g_io_stream_get_input_stream(_SELF(self)));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
static VALUE
|
|
32
|
-
iostream_get_output_stream(VALUE self)
|
|
33
|
-
{
|
|
34
|
-
return GOBJ2RVAL(g_io_stream_get_output_stream(_SELF(self)));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
25
|
static VALUE
|
|
38
26
|
iostream_close(VALUE self, VALUE cancellable)
|
|
39
27
|
{
|
|
@@ -78,12 +66,6 @@ iostream_close_finish(VALUE self, VALUE result)
|
|
|
78
66
|
return self;
|
|
79
67
|
}
|
|
80
68
|
|
|
81
|
-
static VALUE
|
|
82
|
-
iostream_is_closed(VALUE self)
|
|
83
|
-
{
|
|
84
|
-
return CBOOL2RVAL(g_io_stream_is_closed(_SELF(self)));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
69
|
static VALUE
|
|
88
70
|
iostream_has_pending(VALUE self)
|
|
89
71
|
{
|
|
@@ -114,14 +96,9 @@ Init_giostream(VALUE glib)
|
|
|
114
96
|
{
|
|
115
97
|
VALUE iostream = G_DEF_CLASS(G_TYPE_IO_STREAM, "IOStream", glib);
|
|
116
98
|
|
|
117
|
-
rb_undef_alloc_func(iostream);
|
|
118
|
-
|
|
119
|
-
rb_define_method(iostream, "input_stream", iostream_get_input_stream, 0);
|
|
120
|
-
rb_define_method(iostream, "output_stream", iostream_get_output_stream, 0);
|
|
121
99
|
rb_define_method(iostream, "close", iostream_close, 1);
|
|
122
100
|
rb_define_method(iostream, "close_async", iostream_close_async, -1);
|
|
123
101
|
rb_define_method(iostream, "close_finish", iostream_close_finish, 1);
|
|
124
|
-
rb_define_method(iostream, "closed?", iostream_is_closed, 0);
|
|
125
102
|
rb_define_method(iostream, "has_pending?", iostream_has_pending, 0);
|
|
126
103
|
rb_define_method(iostream, "set_pending", iostream_set_pending, 0);
|
|
127
104
|
G_DEF_SETTER(iostream, "pending");
|
|
Binary file
|
data/ext/gio2/gloadableicon.c
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -20,8 +20,6 @@
|
|
|
20
20
|
|
|
21
21
|
#include "gio2.h"
|
|
22
22
|
|
|
23
|
-
#define _SELF(value) G_MEMORY_OUTPUT_STREAM(RVAL2GOBJ(value))
|
|
24
|
-
|
|
25
23
|
/* TODO: Take string argument? */
|
|
26
24
|
static VALUE
|
|
27
25
|
memoryoutputstream_initialize(VALUE self)
|
|
@@ -34,32 +32,10 @@ memoryoutputstream_initialize(VALUE self)
|
|
|
34
32
|
return Qnil;
|
|
35
33
|
}
|
|
36
34
|
|
|
37
|
-
/* TODO: Is there a way to avoid duplicating the result? */
|
|
38
|
-
static VALUE
|
|
39
|
-
memoryoutputstream_get_data(VALUE self)
|
|
40
|
-
{
|
|
41
|
-
return CSTR2RVAL(g_memory_output_stream_get_data(_SELF(self)));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static VALUE
|
|
45
|
-
memoryoutputstream_get_size(VALUE self)
|
|
46
|
-
{
|
|
47
|
-
return GSIZE2RVAL(g_memory_output_stream_get_size(_SELF(self)));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
static VALUE
|
|
51
|
-
memoryoutputstream_get_data_size(VALUE self)
|
|
52
|
-
{
|
|
53
|
-
return GSIZE2RVAL(g_memory_output_stream_get_data_size(_SELF(self)));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
35
|
void
|
|
57
36
|
Init_gmemoryoutputstream(VALUE glib)
|
|
58
37
|
{
|
|
59
38
|
VALUE memoryoutputstream = G_DEF_CLASS(G_TYPE_MEMORY_OUTPUT_STREAM, "MemoryOutputStream", glib);
|
|
60
39
|
|
|
61
40
|
rb_define_method(memoryoutputstream, "initialize", memoryoutputstream_initialize, 0);
|
|
62
|
-
rb_define_method(memoryoutputstream, "data", memoryoutputstream_get_data, 0);
|
|
63
|
-
rb_define_method(memoryoutputstream, "size", memoryoutputstream_get_size, 0);
|
|
64
|
-
rb_define_method(memoryoutputstream, "data_size", memoryoutputstream_get_data_size, 0);
|
|
65
41
|
}
|
|
Binary file
|
data/ext/gio2/gmount.c
CHANGED
|
@@ -256,6 +256,7 @@ Init_gmount(VALUE glib)
|
|
|
256
256
|
|
|
257
257
|
G_DEF_CLASS(G_TYPE_MOUNT_MOUNT_FLAGS, "MountFlags", mount);
|
|
258
258
|
G_DEF_CONSTANTS(mount, G_TYPE_MOUNT_MOUNT_FLAGS, "G_MOUNT_");
|
|
259
|
+
|
|
259
260
|
G_DEF_CLASS(G_TYPE_MOUNT_UNMOUNT_FLAGS, "UnmountFlags", mount);
|
|
260
261
|
G_DEF_CONSTANTS(mount, G_TYPE_MOUNT_UNMOUNT_FLAGS, "G_MOUNT_");
|
|
261
262
|
|
data/ext/gio2/gmount.o
ADDED
|
Binary file
|
data/ext/gio2/gmountoperation.c
CHANGED
|
@@ -39,90 +39,6 @@ mountoperation_initialize(VALUE self)
|
|
|
39
39
|
return Qnil;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
static VALUE
|
|
43
|
-
mountoperation_get_username(VALUE self)
|
|
44
|
-
{
|
|
45
|
-
return CSTR2RVAL(g_mount_operation_get_username(_SELF(self)));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
static VALUE
|
|
49
|
-
mountoperation_set_username(VALUE self, VALUE value)
|
|
50
|
-
{
|
|
51
|
-
g_mount_operation_set_username(_SELF(self), RVAL2CSTR(value));
|
|
52
|
-
|
|
53
|
-
return self;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static VALUE
|
|
57
|
-
mountoperation_get_password(VALUE self)
|
|
58
|
-
{
|
|
59
|
-
return CSTR2RVAL(g_mount_operation_get_password(_SELF(self)));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
static VALUE
|
|
63
|
-
mountoperation_set_password(VALUE self, VALUE value)
|
|
64
|
-
{
|
|
65
|
-
g_mount_operation_set_password(_SELF(self), RVAL2CSTR(value));
|
|
66
|
-
|
|
67
|
-
return self;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
static VALUE
|
|
71
|
-
mountoperation_get_anonymous(VALUE self)
|
|
72
|
-
{
|
|
73
|
-
return CBOOL2RVAL(g_mount_operation_get_anonymous(_SELF(self)));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
static VALUE
|
|
77
|
-
mountoperation_set_anonymous(VALUE self, VALUE value)
|
|
78
|
-
{
|
|
79
|
-
g_mount_operation_set_anonymous(_SELF(self), RVAL2CBOOL(value));
|
|
80
|
-
|
|
81
|
-
return self;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
static VALUE
|
|
85
|
-
mountoperation_get_domain(VALUE self)
|
|
86
|
-
{
|
|
87
|
-
return CSTR2RVAL(g_mount_operation_get_domain(_SELF(self)));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
static VALUE
|
|
91
|
-
mountoperation_set_domain(VALUE self, VALUE value)
|
|
92
|
-
{
|
|
93
|
-
g_mount_operation_set_domain(_SELF(self), RVAL2CSTR(value));
|
|
94
|
-
|
|
95
|
-
return self;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
static VALUE
|
|
99
|
-
mountoperation_get_password_save(VALUE self)
|
|
100
|
-
{
|
|
101
|
-
return GPASSWORDSAVE2RVAL(g_mount_operation_get_password_save(_SELF(self)));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
static VALUE
|
|
105
|
-
mountoperation_set_password_save(VALUE self, VALUE value)
|
|
106
|
-
{
|
|
107
|
-
g_mount_operation_set_password_save(_SELF(self), RVAL2GPASSWORDSAVE(value));
|
|
108
|
-
|
|
109
|
-
return self;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
static VALUE
|
|
113
|
-
mountoperation_get_choice(VALUE self)
|
|
114
|
-
{
|
|
115
|
-
return INT2NUM(g_mount_operation_get_choice(_SELF(self)));
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
static VALUE
|
|
119
|
-
mountoperation_set_choice(VALUE self, VALUE value)
|
|
120
|
-
{
|
|
121
|
-
g_mount_operation_set_choice(_SELF(self), NUM2INT(value));
|
|
122
|
-
|
|
123
|
-
return self;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
42
|
static VALUE
|
|
127
43
|
mountoperation_reply(VALUE self, VALUE value)
|
|
128
44
|
{
|
|
@@ -136,33 +52,15 @@ Init_gmountoperation(VALUE glib)
|
|
|
136
52
|
{
|
|
137
53
|
VALUE mountoperation = G_DEF_CLASS(G_TYPE_MOUNT_OPERATION, "MountOperation", glib);
|
|
138
54
|
|
|
139
|
-
/* TODO: Are these necessary? */
|
|
140
55
|
G_DEF_CLASS(G_TYPE_MOUNT_OPERATION_RESULT, "Result", mountoperation);
|
|
141
56
|
G_DEF_CONSTANTS(mountoperation, G_TYPE_MOUNT_OPERATION_RESULT, "G_MOUNT_OPERATION_");
|
|
142
57
|
|
|
143
58
|
G_DEF_CLASS(G_TYPE_ASK_PASSWORD_FLAGS, "AskPasswordFlags", glib);
|
|
144
59
|
G_DEF_CONSTANTS(glib, G_TYPE_ASK_PASSWORD_FLAGS, "G_");
|
|
60
|
+
|
|
145
61
|
G_DEF_CLASS(G_TYPE_PASSWORD_SAVE, "PasswordSave", glib);
|
|
146
62
|
G_DEF_CONSTANTS(glib, G_TYPE_PASSWORD_SAVE, "G_");
|
|
147
63
|
|
|
148
64
|
rb_define_method(mountoperation, "initialize", mountoperation_initialize, 0);
|
|
149
|
-
rb_define_method(mountoperation, "username", mountoperation_get_username, 0);
|
|
150
|
-
rb_define_method(mountoperation, "set_username", mountoperation_set_username, 1);
|
|
151
|
-
G_DEF_SETTER(mountoperation, "username");
|
|
152
|
-
rb_define_method(mountoperation, "password", mountoperation_get_password, 0);
|
|
153
|
-
rb_define_method(mountoperation, "set_password", mountoperation_set_password, 1);
|
|
154
|
-
G_DEF_SETTER(mountoperation, "password");
|
|
155
|
-
rb_define_method(mountoperation, "anonymous", mountoperation_get_anonymous, 0);
|
|
156
|
-
rb_define_method(mountoperation, "set_anonymous", mountoperation_set_anonymous, 1);
|
|
157
|
-
G_DEF_SETTER(mountoperation, "anonymous");
|
|
158
|
-
rb_define_method(mountoperation, "domain", mountoperation_get_domain, 0);
|
|
159
|
-
rb_define_method(mountoperation, "set_domain", mountoperation_set_domain, 1);
|
|
160
|
-
G_DEF_SETTER(mountoperation, "domain");
|
|
161
|
-
rb_define_method(mountoperation, "password_save", mountoperation_get_password_save, 0);
|
|
162
|
-
rb_define_method(mountoperation, "set_password_save", mountoperation_set_password_save, 1);
|
|
163
|
-
G_DEF_SETTER(mountoperation, "password_save");
|
|
164
|
-
rb_define_method(mountoperation, "choice", mountoperation_get_choice, 0);
|
|
165
|
-
rb_define_method(mountoperation, "set_choice", mountoperation_set_choice, 1);
|
|
166
|
-
G_DEF_SETTER(mountoperation, "choice");
|
|
167
65
|
rb_define_method(mountoperation, "reply", mountoperation_reply, 1);
|
|
168
66
|
}
|
|
Binary file
|
data/ext/gio2/gnetworkaddress.c
CHANGED
|
@@ -31,18 +31,6 @@ networkaddress_initialize(VALUE self, VALUE hostname, VALUE port)
|
|
|
31
31
|
return Qnil;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
static VALUE
|
|
35
|
-
networkaddress_get_hostname(VALUE self)
|
|
36
|
-
{
|
|
37
|
-
return CSTR2RVAL(g_network_address_get_hostname(_SELF(self)));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static VALUE
|
|
41
|
-
networkaddress_get_port(VALUE self)
|
|
42
|
-
{
|
|
43
|
-
return GUINT162RVAL(g_network_address_get_port(_SELF(self)));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
34
|
static VALUE
|
|
47
35
|
networkaddress_parse(G_GNUC_UNUSED VALUE self, VALUE host_and_port, VALUE default_port)
|
|
48
36
|
{
|
|
@@ -66,6 +54,4 @@ Init_gnetworkaddress(VALUE glib)
|
|
|
66
54
|
rb_define_singleton_method(networkaddress, "parse", networkaddress_parse, 2);
|
|
67
55
|
|
|
68
56
|
rb_define_method(networkaddress, "initialize", networkaddress_initialize, 2);
|
|
69
|
-
rb_define_method(networkaddress, "hostname", networkaddress_get_hostname, 0);
|
|
70
|
-
rb_define_method(networkaddress, "port", networkaddress_get_port, 0);
|
|
71
57
|
}
|
|
Binary file
|
data/ext/gio2/gnetworkservice.c
CHANGED
|
@@ -34,31 +34,10 @@ networkservice_initialize(VALUE self, VALUE service, VALUE protocol, VALUE domai
|
|
|
34
34
|
return Qnil;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
static VALUE
|
|
38
|
-
networkservice_get_service(VALUE self)
|
|
39
|
-
{
|
|
40
|
-
return CSTR2RVAL(g_network_service_get_service(_SELF(self)));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
static VALUE
|
|
44
|
-
networkservice_get_protocol(VALUE self)
|
|
45
|
-
{
|
|
46
|
-
return CSTR2RVAL(g_network_service_get_protocol(_SELF(self)));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
static VALUE
|
|
50
|
-
networkservice_get_domain(VALUE self)
|
|
51
|
-
{
|
|
52
|
-
return CSTR2RVAL(g_network_service_get_domain(_SELF(self)));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
37
|
void
|
|
56
38
|
Init_gnetworkservice(VALUE glib)
|
|
57
39
|
{
|
|
58
40
|
VALUE networkservice = G_DEF_CLASS(G_TYPE_NETWORK_SERVICE, "NetworkService", glib);
|
|
59
41
|
|
|
60
42
|
rb_define_method(networkservice, "initialize", networkservice_initialize, 3);
|
|
61
|
-
rb_define_method(networkservice, "service", networkservice_get_service, 0);
|
|
62
|
-
rb_define_method(networkservice, "protocol", networkservice_get_protocol, 0);
|
|
63
|
-
rb_define_method(networkservice, "domain", networkservice_get_domain, 0);
|
|
64
43
|
}
|
|
Binary file
|
data/ext/gio2/goutputstream.c
CHANGED
|
@@ -33,21 +33,17 @@
|
|
|
33
33
|
static VALUE
|
|
34
34
|
outputstream_write(int argc, VALUE *argv, VALUE self)
|
|
35
35
|
{
|
|
36
|
-
VALUE rbbuffer,
|
|
36
|
+
VALUE rbbuffer, cancellable;
|
|
37
37
|
const char *buffer;
|
|
38
|
-
gsize count;
|
|
39
|
-
GCancellable *cancellable;
|
|
40
38
|
GError *error = NULL;
|
|
41
39
|
gssize bytes_written;
|
|
42
40
|
|
|
43
|
-
rb_scan_args(argc, argv, "11", &rbbuffer, &
|
|
41
|
+
rb_scan_args(argc, argv, "11", &rbbuffer, &cancellable);
|
|
44
42
|
buffer = RVAL2CSTR(rbbuffer);
|
|
45
|
-
count = RSTRING_LEN(rbbuffer);
|
|
46
|
-
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
|
47
43
|
bytes_written = g_output_stream_write(_SELF(self),
|
|
48
44
|
buffer,
|
|
49
|
-
|
|
50
|
-
cancellable,
|
|
45
|
+
(gsize)RSTRING_LEN(rbbuffer),
|
|
46
|
+
RVAL2GCANCELLABLE(cancellable),
|
|
51
47
|
&error);
|
|
52
48
|
if (bytes_written == -1)
|
|
53
49
|
rbgio_raise_error(error);
|
|
@@ -58,22 +54,18 @@ outputstream_write(int argc, VALUE *argv, VALUE self)
|
|
|
58
54
|
static VALUE
|
|
59
55
|
outputstream_write_all(int argc, VALUE *argv, VALUE self)
|
|
60
56
|
{
|
|
61
|
-
VALUE rbbuffer,
|
|
57
|
+
VALUE rbbuffer, cancellable;
|
|
62
58
|
const char *buffer;
|
|
63
|
-
gsize count;
|
|
64
59
|
gsize bytes_written;
|
|
65
|
-
GCancellable *cancellable;
|
|
66
60
|
GError *error = NULL;
|
|
67
61
|
|
|
68
|
-
rb_scan_args(argc, argv, "11", &rbbuffer, &
|
|
62
|
+
rb_scan_args(argc, argv, "11", &rbbuffer, &cancellable);
|
|
69
63
|
buffer = RVAL2CSTR(rbbuffer);
|
|
70
|
-
count = RSTRING_LEN(rbbuffer);
|
|
71
|
-
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
|
72
64
|
if (!g_output_stream_write_all(_SELF(self),
|
|
73
65
|
buffer,
|
|
74
|
-
|
|
66
|
+
(gsize)RSTRING_LEN(rbbuffer),
|
|
75
67
|
&bytes_written,
|
|
76
|
-
cancellable,
|
|
68
|
+
RVAL2GCANCELLABLE(cancellable),
|
|
77
69
|
&error))
|
|
78
70
|
rbgio_raise_error(error);
|
|
79
71
|
|
|
@@ -319,8 +311,6 @@ Init_goutputstream(VALUE glib)
|
|
|
319
311
|
G_DEF_CLASS(G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS, "SpliceFlags", outputstream);
|
|
320
312
|
G_DEF_CONSTANTS(outputstream, G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS, "G_OUTPUT_STREAM_");
|
|
321
313
|
|
|
322
|
-
rb_undef_alloc_func(outputstream);
|
|
323
|
-
|
|
324
314
|
rb_define_method(outputstream, "write", outputstream_write, -1);
|
|
325
315
|
rb_define_method(outputstream, "write_all", outputstream_write_all, -1);
|
|
326
316
|
rb_define_method(outputstream, "splice", outputstream_splice, -1);
|
|
Binary file
|
data/ext/gio2/gresolver.c
CHANGED
|
@@ -209,8 +209,6 @@ Init_gresolver(VALUE glib)
|
|
|
209
209
|
rb_define_singleton_method(resolver, "default", resolver_get_default, 0);
|
|
210
210
|
rb_define_singleton_method(resolver, "set_default", resolver_set_default, 1);
|
|
211
211
|
|
|
212
|
-
rb_undef_alloc_func(resolver);
|
|
213
|
-
|
|
214
212
|
/* TODO: Taint result of these methods? */
|
|
215
213
|
rb_define_method(resolver, "lookup_by_name", resolver_lookup_by_name, 2);
|
|
216
214
|
rb_define_method(resolver, "lookup_by_name_async", resolver_lookup_by_name_async, -1);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/ext/gio2/gsocket.c
CHANGED
|
@@ -298,60 +298,7 @@ socket_condition_wait(int argc, VALUE *argv, VALUE self)
|
|
|
298
298
|
return self;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
|
|
302
|
-
socket_set_listen_backlog(VALUE self, VALUE backlog)
|
|
303
|
-
{
|
|
304
|
-
g_socket_set_listen_backlog(_SELF(self), RVAL2GINT(backlog));
|
|
305
|
-
|
|
306
|
-
return self;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
static VALUE
|
|
310
|
-
socket_get_listen_backlog(VALUE self)
|
|
311
|
-
{
|
|
312
|
-
return GINT2RVAL(g_socket_get_listen_backlog(_SELF(self)));
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
static VALUE
|
|
316
|
-
socket_get_blocking(VALUE self)
|
|
317
|
-
{
|
|
318
|
-
return CBOOL2RVAL(g_socket_get_blocking(_SELF(self)));
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
static VALUE
|
|
322
|
-
socket_set_blocking(VALUE self, VALUE blocking)
|
|
323
|
-
{
|
|
324
|
-
g_socket_set_blocking(_SELF(self), RVAL2CBOOL(blocking));
|
|
325
|
-
|
|
326
|
-
return self;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
static VALUE
|
|
330
|
-
socket_get_keepalive(VALUE self)
|
|
331
|
-
{
|
|
332
|
-
return CBOOL2RVAL(g_socket_get_keepalive(_SELF(self)));
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
static VALUE
|
|
336
|
-
socket_set_keepalive(VALUE self, VALUE keepalive)
|
|
337
|
-
{
|
|
338
|
-
g_socket_set_keepalive(_SELF(self), RVAL2CBOOL(keepalive));
|
|
339
|
-
|
|
340
|
-
return self;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
static VALUE
|
|
344
|
-
socket_get_family(VALUE self)
|
|
345
|
-
{
|
|
346
|
-
return GSOCKETFAMILY2RVAL(g_socket_get_family(_SELF(self)));
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
static VALUE
|
|
350
|
-
socket_get_fd(VALUE self)
|
|
351
|
-
{
|
|
352
|
-
return FD2RVAL(g_socket_get_fd(_SELF(self)));
|
|
353
|
-
}
|
|
354
|
-
|
|
301
|
+
/* TODO: Need to make sure that this isn’t overridden. */
|
|
355
302
|
static VALUE
|
|
356
303
|
socket_get_local_address(VALUE self)
|
|
357
304
|
{
|
|
@@ -365,12 +312,6 @@ socket_get_local_address(VALUE self)
|
|
|
365
312
|
return GOBJ2RVAL_UNREF(address);
|
|
366
313
|
}
|
|
367
314
|
|
|
368
|
-
static VALUE
|
|
369
|
-
socket_get_protocol(VALUE self)
|
|
370
|
-
{
|
|
371
|
-
return GSOCKETPROTOCOL2RVAL(g_socket_get_protocol(_SELF(self)));
|
|
372
|
-
}
|
|
373
|
-
|
|
374
315
|
static VALUE
|
|
375
316
|
socket_get_remote_address(VALUE self)
|
|
376
317
|
{
|
|
@@ -384,12 +325,6 @@ socket_get_remote_address(VALUE self)
|
|
|
384
325
|
return GOBJ2RVAL_UNREF(address);
|
|
385
326
|
}
|
|
386
327
|
|
|
387
|
-
static VALUE
|
|
388
|
-
socket_get_socket_type(VALUE self)
|
|
389
|
-
{
|
|
390
|
-
return GSOCKETTYPE2RVAL(g_socket_get_socket_type(_SELF(self)));
|
|
391
|
-
}
|
|
392
|
-
|
|
393
328
|
static VALUE
|
|
394
329
|
socket_speaks_ipv4(VALUE self)
|
|
395
330
|
{
|
|
@@ -399,7 +334,7 @@ socket_speaks_ipv4(VALUE self)
|
|
|
399
334
|
void
|
|
400
335
|
Init_gsocket(VALUE glib)
|
|
401
336
|
{
|
|
402
|
-
VALUE socket = G_DEF_CLASS(
|
|
337
|
+
VALUE socket = G_DEF_CLASS(G_TYPE_SOCKET, "Socket", glib);
|
|
403
338
|
|
|
404
339
|
G_DEF_CLASS(G_TYPE_SOCKET_FAMILY, "Family", socket);
|
|
405
340
|
G_DEF_CONSTANTS(socket, G_TYPE_SOCKET_FAMILY, "G_SOCKET_");
|
|
@@ -432,20 +367,7 @@ Init_gsocket(VALUE glib)
|
|
|
432
367
|
rb_define_method(socket, "create_source", socket_create_source, -1);
|
|
433
368
|
rb_define_method(socket, "condition_check", socket_condition_check, 1);
|
|
434
369
|
rb_define_method(socket, "condition_wait", socket_condition_wait, -1);
|
|
435
|
-
rb_define_method(socket, "set_listen_backlog", socket_set_listen_backlog, 1);
|
|
436
|
-
G_DEF_SETTER(socket, "listen_backlog");
|
|
437
|
-
rb_define_method(socket, "listen_backlog", socket_get_listen_backlog, 0);
|
|
438
|
-
rb_define_method(socket, "blocking?", socket_get_blocking, 0);
|
|
439
|
-
rb_define_method(socket, "set_blocking", socket_set_blocking, 1);
|
|
440
|
-
G_DEF_SETTER(socket, "blocking");
|
|
441
|
-
rb_define_method(socket, "keepalive?", socket_get_keepalive, 0);
|
|
442
|
-
rb_define_method(socket, "set_keepalive", socket_set_keepalive, 1);
|
|
443
|
-
G_DEF_SETTER(socket, "keepalive");
|
|
444
|
-
rb_define_method(socket, "family", socket_get_family, 0);
|
|
445
|
-
rb_define_method(socket, "fd", socket_get_fd, 0);
|
|
446
370
|
rb_define_method(socket, "local_address", socket_get_local_address, 0);
|
|
447
|
-
rb_define_method(socket, "protocol", socket_get_protocol, 0);
|
|
448
371
|
rb_define_method(socket, "remote_address", socket_get_remote_address, 0);
|
|
449
|
-
rb_define_method(socket, "socket_type", socket_get_socket_type, 0);
|
|
450
372
|
rb_define_method(socket, "speaks_ipv4?", socket_speaks_ipv4, 0);
|
|
451
373
|
}
|
data/ext/gio2/gsocket.o
ADDED
|
Binary file
|
data/ext/gio2/gsocketaddress.c
CHANGED
|
@@ -20,16 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
#include "gio2.h"
|
|
22
22
|
|
|
23
|
-
#define _SELF(value) RVAL2GSOCKETADDRESS(value)
|
|
24
|
-
|
|
25
23
|
/* TODO: new_from_native? */
|
|
26
24
|
|
|
27
|
-
static VALUE
|
|
28
|
-
socketaddress_get_family(VALUE self)
|
|
29
|
-
{
|
|
30
|
-
return GSOCKETFAMILY2RVAL(g_socket_address_get_family(_SELF(self)));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
25
|
/* TODO: to_native? */
|
|
34
26
|
|
|
35
27
|
/* TODO: get_native_size? */
|
|
@@ -37,9 +29,5 @@ socketaddress_get_family(VALUE self)
|
|
|
37
29
|
void
|
|
38
30
|
Init_gsocketaddress(VALUE glib)
|
|
39
31
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
rb_undef_alloc_func(socketaddress);
|
|
43
|
-
|
|
44
|
-
rb_define_method(socketaddress, "family", socketaddress_get_family, 0);
|
|
32
|
+
(void)G_DEF_CLASS(G_TYPE_SOCKET_ADDRESS, "SocketAddress", glib);
|
|
45
33
|
}
|
|
Binary file
|
data/ext/gio2/gsocketclient.c
CHANGED
|
@@ -187,62 +187,6 @@ socketclient_connect_to_service_finish(VALUE self, VALUE result)
|
|
|
187
187
|
return connection_finish_method(g_socket_client_connect_to_service_finish, self, result);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
static VALUE
|
|
191
|
-
socketclient_set_family(VALUE self, VALUE family)
|
|
192
|
-
{
|
|
193
|
-
g_socket_client_set_family(_SELF(self), RVAL2GSOCKETFAMILY(family));
|
|
194
|
-
|
|
195
|
-
return self;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
static VALUE
|
|
199
|
-
socketclient_set_local_address(VALUE self, VALUE address)
|
|
200
|
-
{
|
|
201
|
-
g_socket_client_set_local_address(_SELF(self), RVAL2GSOCKETADDRESS(address));
|
|
202
|
-
|
|
203
|
-
return self;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
static VALUE
|
|
207
|
-
socketclient_set_protocol(VALUE self, VALUE protocol)
|
|
208
|
-
{
|
|
209
|
-
g_socket_client_set_protocol(_SELF(self), RVAL2GSOCKETPROTOCOL(protocol));
|
|
210
|
-
|
|
211
|
-
return self;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
static VALUE
|
|
215
|
-
socketclient_set_socket_type(VALUE self, VALUE type)
|
|
216
|
-
{
|
|
217
|
-
g_socket_client_set_socket_type(_SELF(self), RVAL2GSOCKETTYPE(type));
|
|
218
|
-
|
|
219
|
-
return self;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
static VALUE
|
|
223
|
-
socketclient_get_family(VALUE self)
|
|
224
|
-
{
|
|
225
|
-
return GSOCKETFAMILY2RVAL(g_socket_client_get_family(_SELF(self)));
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
static VALUE
|
|
229
|
-
socketclient_get_local_address(VALUE self)
|
|
230
|
-
{
|
|
231
|
-
return GOBJ2RVAL(g_socket_client_get_local_address(_SELF(self)));
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
static VALUE
|
|
235
|
-
socketclient_get_protocol(VALUE self)
|
|
236
|
-
{
|
|
237
|
-
return GSOCKETPROTOCOL2RVAL(g_socket_client_get_protocol(_SELF(self)));
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
static VALUE
|
|
241
|
-
socketclient_get_socket_type(VALUE self)
|
|
242
|
-
{
|
|
243
|
-
return GSOCKETTYPE2RVAL(g_socket_client_get_socket_type(_SELF(self)));
|
|
244
|
-
}
|
|
245
|
-
|
|
246
190
|
void
|
|
247
191
|
Init_gsocketclient(VALUE glib)
|
|
248
192
|
{
|
|
@@ -258,16 +202,4 @@ Init_gsocketclient(VALUE glib)
|
|
|
258
202
|
rb_define_method(socketclient, "connect_to_service", socketclient_connect_to_service, -1);
|
|
259
203
|
rb_define_method(socketclient, "connect_to_service_async", socketclient_connect_to_service_async, -1);
|
|
260
204
|
rb_define_method(socketclient, "connect_to_service_finish", socketclient_connect_to_service_finish, 1);
|
|
261
|
-
rb_define_method(socketclient, "set_family", socketclient_set_family, 1);
|
|
262
|
-
G_DEF_SETTER(socketclient, "family");
|
|
263
|
-
rb_define_method(socketclient, "set_local_address", socketclient_set_local_address, 1);
|
|
264
|
-
G_DEF_SETTER(socketclient, "local_address");
|
|
265
|
-
rb_define_method(socketclient, "set_protocol", socketclient_set_protocol, 1);
|
|
266
|
-
G_DEF_SETTER(socketclient, "protocol");
|
|
267
|
-
rb_define_method(socketclient, "set_socket_type", socketclient_set_socket_type, 1);
|
|
268
|
-
G_DEF_SETTER(socketclient, "socket_type");
|
|
269
|
-
rb_define_method(socketclient, "family", socketclient_get_family, 0);
|
|
270
|
-
rb_define_method(socketclient, "local_address", socketclient_get_local_address, 0);
|
|
271
|
-
rb_define_method(socketclient, "protocol", socketclient_get_protocol, 0);
|
|
272
|
-
rb_define_method(socketclient, "socket_type", socketclient_get_socket_type, 0);
|
|
273
205
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -48,12 +48,6 @@ socketconnection_get_remote_address(VALUE self)
|
|
|
48
48
|
return GOBJ2RVAL_UNREF(address);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
static VALUE
|
|
52
|
-
socketconnection_get_socket(VALUE self)
|
|
53
|
-
{
|
|
54
|
-
return GOBJ2RVAL(g_socket_connection_get_socket(_SELF(self)));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
51
|
static VALUE
|
|
58
52
|
socketconnectionfactory_create_connection(G_GNUC_UNUSED VALUE self, VALUE socket)
|
|
59
53
|
{
|
|
@@ -73,9 +67,8 @@ Init_gsocketconnection(VALUE glib)
|
|
|
73
67
|
|
|
74
68
|
rb_define_method(socketconnection, "local_address", socketconnection_get_local_address, 0);
|
|
75
69
|
rb_define_method(socketconnection, "remote_address", socketconnection_get_remote_address, 0);
|
|
76
|
-
rb_define_method(socketconnection, "socket", socketconnection_get_socket, 0);
|
|
77
70
|
|
|
78
|
-
/* Perhaps just move this to SocketConnection? */
|
|
71
|
+
/* TODO: Perhaps just move this to SocketConnection? */
|
|
79
72
|
socketconnectionfactory = rb_define_module_under(glib, "SocketConnectionFactory");
|
|
80
73
|
|
|
81
74
|
rb_define_module_function(socketconnectionfactory, "create_connection", socketconnectionfactory_create_connection, 1);
|
|
Binary file
|
|
@@ -73,8 +73,6 @@ Init_gsocketcontrolmessage(VALUE glib)
|
|
|
73
73
|
|
|
74
74
|
rb_define_singleton_method(socketcontrolmessage, "deserialize", socketcontrolmessage_deserialize, 3);
|
|
75
75
|
|
|
76
|
-
rb_undef_alloc_func(socketcontrolmessage);
|
|
77
|
-
|
|
78
76
|
rb_define_method(socketcontrolmessage, "level", socketcontrolmessage_get_level, 0);
|
|
79
77
|
rb_define_method(socketcontrolmessage, "msg_type", socketcontrolmessage_get_msg_type, 0);
|
|
80
78
|
rb_define_method(socketcontrolmessage, "size", socketcontrolmessage_get_size, 0);
|
|
Binary file
|