/[pcre]/code/branches/pcre16/pcreposix.c
ViewVC logotype

Diff of /code/branches/pcre16/pcreposix.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 72 by nigel, Sat Feb 24 21:40:24 2007 UTC revision 73 by nigel, Sat Feb 24 21:40:30 2007 UTC
# Line 43  restrictions: Line 43  restrictions:
43    
44  /* Corresponding tables of PCRE error messages and POSIX error codes. */  /* Corresponding tables of PCRE error messages and POSIX error codes. */
45    
46  static const char *estring[] = {  static const char *const estring[] = {
47    ERR1,  ERR2,  ERR3,  ERR4,  ERR5,  ERR6,  ERR7,  ERR8,  ERR9,  ERR10,    ERR1,  ERR2,  ERR3,  ERR4,  ERR5,  ERR6,  ERR7,  ERR8,  ERR9,  ERR10,
48    ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, ERR20,    ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, ERR20,
49    ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR29, ERR29, ERR30,    ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR29, ERR29, ERR30,
50    ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39, ERR40,    ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39, ERR40,
51    ERR41, ERR42, ERR43, ERR44 };    ERR41, ERR42, ERR43, ERR44 };
52    
53  static int eint[] = {  static const int eint[] = {
54    REG_EESCAPE, /* "\\ at end of pattern" */    REG_EESCAPE, /* "\\ at end of pattern" */
55    REG_EESCAPE, /* "\\c at end of pattern" */    REG_EESCAPE, /* "\\c at end of pattern" */
56    REG_EESCAPE, /* "unrecognized character follows \\" */    REG_EESCAPE, /* "unrecognized character follows \\" */
# Line 99  static int eint[] = { Line 99  static int eint[] = {
99    
100  /* Table of texts corresponding to POSIX error codes */  /* Table of texts corresponding to POSIX error codes */
101    
102  static const char *pstring[] = {  static const char *const pstring[] = {
103    "",                                /* Dummy for value 0 */    "",                                /* Dummy for value 0 */
104    "internal error",                  /* REG_ASSERT */    "internal error",                  /* REG_ASSERT */
105    "invalid repeat counts in {}",     /* BADBR      */    "invalid repeat counts in {}",     /* BADBR      */
# Line 145  return REG_ASSERT; Line 145  return REG_ASSERT;
145  *          Translate error code to string        *  *          Translate error code to string        *
146  *************************************************/  *************************************************/
147    
148  size_t  EXPORT size_t
149  regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)  regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
150  {  {
151  const char *message, *addmessage;  const char *message, *addmessage;
# Line 180  return length + addlength; Line 180  return length + addlength;
180  *           Free store held by a regex           *  *           Free store held by a regex           *
181  *************************************************/  *************************************************/
182    
183  void  EXPORT void
184  regfree(regex_t *preg)  regfree(regex_t *preg)
185  {  {
186  (pcre_free)(preg->re_pcre);  (pcre_free)(preg->re_pcre);
# Line 203  Returns: 0 on success Line 203  Returns: 0 on success
203                various non-zero codes on failure                various non-zero codes on failure
204  */  */
205    
206  int  EXPORT int
207  regcomp(regex_t *preg, const char *pattern, int cflags)  regcomp(regex_t *preg, const char *pattern, int cflags)
208  {  {
209  const char *errorptr;  const char *errorptr;
# Line 236  ints. However, if the number of possible Line 236  ints. However, if the number of possible
236  block of store on the stack, to reduce the use of malloc/free. The threshold is  block of store on the stack, to reduce the use of malloc/free. The threshold is
237  in a macro that can be changed at configure time. */  in a macro that can be changed at configure time. */
238    
239  int  EXPORT int
240  regexec(const regex_t *preg, const char *string, size_t nmatch,  regexec(const regex_t *preg, const char *string, size_t nmatch,
241    regmatch_t pmatch[], int eflags)    regmatch_t pmatch[], int eflags)
242  {  {
# Line 294  else Line 294  else
294      case PCRE_ERROR_BADMAGIC: return REG_INVARG;      case PCRE_ERROR_BADMAGIC: return REG_INVARG;
295      case PCRE_ERROR_UNKNOWN_NODE: return REG_ASSERT;      case PCRE_ERROR_UNKNOWN_NODE: return REG_ASSERT;
296      case PCRE_ERROR_NOMEMORY: return REG_ESPACE;      case PCRE_ERROR_NOMEMORY: return REG_ESPACE;
297        case PCRE_ERROR_MATCHLIMIT: return REG_ESPACE;
298        case PCRE_ERROR_BADUTF8: return REG_INVARG;
299        case PCRE_ERROR_BADUTF8_OFFSET: return REG_INVARG;
300      default: return REG_ASSERT;      default: return REG_ASSERT;
301      }      }
302    }    }

Legend:
Removed from v.72  
changed lines
  Added in v.73

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12