glib2 1.1.2-x86-mingw32 → 1.1.3-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,7 @@
25
25
  #define RG_TARGET_NAMESPACE mUCS4
26
26
 
27
27
  static VALUE
28
- rg_m_to_utf16(G_GNUC_UNUSED VALUE self, VALUE rb_ucs4)
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
- rg_m_to_utf8(G_GNUC_UNUSED VALUE self, VALUE rb_ucs4)
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
- RG_DEF_MODFUNC(to_utf16, 1);
78
- RG_DEF_MODFUNC(to_utf8, 1);
77
+ RG_DEF_SMETHOD(to_utf16, 1);
78
+ RG_DEF_SMETHOD(to_utf8, 1);
79
79
  }
@@ -52,44 +52,44 @@ DEF_IS_UNICHAR(wide_cjk)
52
52
  #undef DEF_IS_UNICHAR
53
53
 
54
54
  static VALUE
55
- rg_m_to_upper(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_to_lower(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_to_title(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_digit_value(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_xdigit_value(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_type(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_break_type(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_get_mirror_char(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_combining_class(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_get_script(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_mark_p(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_zero_width_p(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rg_m_to_utf8(G_GNUC_UNUSED VALUE self, VALUE unichar)
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
- rb_define_module_function(RG_TARGET_NAMESPACE, "alnum?",
154
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "alnum?",
155
155
  rbglib_m_unichar_isalnum, 1);
156
- rb_define_module_function(RG_TARGET_NAMESPACE, "alpha?",
156
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "alpha?",
157
157
  rbglib_m_unichar_isalpha, 1);
158
- rb_define_module_function(RG_TARGET_NAMESPACE, "cntrl?",
158
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "cntrl?",
159
159
  rbglib_m_unichar_iscntrl, 1);
160
- rb_define_module_function(RG_TARGET_NAMESPACE, "digit?",
160
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "digit?",
161
161
  rbglib_m_unichar_isdigit, 1);
162
- rb_define_module_function(RG_TARGET_NAMESPACE, "graph?",
162
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "graph?",
163
163
  rbglib_m_unichar_isgraph, 1);
164
- rb_define_module_function(RG_TARGET_NAMESPACE, "lower?",
164
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "lower?",
165
165
  rbglib_m_unichar_islower, 1);
166
- rb_define_module_function(RG_TARGET_NAMESPACE, "print?",
166
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "print?",
167
167
  rbglib_m_unichar_isprint, 1);
168
- rb_define_module_function(RG_TARGET_NAMESPACE, "punct?",
168
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "punct?",
169
169
  rbglib_m_unichar_ispunct, 1);
170
- rb_define_module_function(RG_TARGET_NAMESPACE, "space?",
170
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "space?",
171
171
  rbglib_m_unichar_isspace, 1);
172
- rb_define_module_function(RG_TARGET_NAMESPACE, "upper?",
172
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "upper?",
173
173
  rbglib_m_unichar_isupper, 1);
174
- rb_define_module_function(RG_TARGET_NAMESPACE, "xdigit?",
174
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "xdigit?",
175
175
  rbglib_m_unichar_isxdigit, 1);
176
- rb_define_module_function(RG_TARGET_NAMESPACE, "title?",
176
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "title?",
177
177
  rbglib_m_unichar_istitle, 1);
178
- rb_define_module_function(RG_TARGET_NAMESPACE, "defined?",
178
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "defined?",
179
179
  rbglib_m_unichar_isdefined, 1);
180
- rb_define_module_function(RG_TARGET_NAMESPACE, "wide?",
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
- rb_define_module_function(RG_TARGET_NAMESPACE, "wide_cjk?",
183
+ rbg_define_singleton_method(RG_TARGET_NAMESPACE, "wide_cjk?",
184
184
  rbglib_m_unichar_iswide_cjk, 1);
185
185
  #endif
186
186
 
187
- RG_DEF_MODFUNC(to_upper, 1);
188
- RG_DEF_MODFUNC(to_lower, 1);
189
- RG_DEF_MODFUNC(to_title, 1);
187
+ RG_DEF_SMETHOD(to_upper, 1);
188
+ RG_DEF_SMETHOD(to_lower, 1);
189
+ RG_DEF_SMETHOD(to_title, 1);
190
190
 
191
- RG_DEF_MODFUNC(digit_value, 1);
192
- RG_DEF_MODFUNC(xdigit_value, 1);
191
+ RG_DEF_SMETHOD(digit_value, 1);
192
+ RG_DEF_SMETHOD(xdigit_value, 1);
193
193
 
194
- RG_DEF_MODFUNC(type, 1);
195
- RG_DEF_MODFUNC(break_type, 1);
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
- RG_DEF_MODFUNC(get_mirror_char, 1);
198
+ RG_DEF_SMETHOD(get_mirror_char, 1);
199
199
  #endif
200
200
 
201
201
  #if GLIB_CHECK_VERSION(2,14,0)
202
- RG_DEF_MODFUNC(combining_class, 1);
203
- RG_DEF_MODFUNC(get_script, 1);
204
- RG_DEF_MODFUNC_P(mark, 1);
205
- RG_DEF_MODFUNC_P(zero_width, 1);
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
- RG_DEF_MODFUNC(to_utf8, 1);
209
- }
208
+ RG_DEF_SMETHOD(to_utf8, 1);
209
+ }
@@ -83,7 +83,7 @@ Init_glib_unicode(void)
83
83
 
84
84
  G_DEF_CLASS(G_TYPE_NORMALIZE_MODE, "NormalizeMode", mGLib);
85
85
 
86
- rb_define_module_function(mGLib, "charset", rbglib_m_charset, 0);
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);
@@ -25,7 +25,7 @@
25
25
  #define RG_TARGET_NAMESPACE mUTF16
26
26
 
27
27
  static VALUE
28
- rg_m_to_ucs4(G_GNUC_UNUSED VALUE self, VALUE rb_utf16)
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
- rg_m_to_utf8(G_GNUC_UNUSED VALUE self, VALUE rb_utf16)
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
- RG_DEF_MODFUNC(to_ucs4, 1);
77
- RG_DEF_MODFUNC(to_utf8, 1);
76
+ RG_DEF_SMETHOD(to_ucs4, 1);
77
+ RG_DEF_SMETHOD(to_utf8, 1);
78
78
  }
@@ -25,7 +25,7 @@
25
25
  #define RG_TARGET_NAMESPACE mUTF8
26
26
 
27
27
  static VALUE
28
- rg_m_get_char(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
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
- rg_m_size(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
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
- rg_m_reverse(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
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
- rg_m_validate(G_GNUC_UNUSED VALUE self, VALUE str)
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
- rg_m_upcase(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
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
- rg_m_downcase(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
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
- rg_m_casefold(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
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
- rg_m_normalize(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
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
- rg_m_collate(G_GNUC_UNUSED VALUE self, VALUE utf8a, VALUE utf8b)
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
- rg_m_collate_key(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
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
- rg_m_to_utf16(G_GNUC_UNUSED VALUE self, VALUE rb_utf8)
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
- rg_m_to_ucs4(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
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
- RG_DEF_MODFUNC(get_char, -1);
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
- RG_DEF_MODFUNC(size, 1);
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
- RG_DEF_MODFUNC(reverse, 1);
246
- RG_DEF_MODFUNC(validate, 1);
245
+ RG_DEF_SMETHOD(reverse, 1);
246
+ RG_DEF_SMETHOD(validate, 1);
247
247
 
248
- RG_DEF_MODFUNC(upcase, 1);
249
- RG_DEF_MODFUNC(downcase, 1);
250
- RG_DEF_MODFUNC(casefold, 1);
248
+ RG_DEF_SMETHOD(upcase, 1);
249
+ RG_DEF_SMETHOD(downcase, 1);
250
+ RG_DEF_SMETHOD(casefold, 1);
251
251
 
252
- RG_DEF_MODFUNC(normalize, -1);
252
+ RG_DEF_SMETHOD(normalize, -1);
253
253
 
254
- RG_DEF_MODFUNC(collate, 2);
255
- RG_DEF_MODFUNC(collate_key, -1);
254
+ RG_DEF_SMETHOD(collate, 2);
255
+ RG_DEF_SMETHOD(collate_key, -1);
256
256
 
257
- RG_DEF_MODFUNC(to_utf16, 1);
258
- RG_DEF_MODFUNC(to_ucs4, -1);
257
+ RG_DEF_SMETHOD(to_utf16, 1);
258
+ RG_DEF_SMETHOD(to_ucs4, -1);
259
259
  }
@@ -26,13 +26,13 @@
26
26
 
27
27
  #if GLIB_CHECK_VERSION(2,2,0)
28
28
  static VALUE
29
- rg_m_application_name(G_GNUC_UNUSED VALUE self)
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
- rg_m_set_application_name(VALUE self, VALUE application_name)
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
- rg_m_prgname(G_GNUC_UNUSED VALUE self)
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
- rg_m_set_prgname(VALUE self, VALUE prgname)
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
- rg_m_getenv(G_GNUC_UNUSED VALUE self, VALUE variable)
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
- rg_m_setenv(G_GNUC_UNUSED VALUE self, VALUE variable, VALUE value, VALUE overwrite)
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
- rg_m_unsetenv(VALUE self, VALUE variable)
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
- rg_m_listenv(VALUE self)
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
- rg_m_host_name(G_GNUC_UNUSED VALUE self)
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
- rg_m_user_name(G_GNUC_UNUSED VALUE self)
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
- rg_m_real_name(G_GNUC_UNUSED VALUE self)
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
- rg_m_user_cache_dir(G_GNUC_UNUSED VALUE self)
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
- rg_m_user_data_dir(G_GNUC_UNUSED VALUE self)
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
- rg_m_user_config_dir(G_GNUC_UNUSED VALUE self)
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
- rg_m_system_data_dirs(G_GNUC_UNUSED VALUE self)
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
- rg_m_system_config_dirs(G_GNUC_UNUSED VALUE self)
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
- rg_m_get_user_special_dir(G_GNUC_UNUSED VALUE self, VALUE directory)
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
- rg_m_home_dir(G_GNUC_UNUSED VALUE self)
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
- rg_m_tmp_dir(G_GNUC_UNUSED VALUE self)
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
- rg_m_current_dir(G_GNUC_UNUSED VALUE self)
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
- rg_m_path_is_absolute_p(G_GNUC_UNUSED VALUE self, VALUE fname)
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
- rg_m_path_skip_root(G_GNUC_UNUSED VALUE self, VALUE fname)
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
- rg_m_path_get_basename(G_GNUC_UNUSED VALUE self, VALUE fname)
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
- rg_m_path_get_dirname(G_GNUC_UNUSED VALUE self, VALUE fname)
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
- rg_m_find_program_in_path(G_GNUC_UNUSED VALUE self, VALUE program)
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
- rg_m_bit_nth_lsf(G_GNUC_UNUSED VALUE self, VALUE mask, VALUE nth_bit)
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
- rg_m_bit_nth_msf(G_GNUC_UNUSED VALUE self, VALUE mask, VALUE nth_bit)
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
- rg_m_bit_storage(G_GNUC_UNUSED VALUE self, VALUE number)
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
- rg_m_spaced_primes_closest(G_GNUC_UNUSED VALUE self, VALUE num)
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
- rg_m_parse_debug_string(G_GNUC_UNUSED VALUE self, VALUE string, VALUE keys)
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
- rg_m_check_version_p(G_GNUC_UNUSED VALUE self, VALUE major, VALUE minor, VALUE micro)
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
- RG_DEF_MODFUNC(application_name, 0);
306
- RG_DEF_MODFUNC(set_application_name, 1);
305
+ RG_DEF_SMETHOD(application_name, 0);
306
+ RG_DEF_SMETHOD(set_application_name, 1);
307
307
  #endif
308
- RG_DEF_MODFUNC(prgname, 0);
309
- RG_DEF_MODFUNC(set_prgname, 1);
310
- RG_DEF_MODFUNC(getenv, 1);
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
- RG_DEF_MODFUNC(setenv, 2);
313
- RG_DEF_MODFUNC(unsetenv, 1);
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
- RG_DEF_MODFUNC(listenv, 0);
317
+ RG_DEF_SMETHOD(listenv, 0);
318
318
  #endif
319
- RG_DEF_MODFUNC(host_name, 0);
319
+ RG_DEF_SMETHOD(host_name, 0);
320
320
  #endif
321
- RG_DEF_MODFUNC(user_name, 0);
322
- RG_DEF_MODFUNC(real_name, 0);
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
- RG_DEF_MODFUNC(user_cache_dir, 0);
326
- RG_DEF_MODFUNC(user_data_dir, 0);
327
- RG_DEF_MODFUNC(user_config_dir, 0);
328
- RG_DEF_MODFUNC(system_data_dirs, 0);
329
- RG_DEF_MODFUNC(system_config_dirs, 0);
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
- RG_DEF_MODFUNC(get_user_special_dir, 1);
332
+ RG_DEF_SMETHOD(get_user_special_dir, 1);
333
333
  #endif
334
- RG_DEF_MODFUNC(home_dir, 0);
335
- RG_DEF_MODFUNC(tmp_dir, 0);
336
- RG_DEF_MODFUNC(current_dir, 0);
337
-
338
- RG_DEF_MODFUNC_P(path_is_absolute, 1);
339
- RG_DEF_MODFUNC(path_skip_root, 1);
340
- RG_DEF_MODFUNC(path_get_basename, 1);
341
- RG_DEF_MODFUNC(path_get_dirname, 1);
342
- RG_DEF_MODFUNC(find_program_in_path, 1);
343
- RG_DEF_MODFUNC(bit_nth_lsf, 2);
344
- RG_DEF_MODFUNC(bit_nth_msf, 2);
345
- RG_DEF_MODFUNC(bit_storage, 1);
346
- RG_DEF_MODFUNC(spaced_primes_closest, 1);
347
- RG_DEF_MODFUNC(parse_debug_string, 2);
348
- RG_DEF_MODFUNC_P(check_version, 3);
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
  }