sh - Sync to FreeBSD d038ee76 part 2/2 (a)
[dragonfly.git] / contrib / grep / src / system.h
blob7da1d8d72bdaed9d704007c7643d213fbbbb7338
1 /* Portability cruft. Include after config.h and sys/types.h.
2 Copyright 1996, 1998-2000, 2007, 2009-2014 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, 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
16 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
17 02110-1301, USA. */
19 #ifndef GREP_SYSTEM_H
20 #define GREP_SYSTEM_H 1
22 #include <fcntl.h>
23 #include <unistd.h>
24 #include <errno.h>
26 #include "binary-io.h"
27 #include "configmake.h"
28 #include "dirname.h"
29 #include "minmax.h"
30 #include "same-inode.h"
32 #include <stdlib.h>
33 #include <stddef.h>
34 #include <limits.h>
35 #include <string.h>
36 #include <ctype.h>
38 enum { EXIT_TROUBLE = 2 };
40 #include <gettext.h>
41 #define N_(String) gettext_noop(String)
42 #define _(String) gettext(String)
44 #include <locale.h>
46 #ifndef initialize_main
47 # define initialize_main(argcp, argvp)
48 #endif
50 #include "unlocked-io.h"
52 #define STREQ(a, b) (strcmp (a, b) == 0)
54 /* Convert a possibly-signed character to an unsigned character. This is
55 a bit safer than casting to unsigned char, since it catches some type
56 errors that the cast doesn't. */
57 static inline unsigned char
58 to_uchar (char ch)
60 return ch;
63 #endif