>From e1ae97cb4b6e75b8815a71e0f1c21cb6ad0df208 Mon Sep 17 00:00:00 2001 From: Norihiro Tanaka Date: Wed, 20 Apr 2016 23:44:03 -0700 Subject: [PATCH 2/2] dfa: stop exporting internal functions * src/dfa.c, src/dfa.h (dfaparse, dfaanalyze, dfastate, dfainit): Now static. --- src/dfa.c | 8 ++++---- src/dfa.h | 16 ---------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/dfa.c b/src/dfa.c index ee5fe88..a2aee29 100644 --- a/src/dfa.c +++ b/src/dfa.c @@ -1913,7 +1913,7 @@ regexp (void) /* Main entry point for the parser. S is a string to be parsed, len is the length of the string, so s can include NUL characters. D is a pointer to the struct dfa to parse into. */ -void +static void dfaparse (char const *s, size_t len, struct dfa *d) { dfa = d; @@ -2292,7 +2292,7 @@ state_separate_contexts (position_set const *s) Sets are stored as arrays of the elements, obeying a stack-like allocation scheme; the number of elements in each set deeper in the stack can be used to determine the address of a particular set's array. */ -void +static void dfaanalyze (struct dfa *d, bool searchflag) { /* Array allocated to hold position sets. */ @@ -2538,7 +2538,7 @@ dfaanalyze (struct dfa *d, bool searchflag) If after comparing with every group there are characters remaining in C, create a new group labeled with the characters of C and insert this position in that group. */ -void +static void dfastate (state_num s, struct dfa *d, state_num trans[]) { leaf_set grps[NOTCHAR]; /* As many as will ever be needed. */ @@ -3468,7 +3468,7 @@ free_mbdata (struct dfa *d) /* Initialize the components of a dfa that the other routines don't initialize for themselves. */ -void +static void dfainit (struct dfa *d) { memset (d, 0, sizeof *d); diff --git a/src/dfa.h b/src/dfa.h index 23b8783..ce267ec 100644 --- a/src/dfa.h +++ b/src/dfa.h @@ -87,22 +87,6 @@ extern bool dfaisfast (struct dfa const *) _GL_ATTRIBUTE_PURE; /* Free the storage held by the components of a struct dfa. */ extern void dfafree (struct dfa *); -/* Entry points for people who know what they're doing. */ - -/* Initialize the components of a struct dfa. */ -extern void dfainit (struct dfa *); - -/* Incrementally parse a string of given length into a struct dfa. */ -extern void dfaparse (char const *, size_t, struct dfa *); - -/* Analyze a parsed regexp; second argument tells whether to build a searching - or an exact matcher. */ -extern void dfaanalyze (struct dfa *, bool); - -/* Compute, for each possible character, the transitions out of a given - state, storing them in an array of integers. */ -extern void dfastate (ptrdiff_t, struct dfa *, ptrdiff_t []); - /* Error handling. */ /* dfawarn() is called by the regexp routines whenever a regex is compiled -- 2.5.5