diff options
author | ben <ben@rana> | 2016-04-27 07:52:41 -0500 |
---|---|---|
committer | ben <ben@rana> | 2016-04-27 07:52:41 -0500 |
commit | 85824350b5f65053053245d141aaf7d668089d28 (patch) | |
tree | 075fe72eef40032c692d31194b2faac58eec5d18 /sys/src/ape/lib/regexp/regaux.c | |
parent | 0f8168038af32828fcdc39575dea0e4de0c01122 (diff) |
remove ape regexp library, add utility for awk native port
Diffstat (limited to 'sys/src/ape/lib/regexp/regaux.c')
-rw-r--r-- | sys/src/ape/lib/regexp/regaux.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/sys/src/ape/lib/regexp/regaux.c b/sys/src/ape/lib/regexp/regaux.c deleted file mode 100644 index 6643b8ff8..000000000 --- a/sys/src/ape/lib/regexp/regaux.c +++ /dev/null @@ -1,56 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include "regexp.h" -#include "regcomp.h" - -/* - * Machine state - */ -Relist* _relist[2]; -Relist* _reliste[2]; -int _relistsize = LISTINCREMENT; - -/* - * save a new match in mp - */ -extern void -_renewmatch(Resub *mp, int ms, Resublist *sp) -{ - int i; - - if(mp==0 || ms<=0) - return; - if(mp[0].s.sp==0 || sp->m[0].s.sp<mp[0].s.sp || - (sp->m[0].s.sp==mp[0].s.sp && sp->m[0].e.ep>mp[0].e.ep)){ - for(i=0; i<ms && i<NSUBEXP; i++) - mp[i] = sp->m[i]; - for(; i<ms; i++) - mp[i].s.sp = mp[i].e.ep = 0; - } -} - -/* - * Note optimization in _renewthread: - * *lp must be pending when _renewthread called; if *l has been looked - * at already, the optimization is a bug. - */ -extern Relist* -_renewthread(Relist *lp, /* _relist to add to */ - Reinst *ip, /* instruction to add */ - Resublist *sep) /* pointers to subexpressions */ -{ - Relist *p; - - for(p=lp; p->inst; p++){ - if(p->inst == ip){ - if((sep)->m[0].s.sp < p->se.m[0].s.sp) - p->se = *sep; - return 0; - } - } - p->inst = ip; - p->se = *sep; - (++p)->inst = 0; - return p; -} - |