diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-12-17 00:20:53 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-12-17 00:24:52 -0800 |
commit | 83e9cc897cd081aba38adecce46db2b6ed49b669 (patch) | |
tree | 25803aa1a5126a90cc7497cb695aeeee7f1b39c2 /lib/dfa.h | |
parent | 10ad4d2ac38c2ac2d16bd7686792715f64f9435e (diff) | |
download | gnulib-83e9cc897cd081aba38adecce46db2b6ed49b669.tar.gz |
dfa: new function dfacopysyntax
* lib/dfa.c (struct dfa): Move syntax member later so
that dfacopysyntax can easily clear earlier members.
(dfacopysyntax): New function, used by Gawk.
Diffstat (limited to 'lib/dfa.h')
-rw-r--r-- | lib/dfa.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -45,6 +45,7 @@ struct dfa; /* Entry points. */ /* Allocate a struct dfa. The struct dfa is completely opaque. + It should be initialized via dfasyntax or dfacopysyntax before other use. The returned pointer should be passed directly to free() after calling dfafree() on it. */ extern struct dfa *dfaalloc (void) _GL_ATTRIBUTE_MALLOC; @@ -61,8 +62,7 @@ enum DFA_EOL_NUL = 1 << 1 }; -/* Initialize or reinitialize a DFA. This must be called before - any of the routines below. The arguments are: +/* Initialize or reinitialize a DFA. The arguments are: 1. The DFA to operate on. 2. Information about the current locale. 3. Syntax bits described in regex.h. @@ -70,6 +70,9 @@ enum extern void dfasyntax (struct dfa *, struct localeinfo const *, reg_syntax_t, int); +/* Initialize or reinitialize a DFA from an already-initialized DFA. */ +extern void dfacopysyntax (struct dfa *, struct dfa const *); + /* Parse the given string of given length into the given struct dfa. */ extern void dfaparse (char const *, ptrdiff_t, struct dfa *); |