summaryrefslogtreecommitdiff
path: root/regerror.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-11 00:48:35 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-11 00:48:35 (GMT)
commitc506f190e142ad8cda2be386180c51d428a937fc (patch)
treec52bde6924eaa562e434a01ef2cdc83b06e8bd8b /regerror.c
parent2503de61fc96c932c4172d7c4b48d2dded5679e6 (diff)
* regerror.c (onig_vsnprintf_with_pattern): added.
* regparse.c (onig_syntax_warn): use above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regerror.c')
-rw-r--r--regerror.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/regerror.c b/regerror.c
index 358ce0c..a9d0eb6 100644
--- a/regerror.c
+++ b/regerror.c
@@ -312,31 +312,16 @@ onig_error_code_to_str(s, code, va_alist)
return (int)len;
}
-
void
-#ifdef HAVE_STDARG_PROTOTYPES
-onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
- UChar* pat, UChar* pat_end, const UChar *fmt, ...)
-#else
-onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
- UChar buf[];
- int bufsize;
- OnigEncoding enc;
- UChar* pat;
- UChar* pat_end;
- const UChar *fmt;
- va_dcl
-#endif
+onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
+ UChar* pat, UChar* pat_end, const UChar *fmt, va_list args)
{
size_t need;
int n, len;
UChar *p, *s, *bp;
UChar bs[6];
- va_list args;
- va_init_list(args, fmt);
n = xvsnprintf((char* )buf, bufsize, (const char* )fmt, args);
- va_end(args);
need = (pat_end - pat) * 4 + 4;
@@ -387,3 +372,26 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
*s = '\0';
}
}
+
+void
+#ifdef HAVE_STDARG_PROTOTYPES
+onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
+ UChar* pat, UChar* pat_end, const UChar *fmt, ...)
+#else
+onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
+ UChar buf[];
+ int bufsize;
+ OnigEncoding enc;
+ UChar* pat;
+ UChar* pat_end;
+ const UChar *fmt;
+ va_dcl
+#endif
+{
+ va_list args;
+ va_init_list(args, fmt);
+ onig_vsnprintf_with_pattern(buf, bufsize, enc,
+ pat, pat_end, fmt, args);
+ va_end(args);
+}
+