groff before CVS: release 1.05
[s-roff.git] / lib / lib.h
blob9e43500119352eb72a2c3e6aa9508af9f1e04c55
1 /* Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
2 Written by James Clark (jjc@jclark.uucp)
4 This file is part of groff.
6 groff is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 1, or (at your option) any later
9 version.
11 groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License along
17 with groff; see the file LICENSE. If not, write to the Free Software
18 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 /* This file is included in both C and C++ compilations. */
22 #ifdef __cplusplus
23 extern "C" {
24 char *strerror(int);
25 #ifndef __BORLANDC__
26 const char *itoa(int);
27 const char *iftoa(int, int);
28 #endif /* __BORLANDC__ */
31 char *strsave(const char *s);
32 int is_prime(unsigned);
33 #include <stdio.h>
34 FILE *xtmpfile();
36 int interpret_lf_args(const char *p);
38 inline int illegal_input_char(int c)
40 return c == 000 || (c > 012 && c < 040) || (c >= 0200 && c < 0240);
43 #endif
45 #ifndef INT_MAX
46 #define INT_MAX 2147483647
47 #endif
49 /* It's not safe to rely on people getting INT_MIN right (ie signed). */
51 #ifdef INT_MIN
52 #undef INT_MIN
53 #endif
55 #ifdef CFRONT_ANSI_BUG
57 /* This works around a bug in cfront 2.0 used with ANSI C compilers. */
59 #define INT_MIN ((long)(-INT_MAX-1))
61 #else /* CFRONT_ANSI_BUG */
63 #define INT_MIN (-INT_MAX-1)
65 #endif /* CFRONT_ANSI_BUG */
67 /* Maximum number of digits in the decimal representation of an int
68 (not including the -). */
70 #define INT_DIGITS 10
72 /* ad_delete deletes an array of objects with destructors;
73 a_delete deletes an array of objects without destructors */
75 #ifdef ARRAY_DELETE_NEEDS_SIZE
76 /* for 2.0 systems */
77 #define ad_delete(size) delete [size]
78 #define a_delete delete
79 #else /* not ARRAY_DELETE_NEEDS_SIZE */
80 /* for ARM systems */
81 #define ad_delete(size) delete []
82 #define a_delete delete []
83 #endif /* not ARRAY_DELETE_NEEDS_SIZE */