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 2, or (at your option)
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, write to the Free Software Foundation,
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
30 /* A pattern matcher. */
33 /* Compile a pattern and return the compiled pattern. */
34 void * (*compile
) (const char *pattern
, size_t pattern_size
,
35 bool match_icase
, bool match_words
, bool match_lines
,
38 /* Execute a search. */
39 size_t (*execute
) (const void *compiled_pattern
,
40 const char *buf
, size_t buf_size
,
41 size_t *match_size
, bool exact
);
43 /* Free a compiled pattern. */
44 void (*free
) (void *compiled_pattern
);
48 /* The built-in pattern matchers. */
49 extern matcher_t matcher_grep
; /* POSIX Basic Regular Expressions */
50 extern matcher_t matcher_egrep
; /* POSIX Extended Regular Expressions */
51 extern matcher_t matcher_fgrep
; /* Fixed String search */
52 extern matcher_t matcher_awk
; /* AWK Regular Expressions */
60 #endif /* _LIBGREP_H */