diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2014-01-07 15:01:45 +0200 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2014-01-07 15:01:45 +0200 |
| commit | 6a7e7f8bc9182675098b587ff22b629654bd473d (patch) | |
| tree | 3238a0216c51742555c0097acfca251733785acc /trex.c | |
| parent | 522b066870988b60b67efcc118cc1a33c9e35547 (diff) | |
| download | tiny-rex-6a7e7f8bc9182675098b587ff22b629654bd473d.tar.gz tiny-rex-6a7e7f8bc9182675098b587ff22b629654bd473d.zip | |
enable defining flags when compiling regexp
Diffstat (limited to 'trex.c')
| -rw-r--r-- | trex.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -76,6 +76,7 @@ struct TRex{ int _currsubexp; void *_jmpbuf; const TRexChar **_error; + int _flags; }; static int trex_list(TRex *exp); @@ -528,7 +529,7 @@ static const TRexChar *trex_matchnode(TRex* exp,TRexNode *node,const TRexChar *s } /* public api */ -TRex *trex_compile(const TRexChar *pattern,const TRexChar **error) +TRex *trex_compile(const TRexChar *pattern,const TRexChar **error,int flags) { TRex *exp = (TRex *)malloc(sizeof(TRex)); exp->_eol = exp->_bol = NULL; @@ -541,6 +542,7 @@ TRex *trex_compile(const TRexChar *pattern,const TRexChar **error) exp->_first = trex_newnode(exp,OP_EXPR); exp->_error = error; exp->_jmpbuf = malloc(sizeof(jmp_buf)); + exp->_flags = flags; if(setjmp(*((jmp_buf*)exp->_jmpbuf)) == 0) { int res = trex_list(exp); exp->_nodes[exp->_first].left = res; |
