No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / libgrep / m-common.h
blob57970366ad9af920ab60cf0a19b6e00759fe3803
1 /* Pattern Matchers - Common Utilities.
2 Copyright (C) 1992, 1998, 2000, 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 #include <stdbool.h>
19 #include <stddef.h>
20 #include <limits.h>
21 #include "kwset.h"
23 #if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
24 /* We can handle multibyte string. */
25 # define MBS_SUPPORT
26 # include <wchar.h>
27 # include <wctype.h>
28 #endif
30 #define NCHAR (UCHAR_MAX + 1)
32 struct compiled_kwset {
33 kwset_t kwset;
34 char *trans;
35 bool match_words;
36 bool match_lines;
37 char eolbyte;
40 extern void
41 kwsinit (struct compiled_kwset *ckwset,
42 bool match_icase, bool match_words, bool match_lines,
43 char eolbyte);
45 #ifdef MBS_SUPPORT
46 extern char*
47 check_multibyte_string (const char *buf, size_t buf_size);
48 #endif
50 #define IS_WORD_CONSTITUENT(C) (ISALNUM(C) || (C) == '_')