gio2 2.1.0-x86-mingw32 → 2.2.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +26 -9
  3. data/ext/gio2/extconf.rb +38 -28
  4. data/ext/gio2/rb-gio2-pollable-source.c +59 -0
  5. data/ext/gio2/{rbgiofilteroutputstream.c → rb-gio2.c} +9 -5
  6. data/ext/gio2/{gio2.c → rb-gio2.h} +5 -10
  7. data/extconf.rb +22 -6
  8. data/lib/1.9/gio2.so +0 -0
  9. data/lib/2.0/gio2.so +0 -0
  10. data/lib/2.1/gio2.so +0 -0
  11. data/lib/gio2/deprecated.rb +16 -0
  12. data/lib/gio2/inet-address.rb +33 -0
  13. data/lib/gio2/input-stream.rb +39 -0
  14. data/lib/gio2/loader.rb +244 -0
  15. data/lib/gio2/output-stream.rb +24 -0
  16. data/lib/gio2/pollable-input-stream.rb +51 -0
  17. data/lib/gio2/pollable-output-stream.rb +32 -0
  18. data/lib/gio2/resources.rb +62 -0
  19. data/lib/gio2.rb +38 -143
  20. data/test/fixture/content-type/x-content/unix-software/autorun.sh +1 -0
  21. data/test/fixture/resource/Rakefile +32 -0
  22. data/test/fixture/resource/logo.png +0 -0
  23. data/test/fixture/resource/ruby-gio2.gresource +0 -0
  24. data/test/fixture/resource/ruby-gio2.gresource.xml +6 -0
  25. data/test/gio2-test-utils/fixture.rb +24 -0
  26. data/test/gio2-test-utils/socket-client.rb +59 -0
  27. data/test/gio2-test-utils.rb +21 -0
  28. data/test/run-test.rb +45 -9
  29. data/test/test-buffered-input-stream.rb +23 -0
  30. data/test/test-charset-converter.rb +23 -0
  31. data/test/test-content-type.rb +31 -0
  32. data/test/test-data-input-stream.rb +21 -0
  33. data/test/test-file-enumerator.rb +26 -0
  34. data/test/test-file-monitor.rb +33 -0
  35. data/test/test-file.rb +28 -0
  36. data/test/test-inet-address.rb +34 -0
  37. data/test/test-input-stream.rb +36 -0
  38. data/test/test-output-stream.rb +39 -0
  39. data/test/test-pollable-input-stream.rb +54 -0
  40. data/test/test-pollable-output-stream.rb +53 -0
  41. data/test/test-resources.rb +58 -0
  42. metadata +49 -107
  43. data/README +0 -34
  44. data/ext/gio2/depend +0 -11
  45. data/ext/gio2/gio2.def +0 -2
  46. data/ext/gio2/gio2.h +0 -30
  47. data/ext/gio2/rbgio.c +0 -133
  48. data/ext/gio2/rbgio2.h +0 -158
  49. data/ext/gio2/rbgio2conversions.h +0 -154
  50. data/ext/gio2/rbgio2private.h +0 -148
  51. data/ext/gio2/rbgioappinfo.c +0 -317
  52. data/ext/gio2/rbgioapplaunchcontext.c +0 -81
  53. data/ext/gio2/rbgioasyncinitable.c +0 -246
  54. data/ext/gio2/rbgioasyncresult.c +0 -41
  55. data/ext/gio2/rbgiobufferedinputstream.c +0 -167
  56. data/ext/gio2/rbgiobufferedoutputstream.c +0 -50
  57. data/ext/gio2/rbgiocancellable.c +0 -180
  58. data/ext/gio2/rbgiocharsetconverter.c +0 -57
  59. data/ext/gio2/rbgiocontenttype.c +0 -131
  60. data/ext/gio2/rbgioconverter.c +0 -113
  61. data/ext/gio2/rbgioconverterinputstream.c +0 -43
  62. data/ext/gio2/rbgioconverteroutputstream.c +0 -43
  63. data/ext/gio2/rbgiodatainputstream.c +0 -309
  64. data/ext/gio2/rbgiodataoutputstream.c +0 -186
  65. data/ext/gio2/rbgiodesktopappinfo.c +0 -87
  66. data/ext/gio2/rbgiodrive.c +0 -266
  67. data/ext/gio2/rbgioemblem.c +0 -52
  68. data/ext/gio2/rbgioemblemedicon.c +0 -65
  69. data/ext/gio2/rbgiofile.c +0 -2045
  70. data/ext/gio2/rbgiofileattribute.c +0 -114
  71. data/ext/gio2/rbgiofileattributeinfo.c +0 -86
  72. data/ext/gio2/rbgiofileattributeinfolist.c +0 -108
  73. data/ext/gio2/rbgiofileattributematcher.c +0 -95
  74. data/ext/gio2/rbgiofiledescriptorbased.c +0 -45
  75. data/ext/gio2/rbgiofileenumerator.c +0 -166
  76. data/ext/gio2/rbgiofileicon.c +0 -41
  77. data/ext/gio2/rbgiofileinfo.c +0 -617
  78. data/ext/gio2/rbgiofileinputstream.c +0 -91
  79. data/ext/gio2/rbgiofileiostream.c +0 -98
  80. data/ext/gio2/rbgiofilemonitor.c +0 -46
  81. data/ext/gio2/rbgiofilenamecompleter.c +0 -73
  82. data/ext/gio2/rbgiofileoutputstream.c +0 -98
  83. data/ext/gio2/rbgiofilterinputstream.c +0 -28
  84. data/ext/gio2/rbgioicon.c +0 -69
  85. data/ext/gio2/rbgioinetaddress.c +0 -118
  86. data/ext/gio2/rbgioinetsocketaddress.c +0 -41
  87. data/ext/gio2/rbgioinitable.c +0 -199
  88. data/ext/gio2/rbgioinputstream.c +0 -341
  89. data/ext/gio2/rbgioio.c +0 -73
  90. data/ext/gio2/rbgioiomodule.c +0 -45
  91. data/ext/gio2/rbgioiomodules.c +0 -47
  92. data/ext/gio2/rbgioioscheduler.c +0 -102
  93. data/ext/gio2/rbgioioschedulerjob.c +0 -121
  94. data/ext/gio2/rbgioiostream.c +0 -107
  95. data/ext/gio2/rbgioloadableicon.c +0 -92
  96. data/ext/gio2/rbgiomemoryinputstream.c +0 -67
  97. data/ext/gio2/rbgiomemoryoutputstream.c +0 -44
  98. data/ext/gio2/rbgiomount.c +0 -286
  99. data/ext/gio2/rbgiomountoperation.c +0 -53
  100. data/ext/gio2/rbgionetworkaddress.c +0 -59
  101. data/ext/gio2/rbgionetworkservice.c +0 -45
  102. data/ext/gio2/rbgiooutputstream.c +0 -331
  103. data/ext/gio2/rbgioresolver.c +0 -230
  104. data/ext/gio2/rbgioseekable.c +0 -91
  105. data/ext/gio2/rbgiosimpleasyncresult.c +0 -152
  106. data/ext/gio2/rbgiosocket.c +0 -390
  107. data/ext/gio2/rbgiosocketaddress.c +0 -34
  108. data/ext/gio2/rbgiosocketaddressenumerator.c +0 -83
  109. data/ext/gio2/rbgiosocketclient.c +0 -207
  110. data/ext/gio2/rbgiosocketconnectable.c +0 -41
  111. data/ext/gio2/rbgiosocketconnection.c +0 -66
  112. data/ext/gio2/rbgiosocketconnectionfactory.c +0 -39
  113. data/ext/gio2/rbgiosocketcontrolmessage.c +0 -82
  114. data/ext/gio2/rbgiosocketlistener.c +0 -246
  115. data/ext/gio2/rbgiosocketservice.c +0 -66
  116. data/ext/gio2/rbgiosrvtarget.c +0 -76
  117. data/ext/gio2/rbgiotcpconnection.c +0 -28
  118. data/ext/gio2/rbgiothemedicon.c +0 -83
  119. data/ext/gio2/rbgiothreadedsocketservice.c +0 -43
  120. data/ext/gio2/rbgiotlscertificate.c +0 -89
  121. data/ext/gio2/rbgiounixconnection.c +0 -71
  122. data/ext/gio2/rbgiounixfdlist.c +0 -115
  123. data/ext/gio2/rbgiounixfdmessage.c +0 -74
  124. data/ext/gio2/rbgiounixinputstream.c +0 -51
  125. data/ext/gio2/rbgiounixmount.c +0 -164
  126. data/ext/gio2/rbgiounixmountmonitor.c +0 -65
  127. data/ext/gio2/rbgiounixmountpoint.c +0 -136
  128. data/ext/gio2/rbgiounixmountpoints.c +0 -58
  129. data/ext/gio2/rbgiounixmounts.c +0 -58
  130. data/ext/gio2/rbgiounixoutputstream.c +0 -51
  131. data/ext/gio2/rbgiounixsocketaddress.c +0 -69
  132. data/ext/gio2/rbgiovfs.c +0 -84
  133. data/ext/gio2/rbgiovolume.c +0 -193
  134. data/ext/gio2/rbgiovolumemonitor.c +0 -77
  135. data/ext/gio2/rbgiozlibcompressor.c +0 -52
  136. data/ext/gio2/rbgiozlibdecompressor.c +0 -45
  137. data/ext/gio2/util.c +0 -303
  138. data/test/test_bufferedinputstream.rb +0 -9
  139. data/test/test_charsetconverter.rb +0 -9
  140. data/test/test_datainputstream.rb +0 -7
  141. data/test/test_fileenumerator.rb +0 -8
  142. data/test/test_filemonitor.rb +0 -17
  143. data/test/test_inetaddress.rb +0 -8
