60baa01555
PR: ports/68172 Submitted by: Alexander Novitsky <alecn2002 at yandex dot ru> Approved by: maintainer
27 lines
659 B
Text
27 lines
659 B
Text
--- rblocale.c.orig Fri Apr 14 08:20:58 2000
|
|
+++ rblocale.c Mon Jun 21 20:36:37 2004
|
|
@@ -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));
|