X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/462fca95471224f85b85be911e72faee16cd1597..104808840672ea22714fd8cedb51ead07e21a3c5:/quiz/rxp.c diff --git a/quiz/rxp.c b/quiz/rxp.c index bd9a0c1d..8531718b 100644 --- a/quiz/rxp.c +++ b/quiz/rxp.c @@ -1,9 +1,12 @@ +/* $NetBSD: rxp.c,v 1.7 1999/09/08 21:17:56 jsm Exp $ */ + /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by - * Jim R. Oldroyd at The Instruction Set. + * Jim R. Oldroyd at The Instruction Set and Keith Gabryelski at + * Commodore Business Machines. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,9 +37,13 @@ * SUCH DAMAGE. */ +#include #ifndef lint -/*static char sccsid[] = "from: @(#)rxp.c 5.1 (Berkeley) 11/10/91";*/ -static char rcsid[] = "$Id: rxp.c,v 1.3 1993/08/01 18:52:58 mycroft Exp $"; +#if 0 +static char sccsid[] = "@(#)rxp.c 8.1 (Berkeley) 5/31/93"; +#else +__RCSID("$NetBSD: rxp.c,v 1.7 1999/09/08 21:17:56 jsm Exp $"); +#endif #endif /* not lint */ /* @@ -78,24 +85,24 @@ typedef short Rxp_t; /* type for regexp tokens */ static Rxp_t rxpbuf[RXP_LINE_SZ]; /* compiled regular expression buffer */ char rxperr[128]; /* parser error message */ -static int rxp__compile __P((char *, int)); +static int rxp__compile __P((const char *, int)); static char *rxp__expand __P((int)); -static int rxp__match __P((char *, int, Rxp_t *, Rxp_t *, char *)); +static int rxp__match __P((const char *, int, Rxp_t *, Rxp_t *, const char *)); int rxp_compile(s) - register char * s; + const char * s; { return (rxp__compile(s, TRUE)); } static int rxp__compile(s, first) - register char *s; + const char *s; int first; { static Rxp_t *rp; - static char *sp; + static const char *sp; Rxp_t *grp_ptr; Rxp_t *alt_ptr; int esc, err; @@ -189,23 +196,23 @@ rxp__compile(s, first) */ int rxp_match(s) - register char * s; + const char * s; { return (rxp__match(s, TRUE, NULL, NULL, NULL)); } static int rxp__match(s, first, j_succ, j_fail, sp_fail) - char *s; + const char *s; int first; Rxp_t *j_succ; /* jump here on successful alt match */ Rxp_t *j_fail; /* jump here on failed match */ - char *sp_fail; /* reset sp to here on failed match */ + const char *sp_fail; /* reset sp to here on failed match */ { static Rxp_t *rp; - static char *sp; - register int ch; - Rxp_t *grp_end; + static const char *sp; + int ch; + Rxp_t *grp_end = NULL; int err; if (first) {