summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-10 01:33:05 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-10 01:33:05 +0000
commit322ce91a97497d48224ea3f5578fce514103b481 (patch)
tree68fd91411618ad1b353e3f10863c59f872d72703 /file.c
parentaf15922b03275d1ca7ca8d6ed0985de5fc2156bd (diff)
* include/ruby/intern.h (rb_path_next, rb_path_skip_prefix,
rb_path_last_separator, rb_path_end, ruby_find_basename, ruby_find_extname): restore the declarations of these functions for backword compatibility. * filc.c (rb_path_next, rb_path_skip_prefix, rb_path_last_separator, rb_path_end, ruby_find_basename, ruby_find_extname): implements these functions as the wrapper of rb_enc_*(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@41878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/file.c b/file.c
index c60de23302..e7e0885e98 100644
--- a/file.c
+++ b/file.c
@@ -2784,6 +2784,34 @@ rb_enc_path_end(const char *path, const char *end, rb_encoding *enc)
return chompdirsep(path, end, enc);
}
+char *
+rb_path_next(const char *path)
+{
+ rb_warn("rb_path_next() is deprecated");
+ return rb_enc_path_next(path, path + strlen(path), rb_filesystem_encoding());
+}
+
+char *
+rb_path_skip_prefix(const char *path)
+{
+ rb_warn("rb_path_skip_prefix() is deprecated");
+ return rb_enc_path_skip_prefix(path, path + strlen(path), rb_filesystem_encoding());
+}
+
+char *
+rb_path_last_separator(const char *path)
+{
+ rb_warn("rb_path_last_separator() is deprecated");
+ return rb_enc_path_last_separator(path, path + strlen(path), rb_filesystem_encoding());
+}
+
+char *rb_path_end(const char *path)
+{
+ rb_warn("rb_path_end() is deprecated");
+ return rb_enc_path_end(path, path + strlen(path), rb_filesystem_encoding());
+}
+
+
#if USE_NTFS
static char *
ntfs_tail(const char *path, const char *end, rb_encoding *enc)
@@ -3629,6 +3657,13 @@ ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encodin
return p;
}
+const char *
+ruby_find_basename(const char *name, long *baselen, long *alllen)
+{
+ rb_warn("ruby_find_basename() is deprecated");
+ return ruby_enc_find_basename(name, baselen, alllen, rb_filesystem_encoding());
+}
+
/*
* call-seq:
* File.basename(file_name [, suffix] ) -> base_name
@@ -3818,6 +3853,13 @@ ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
return e;
}
+const char *
+ruby_find_extname(const char *name, long *len)
+{
+ rb_warn("ruby_find_extname() is deprecated");
+ return ruby_enc_find_extname(name, len, rb_filesystem_encoding());
+}
+
/*
* call-seq:
* File.extname(path) -> string