home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / OS2 / gnuinfo.zip / lib / system.h < prev    next >
C/C++ Source or Header  |  1997-11-15  |  3KB  |  103 lines

  1. /* system.h: System-dependent declarations.  Include this first.
  2.    $Id: system.h,v 1.5 1997/07/31 20:34:36 karl Exp $
  3.  
  4.    Copyright (C) 1997 Free Software Foundation, Inc.
  5.  
  6.    This program is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2, or (at your option)
  9.    any later version.
  10.  
  11.    This program is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this program; if not, write to the Free Software Foundation,
  18.    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  19.  
  20. #ifndef TEXINFO_SYSTEM_H
  21. #define TEXINFO_SYSTEM_H
  22.  
  23. #define _GNU_SOURCE
  24.  
  25. #include <config.h>
  26.  
  27. /* <unistd.h> should be included before any preprocessor test
  28.    of _POSIX_VERSION.  */
  29. #ifdef HAVE_UNISTD_H
  30. #include <unistd.h>
  31. #endif /* HAVE_UNISTD_H */
  32.  
  33. #include <stdio.h>
  34. #include <sys/types.h>
  35. #include <ctype.h>
  36.  
  37. #ifdef HAVE_LOCALE_H
  38. #include <locale.h>
  39. #endif
  40. #include <libgettext.h>
  41.  
  42. /* Don't use bcopy!  Use memmove if source and destination may overlap,
  43.    memcpy otherwise.  */
  44. #ifdef HAVE_STRING_H
  45. # if !STDC_HEADERS && HAVE_MEMORY_H
  46. #  include <memory.h>
  47. # endif
  48. # include <string.h>
  49. #else
  50. # include <strings.h>
  51. char *memchr ();
  52. #endif
  53.  
  54. #ifdef STDC_HEADERS
  55. #define getopt system_getopt
  56. #include <stdlib.h>
  57. #undef getopt
  58. #else
  59. extern char *getenv ();
  60. #endif
  61.  
  62. #ifndef HAVE_STRERROR
  63. extern char *strerror ();
  64. #endif
  65.  
  66. #include <errno.h>
  67. #ifndef errno
  68. extern int errno;
  69. #endif
  70. #ifdef VMS
  71. #include <perror.h>
  72. #endif
  73.  
  74. #include <sys/stat.h>
  75.  
  76. #ifdef HAVE_SYS_FILE_H
  77. #include <sys/file.h>
  78. #endif /* HAVE_SYS_FILE_H */
  79.  
  80. #ifndef O_RDONLY
  81. /* Since <fcntl.h> is POSIX, prefer that to <sys/fcntl.h>.
  82.    This also avoids some useless warnings on (at least) Linux.  */
  83. #ifdef HAVE_FCNTL_H
  84. #include <fcntl.h>
  85. #else /* not HAVE_FCNTL_H */
  86. #ifdef HAVE_SYS_FCNTL_H
  87. #include <sys/fcntl.h>
  88. #endif /* not HAVE_SYS_FCNTL_H */
  89. #endif /* not HAVE_FCNTL_H */
  90. #endif /* not O_RDONLY */
  91.  
  92. #ifdef HAVE_PWD_H
  93. #include <pwd.h>
  94. #endif
  95. /* Some systems don't declare this function in pwd.h. */
  96. struct passwd *getpwnam ();
  97.  
  98. /* Our library routines not included in any system library.  */
  99. extern void *xmalloc (), *xrealloc ();
  100. extern char *xstrdup ();
  101.  
  102. #endif /* TEXINFO_SYSTEM_H */
  103.