summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-27 13:15:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-27 13:15:48 +0000
commit0d40bf8ffec9c9431194ccb8f7c4dfc39446181e (patch)
tree95fecb09fa1924e94753969cb79015d7fae8354f /error.c
parentcc8f2f857ccf817c96a70c43508f3cf429c7666e (diff)
downloadruby-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.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/error.c b/error.c
index f980f67b01..a2f780e5b2 100644
--- a/error.c
+++ b/error.c
@@ -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)
{