summaryrefslogtreecommitdiff
path: root/ext/tmpdir
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-08 03:25:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-08 03:25:17 +0000
commit2c01a07bf4317605758b1242cf2f802baa117087 (patch)
tree2d32161f8fae91113feef563b392d256bce1cad2 /ext/tmpdir
parent5512c9b28716df7681680e0db598f3263ad3fe44 (diff)
* ext/etc/etc.c (etc_systmpdir): moved from ext/tmpdir.
* ext/etc/etc.c (etc_sysconfdir): added. * lib/rubygems/config_file.rb, lib/tmpdir.rb: use etc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tmpdir')
-rw-r--r--ext/tmpdir/extconf.rb6
-rw-r--r--ext/tmpdir/tmpdir.c32
2 files changed, 0 insertions, 38 deletions
diff --git a/ext/tmpdir/extconf.rb b/ext/tmpdir/extconf.rb
deleted file mode 100644
index a283f851b0..0000000000
--- a/ext/tmpdir/extconf.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-case
-when have_func("rb_w32_system_tmpdir")
- ok = true # win32
-else
-end
-create_makefile("tmpdir") if ok
diff --git a/ext/tmpdir/tmpdir.c b/ext/tmpdir/tmpdir.c
deleted file mode 100644
index f046713b63..0000000000
--- a/ext/tmpdir/tmpdir.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <ruby/ruby.h>
-#include <ruby/encoding.h>
-
-#define numberof(array) (sizeof(array) / sizeof(*array))
-
-#ifdef HAVE_RB_W32_SYSTEM_TMPDIR
-UINT rb_w32_system_tmpdir(WCHAR *path, UINT len);
-VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc);
-#endif
-
-static VALUE
-system_tmpdir(void)
-{
-#ifdef HAVE_RB_W32_SYSTEM_TMPDIR
- WCHAR path[_MAX_PATH];
- UINT len = rb_w32_system_tmpdir(path, numberof(path));
- if (!len) return Qnil;
- return rb_w32_conv_from_wchar(path, rb_filesystem_encoding());
-#else
- return rb_filesystem_str_new_cstr("/tmp");
-#endif
-}
-
-/*
- * sets Dir.@@systmpdir.
- */
-void
-Init_tmpdir(void)
-{
- rb_cvar_set(rb_cDir, rb_intern_const("@@systmpdir"),
- rb_obj_freeze(system_tmpdir()));
-}