1
0
mirror of https://github.com/gryf/gryf-overlay.git synced 2025-12-19 04:20:26 +01:00
Files
gryf-overlay/dev-ruby/ruby-locale/files/ruby_locale_get_method.patch
2010-02-09 21:25:29 +01:00

28 lines
722 B
Diff

--- ruby-locale-0.2/rblocale.c 2000-04-14 06:20:58.000000000 +0200
+++ ruby-locale-0.2_p/rblocale.c 2008-01-31 21:47:47.000000000 +0100
@@ -31,6 +31,16 @@
return ret == NULL ? Qnil : rb_str_new2(ret);
}
+VALUE
+locale_get( self, category )
+ VALUE self, category;
+{
+ char *ret;
+
+ ret = setlocale(NUM2INT(category), NULL );
+ return ret == NULL ? Qnil : rb_str_new2(ret);
+}
+
void Init_locale()
{
char *curr_locale;
@@ -44,6 +54,7 @@
}
rb_define_module_function(mLocale, "set", locale_set, 2);
+ rb_define_module_function(mLocale, "get", locale_get, 1);
rb_define_const(mLocale, "ALL", INT2FIX(LC_ALL));
rb_define_const(mLocale, "COLLATE", INT2FIX(LC_COLLATE));