| 1 | /* system.h: system-dependent declarations; include this first.
|
|---|
| 2 | $Id: system.h,v 1.12 2004/04/26 13:56:57 karl Exp $
|
|---|
| 3 |
|
|---|
| 4 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
|
|---|
| 5 | Foundation, Inc.
|
|---|
| 6 |
|
|---|
| 7 | This program is free software; you can redistribute it and/or modify
|
|---|
| 8 | it under the terms of the GNU General Public License as published by
|
|---|
| 9 | the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 10 | any later version.
|
|---|
| 11 |
|
|---|
| 12 | This program is distributed in the hope that it will be useful,
|
|---|
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 15 | GNU General Public License for more details.
|
|---|
| 16 |
|
|---|
| 17 | You should have received a copy of the GNU General Public License
|
|---|
| 18 | along with this program; if not, write to the Free Software Foundation,
|
|---|
| 19 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|---|
| 20 |
|
|---|
| 21 | #ifndef TEXINFO_SYSTEM_H
|
|---|
| 22 | #define TEXINFO_SYSTEM_H
|
|---|
| 23 |
|
|---|
| 24 | #define _GNU_SOURCE
|
|---|
| 25 |
|
|---|
| 26 | #include <config.h>
|
|---|
| 27 |
|
|---|
| 28 | #ifdef MIKTEX
|
|---|
| 29 | #include <gnu-miktex.h>
|
|---|
| 30 | #define S_ISDIR(x) ((x)&_S_IFDIR)
|
|---|
| 31 | #else
|
|---|
| 32 | /* MiKTeX defines substring() in a separate DLL, where it has its
|
|---|
| 33 | own __declspec declaration. We don't want to try to duplicate
|
|---|
| 34 | this Microsoft-ism here. */
|
|---|
| 35 | extern char *substring (const char *, const char *);
|
|---|
| 36 | #endif
|
|---|
| 37 |
|
|---|
| 38 | /* We follow the order of header inclusion from Autoconf's
|
|---|
| 39 | ac_includes_default, more or less. */
|
|---|
| 40 | #include <stdio.h>
|
|---|
| 41 | #include <sys/types.h>
|
|---|
| 42 | #include <ctype.h>
|
|---|
| 43 |
|
|---|
| 44 | /* All systems nowadays probably have these functions, but ... */
|
|---|
| 45 | #ifdef HAVE_LOCALE_H
|
|---|
| 46 | #include <locale.h>
|
|---|
| 47 | #endif
|
|---|
| 48 | #ifndef HAVE_SETLOCALE
|
|---|
| 49 | #define setlocale(category,locale) /* empty */
|
|---|
| 50 | #endif
|
|---|
| 51 |
|
|---|
| 52 | /* For gettext (NLS). */
|
|---|
| 53 | #define const
|
|---|
| 54 | #include "gettext.h"
|
|---|
| 55 | #undef const
|
|---|
| 56 |
|
|---|
| 57 | #define _(String) gettext (String)
|
|---|
| 58 | #define N_(String) (String)
|
|---|
| 59 |
|
|---|
| 60 | #ifdef STDC_HEADERS
|
|---|
| 61 | #define getopt system_getopt
|
|---|
| 62 | #include <stdlib.h>
|
|---|
| 63 | #undef getopt
|
|---|
| 64 | #else
|
|---|
| 65 | extern char *getenv ();
|
|---|
| 66 | #endif
|
|---|
| 67 |
|
|---|
| 68 | /* Don't use bcopy! Use memmove if source and destination may overlap,
|
|---|
| 69 | memcpy otherwise. */
|
|---|
| 70 | #if HAVE_STRING_H
|
|---|
| 71 | # if !STDC_HEADERS && HAVE_MEMORY_H
|
|---|
| 72 | # include <memory.h>
|
|---|
| 73 | # endif
|
|---|
| 74 | # include <string.h>
|
|---|
| 75 | #endif
|
|---|
| 76 |
|
|---|
| 77 | #if HAVE_STRINGS_H
|
|---|
| 78 | /* Always include <strings.h> if we have it. This is because that's
|
|---|
| 79 | what Autoconf's AC_CHECK_DECL does. On IBM AIX 4.2, strncasecmp is
|
|---|
| 80 | only declared in strings.h. */
|
|---|
| 81 | # include <strings.h>
|
|---|
| 82 | #endif
|
|---|
| 83 |
|
|---|
| 84 | #if !HAVE_STRNCASECMP || !HAVE_STRCASECMP
|
|---|
| 85 | # include "strcase.h"
|
|---|
| 86 | #endif
|
|---|
| 87 |
|
|---|
| 88 | #if !HAVE_DECL_MEMCHR
|
|---|
| 89 | char *memchr ();
|
|---|
| 90 | #endif
|
|---|
| 91 |
|
|---|
| 92 | /* <unistd.h> defines _POSIX_VERSION, but Paul Eggert points out that is
|
|---|
| 93 | only supposed to be used in user code, not other system headers. */
|
|---|
| 94 | #ifdef HAVE_UNISTD_H
|
|---|
| 95 | #include <unistd.h>
|
|---|
| 96 | #endif /* HAVE_UNISTD_H */
|
|---|
| 97 |
|
|---|
| 98 | #include <errno.h>
|
|---|
| 99 | #ifndef errno
|
|---|
| 100 | extern int errno;
|
|---|
| 101 | #endif
|
|---|
| 102 | #ifdef VMS
|
|---|
| 103 | #include <perror.h>
|
|---|
| 104 | #endif
|
|---|
| 105 |
|
|---|
| 106 | #ifndef HAVE_DECL_STRERROR
|
|---|
| 107 | extern char *strerror ();
|
|---|
| 108 | #endif
|
|---|
| 109 |
|
|---|
| 110 | #ifdef HAVE_LIMITS_H
|
|---|
| 111 | #include <limits.h>
|
|---|
| 112 | #endif
|
|---|
| 113 | #ifndef PATH_MAX
|
|---|
| 114 | #ifndef _POSIX_PATH_MAX
|
|---|
| 115 | # define _POSIX_PATH_MAX 255
|
|---|
| 116 | #endif
|
|---|
| 117 | #define PATH_MAX _POSIX_PATH_MAX
|
|---|
| 118 | #endif
|
|---|
| 119 |
|
|---|
| 120 | #ifndef HAVE_DECL_STRCASECMP
|
|---|
| 121 | extern int strcasecmp ();
|
|---|
| 122 | #endif
|
|---|
| 123 |
|
|---|
| 124 | #ifndef HAVE_DECL_STRNCASECMP
|
|---|
| 125 | extern int strncasecmp ();
|
|---|
|
|---|