home *** CD-ROM | disk | FTP | other *** search
- #ifndef ORI_RE_LIB_READ
- # define ORI_RE_LIB_READ
- # include "bregex.h"
- /*{{{}}}*/
- /*{{{ maybe, regexec needs the length of the string*/
- # ifdef RE_STRLEN
- # undef regexec
- # define regexec(p,s,n,m,f) bregexec((p),(s),strlen(s),(n),(m),(f))
- # endif
- /*}}} */
- /*{{{ maybe limit the number of subexpressions*/
- # ifdef REG_NSUBMAX
- # define USE_SUB_LIMIT(x,p) ((p).re_nsub=(x),REG_NSUBMAX)
- # else
- # define USE_SUB_LIMIT(x,p) 0
- # endif
- /*}}} */
- /*{{{ maybe use NOSUB, while only searching*/
- # define USE_NOSUB(repl) ((repl)?0:REG_NOSUB)
- /*}}} */
- /*{{{ get error from regcomp/exec*/
- # define REG_ERR_OFF(preg) ((preg).re_erroffset)
- # define REG_ERR_TAG(e) ((e)==REG_ECOLLATE?(char*)"collation": \
- (e)==REG_ECTYPE ?(char*)"class": \
- (e)==REG_EESCAPE ?(char*)"\\": \
- (e)==REG_ESUBREG ?(char*)"\\x": \
- (e)==REG_EBRACK ?(char*)"[]": \
- (e)==REG_EPAREN ?(char*)"()": \
- (e)==REG_EBRACE ?(char*)"{}": \
- (e)==REG_BADBR ?(char*)"repeat": \
- (e)==REG_ERANGE ?(char*)"range": \
- (e)==REG_ESPACE ?(char*)M_NO_MEMORY: \
- (e)==REG_BADRPT ?(char*)"*+?!": \
- (char*)"failed")
- /*}}} */
- #endif
-