aboutsummaryrefslogtreecommitdiffstats
path: root/dfa.h
diff options
context:
space:
mode:
Diffstat (limited to 'dfa.h')
-rw-r--r--dfa.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/dfa.h b/dfa.h
index 24fbcbe7..4eb42968 100644
--- a/dfa.h
+++ b/dfa.h
@@ -19,13 +19,20 @@
/* Written June, 1988 by Mike Haertel */
#include <regex.h>
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#else
+#include "missing_d/gawkbool.h"
+#endif /* HAVE_STDBOOL_H */
#include <stddef.h>
/* Element of a list of strings, at least one of which is known to
appear in any R.E. matching the DFA. */
struct dfamust
{
- int exact;
+ bool exact;
+ bool begline;
+ bool endline;
char *must;
struct dfamust *next;
};
@@ -68,6 +75,15 @@ extern void dfacomp (char const *, size_t, struct dfa *, int);
extern char *dfaexec (struct dfa *d, char const *begin, char *end,
int newline, size_t *count, int *backref);
+/* Return a superset for D. The superset matches everything that D
+ matches, along with some other strings (though the latter should be
+ rare, for efficiency reasons). Return a null pointer if no useful
+ superset is available. */
+extern struct dfa *dfasuperset (struct dfa const *d) _GL_ATTRIBUTE_PURE;
+
+/* The DFA is likely to be fast. */
+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 *);
@@ -101,11 +117,3 @@ extern void dfawarn (const char *);
extern _Noreturn void dfaerror (const char *);
extern int using_utf8 (void);
-
-/* Maximum number of characters that can be the case-folded
- counterparts of a single character, not counting the character
- itself. This is 1 for towupper, 1 for towlower, and 1 for each
- entry in LONESOME_LOWER; see dfa.c. */
-enum { CASE_FOLDED_BUFSIZE = 1 + 1 + 19 };
-
-extern int case_folded_counterparts (wchar_t, wchar_t[CASE_FOLDED_BUFSIZE]);