1 /* Search for patterns in strings or files.
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
29 /* A pattern matcher. */
32 /* Compile a pattern and return the compiled pattern. */
33 void * (*compile) (const char *pattern, size_t pattern_size,
34 bool match_icase, bool match_words, bool match_lines,
37 /* Execute a search. */
38 size_t (*execute) (const void *compiled_pattern,
39 const char *buf, size_t buf_size,
40 size_t *match_size, bool exact);
42 /* Free a compiled pattern. */
43 void (*free) (void *compiled_pattern);
47 /* The built-in pattern matchers. */
48 extern matcher_t matcher_grep; /* POSIX Basic Regular Expressions */
49 extern matcher_t matcher_egrep; /* POSIX Extended Regular Expressions */
50 extern matcher_t matcher_fgrep; /* Fixed String search */
51 extern matcher_t matcher_awk; /* AWK Regular Expressions */
59 #endif /* _LIBGREP_H */