summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-15 14:50:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-15 14:50:08 +0000
commit59ee5e05084a2a78e54186adca1b6f134d21f3ee (patch)
treee9166b4992db2bed561f32b30c84a2b03c1914b1
parentd355c4bf0af1804941a138b693a45304e43c0596 (diff)
* ext/iconv/iconv.c (Init_iconv): InvalidEncoding also should include
Iconv::Failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog23
-rw-r--r--ext/iconv/iconv.c79
2 files changed, 50 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog
index cf1917e7af..3abcfd8eb0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Mar 15 23:49:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/iconv/iconv.c (Init_iconv): InvalidEncoding also should include
+ Iconv::Failure.
+
Tue Mar 15 16:38:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tkutil.c (ary2list): give wrong arguments to hash2kv()
@@ -17,9 +22,9 @@ Mon Mar 14 12:21:03 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
Mon Mar 14 00:13:49 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/timer.rb (TkRTTimer): correct calculation of offset
- value. get a little better accuracy.
+ value. get a little better accuracy.
- * ext/tk/sample/demos-en/widget: use a binding with no local variables
+ * ext/tk/sample/demos-en/widget: use a binding with no local variables
when eval a sample script.
* ext/tk/sample/demos-en/bind.rb: ditto.
@@ -46,10 +51,10 @@ Thu Mar 10 19:12:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/tkrttimer.rb: sample of TkRTTimer class
- * ext/tk/lib/tk/textmark.rb: move TkTextMark#+ and TkTextMark#- to
+ * ext/tk/lib/tk/textmark.rb: move TkTextMark#+ and TkTextMark#- to
TkText::IndexModMethods
- * ext/tk/lib/tk/text.rb: improve TkTextMark#+ and TkTextMark#-, and
+ * ext/tk/lib/tk/text.rb: improve TkTextMark#+ and TkTextMark#-, and
add them to TkText::IndexModMethods module
* ext/tk/sample/tktextio.rb: add test part of "seek by text index
@@ -91,8 +96,8 @@ Tue Mar 8 12:36:17 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
Tue Mar 8 01:27:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 1.66
- fixed: [ruby-dev:25828]
+ * ext/nkf/nkf-utf8/nkf.c: follow nkf 1.66
+ fixed: [ruby-dev:25828]
Mon Mar 7 21:35:02 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
@@ -133,7 +138,7 @@ Wed Feb 16 02:55:21 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/lib/openssl/ssl.rb: set non-blocking flag to the
underlying IO.
- * ext/openssl/extconf.rb: get rid of GNUmakefile generation.
+ * ext/openssl/extconf.rb: get rid of GNUmakefile generation.
* text/openssl/test_pair.rb: test for IO like methods.
@@ -151,8 +156,8 @@ Mon Mar 7 09:18:42 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
Mon Mar 7 01:22:14 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tkutil.c: remove the some codes which depend on the
- difference between Ruby1.8 and 1.9, because st.c on Ruby1.9
- was changed.
+ difference between Ruby1.8 and 1.9, because st.c on Ruby1.9
+ was changed.
Mon Mar 7 00:01:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index a6d63855ae..d8958c0e3f 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -112,6 +112,12 @@ static VALUE iconv_iconv _((int argc, VALUE *argv, VALUE self));
static VALUE charset_map;
+/*
+ * Document-method: charset_map
+ * call-seq: Iconv.charset_map
+ *
+ * Returns the map from canonical name to system dependent name.
+ */
static VALUE charset_map_get _((void))
{
return charset_map;
@@ -510,8 +516,8 @@ iconv_s_allocate
* === Exceptions
*
* TypeError:: if +to+ or +from+ aren't String
- * ArgumentError:: if designated converter couldn't find out
- * SystemCallError:: if <tt>iconv_open3</tt> fails
+ * InvalidEncoding:: if designated converter couldn't find out
+ * SystemCallError:: if <tt>iconv_open(3)</tt> fails
*/
static VALUE
iconv_initialize
@@ -602,7 +608,7 @@ iconv_s_convert
* === Exceptions
*
* Exceptions thrown by Iconv.new, Iconv.open and Iconv#iconv.
-*/
+ */
static VALUE
iconv_s_iconv
#ifdef HAVE_PROTOTYPES
@@ -633,7 +639,7 @@ iconv_s_iconv
*
* Shorthand for
* Iconv.iconv(to, from, str).join
- * See Iconv.iconv ???
+ * See Iconv.iconv.
*/
static VALUE
iconv_s_conv
@@ -663,8 +669,8 @@ iconv_s_conv
* multiple calls of #close are guaranteed to end successfully.
*
* Returns a string containing the byte sequence to change the output buffer to
- * its initial shift state. <i>???</i>
-*/
+ * its initial shift state.
+ */
static VALUE
iconv_init_state
#ifdef HAVE_PROTOTYPES
@@ -720,7 +726,7 @@ iconv_finish
* === Examples
*
* See the Iconv documentation.
-*/
+ */
static VALUE
iconv_iconv
#ifdef HAVE_PROTOTYPES
@@ -748,22 +754,16 @@ iconv_iconv
* Document-class: Iconv::Failure
*
* Base attributes for Iconv exceptions.
- *
- * === Iconv::Failure#success
+ */
+
+/*
+ * Document-method: success
+ * call-seq: success
*
* Returns string(s) translated successfully until the exception occurred.
* * In the case of failure occurred within Iconv.iconv, returned
* value is an array of strings translated successfully preceding
* failure and the last element is string on the way.
- *
- * === Iconv::Failure#failed
- *
- * Returns substring of the original string passed to Iconv that starts at the
- * character caused the exception.
- *
- * === Iconv::Failure#inspect
- *
- * Returns inspected string like as: #<_class_: _success_, _failed_>
*/
static VALUE
iconv_failure_success
@@ -778,7 +778,11 @@ iconv_failure_success
}
/*
- * Comment!
+ * Document-method: failed
+ * call-seq: failed
+ *
+ * Returns substring of the original string passed to Iconv that starts at the
+ * character caused the exception.
*/
static VALUE
iconv_failure_failed
@@ -792,6 +796,12 @@ iconv_failure_failed
return rb_attr_get(self, rb_failed);
}
+/*
+ * Document-method: inspect
+ * call-seq: inspect
+ *
+ * Returns inspected string like as: #<_class_: _success_, _failed_>
+ */
static VALUE
iconv_failure_inspect
#ifdef HAVE_PROTOTYPES
@@ -813,19 +823,17 @@ iconv_failure_inspect
}
/*
+ * Document-class: Iconv::InvalidEncoding
+ *
+ * Requested coding-system is not available on this system.
+ */
+
+/*
* Document-class: Iconv::IllegalSequence
*
* Input conversion stopped due to an input byte that does not belong to
* the input codeset, or the output codeset does not contain the
* character.
- *
- * === Superclass
- *
- * ArgumentError
- *
- * === Included Modules
- *
- * Iconv::Failure
*/
/*
@@ -833,28 +841,12 @@ iconv_failure_inspect
*
* Input conversion stopped due to an incomplete character or shift
* sequence at the end of the input buffer.
- *
- * === Superclass
- *
- * ArgumentError
- *
- * === Included Modules
- *
- * Iconv::Failure
*/
/*
* Document-class: Iconv::OutOfRange
*
* Iconv library internal error. Must not occur.
- *
- * === Superclass
- *
- * RuntimeError
- *
- * === Included Modules
- *
- * Iconv::Failure
*/
void
@@ -880,6 +872,7 @@ Init_iconv _((void))
rb_eIconvIllegalSeq = rb_define_class_under(rb_cIconv, "IllegalSequence", rb_eArgError);
rb_eIconvInvalidChar = rb_define_class_under(rb_cIconv, "InvalidCharacter", rb_eArgError);
rb_eIconvOutOfRange = rb_define_class_under(rb_cIconv, "OutOfRange", rb_eRuntimeError);
+ rb_include_module(rb_eIconvInvalidEncoding, rb_eIconvFailure);
rb_include_module(rb_eIconvIllegalSeq, rb_eIconvFailure);
rb_include_module(rb_eIconvInvalidChar, rb_eIconvFailure);
rb_include_module(rb_eIconvOutOfRange, rb_eIconvFailure);