@@ -1,286 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
5
- *
6
- * This library is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU Lesser General Public
8
- * License as published by the Free Software Foundation; either
9
- * version 2.1 of the License, or (at your option) any later version.
10
- *
11
- * This library is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public
17
- * License along with this library; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
- * MA 02110-1301 USA
20
- */
21
-
22
- #include "rbgio2private.h"
23
-
24
- #define RG_TARGET_NAMESPACE mMount
25
- #define _SELF(value) RVAL2GMOUNT(value)
26
-
27
- static VALUE
28
- rg_name(VALUE self)
29
- {
30
- return CSTR2RVAL_FREE(g_mount_get_name(_SELF(self)));
31
- }
32
-
33
- static VALUE
34
- rg_uuid(VALUE self)
35
- {
36
- return CSTR2RVAL_FREE(g_mount_get_uuid(_SELF(self)));
37
- }
38
-
39
- static VALUE
40
- rg_icon(VALUE self)
41
- {
42
- return GOBJ2RVAL_UNREF(g_mount_get_icon(_SELF(self)));
43
- }
44
-
45
- static VALUE
46
- rg_drive(VALUE self)
47
- {
48
- return GOBJ2RVAL_UNREF(g_mount_get_drive(_SELF(self)));
49
- }
50
-
51
- static VALUE
52
- rg_root(VALUE self)
53
- {
54
- return GOBJ2RVAL_UNREF(g_mount_get_root(_SELF(self)));
55
- }
56
-
57
- static VALUE
58
- rg_volume(VALUE self)
59
- {
60
- return GOBJ2RVAL_UNREF(g_mount_get_volume(_SELF(self)));
61
- }
62
-
63
- static VALUE
64
- rg_default_location(VALUE self)
65
- {
66
- return GOBJ2RVAL_UNREF(g_mount_get_default_location(_SELF(self)));
67
- }
68
-
69
- static VALUE
70
- rg_can_unmount_p(VALUE self)
71
- {
72
- return CBOOL2RVAL(g_mount_can_unmount(_SELF(self)));
73
- }
74
-
75
- typedef void (*UnmountEjectMethod)(GMount *,
76
- GMountUnmountFlags,
77
- GMountOperation *,
78
- GCancellable *,
79
- GAsyncReadyCallback,
80
- gpointer);
81
-
82
- static VALUE
83
- unmount_eject_method(UnmountEjectMethod method, int argc, VALUE *argv, VALUE self)
84
- {
85
- VALUE rbflags, rbmount_operation, rbcancellable, block;
86
- GMountUnmountFlags flags;
87
- GMountOperation *mount_operation;
88
- GCancellable *cancellable;
89
-
90
- rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block);
91
- flags = RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(rbflags);
92
- mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation);
93
- cancellable = RVAL2GCANCELLABLE(rbcancellable);
94
- SAVE_BLOCK(block);
95
- method(_SELF(self),
96
- flags,
97
- mount_operation,
98
- cancellable,
99
- rbgio_async_ready_callback,
100
- (gpointer)block);
101
-
102
- return self;
103
- }
104
-
105
- static VALUE
106
- rg_unmount_with_operation(int argc, VALUE *argv, VALUE self)
107
- {
108
- return unmount_eject_method(g_mount_unmount_with_operation, argc, argv, self);
109
- }
110
-
111
- typedef gboolean (*BooleanFinishMethod)(GMount *,
112
- GAsyncResult *,
113
- GError **);
114
-
115
- static VALUE
116
- boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result)
117
- {
118
- GError *error = NULL;
119
-
120
- if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error))
121
- rbgio_raise_error(error);
122
-
123
- return self;
124
- }
125
-
126
- static VALUE
127
- rg_unmount_with_operation_finish(VALUE self, VALUE result)
128
- {
129
- return boolean_finish_method(g_mount_unmount_with_operation_finish, self, result);
130
- }
131
-
132
- static VALUE
133
- rg_remount(int argc, VALUE *argv, VALUE self)
134
- {
135
- VALUE rbflags, rbmount_operation, rbcancellable, block;
136
- GMountMountFlags flags;
137
- GMountOperation *mount_operation;
138
- GCancellable *cancellable;
139
-
140
- rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block);
141
- flags = RVAL2GMOUNTMOUNTFLAGSDEFAULT(rbflags);
142
- mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation);
143
- cancellable = RVAL2GCANCELLABLE(rbcancellable);
144
- SAVE_BLOCK(block);
145
- g_mount_remount(_SELF(self),
146
- flags,
147
- mount_operation,
148
- cancellable,
149
- rbgio_async_ready_callback,
150
- (gpointer)block);
151
-
152
- return self;
153
- }
154
-
155
- static VALUE
156
- rg_remount_finish(VALUE self, VALUE result)
157
- {
158
- return boolean_finish_method(g_mount_remount_finish, self, result);
159
- }
160
-
161
- static VALUE
162
- rg_can_eject_p(VALUE self)
163
- {
164
- return CBOOL2RVAL(g_mount_can_eject(_SELF(self)));
165
- }
166
-
167
- static VALUE
168
- rg_eject_with_operation(int argc, VALUE *argv, VALUE self)
169
- {
170
- return unmount_eject_method(g_mount_eject_with_operation, argc, argv, self);
171
- }
172
-
173
- static VALUE
174
- rg_eject_with_operation_finish(VALUE self, VALUE result)
175
- {
176
- return boolean_finish_method(g_mount_eject_with_operation_finish, self, result);
177
- }
178
-
179
- static VALUE
180
- rg_guess_content_type(int argc, VALUE *argv, VALUE self)
181
- {
182
- VALUE rbforce_rescan, rbcancellable, block;
183
- gboolean force_rescan;
184
- GCancellable *cancellable;
185
-
186
- rb_scan_args(argc, argv, "02&", &rbforce_rescan, &rbcancellable, &block);
187
- force_rescan = RVAL2CBOOL(rbforce_rescan);
188
- cancellable = RVAL2GCANCELLABLE(rbcancellable);
189
- SAVE_BLOCK(block);
190
- g_mount_guess_content_type(_SELF(self),
191
- force_rescan,
192
- cancellable,
193
- rbgio_async_ready_callback,
194
- (gpointer)block);
195
-
196
- return self;
197
- }
198
-
199
- static VALUE
200
- rg_guess_content_type_finish(VALUE self, VALUE result)
201
- {
202
- GError *error = NULL;
203
- gchar **content_types;
204
-
205
- content_types = g_mount_guess_content_type_finish(_SELF(self),
206
- RVAL2GASYNCRESULT(result),
207
- &error);
208
- if (content_types == NULL)
209
- rbgio_raise_error(error);
210
-
211
- return STRV2RVAL_FREE(content_types);
212
- }
213
-
214
- static VALUE
215
- rg_guess_content_type_sync(int argc, VALUE *argv, VALUE self)
216
- {
217
- VALUE force_rescan, cancellable;
218
- GError *error = NULL;
219
- gchar **content_types;
220
-
221
- rb_scan_args(argc, argv, "02", &force_rescan, &cancellable);
222
- content_types = g_mount_guess_content_type_sync(_SELF(self),
223
- RVAL2CBOOL(force_rescan),
224
- RVAL2GCANCELLABLE(cancellable),
225
- &error);
226
- if (content_types == NULL)
227
- rbgio_raise_error(error);
228
-
229
- return STRV2RVAL_FREE(content_types);
230
- }
231
-
232
- static VALUE
233
- rg_shadowed_p(VALUE self)
234
- {
235
- return CBOOL2RVAL(g_mount_is_shadowed(_SELF(self)));
236
- }
237
-
238
- static VALUE
239
- rg_shadow(VALUE self)
240
- {
241
- g_mount_shadow(_SELF(self));
242
-
243
- return self;
244
- }
245
-
246
- static VALUE
247
- rg_unshadow(VALUE self)
248
- {
249
- g_mount_unshadow(_SELF(self));
250
-
251
- return self;
252
- }
253
-
254
- void
255
- Init_gmount(VALUE mGio)
256
- {
257
- VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_MOUNT, "Mount", mGio);
258
-
259
- G_DEF_CLASS(G_TYPE_MOUNT_MOUNT_FLAGS, "MountFlags", RG_TARGET_NAMESPACE);
260
- G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_MOUNT_MOUNT_FLAGS, "G_MOUNT_");
261
-
262
- G_DEF_CLASS(G_TYPE_MOUNT_UNMOUNT_FLAGS, "UnmountFlags", RG_TARGET_NAMESPACE);
263
- G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_MOUNT_UNMOUNT_FLAGS, "G_MOUNT_");
264
-
265
- RG_DEF_METHOD(name, 0);
266
- RG_DEF_METHOD(uuid, 0);
267
- RG_DEF_METHOD(icon, 0);
268
- RG_DEF_METHOD(drive, 0);
269
- RG_DEF_METHOD(root, 0);
270
- RG_DEF_METHOD(volume, 0);
271
- RG_DEF_METHOD(default_location, 0);
272
- RG_DEF_METHOD_P(can_unmount, 0);
273
- RG_DEF_METHOD(unmount_with_operation, -1);
274
- RG_DEF_METHOD(unmount_with_operation_finish, 1);
275
- RG_DEF_METHOD(remount, -1);
276
- RG_DEF_METHOD(remount_finish, 1);
277
- RG_DEF_METHOD_P(can_eject, 0);
278
- RG_DEF_METHOD(eject_with_operation, -1);
279
- RG_DEF_METHOD(eject_with_operation_finish, 1);
280
- RG_DEF_METHOD(guess_content_type, -1);
281
- RG_DEF_METHOD(guess_content_type_finish, 1);
282
- RG_DEF_METHOD(guess_content_type_sync, -1);
283
- RG_DEF_METHOD_P(shadowed, 0);
284
- RG_DEF_METHOD(shadow, 0);
285
- RG_DEF_METHOD(unshadow, 0);
286
- }
@@ -1,53 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
5
- *
6
- * This library is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU Lesser General Public
8
- * License as published by the Free Software Foundation; either
9
- * version 2.1 of the License, or (at your option) any later version.
10
- *
11
- * This library is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public
17
- * License along with this library; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
- * MA 02110-1301 USA
20
- */
21
-
22
- #include "rbgio2private.h"
23
-
24
- #define RG_TARGET_NAMESPACE cMountOperation
25
- #define _SELF(value) RVAL2GMOUNTOPERATION(value)
26
-
27
- static VALUE
28
- rg_initialize(VALUE self)
29
- {
30
- G_INITIALIZE(self, g_mount_operation_new());
31
-
32
- return Qnil;
33
- }
34
-
35
- static VALUE
36
- rg_reply(VALUE self, VALUE value)
37
- {
38
- g_mount_operation_reply(_SELF(self), RVAL2GMOUNTOPERATIONRESULT(value));
39
-
40
- return self;
41
- }
42
-
43
- void
44
- Init_gmountoperation(VALUE mGio)
45
- {
46
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MOUNT_OPERATION, "MountOperation", mGio);
47
-
48
- G_DEF_CLASS(G_TYPE_MOUNT_OPERATION_RESULT, "Result", RG_TARGET_NAMESPACE);
49
- G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_MOUNT_OPERATION_RESULT, "G_MOUNT_OPERATION_");
50
-
51
- RG_DEF_METHOD(initialize, 0);
52
- RG_DEF_METHOD(reply, 1);
53
- }
@@ -1,59 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
5
- *
6
- * This library is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU Lesser General Public
8
- * License as published by the Free Software Foundation; either
9
- * version 2.1 of the License, or (at your option) any later version.
10
- *
11
- * This library is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public
17
- * License along with this library; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
- * MA 02110-1301 USA
20
- */
21
-
22
- #include "rbgio2private.h"
23
-
24
- #define RG_TARGET_NAMESPACE cNetworkAddress
25
- #define _SELF(value) RVAL2GNETWORKADDRESS(value)
26
-
27
- static VALUE
28
- rg_initialize(VALUE self, VALUE hostname, VALUE port)
29
- {
30
- G_INITIALIZE(self, g_network_address_new(RVAL2CSTR(hostname),
31
- RVAL2GUINT16(port)));
32
-
33
- return Qnil;
34
- }
35
-
36
- static VALUE
37
- rg_s_parse(G_GNUC_UNUSED VALUE self, VALUE host_and_port, VALUE default_port)
38
- {
39
- GError *error = NULL;
40
- GSocketConnectable *connectable;
41
-
42
- connectable = g_network_address_parse(RVAL2CSTR(host_and_port),
43
- RVAL2GUINT16(default_port),
44
- &error);
45
- if (connectable == NULL)
46
- rbgio_raise_error(error);
47
-
48
- return GOBJ2RVAL_UNREF(connectable);
49
- }
50
-
51
- void
52
- Init_gnetworkaddress(VALUE mGio)
53
- {
54
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_NETWORK_ADDRESS, "NetworkAddress", mGio);
55
-
56
- RG_DEF_SMETHOD(parse, 2);
57
-
58
- RG_DEF_METHOD(initialize, 2);
59
- }
@@ -1,45 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
5
- *
6
- * This library is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU Lesser General Public
8
- * License as published by the Free Software Foundation; either
9
- * version 2.1 of the License, or (at your option) any later version.
10
- *
11
- * This library is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public
17
- * License along with this library; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
- * MA 02110-1301 USA
20
- */
21
-
22
- #include "rbgio2private.h"
23
-
24
- #define RG_TARGET_NAMESPACE cNetworkService
25
- #define _SELF(value) RVAL2GNETWORKSERVICE(value)
26
-
27
- static VALUE
28
- rg_initialize(VALUE self, VALUE service, VALUE protocol, VALUE domain)
29
- {
30
- /* TODO: If these are infected, so should they be when returned. How
31
- * do we deal with that? */
32
- G_INITIALIZE(self, g_network_service_new(RVAL2CSTR(service),
33
- RVAL2CSTR(protocol),
34
- RVAL2CSTR(domain)));
35
-
36
- return Qnil;
37
- }
38
-
39
- void
40
- Init_gnetworkservice(VALUE mGio)
41
- {
42
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_NETWORK_SERVICE, "NetworkService", mGio);
43
-
44
- RG_DEF_METHOD(initialize, 3);
45
- }