glib2 1.1.2-x86-mingw32 → 1.1.3-x86-mingw32
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/ext/glib2/rbglib.c +6 -9
- data/ext/glib2/rbglib.h +1 -1
- data/ext/glib2/rbglib_convert.c +17 -17
- data/ext/glib2/rbglib_fileutils.c +1 -1
- data/ext/glib2/rbglib_i18n.c +2 -2
- data/ext/glib2/rbglib_iochannel.c +0 -2
- data/ext/glib2/rbglib_maincontext.c +14 -16
- data/ext/glib2/rbglib_messages.c +12 -14
- data/ext/glib2/rbglib_pollfd.c +0 -3
- data/ext/glib2/rbglib_shell.c +6 -6
- data/ext/glib2/rbglib_source.c +0 -2
- data/ext/glib2/rbglib_spawn.c +12 -12
- data/ext/glib2/rbglib_ucs4.c +4 -4
- data/ext/glib2/rbglib_unichar.c +42 -42
- data/ext/glib2/rbglib_unicode.c +1 -1
- data/ext/glib2/rbglib_utf16.c +4 -4
- data/ext/glib2/rbglib_utf8.c +24 -24
- data/ext/glib2/rbglib_utils.c +63 -63
- data/ext/glib2/rbglib_win32.c +18 -18
- data/ext/glib2/rbgobj_boxed.c +3 -3
- data/ext/glib2/rbgobj_enums.c +2 -2
- data/ext/glib2/rbgobj_flags.c +6 -6
- data/ext/glib2/rbgobj_object.c +5 -5
- data/ext/glib2/rbgobj_param.c +7 -7
- data/ext/glib2/rbgobj_paramspecs.c +17 -17
- data/ext/glib2/rbgobj_signal.c +27 -26
- data/ext/glib2/rbgobj_typeinterface.c +2 -2
- data/ext/glib2/rbgobj_valuetypes.c +6 -6
- data/ext/glib2/rbgutil.h +2 -2
- data/lib/1.8/glib2.so +0 -0
- data/lib/1.9/glib2.so +0 -0
- data/lib/glib-mkenums.rb +1 -1
- data/lib/gnome2-raketask.rb +2 -3
- data/test/test_unicode.rb +14 -2
- metadata +5 -5
data/ext/glib2/rbglib_ucs4.c
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
#define RG_TARGET_NAMESPACE mUCS4
|
26
26
|
|
27
27
|
static VALUE
|
28
|
-
|
28
|
+
rg_s_to_utf16(G_GNUC_UNUSED VALUE self, VALUE rb_ucs4)
|
29
29
|
{
|
30
30
|
VALUE result;
|
31
31
|
gunichar *ucs4;
|
@@ -48,7 +48,7 @@ rg_m_to_utf16(G_GNUC_UNUSED VALUE self, VALUE rb_ucs4)
|
|
48
48
|
}
|
49
49
|
|
50
50
|
static VALUE
|
51
|
-
|
51
|
+
rg_s_to_utf8(G_GNUC_UNUSED VALUE self, VALUE rb_ucs4)
|
52
52
|
{
|
53
53
|
VALUE result;
|
54
54
|
gunichar *ucs4;
|
@@ -74,6 +74,6 @@ Init_glib_ucs4(void)
|
|
74
74
|
{
|
75
75
|
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "UCS4");
|
76
76
|
|
77
|
-
|
78
|
-
|
77
|
+
RG_DEF_SMETHOD(to_utf16, 1);
|
78
|
+
RG_DEF_SMETHOD(to_utf8, 1);
|
79
79
|
}
|
data/ext/glib2/rbglib_unichar.c
CHANGED
@@ -52,44 +52,44 @@ DEF_IS_UNICHAR(wide_cjk)
|
|
52
52
|
#undef DEF_IS_UNICHAR
|
53
53
|
|
54
54
|
static VALUE
|
55
|
-
|
55
|
+
rg_s_to_upper(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
56
56
|
{
|
57
57
|
return UINT2NUM(g_unichar_toupper(NUM2UINT(unichar)));
|
58
58
|
}
|
59
59
|
|
60
60
|
static VALUE
|
61
|
-
|
61
|
+
rg_s_to_lower(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
62
62
|
{
|
63
63
|
return UINT2NUM(g_unichar_tolower(NUM2UINT(unichar)));
|
64
64
|
}
|
65
65
|
|
66
66
|
static VALUE
|
67
|
-
|
67
|
+
rg_s_to_title(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
68
68
|
{
|
69
69
|
return UINT2NUM(g_unichar_totitle(NUM2UINT(unichar)));
|
70
70
|
}
|
71
71
|
|
72
72
|
static VALUE
|
73
|
-
|
73
|
+
rg_s_digit_value(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
74
74
|
{
|
75
75
|
return INT2NUM(g_unichar_digit_value(NUM2UINT(unichar)));
|
76
76
|
}
|
77
77
|
|
78
78
|
static VALUE
|
79
|
-
|
79
|
+
rg_s_xdigit_value(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
80
80
|
{
|
81
81
|
return INT2NUM(g_unichar_xdigit_value(NUM2UINT(unichar)));
|
82
82
|
}
|
83
83
|
|
84
84
|
static VALUE
|
85
|
-
|
85
|
+
rg_s_type(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
86
86
|
{
|
87
87
|
return GENUM2RVAL(g_unichar_type(NUM2UINT(unichar)),
|
88
88
|
G_TYPE_UNICODE_TYPE);
|
89
89
|
}
|
90
90
|
|
91
91
|
static VALUE
|
92
|
-
|
92
|
+
rg_s_break_type(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
93
93
|
{
|
94
94
|
return GENUM2RVAL(g_unichar_break_type(NUM2UINT(unichar)),
|
95
95
|
G_TYPE_UNICODE_BREAK_TYPE);
|
@@ -97,7 +97,7 @@ rg_m_break_type(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
|
97
97
|
|
98
98
|
#if GLIB_CHECK_VERSION(2,4,0)
|
99
99
|
static VALUE
|
100
|
-
|
100
|
+
rg_s_get_mirror_char(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
101
101
|
{
|
102
102
|
gunichar mirrored_char;
|
103
103
|
|
@@ -111,33 +111,33 @@ rg_m_get_mirror_char(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
|
111
111
|
|
112
112
|
#if GLIB_CHECK_VERSION(2,14,0)
|
113
113
|
static VALUE
|
114
|
-
|
114
|
+
rg_s_combining_class(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
115
115
|
{
|
116
116
|
return INT2NUM(g_unichar_combining_class(NUM2UINT(unichar)));
|
117
117
|
}
|
118
118
|
|
119
119
|
static VALUE
|
120
|
-
|
120
|
+
rg_s_get_script(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
121
121
|
{
|
122
122
|
return GENUM2RVAL(g_unichar_get_script(NUM2UINT(unichar)),
|
123
123
|
G_TYPE_UNICODE_SCRIPT);
|
124
124
|
}
|
125
125
|
|
126
126
|
static VALUE
|
127
|
-
|
127
|
+
rg_s_mark_p(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
128
128
|
{
|
129
129
|
return CBOOL2RVAL(g_unichar_ismark(NUM2UINT(unichar)));
|
130
130
|
}
|
131
131
|
|
132
132
|
static VALUE
|
133
|
-
|
133
|
+
rg_s_zero_width_p(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
134
134
|
{
|
135
135
|
return CBOOL2RVAL(g_unichar_iszerowidth(NUM2UINT(unichar)));
|
136
136
|
}
|
137
137
|
#endif
|
138
138
|
|
139
139
|
static VALUE
|
140
|
-
|
140
|
+
rg_s_to_utf8(G_GNUC_UNUSED VALUE self, VALUE unichar)
|
141
141
|
{
|
142
142
|
gchar utf8[6];
|
143
143
|
gint len;
|
@@ -151,59 +151,59 @@ Init_glib_unichar(void)
|
|
151
151
|
{
|
152
152
|
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "UniChar");
|
153
153
|
|
154
|
-
|
154
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "alnum?",
|
155
155
|
rbglib_m_unichar_isalnum, 1);
|
156
|
-
|
156
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "alpha?",
|
157
157
|
rbglib_m_unichar_isalpha, 1);
|
158
|
-
|
158
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "cntrl?",
|
159
159
|
rbglib_m_unichar_iscntrl, 1);
|
160
|
-
|
160
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "digit?",
|
161
161
|
rbglib_m_unichar_isdigit, 1);
|
162
|
-
|
162
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "graph?",
|
163
163
|
rbglib_m_unichar_isgraph, 1);
|
164
|
-
|
164
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "lower?",
|
165
165
|
rbglib_m_unichar_islower, 1);
|
166
|
-
|
166
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "print?",
|
167
167
|
rbglib_m_unichar_isprint, 1);
|
168
|
-
|
168
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "punct?",
|
169
169
|
rbglib_m_unichar_ispunct, 1);
|
170
|
-
|
170
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "space?",
|
171
171
|
rbglib_m_unichar_isspace, 1);
|
172
|
-
|
172
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "upper?",
|
173
173
|
rbglib_m_unichar_isupper, 1);
|
174
|
-
|
174
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "xdigit?",
|
175
175
|
rbglib_m_unichar_isxdigit, 1);
|
176
|
-
|
176
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "title?",
|
177
177
|
rbglib_m_unichar_istitle, 1);
|
178
|
-
|
178
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "defined?",
|
179
179
|
rbglib_m_unichar_isdefined, 1);
|
180
|
-
|
180
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "wide?",
|
181
181
|
rbglib_m_unichar_iswide, 1);
|
182
182
|
#if GLIB_CHECK_VERSION(2,12,0)
|
183
|
-
|
183
|
+
rbg_define_singleton_method(RG_TARGET_NAMESPACE, "wide_cjk?",
|
184
184
|
rbglib_m_unichar_iswide_cjk, 1);
|
185
185
|
#endif
|
186
186
|
|
187
|
-
|
188
|
-
|
189
|
-
|
187
|
+
RG_DEF_SMETHOD(to_upper, 1);
|
188
|
+
RG_DEF_SMETHOD(to_lower, 1);
|
189
|
+
RG_DEF_SMETHOD(to_title, 1);
|
190
190
|
|
191
|
-
|
192
|
-
|
191
|
+
RG_DEF_SMETHOD(digit_value, 1);
|
192
|
+
RG_DEF_SMETHOD(xdigit_value, 1);
|
193
193
|
|
194
|
-
|
195
|
-
|
194
|
+
RG_DEF_SMETHOD(type, 1);
|
195
|
+
RG_DEF_SMETHOD(break_type, 1);
|
196
196
|
|
197
197
|
#if GLIB_CHECK_VERSION(2,4,0)
|
198
|
-
|
198
|
+
RG_DEF_SMETHOD(get_mirror_char, 1);
|
199
199
|
#endif
|
200
200
|
|
201
201
|
#if GLIB_CHECK_VERSION(2,14,0)
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
202
|
+
RG_DEF_SMETHOD(combining_class, 1);
|
203
|
+
RG_DEF_SMETHOD(get_script, 1);
|
204
|
+
RG_DEF_SMETHOD_P(mark, 1);
|
205
|
+
RG_DEF_SMETHOD_P(zero_width, 1);
|
206
206
|
#endif
|
207
207
|
|
208
|
-
|
209
|
-
}
|
208
|
+
RG_DEF_SMETHOD(to_utf8, 1);
|
209
|
+
}
|
data/ext/glib2/rbglib_unicode.c
CHANGED
@@ -83,7 +83,7 @@ Init_glib_unicode(void)
|
|
83
83
|
|
84
84
|
G_DEF_CLASS(G_TYPE_NORMALIZE_MODE, "NormalizeMode", mGLib);
|
85
85
|
|
86
|
-
|
86
|
+
rbg_define_singleton_method(mGLib, "charset", rbglib_m_charset, 0);
|
87
87
|
|
88
88
|
RG_DEF_SMETHOD(canonical_ordering, 1);
|
89
89
|
RG_DEF_SMETHOD(canonical_decomposition, 1);
|
data/ext/glib2/rbglib_utf16.c
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
#define RG_TARGET_NAMESPACE mUTF16
|
26
26
|
|
27
27
|
static VALUE
|
28
|
-
|
28
|
+
rg_s_to_ucs4(G_GNUC_UNUSED VALUE self, VALUE rb_utf16)
|
29
29
|
{
|
30
30
|
VALUE result;
|
31
31
|
gunichar *ucs4;
|
@@ -47,7 +47,7 @@ rg_m_to_ucs4(G_GNUC_UNUSED VALUE self, VALUE rb_utf16)
|
|
47
47
|
}
|
48
48
|
|
49
49
|
static VALUE
|
50
|
-
|
50
|
+
rg_s_to_utf8(G_GNUC_UNUSED VALUE self, VALUE rb_utf16)
|
51
51
|
{
|
52
52
|
VALUE result;
|
53
53
|
gchar *utf8;
|
@@ -73,6 +73,6 @@ Init_glib_utf16(void)
|
|
73
73
|
{
|
74
74
|
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "UTF16");
|
75
75
|
|
76
|
-
|
77
|
-
|
76
|
+
RG_DEF_SMETHOD(to_ucs4, 1);
|
77
|
+
RG_DEF_SMETHOD(to_utf8, 1);
|
78
78
|
}
|
data/ext/glib2/rbglib_utf8.c
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
#define RG_TARGET_NAMESPACE mUTF8
|
26
26
|
|
27
27
|
static VALUE
|
28
|
-
|
28
|
+
rg_s_get_char(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
29
29
|
{
|
30
30
|
VALUE utf8, validate;
|
31
31
|
gunichar result;
|
@@ -49,7 +49,7 @@ rg_m_get_char(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
|
49
49
|
}
|
50
50
|
|
51
51
|
static VALUE
|
52
|
-
|
52
|
+
rg_s_size(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
53
53
|
{
|
54
54
|
gchar *utf8;
|
55
55
|
|
@@ -58,7 +58,7 @@ rg_m_size(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
|
58
58
|
}
|
59
59
|
|
60
60
|
static VALUE
|
61
|
-
|
61
|
+
rg_s_reverse(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
62
62
|
{
|
63
63
|
VALUE result;
|
64
64
|
gchar *utf8, *reversed_utf8;
|
@@ -71,7 +71,7 @@ rg_m_reverse(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
|
71
71
|
}
|
72
72
|
|
73
73
|
static VALUE
|
74
|
-
|
74
|
+
rg_s_validate(G_GNUC_UNUSED VALUE self, VALUE str)
|
75
75
|
{
|
76
76
|
StringValue(str);
|
77
77
|
return CBOOL2RVAL(g_utf8_validate(RSTRING_PTR(str), RSTRING_LEN(str),
|
@@ -79,7 +79,7 @@ rg_m_validate(G_GNUC_UNUSED VALUE self, VALUE str)
|
|
79
79
|
}
|
80
80
|
|
81
81
|
static VALUE
|
82
|
-
|
82
|
+
rg_s_upcase(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
83
83
|
{
|
84
84
|
VALUE result;
|
85
85
|
gchar *utf8, *upcased_utf8;
|
@@ -92,7 +92,7 @@ rg_m_upcase(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
|
92
92
|
}
|
93
93
|
|
94
94
|
static VALUE
|
95
|
-
|
95
|
+
rg_s_downcase(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
96
96
|
{
|
97
97
|
VALUE result;
|
98
98
|
gchar *utf8, *downcased_utf8;
|
@@ -105,7 +105,7 @@ rg_m_downcase(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
|
105
105
|
}
|
106
106
|
|
107
107
|
static VALUE
|
108
|
-
|
108
|
+
rg_s_casefold(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
109
109
|
{
|
110
110
|
VALUE result;
|
111
111
|
gchar *utf8, *casefolded_utf8;
|
@@ -118,7 +118,7 @@ rg_m_casefold(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
|
118
118
|
}
|
119
119
|
|
120
120
|
static VALUE
|
121
|
-
|
121
|
+
rg_s_normalize(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
122
122
|
{
|
123
123
|
VALUE rb_utf8, rb_mode, result;
|
124
124
|
gchar *utf8, *normalized_utf8;
|
@@ -137,14 +137,14 @@ rg_m_normalize(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
|
137
137
|
}
|
138
138
|
|
139
139
|
static VALUE
|
140
|
-
|
140
|
+
rg_s_collate(G_GNUC_UNUSED VALUE self, VALUE utf8a, VALUE utf8b)
|
141
141
|
{
|
142
142
|
return INT2NUM(g_utf8_collate(StringValueCStr(utf8a),
|
143
143
|
StringValueCStr(utf8b)));
|
144
144
|
}
|
145
145
|
|
146
146
|
static VALUE
|
147
|
-
|
147
|
+
rg_s_collate_key(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
148
148
|
{
|
149
149
|
VALUE result, rb_utf8, for_filename;
|
150
150
|
gchar *key, *utf8;
|
@@ -167,7 +167,7 @@ rg_m_collate_key(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
|
167
167
|
}
|
168
168
|
|
169
169
|
static VALUE
|
170
|
-
|
170
|
+
rg_s_to_utf16(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
171
171
|
{
|
172
172
|
VALUE result;
|
173
173
|
gchar *utf8;
|
@@ -190,7 +190,7 @@ rg_m_to_utf16(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
|
|
190
190
|
}
|
191
191
|
|
192
192
|
static VALUE
|
193
|
-
|
193
|
+
rg_s_to_ucs4(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
194
194
|
{
|
195
195
|
VALUE result, rb_utf8, is_fast;
|
196
196
|
gchar *utf8;
|
@@ -226,7 +226,7 @@ Init_glib_utf8(void)
|
|
226
226
|
Not implemented.
|
227
227
|
g_utf8_next_char
|
228
228
|
*/
|
229
|
-
|
229
|
+
RG_DEF_SMETHOD(get_char, -1);
|
230
230
|
/*
|
231
231
|
Not implemented.
|
232
232
|
g_utf8_offset_to_pointer
|
@@ -236,24 +236,24 @@ Init_glib_utf8(void)
|
|
236
236
|
g_utf8_find_prev_char
|
237
237
|
g_utf8_prev_char
|
238
238
|
*/
|
239
|
-
|
239
|
+
RG_DEF_SMETHOD(size, 1);
|
240
240
|
/*
|
241
241
|
Not implemented.
|
242
242
|
g_utf8_strncpy
|
243
243
|
g_utf8_strrchr
|
244
244
|
*/
|
245
|
-
|
246
|
-
|
245
|
+
RG_DEF_SMETHOD(reverse, 1);
|
246
|
+
RG_DEF_SMETHOD(validate, 1);
|
247
247
|
|
248
|
-
|
249
|
-
|
250
|
-
|
248
|
+
RG_DEF_SMETHOD(upcase, 1);
|
249
|
+
RG_DEF_SMETHOD(downcase, 1);
|
250
|
+
RG_DEF_SMETHOD(casefold, 1);
|
251
251
|
|
252
|
-
|
252
|
+
RG_DEF_SMETHOD(normalize, -1);
|
253
253
|
|
254
|
-
|
255
|
-
|
254
|
+
RG_DEF_SMETHOD(collate, 2);
|
255
|
+
RG_DEF_SMETHOD(collate_key, -1);
|
256
256
|
|
257
|
-
|
258
|
-
|
257
|
+
RG_DEF_SMETHOD(to_utf16, 1);
|
258
|
+
RG_DEF_SMETHOD(to_ucs4, -1);
|
259
259
|
}
|
data/ext/glib2/rbglib_utils.c
CHANGED
@@ -26,13 +26,13 @@
|
|
26
26
|
|
27
27
|
#if GLIB_CHECK_VERSION(2,2,0)
|
28
28
|
static VALUE
|
29
|
-
|
29
|
+
rg_s_application_name(G_GNUC_UNUSED VALUE self)
|
30
30
|
{
|
31
31
|
return CSTR2RVAL(g_get_application_name());
|
32
32
|
}
|
33
33
|
|
34
34
|
static VALUE
|
35
|
-
|
35
|
+
rg_s_set_application_name(VALUE self, VALUE application_name)
|
36
36
|
{
|
37
37
|
g_set_prgname(RVAL2CSTR_ACCEPT_NIL(application_name));
|
38
38
|
return self;
|
@@ -40,27 +40,27 @@ rg_m_set_application_name(VALUE self, VALUE application_name)
|
|
40
40
|
#endif
|
41
41
|
|
42
42
|
static VALUE
|
43
|
-
|
43
|
+
rg_s_prgname(G_GNUC_UNUSED VALUE self)
|
44
44
|
{
|
45
45
|
return CSTR2RVAL(g_get_prgname());
|
46
46
|
}
|
47
47
|
|
48
48
|
static VALUE
|
49
|
-
|
49
|
+
rg_s_set_prgname(VALUE self, VALUE prgname)
|
50
50
|
{
|
51
51
|
g_set_prgname(RVAL2CSTR_ACCEPT_NIL(prgname));
|
52
52
|
return self;
|
53
53
|
}
|
54
54
|
|
55
55
|
static VALUE
|
56
|
-
|
56
|
+
rg_s_getenv(G_GNUC_UNUSED VALUE self, VALUE variable)
|
57
57
|
{
|
58
58
|
return CSTR2RVAL(g_getenv(RVAL2CSTR(variable)));
|
59
59
|
}
|
60
60
|
|
61
61
|
#if GLIB_CHECK_VERSION(2,4,0)
|
62
62
|
static VALUE
|
63
|
-
|
63
|
+
rg_s_setenv(G_GNUC_UNUSED VALUE self, VALUE variable, VALUE value, VALUE overwrite)
|
64
64
|
{
|
65
65
|
return CBOOL2RVAL(g_setenv(RVAL2CSTR(variable),
|
66
66
|
RVAL2CSTR_ACCEPT_NIL(value),
|
@@ -68,7 +68,7 @@ rg_m_setenv(G_GNUC_UNUSED VALUE self, VALUE variable, VALUE value, VALUE overwri
|
|
68
68
|
}
|
69
69
|
|
70
70
|
static VALUE
|
71
|
-
|
71
|
+
rg_s_unsetenv(VALUE self, VALUE variable)
|
72
72
|
{
|
73
73
|
g_unsetenv(RVAL2CSTR(variable));
|
74
74
|
return self;
|
@@ -78,7 +78,7 @@ rg_m_unsetenv(VALUE self, VALUE variable)
|
|
78
78
|
#if GLIB_CHECK_VERSION(2,8,0)
|
79
79
|
#ifdef HAVE_G_LISTENV
|
80
80
|
static VALUE
|
81
|
-
|
81
|
+
rg_s_listenv(G_GNUC_UNUSED VALUE self)
|
82
82
|
{
|
83
83
|
gchar** c_list;
|
84
84
|
gchar** c_var;
|
@@ -94,51 +94,51 @@ rg_m_listenv(VALUE self)
|
|
94
94
|
#endif
|
95
95
|
|
96
96
|
static VALUE
|
97
|
-
|
97
|
+
rg_s_host_name(G_GNUC_UNUSED VALUE self)
|
98
98
|
{
|
99
99
|
return CSTR2RVAL(g_get_host_name());
|
100
100
|
}
|
101
101
|
#endif
|
102
102
|
|
103
103
|
static VALUE
|
104
|
-
|
104
|
+
rg_s_user_name(G_GNUC_UNUSED VALUE self)
|
105
105
|
{
|
106
106
|
return CSTR2RVAL(g_get_user_name());
|
107
107
|
}
|
108
108
|
|
109
109
|
static VALUE
|
110
|
-
|
110
|
+
rg_s_real_name(G_GNUC_UNUSED VALUE self)
|
111
111
|
{
|
112
112
|
return CSTR2RVAL(g_get_real_name());
|
113
113
|
}
|
114
114
|
|
115
115
|
#if GLIB_CHECK_VERSION(2, 6, 0)
|
116
116
|
static VALUE
|
117
|
-
|
117
|
+
rg_s_user_cache_dir(G_GNUC_UNUSED VALUE self)
|
118
118
|
{
|
119
119
|
return CSTR2RVAL(g_get_user_cache_dir());
|
120
120
|
}
|
121
121
|
|
122
122
|
static VALUE
|
123
|
-
|
123
|
+
rg_s_user_data_dir(G_GNUC_UNUSED VALUE self)
|
124
124
|
{
|
125
125
|
return CSTR2RVAL(g_get_user_data_dir());
|
126
126
|
}
|
127
127
|
|
128
128
|
static VALUE
|
129
|
-
|
129
|
+
rg_s_user_config_dir(G_GNUC_UNUSED VALUE self)
|
130
130
|
{
|
131
131
|
return CSTR2RVAL(g_get_user_config_dir());
|
132
132
|
}
|
133
133
|
|
134
134
|
static VALUE
|
135
|
-
|
135
|
+
rg_s_system_data_dirs(G_GNUC_UNUSED VALUE self)
|
136
136
|
{
|
137
137
|
return STRV2RVAL((const gchar **)g_get_system_data_dirs());
|
138
138
|
}
|
139
139
|
|
140
140
|
static VALUE
|
141
|
-
|
141
|
+
rg_s_system_config_dirs(G_GNUC_UNUSED VALUE self)
|
142
142
|
{
|
143
143
|
return STRV2RVAL((const gchar **)g_get_system_config_dirs());
|
144
144
|
}
|
@@ -146,7 +146,7 @@ rg_m_system_config_dirs(G_GNUC_UNUSED VALUE self)
|
|
146
146
|
|
147
147
|
#if GLIB_CHECK_VERSION(2, 14, 0)
|
148
148
|
static VALUE
|
149
|
-
|
149
|
+
rg_s_get_user_special_dir(G_GNUC_UNUSED VALUE self, VALUE directory)
|
150
150
|
{
|
151
151
|
return CSTR2RVAL(g_get_user_special_dir(RVAL2GENUM(directory,
|
152
152
|
G_TYPE_USER_DIRECTORY)));
|
@@ -154,19 +154,19 @@ rg_m_get_user_special_dir(G_GNUC_UNUSED VALUE self, VALUE directory)
|
|
154
154
|
#endif
|
155
155
|
|
156
156
|
static VALUE
|
157
|
-
|
157
|
+
rg_s_home_dir(G_GNUC_UNUSED VALUE self)
|
158
158
|
{
|
159
159
|
return CSTR2RVAL(g_get_home_dir());
|
160
160
|
}
|
161
161
|
|
162
162
|
static VALUE
|
163
|
-
|
163
|
+
rg_s_tmp_dir(G_GNUC_UNUSED VALUE self)
|
164
164
|
{
|
165
165
|
return CSTR2RVAL(g_get_tmp_dir());
|
166
166
|
}
|
167
167
|
|
168
168
|
static VALUE
|
169
|
-
|
169
|
+
rg_s_current_dir(G_GNUC_UNUSED VALUE self)
|
170
170
|
{
|
171
171
|
gchar* dir = g_get_current_dir();
|
172
172
|
VALUE ret = CSTR2RVAL(dir);
|
@@ -175,25 +175,25 @@ rg_m_current_dir(G_GNUC_UNUSED VALUE self)
|
|
175
175
|
}
|
176
176
|
|
177
177
|
static VALUE
|
178
|
-
|
178
|
+
rg_s_path_is_absolute_p(G_GNUC_UNUSED VALUE self, VALUE fname)
|
179
179
|
{
|
180
180
|
return CBOOL2RVAL(g_path_is_absolute(RVAL2CSTR(fname)));
|
181
181
|
}
|
182
182
|
|
183
183
|
static VALUE
|
184
|
-
|
184
|
+
rg_s_path_skip_root(G_GNUC_UNUSED VALUE self, VALUE fname)
|
185
185
|
{
|
186
186
|
return CSTR2RVAL(g_path_skip_root(RVAL2CSTR(fname)));
|
187
187
|
}
|
188
188
|
|
189
189
|
static VALUE
|
190
|
-
|
190
|
+
rg_s_path_get_basename(G_GNUC_UNUSED VALUE self, VALUE fname)
|
191
191
|
{
|
192
192
|
return CSTR2RVAL(g_path_get_basename(RVAL2CSTR(fname)));
|
193
193
|
}
|
194
194
|
|
195
195
|
static VALUE
|
196
|
-
|
196
|
+
rg_s_path_get_dirname(G_GNUC_UNUSED VALUE self, VALUE fname)
|
197
197
|
{
|
198
198
|
return CSTR2RVAL(g_path_get_dirname(RVAL2CSTR(fname)));
|
199
199
|
}
|
@@ -211,7 +211,7 @@ gchar* g_build_pathv (const gchar *separator,
|
|
211
211
|
*/
|
212
212
|
|
213
213
|
static VALUE
|
214
|
-
|
214
|
+
rg_s_find_program_in_path(G_GNUC_UNUSED VALUE self, VALUE program)
|
215
215
|
{
|
216
216
|
gchar* path = g_find_program_in_path(RVAL2CSTR(program));
|
217
217
|
VALUE ret = CSTR2RVAL(path);
|
@@ -220,25 +220,25 @@ rg_m_find_program_in_path(G_GNUC_UNUSED VALUE self, VALUE program)
|
|
220
220
|
}
|
221
221
|
|
222
222
|
static VALUE
|
223
|
-
|
223
|
+
rg_s_bit_nth_lsf(G_GNUC_UNUSED VALUE self, VALUE mask, VALUE nth_bit)
|
224
224
|
{
|
225
225
|
return INT2NUM(g_bit_nth_lsf(NUM2ULONG(mask), NUM2INT(nth_bit)));
|
226
226
|
}
|
227
227
|
|
228
228
|
static VALUE
|
229
|
-
|
229
|
+
rg_s_bit_nth_msf(G_GNUC_UNUSED VALUE self, VALUE mask, VALUE nth_bit)
|
230
230
|
{
|
231
231
|
return INT2NUM(g_bit_nth_msf(NUM2ULONG(mask), NUM2INT(nth_bit)));
|
232
232
|
}
|
233
233
|
|
234
234
|
static VALUE
|
235
|
-
|
235
|
+
rg_s_bit_storage(G_GNUC_UNUSED VALUE self, VALUE number)
|
236
236
|
{
|
237
237
|
return UINT2NUM(g_bit_storage(NUM2ULONG(number)));
|
238
238
|
}
|
239
239
|
|
240
240
|
static VALUE
|
241
|
-
|
241
|
+
rg_s_spaced_primes_closest(G_GNUC_UNUSED VALUE self, VALUE num)
|
242
242
|
{
|
243
243
|
return UINT2NUM(g_spaced_primes_closest(NUM2UINT(num)));
|
244
244
|
}
|
@@ -249,7 +249,7 @@ void g_atexit (GVoidFunc func);
|
|
249
249
|
*/
|
250
250
|
|
251
251
|
static VALUE
|
252
|
-
|
252
|
+
rg_s_parse_debug_string(G_GNUC_UNUSED VALUE self, VALUE string, VALUE keys)
|
253
253
|
{
|
254
254
|
gint i, nkeys;
|
255
255
|
VALUE ary;
|
@@ -282,7 +282,7 @@ void g_nullify_pointer (gpointer *nullify_location);
|
|
282
282
|
*/
|
283
283
|
|
284
284
|
static VALUE
|
285
|
-
|
285
|
+
rg_s_check_version_p(G_GNUC_UNUSED VALUE self, VALUE major, VALUE minor, VALUE micro)
|
286
286
|
{
|
287
287
|
return CBOOL2RVAL(glib_major_version > NUM2UINT(major) ||
|
288
288
|
(glib_major_version == NUM2UINT(major) &&
|
@@ -302,49 +302,49 @@ Init_glib_utils(void)
|
|
302
302
|
#endif
|
303
303
|
|
304
304
|
#if GLIB_CHECK_VERSION(2,2,0)
|
305
|
-
|
306
|
-
|
305
|
+
RG_DEF_SMETHOD(application_name, 0);
|
306
|
+
RG_DEF_SMETHOD(set_application_name, 1);
|
307
307
|
#endif
|
308
|
-
|
309
|
-
|
310
|
-
|
308
|
+
RG_DEF_SMETHOD(prgname, 0);
|
309
|
+
RG_DEF_SMETHOD(set_prgname, 1);
|
310
|
+
RG_DEF_SMETHOD(getenv, 1);
|
311
311
|
#if GLIB_CHECK_VERSION(2,4,0)
|
312
|
-
|
313
|
-
|
312
|
+
RG_DEF_SMETHOD(setenv, 2);
|
313
|
+
RG_DEF_SMETHOD(unsetenv, 1);
|
314
314
|
#endif
|
315
315
|
#if GLIB_CHECK_VERSION(2,8,0)
|
316
316
|
#ifdef HAVE_G_LISTENV
|
317
|
-
|
317
|
+
RG_DEF_SMETHOD(listenv, 0);
|
318
318
|
#endif
|
319
|
-
|
319
|
+
RG_DEF_SMETHOD(host_name, 0);
|
320
320
|
#endif
|
321
|
-
|
322
|
-
|
321
|
+
RG_DEF_SMETHOD(user_name, 0);
|
322
|
+
RG_DEF_SMETHOD(real_name, 0);
|
323
323
|
|
324
324
|
#if GLIB_CHECK_VERSION(2, 6, 0)
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
325
|
+
RG_DEF_SMETHOD(user_cache_dir, 0);
|
326
|
+
RG_DEF_SMETHOD(user_data_dir, 0);
|
327
|
+
RG_DEF_SMETHOD(user_config_dir, 0);
|
328
|
+
RG_DEF_SMETHOD(system_data_dirs, 0);
|
329
|
+
RG_DEF_SMETHOD(system_config_dirs, 0);
|
330
330
|
#endif
|
331
331
|
#if GLIB_CHECK_VERSION(2, 14, 0)
|
332
|
-
|
332
|
+
RG_DEF_SMETHOD(get_user_special_dir, 1);
|
333
333
|
#endif
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
334
|
+
RG_DEF_SMETHOD(home_dir, 0);
|
335
|
+
RG_DEF_SMETHOD(tmp_dir, 0);
|
336
|
+
RG_DEF_SMETHOD(current_dir, 0);
|
337
|
+
|
338
|
+
RG_DEF_SMETHOD_P(path_is_absolute, 1);
|
339
|
+
RG_DEF_SMETHOD(path_skip_root, 1);
|
340
|
+
RG_DEF_SMETHOD(path_get_basename, 1);
|
341
|
+
RG_DEF_SMETHOD(path_get_dirname, 1);
|
342
|
+
RG_DEF_SMETHOD(find_program_in_path, 1);
|
343
|
+
RG_DEF_SMETHOD(bit_nth_lsf, 2);
|
344
|
+
RG_DEF_SMETHOD(bit_nth_msf, 2);
|
345
|
+
RG_DEF_SMETHOD(bit_storage, 1);
|
346
|
+
RG_DEF_SMETHOD(spaced_primes_closest, 1);
|
347
|
+
RG_DEF_SMETHOD(parse_debug_string, 2);
|
348
|
+
RG_DEF_SMETHOD_P(check_version, 3);
|
349
349
|
|
350
350
|
}
|