home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / groff / libgroff / lib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-08  |  2.5 KB  |  95 lines

  1. /*-
  2.  * This code is derived from software copyrighted by the Free Software
  3.  * Foundation.
  4.  *
  5.  * Modified 1991 by Donn Seeley at UUNET Technologies, Inc.
  6.  *
  7.  *    @(#)lib.h    6.4 (Berkeley) 5/8/91
  8.  */
  9.  
  10. /* Copyright (C) 1989, 1990 Free Software Foundation, Inc.
  11.      Written by James Clark (jjc@jclark.uucp)
  12.  
  13. This file is part of groff.
  14.  
  15. groff is free software; you can redistribute it and/or modify it under
  16. the terms of the GNU General Public License as published by the Free
  17. Software Foundation; either version 1, or (at your option) any later
  18. version.
  19.  
  20. groff is distributed in the hope that it will be useful, but WITHOUT ANY
  21. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  22. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  23. for more details.
  24.  
  25. You should have received a copy of the GNU General Public License along
  26. with groff; see the file LICENSE.  If not, write to the Free Software
  27. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  28.  
  29. /* This file is included in both C and C++ compilations. */
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33.   // const char *strerror(int);
  34.   // const char *itoa(int);
  35.   // const char *iftoa(int, int);
  36. };
  37.  
  38. const char *itoa(int);
  39. const char *iftoa(int, int);
  40.  
  41. char *strsave(const char *s);
  42.  
  43. int interpret_lf_args(const char *p);
  44.  
  45. inline int illegal_input_char(int c)
  46. {
  47.   return c == 000 || (c > 012 && c < 040) || (c >= 0200 && c < 0240);
  48. }
  49.  
  50. #endif
  51.  
  52. #ifndef INT_MAX
  53. #define INT_MAX 2147483647
  54. #endif
  55.  
  56. /* It's not safe to rely on people getting INT_MIN right (ie signed). */
  57.  
  58. #ifdef INT_MIN
  59. #undef INT_MIN
  60. #endif
  61.  
  62. #ifdef CFRONT_ANSI_BUG
  63.  
  64. /* This works around a bug in cfront 2.0 used with ANSI C compilers. */
  65.  
  66. #define INT_MIN ((long)(-INT_MAX-1))
  67.  
  68. #else /* CFRONT_ANSI_BUG */
  69.  
  70. #define INT_MIN (-INT_MAX-1)
  71.  
  72. #endif /* CFRONT_ANSI_BUG */
  73.  
  74. /* Maximum number of digits in the decimal representation of an int
  75. (not including the -). */
  76.  
  77. #define INT_DIGITS 10
  78.  
  79. /* From the old GNU math.h; does some standard actually require these? */
  80. #define M_E         2.7182818284590452354
  81. #define M_LOG2E     1.4426950408889634074
  82. #define M_LOG10E    0.43429448190325182765
  83. #define M_LN2       0.69314718055994530942
  84. #define M_LN10      2.30258509299404568402
  85. #define M_PI        3.14159265358979323846
  86. #define M_PI_2      1.57079632679489661923
  87. #define M_1_PI      0.31830988618379067154
  88. #define M_PI_4      0.78539816339744830962
  89. #define M_2_PI      0.63661977236758134308
  90. #define M_2_SQRTPI  1.12837916709551257390
  91. #define M_SQRT2     1.41421356237309504880
  92. #define M_SQRT1_2   0.70710678118654752440
  93. #define PI  M_PI
  94. #define PI2  M_PI_2
  95.