summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-20 23:22:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-20 23:22:34 +0000
commit564517840edd91b632d7456cc74ede31fcfc1b82 (patch)
tree5aa1b485e54ed107ab6b475ecb2d11c5b4b04512 /win32
parentf60de59a7058877d69031c45c6ce88a2c11f2130 (diff)
* win32/win32.c (rb_w32_conv_from_wstr): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/win32/win32.c b/win32/win32.c
index ddbbe41c8b..e907422dbe 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -5013,59 +5013,3 @@ rb_w32_fsopen(const char *path, const char *mode, int shflags)
return f;
}
#endif
-
-BOOL
-rb_w32_get_special_directory(int n, WCHAR *path)
-{
- if (!get_special_folder(n, path))
- return FALSE;
- regulate_path(path);
- return TRUE;
-}
-
-static VALUE
-w32_get_special_directory(VALUE self, VALUE num)
-{
- VALUE str;
- int n = NUM2INT(num);
- WCHAR path[_MAX_PATH];
-
- if (!rb_w32_get_special_directory(n, path)) {
- rb_sys_fail(0);
- }
- str = rb_w32_conv_from_wchar(path, rb_filesystem_encoding());
- OBJ_TAINT(str);
- return str;
-}
-
-static VALUE
-w32_get_system_directory(VALUE self)
-{
- VALUE str;
- WCHAR path[_MAX_PATH];
-
- if (!get_system_directory(path, numberof(path))) {
- rb_sys_fail(0);
- }
- regulate_path(path);
- str = rb_w32_conv_from_wchar(path, rb_filesystem_encoding());
- OBJ_TAINT(str);
- return str;
-}
-
-void
-Init_win32(void)
-{
- VALUE mWin32 = rb_define_module("Win32");
- VALUE dir = rb_define_module_under(mWin32, "Dir");
- rb_define_module_function(dir, "special", w32_get_special_directory, 1);
- rb_define_module_function(dir, "system", w32_get_system_directory, 0);
- rb_define_const(dir, "LOCAL_APPDATA", UINT2NUM(CSIDL_LOCAL_APPDATA));
- rb_define_const(dir, "COMMON_APPDATA", UINT2NUM(CSIDL_COMMON_APPDATA));
- rb_define_const(dir, "WINDOWS", UINT2NUM(CSIDL_WINDOWS));
- rb_define_const(dir, "SYSTEM", UINT2NUM(CSIDL_SYSTEM));
- rb_define_const(dir, "PROFILE", UINT2NUM(CSIDL_PROFILE));
- rb_define_const(dir, "PERSONAL", UINT2NUM(CSIDL_PERSONAL));
- rb_define_const(mWin32, "Version", UINT2NUM(rb_w32_osver()));
- rb_ivar_set(rb_mKernel, rb_intern("@__win32__"), mWin32);
-}