summaryrefslogtreecommitdiff
path: root/regerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'regerror.c')
-rw-r--r--regerror.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/regerror.c b/regerror.c
index 3c8b7371c2..2bf1d320d3 100644
--- a/regerror.c
+++ b/regerror.c
@@ -1,8 +1,9 @@
/**********************************************************************
- regerror.c - Oniguruma (regular expression library)
+ regerror.c - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +40,7 @@
#endif
extern UChar*
-onig_error_code_to_format(int code)
+onig_error_code_to_format(OnigPosition code)
{
const char *p;
@@ -64,8 +65,8 @@ onig_error_code_to_format(int code)
p = "undefined bytecode (bug)"; break;
case ONIGERR_UNEXPECTED_BYTECODE:
p = "unexpected bytecode (bug)"; break;
- case ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED:
- p = "default multibyte-encoding is not setted"; break;
+ case ONIGERR_DEFAULT_ENCODING_IS_NOT_SET:
+ p = "default multibyte-encoding is not set"; break;
case ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR:
p = "can't convert to wide-char on specified multibyte-encoding"; break;
case ONIGERR_INVALID_ARGUMENT:
@@ -114,6 +115,8 @@ onig_error_code_to_format(int code)
p = "invalid pattern in look-behind"; break;
case ONIGERR_INVALID_REPEAT_RANGE_PATTERN:
p = "invalid repeat range {lower,upper}"; break;
+ case ONIGERR_INVALID_CONDITION_PATTERN:
+ p = "invalid condition pattern"; break;
case ONIGERR_TOO_BIG_NUMBER:
p = "too big number"; break;
case ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE:
@@ -140,6 +143,8 @@ onig_error_code_to_format(int code)
p = "numbered backref/call is not allowed. (use name)"; break;
case ONIGERR_TOO_BIG_WIDE_CHAR_VALUE:
p = "too big wide-char value"; break;
+ case ONIGERR_TOO_SHORT_DIGITS:
+ p = "too short digits"; break;
case ONIGERR_TOO_LONG_WIDE_CHAR_VALUE:
p = "too long wide-char value"; break;
case ONIGERR_INVALID_CODE_POINT_VALUE:
@@ -232,7 +237,7 @@ static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
*is_over = ((p < end) ? 1 : 0);
}
else {
- len = (int)MIN((end - s), buf_size);
+ len = (int )MIN((end - s), buf_size);
xmemcpy(buf, s, (size_t )len);
*is_over = ((buf_size < (end - s)) ? 1 : 0);
}
@@ -246,11 +251,11 @@ static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
extern int
#ifdef HAVE_STDARG_PROTOTYPES
-onig_error_code_to_str(UChar* s, int code, ...)
+onig_error_code_to_str(UChar* s, OnigPosition code, ...)
#else
onig_error_code_to_str(s, code, va_alist)
UChar* s;
- int code;
+ OnigPosition code;
va_dcl
#endif
{
@@ -309,7 +314,7 @@ onig_error_code_to_str(s, code, va_alist)
}
va_end(vargs);
- return (int)len;
+ return (int )len;
}
void
@@ -325,7 +330,7 @@ onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
need = (pat_end - pat) * 4 + 4;
- if (n + need < (size_t)bufsize) {
+ if (n + need < (size_t )bufsize) {
strcat((char* )buf, ": /");
s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf);