home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / groff-1.09-src.lha / src / amiga / groff-1.09 / include / lib.h < prev    next >
C/C++ Source or Header  |  1994-02-12  |  3KB  |  126 lines

  1. // -*- C++ -*-
  2. /* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
  3.      Written by James Clark (jjc@jclark.com)
  4.  
  5. This file is part of groff.
  6.  
  7. groff is free software; you can redistribute it and/or modify it under
  8. the terms of the GNU General Public License as published by the Free
  9. Software Foundation; either version 2, or (at your option) any later
  10. version.
  11.  
  12. groff is distributed in the hope that it will be useful, but WITHOUT ANY
  13. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License along
  18. with groff; see the file COPYING.  If not, write to the Free Software
  19. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  20.  
  21. extern "C" {
  22. #ifndef strerror
  23.   char *strerror(int);
  24. #endif
  25. #ifndef __BORLANDC__
  26.   const char *itoa(int);
  27.   const char *iftoa(int, int);
  28. #endif /* __BORLANDC__ */
  29. }
  30.  
  31. #ifdef STDLIB_H_DECLARES_GETOPT
  32. #include <stdlib.h>
  33. #else /* not STDLIB_H_DECLARES_GETOPT */
  34. #ifdef UNISTD_H_DECLARES_GETOPT
  35. #include <sys/types.h>
  36. #include <unistd.h>
  37. #else /* not UNISTD_H_DECLARES_GETOPT */
  38. extern "C" {
  39.   int getopt(int, char **, const char *);
  40. }
  41. #endif /* not UNISTD_H_DECLARES_GETOPT */
  42.  
  43. extern "C" {
  44.   extern char *optarg;
  45.   extern int optind;
  46.   extern int opterr;
  47. }
  48.  
  49. #endif /* not STDLIB_H_DECLARES_GETOPT */
  50.  
  51. char *strsave(const char *s);
  52. int is_prime(unsigned);
  53.  
  54. #include <stdio.h>
  55.  
  56. FILE *xtmpfile();
  57.  
  58. #ifndef STDIO_H_DECLARES_POPEN
  59.  
  60. extern "C" { FILE *popen(const char *, const char *); }
  61.  
  62. #endif /* not STDIO_H_DECLARES_POPEN */
  63.  
  64. #ifndef STDIO_H_DECLARES_PCLOSE
  65.  
  66. extern "C" { int pclose (FILE *); }
  67.  
  68. #endif /* not STDIO_H_DECLARES_PCLOSE */
  69.  
  70. int interpret_lf_args(const char *p);
  71.  
  72. extern char illegal_char_table[];
  73.  
  74. inline int illegal_input_char(int c)
  75. {
  76.   return c >= 0 && illegal_char_table[c];
  77. }
  78.  
  79. #ifdef HAVE_CC_LIMITS_H
  80. #include <limits.h>
  81. #else /* not HAVE_CC_LIMITS_H */
  82. #define INT_MAX 2147483647
  83. #endif /* not HAVE_CC_LIMITS_H */
  84.  
  85. /* It's not safe to rely on people getting INT_MIN right (ie signed). */
  86.  
  87. #ifdef INT_MIN
  88. #undef INT_MIN
  89. #endif
  90.  
  91. #ifdef CFRONT_ANSI_BUG
  92.  
  93. /* This works around a bug in cfront 2.0 used with ANSI C compilers. */
  94.  
  95. #define INT_MIN ((long)(-INT_MAX-1))
  96.  
  97. #else /* not CFRONT_ANSI_BUG */
  98.  
  99. #define INT_MIN (-INT_MAX-1)
  100.  
  101. #endif /* not CFRONT_ANSI_BUG */
  102.  
  103. /* Maximum number of digits in the decimal representation of an int
  104. (not including the -). */
  105.  
  106. #define INT_DIGITS 10
  107.  
  108. #ifdef PI
  109. #undef PI
  110. #endif
  111.  
  112. const double PI = 3.14159265358979323846;
  113.  
  114. /* ad_delete deletes an array of objects with destructors;
  115. a_delete deletes an array of objects without destructors */
  116.  
  117. #ifdef ARRAY_DELETE_NEEDS_SIZE
  118. /* for 2.0 systems */
  119. #define ad_delete(size) delete [size]
  120. #define a_delete delete
  121. #else /* not ARRAY_DELETE_NEEDS_SIZE */
  122. /* for ARM systems */
  123. #define ad_delete(size) delete []
  124. #define a_delete delete []
  125. #endif /* not ARRAY_DELETE_NEEDS_SIZE */
  126.