Received: by taz.hyperreal.com (8.7.6/V2.0) id UAA26441; Wed, 6 Nov 1996 20:11:24 -0800 (PST) Received: from pooh.pageplus.com by taz.hyperreal.com (8.7.6/V2.0) with ESMTP id UAA26413; Wed, 6 Nov 1996 20:11:14 -0800 (PST) Received: from pooh.pageplus.com (hsf@localhost [127.0.0.1]) by pooh.pageplus.com (8.7.5/8.7.3) with ESMTP id WAA06016 for ; Wed, 6 Nov 1996 22:07:56 -0700 Message-Id: <199611070507.WAA06016@pooh.pageplus.com> To: new-httpd@hyperreal.com Subject: Re: call for votes: move code into subdirs before release? In-reply-to: Your message of "04 Nov 1996 18:24:31 GMT." <57n2wxpvkw.fsf@tees.elsevier.co.uk> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <6006.847343237.0@pooh.pageplus.com> Date: Wed, 06 Nov 1996 22:07:56 -0700 From: Howard Fear Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6006.847343237.1@pooh.pageplus.com> Paul Richards writes: > I started to look into this but I need whoever did this to provide me > with the original version of the lib that they used and a set of > diffs. I can get the diffs myself if you tell me where the original > version is. See attached files. (I can't remember if I sent the original Makefile or not, so I've included it as well) > If we don't do this properly merging in updates to the original > library will get messy. Henry's next version will be a complete rewrite. -- Howard Fear email1: howard_fear@pageplus.com email2: howard_fear@redcape.com http://www.pageplus.com/~hsf/ ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6006.847343237.2@pooh.pageplus.com> Content-Description: regex2.h /* * First, the stuff that ends up in the outside-world include file = typedef off_t regoff_t; = typedef struct { = int re_magic; = size_t re_nsub; // number of parenthesized subexpressions = const char *re_endp; // end pointer for REG_PEND = struct re_guts *re_g; // none of your business :-) = } regex_t; = typedef struct { = regoff_t rm_so; // start of match = regoff_t rm_eo; // end of match = } regmatch_t; */ /* * internals of regex_t */ #define MAGIC1 ((('r'^0200)<<8) | 'e') /* * The internal representation is a *strip*, a sequence of * operators ending with an endmarker. (Some terminology etc. is a * historical relic of earlier versions which used multiple strips.) * Certain oddities in the representation are there to permit running * the machinery backwards; in particular, any deviation from sequential * flow must be marked at both its source and its destination. Some * fine points: * * - OPLUS_ and O_PLUS are *inside* the loop they create. * - OQUEST_ and O_QUEST are *outside* the bypass they create. * - OCH_ and O_CH are *outside* the multi-way branch they create, while * OOR1 and OOR2 are respectively the end and the beginning of one of * the branches. Note that there is an implicit OOR2 following OCH_ * and an implicit OOR1 preceding O_CH. * * In state representations, an operator's bit is on to signify a state * immediately *preceding* "execution" of that operator. */ typedef unsigned long sop; /* strip operator */ typedef long sopno; #define OPRMASK 0xf8000000 #define OPDMASK 0x07ffffff #define OPSHIFT ((unsigned)27) #define OP(n) ((n)&OPRMASK) #define OPND(n) ((n)&OPDMASK) #define SOP(op, opnd) ((op)|(opnd)) /* operators meaning operand */ /* (back, fwd are offsets) */ #define OEND (1< uch [csetsize] */ uch mask; /* bit within array */ uch hash; /* hash code */ size_t smultis; char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */ } cset; /* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */ #define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c)) #define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (c)) #define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask) #define MCadd(p, cs, cp) mcadd(p, cs, cp) /* regcomp() internal fns */ #define MCsub(p, cs, cp) mcsub(p, cs, cp) #define MCin(p, cs, cp) mcin(p, cs, cp) /* stuff for character categories */ typedef unsigned char cat_t; /* * main compiled-expression structure */ struct re_guts { int magic; # define MAGIC2 ((('R'^0200)<<8)|'E') sop *strip; /* malloced area for strip */ int csetsize; /* number of bits in a cset vector */ int ncsets; /* number of csets in use */ cset *sets; /* -> cset [ncsets] */ uch *setbits; /* -> uch[csetsize][ncsets/CHAR_BIT] */ int cflags; /* copy of regcomp() cflags argument */ sopno nstates; /* = number of sops */ sopno firststate; /* the initial OEND (normally 0) */ sopno laststate; /* the final OEND */ int iflags; /* internal flags */ # define USEBOL 01 /* used ^ */ # define USEEOL 02 /* used $ */ # define BAD 04 /* something wrong */ int nbol; /* number of ^ used */ int neol; /* number of $ used */ int ncategories; /* how many character categories */ cat_t *categories; /* ->catspace[-CHAR_MIN] */ char *must; /* match must contain this string */ int mlen; /* length of must */ size_t nsub; /* copy of re_nsub */ int backrefs; /* does it use back references? */ sopno nplus; /* how deep does it nest +s? */ /* catspace must be last */ cat_t catspace[1]; /* actually [NC] */ }; /* misc utilities */ #define OUT (CHAR_MAX+1) /* a non-character value */ #define ISWORD(c) (isalnum(c) || (c) == '_') ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6006.847343237.3@pooh.pageplus.com> Content-Description: utils.h /* utility definitions */ #define DUPMAX _POSIX2_RE_DUP_MAX /* xxx is this right? */ #define INFINITY (DUPMAX + 1) #define NC (CHAR_MAX - CHAR_MIN + 1) typedef unsigned char uch; /* switch off assertions (if not already off) if no REDEBUG */ #ifndef REDEBUG #ifndef NDEBUG #define NDEBUG /* no assertions please */ #endif #endif #include /* for old systems with bcopy() but no memmove() */ #ifdef USEBCOPY #define memmove(d, s, c) bcopy(s, d, c) #endif ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6006.847343237.4@pooh.pageplus.com> Content-Description: Makefile # You probably want to take -DREDEBUG out of CFLAGS, and put something like # -O in, *after* testing (-DREDEBUG strengthens testing by enabling a lot of # internal assertion checking and some debugging facilities). # Put -Dconst= in for a pre-ANSI compiler. # Do not take -DPOSIX_MISTAKE out. # REGCFLAGS isn't important to you (it's for my use in some special contexts). CFLAGS=-I. -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) # If you have a pre-ANSI compiler, put -o into MKHFLAGS. If you want # the Berkeley __P macro, put -b in. MKHFLAGS= # Flags for linking but not compiling, if any. LDFLAGS= # Extra libraries for linking, if any. LIBS= # Internal stuff, should not need changing. OBJPRODN=regcomp.o regexec.o regerror.o regfree.o OBJS=$(OBJPRODN) split.o debug.o main.o H=cclass.h cname.h regex2.h utils.h REGSRC=regcomp.c regerror.c regexec.c regfree.c ALLSRC=$(REGSRC) engine.c debug.c main.c split.c # Stuff that matters only if you're trying to lint the package. LINTFLAGS=-I. -Dstatic= -Dconst= -DREDEBUG LINTC=regcomp.c regexec.c regerror.c regfree.c debug.c main.c JUNKLINT=possible pointer alignment|null effect # arrangements to build forward-reference header files .SUFFIXES: .ih .h .c.ih: sh ./mkh $(MKHFLAGS) -p $< >$@ default: r lib: purge $(OBJPRODN) rm -f libregex.a ar crv libregex.a $(OBJPRODN) purge: rm -f *.o # stuff to build regex.h REGEXH=regex.h REGEXHSRC=regex2.h $(REGSRC) $(REGEXH): $(REGEXHSRC) mkh sh ./mkh $(MKHFLAGS) -i _REGEX_H_ $(REGEXHSRC) >regex.tmp cmp -s regex.tmp regex.h 2>/dev/null || cp regex.tmp regex.h rm -f regex.tmp # dependencies $(OBJPRODN) debug.o: utils.h regex.h regex2.h regcomp.o: cclass.h cname.h regcomp.ih regexec.o: engine.c engine.ih regerror.o: regerror.ih debug.o: debug.ih main.o: main.ih # tester re: $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ # regression test r: re tests ./re &1 | egrep -v '$(JUNKLINT)' | tee lint fullprint: ti README WHATSNEW notes todo | list ti *.h | list list *.c list regex.3 regex.7 print: ti README WHATSNEW notes todo | list ti *.h | list list reg*.c engine.c mf.tmp: Makefile sed '/^REGEXH=/s/=.*/=regex.h/' Makefile | sed '/#DEL$$/d' >$@ DTRH=cclass.h cname.h regex2.h utils.h PRE=COPYRIGHT README WHATSNEW POST=mkh regex.3 regex.7 tests $(DTRH) $(ALLSRC) fake/*.[ch] FILES=$(PRE) Makefile $(POST) DTR=$(PRE) Makefile=mf.tmp $(POST) dtr: $(FILES) mf.tmp makedtr $(DTR) >$@ rm mf.tmp cio: $(FILES) cio $(FILES) rdf: $(FILES) rcsdiff -c $(FILES) 2>&1 | p # various forms of cleanup tidy: rm -f junk* core core.* *.core dtr *.tmp lint clean: tidy rm -f *.o *.s *.ih re libregex.a # don't do this one unless you know what you're doing spotless: clean rm -f mkh regex.h ------- =_aaaaaaaaaa0--