Deleted Added
full compact
regcomp.c (104358) regcomp.c (111010)
1/*-
2 * Copyright (c) 1992, 1993, 1994 Henry Spencer.
3 * Copyright (c) 1992, 1993, 1994
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Henry Spencer.
8 *

--- 27 unchanged lines hidden (view full) ---

36 *
37 * @(#)regcomp.c 8.5 (Berkeley) 3/20/94
38 */
39
40#if defined(LIBC_SCCS) && !defined(lint)
41static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
42#endif /* LIBC_SCCS and not lint */
43#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1992, 1993, 1994 Henry Spencer.
3 * Copyright (c) 1992, 1993, 1994
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Henry Spencer.
8 *

--- 27 unchanged lines hidden (view full) ---

36 *
37 * @(#)regcomp.c 8.5 (Berkeley) 3/20/94
38 */
39
40#if defined(LIBC_SCCS) && !defined(lint)
41static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
42#endif /* LIBC_SCCS and not lint */
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/lib/libc/regex/regcomp.c 104358 2002-10-02 07:49:35Z mike $");
44__FBSDID("$FreeBSD: head/lib/libc/regex/regcomp.c 111010 2003-02-16 17:29:11Z nectar $");
45
46#include <sys/types.h>
47#include <stdio.h>
48#include <string.h>
49#include <ctype.h>
50#include <limits.h>
51#include <stdlib.h>
52#include <regex.h>

--- 48 unchanged lines hidden (view full) ---

101static void nonnewline(struct parse *p);
102static void repeat(struct parse *p, sopno start, int from, int to);
103static int seterr(struct parse *p, int e);
104static cset *allocset(struct parse *p);
105static void freeset(struct parse *p, cset *cs);
106static int freezeset(struct parse *p, cset *cs);
107static int firstch(struct parse *p, cset *cs);
108static int nch(struct parse *p, cset *cs);
45
46#include <sys/types.h>
47#include <stdio.h>
48#include <string.h>
49#include <ctype.h>
50#include <limits.h>
51#include <stdlib.h>
52#include <regex.h>

--- 48 unchanged lines hidden (view full) ---

101static void nonnewline(struct parse *p);
102static void repeat(struct parse *p, sopno start, int from, int to);
103static int seterr(struct parse *p, int e);
104static cset *allocset(struct parse *p);
105static void freeset(struct parse *p, cset *cs);
106static int freezeset(struct parse *p, cset *cs);
107static int firstch(struct parse *p, cset *cs);
108static int nch(struct parse *p, cset *cs);
109static void mcadd(struct parse *p, cset *cs, char *cp);
109static void mcadd(struct parse *p, cset *cs, char *cp) __unused;
110#if used
111static void mcsub(cset *cs, char *cp);
112static int mcin(cset *cs, char *cp);
113static char *mcfind(cset *cs, char *cp);
114#endif
115static void mcinvert(struct parse *p, cset *cs);
116static void mccase(struct parse *p, cset *cs);
117static int isinsets(struct re_guts *g, int c);

--- 1841 unchanged lines hidden (view full) ---

1959 g->charjump[ch] = g->mlen;
1960
1961 /* If the character does exist, compute the jump that would
1962 * take us to the last character in the pattern equal to it
1963 * (notice that we match right to left, so that last character
1964 * is the first one that would be matched).
1965 */
1966 for (mindex = 0; mindex < g->mlen; mindex++)
110#if used
111static void mcsub(cset *cs, char *cp);
112static int mcin(cset *cs, char *cp);
113static char *mcfind(cset *cs, char *cp);
114#endif
115static void mcinvert(struct parse *p, cset *cs);
116static void mccase(struct parse *p, cset *cs);
117static int isinsets(struct re_guts *g, int c);

--- 1841 unchanged lines hidden (view full) ---

1959 g->charjump[ch] = g->mlen;
1960
1961 /* If the character does exist, compute the jump that would
1962 * take us to the last character in the pattern equal to it
1963 * (notice that we match right to left, so that last character
1964 * is the first one that would be matched).
1965 */
1966 for (mindex = 0; mindex < g->mlen; mindex++)
1967 g->charjump[g->must[mindex]] = g->mlen - mindex - 1;
1967 g->charjump[(int)g->must[mindex]] = g->mlen - mindex - 1;
1968}
1969
1970/*
1971 - computematchjumps - compute match jumps for BM scan
1972 == static void computematchjumps(struct parse *p, struct re_guts *g);
1973 *
1974 * This algorithm assumes g->must exists and is has size greater than
1975 * zero. It's based on the algorithm found on Computer Algorithms by

--- 114 unchanged lines hidden ---
1968}
1969
1970/*
1971 - computematchjumps - compute match jumps for BM scan
1972 == static void computematchjumps(struct parse *p, struct re_guts *g);
1973 *
1974 * This algorithm assumes g->must exists and is has size greater than
1975 * zero. It's based on the algorithm found on Computer Algorithms by

--- 114 unchanged lines hidden ---