X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/f12b51f99bbe8bb6ad7eca12b047ba9b46836ee6..bdafda27046fab8d24e4e422b04574856b8b1d28:/quiz/rxp.c diff --git a/quiz/rxp.c b/quiz/rxp.c index 47c82d88..015d8a51 100644 --- a/quiz/rxp.c +++ b/quiz/rxp.c @@ -1,4 +1,4 @@ -/* $NetBSD: rxp.c,v 1.11 2003/08/07 09:37:34 agc Exp $ */ +/* $NetBSD: rxp.c,v 1.13 2009/08/27 00:31:12 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)rxp.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: rxp.c,v 1.11 2003/08/07 09:37:34 agc Exp $"); +__RCSID("$NetBSD: rxp.c,v 1.13 2009/08/27 00:31:12 dholland Exp $"); #endif #endif /* not lint */ @@ -82,21 +82,18 @@ 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((const char *, int)); -static char *rxp__expand __P((int)); -static int rxp__match __P((const char *, int, Rxp_t *, Rxp_t *, const char *)); +static int rxp__compile(const char *, int); +static char *rxp__expand(int); +static int rxp__match(const char *, int, Rxp_t *, Rxp_t *, const char *); int -rxp_compile(s) - const char * s; +rxp_compile(const char *s) { return (rxp__compile(s, TRUE)); } static int -rxp__compile(s, first) - const char *s; - int first; +rxp__compile(const char *s, int first) { static Rxp_t *rp; static const char *sp; @@ -192,19 +189,17 @@ rxp__compile(s, first) * match string against compiled regular expression */ int -rxp_match(s) - const char * s; +rxp_match(const char *s) { return (rxp__match(s, TRUE, NULL, NULL, NULL)); } static int -rxp__match(s, first, j_succ, j_fail, sp_fail) - const char *s; - int first; - Rxp_t *j_succ; /* jump here on successful alt match */ - Rxp_t *j_fail; /* jump here on failed match */ - const char *sp_fail; /* reset sp to here on failed match */ +rxp__match(const char *s, + int first, + Rxp_t *j_succ, /* jump here on successful alt match */ + Rxp_t *j_fail, /* jump here on failed match */ + const char *sp_fail) /* reset sp to here on failed match */ { static Rxp_t *rp; static const char *sp; @@ -262,14 +257,13 @@ rxp__match(s, first, j_succ, j_fail, sp_fail) * Reverse engineer the regular expression, by picking first of all alternates. */ char * -rxp_expand() +rxp_expand(void) { return (rxp__expand(TRUE)); } static char * -rxp__expand(first) - int first; +rxp__expand(int first) { static char buf[RXP_LINE_SZ/2]; static Rxp_t *rp;