diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-27 13:15:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-27 13:15:48 +0000 |
commit | 0d40bf8ffec9c9431194ccb8f7c4dfc39446181e (patch) | |
tree | 95fecb09fa1924e94753969cb79015d7fae8354f /error.c | |
parent | cc8f2f857ccf817c96a70c43508f3cf429c7666e (diff) | |
download | ruby-0d40bf8ffec9c9431194ccb8f7c4dfc39446181e.tar.gz |
error.c: warning functions
* error.c: define warning functions in all combinations of
* no errno, system errno, argument
* without/with encoding
* enabled/disabled by default
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 70 |
1 files changed, 70 insertions, 0 deletions
@@ -2388,6 +2388,52 @@ syserr_warning(VALUE mesg, int err) rb_write_warning_str(mesg); } +#if 0 +void +rb_sys_warn(const char *fmt, ...) +{ + if (!NIL_P(ruby_verbose)) { + int errno_save = errno; + with_warning_string(mesg, 0, fmt) { + syserr_warning(mesg, errno_save); + } + errno = errno_save; + } +} + +void +rb_syserr_warn(int err, const char *fmt, ...) +{ + if (!NIL_P(ruby_verbose)) { + with_warning_string(mesg, 0, fmt) { + syserr_warning(mesg, err); + } + } +} + +void +rb_sys_enc_warn(rb_encoding *enc, const char *fmt, ...) +{ + if (!NIL_P(ruby_verbose)) { + int errno_save = errno; + with_warning_string(mesg, enc, fmt) { + syserr_warning(mesg, errno_save); + } + errno = errno_save; + } +} + +void +rb_syserr_enc_warn(int err, rb_encoding *enc, const char *fmt, ...) +{ + if (!NIL_P(ruby_verbose)) { + with_warning_string(mesg, enc, fmt) { + syserr_warning(mesg, err); + } + } +} +#endif + void rb_sys_warning(const char *fmt, ...) { @@ -2400,6 +2446,18 @@ rb_sys_warning(const char *fmt, ...) } } +#if 0 +void +rb_syserr_warning(int err, const char *fmt, ...) +{ + if (RTEST(ruby_verbose)) { + with_warning_string(mesg, 0, fmt) { + syserr_warning(mesg, err); + } + } +} +#endif + void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...) { @@ -2412,6 +2470,18 @@ rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...) } } +#if 0 +void +rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...) +{ + if (RTEST(ruby_verbose)) { + with_warning_string(mesg, enc, fmt) { + syserr_warning(mesg, err); + } + } +} +#endif + void rb_load_fail(VALUE path, const char *err) { |