No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / libgrep / libgrep.h
blob99988c1f82d94955cc78a25ffd3626dbb2295cbe
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)
7 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, write to the Free Software Foundation,
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18 #ifndef _LIBGREP_H
19 #define _LIBGREP_H
21 #include <stdbool.h>
22 #include <stddef.h>
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
30 /* A pattern matcher. */
31 typedef struct {
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,
36 char eolbyte);
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);
46 } matcher_t;
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 */
55 #ifdef __cplusplus
57 #endif
60 #endif /* _LIBGREP_H */