[前][次][番号順一覧][スレッド一覧]

ruby-changes:29826

From: usa <ko1@a...>
Date: Wed, 10 Jul 2013 10:33:16 +0900 (JST)
Subject: [ruby-changes:29826] usa:r41878 (ruby_1_9_3): * include/ruby/intern.h (rb_path_next, rb_path_skip_prefix,

usa	2013-07-10 10:33:05 +0900 (Wed, 10 Jul 2013)

  New Revision: 41878

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41878

  Log:
    * 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_*().

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/file.c
    branches/ruby_1_9_3/include/ruby/intern.h
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/include/ruby/intern.h
===================================================================
--- ruby_1_9_3/include/ruby/intern.h	(revision 41877)
+++ ruby_1_9_3/include/ruby/intern.h	(revision 41878)
@@ -413,9 +413,15 @@ int rb_find_file_ext_safe(VALUE*, const https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/include/ruby/intern.h#L413
 VALUE rb_find_file_safe(VALUE, int);
 int rb_find_file_ext(VALUE*, const char* const*);
 VALUE rb_find_file(VALUE);
+DEPRECATED(char *rb_path_next(const char *));
+DEPRECATED(char *rb_path_skip_prefix(const char *));
+DEPRECATED(char *rb_path_last_separator(const char *));
+DEPRECATED(char *rb_path_end(const char *));
 VALUE rb_file_directory_p(VALUE,VALUE);
 VALUE rb_str_encode_ospath(VALUE);
 int rb_is_absolute_path(const char *);
+DEPRECATED(const char *ruby_find_basename(const char *name, long *baselen, long *alllen));
+DEPRECATED(const char *ruby_find_extname(const char *name, long *len));
 /* gc.c */
 void ruby_set_stack_size(size_t);
 NORETURN(void rb_memerror(void));
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 41877)
+++ ruby_1_9_3/ChangeLog	(revision 41878)
@@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Wed Jul 10 10:27:12 2013  NAKAMURA Usaku  <usa@r...>
+
+	* 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_*().
+
 Wed Jul 10 10:05:40 2013  NAKAMURA Usaku  <usa@r...>
 
 	* include/ruby/intern.h (rb_f_lambda): restore the declaration of
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 41877)
+++ ruby_1_9_3/version.h	(revision 41878)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 450
+#define RUBY_PATCHLEVEL 451
 
 #define RUBY_RELEASE_DATE "2013-07-10"
 #define RUBY_RELEASE_YEAR 2013
Index: ruby_1_9_3/file.c
===================================================================
--- ruby_1_9_3/file.c	(revision 41877)
+++ ruby_1_9_3/file.c	(revision 41878)
@@ -2784,6 +2784,34 @@ rb_enc_path_end(const char *path, const https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/file.c#L2784
     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, https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/file.c#L3657
     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, https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/file.c#L3853
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]