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 char *strerror(int);
23 #ifndef __BORLANDC__
24 const char *itoa(int);
25 const char *iftoa(int, int);
26 #endif /* __BORLANDC__ */
27 };
28
29 #include <stdlib.h>
30
31 char *strsave(const char *s);
32 int is_prime(unsigned);
33
34 #include <stdio.h>
35
36 FILE *xtmpfile();
37
38 int interpret_lf_args(const char *p);
39
40 extern char illegal_char_table[];
41
illegal_input_char(int c)42 inline int illegal_input_char(int c)
43 {
44 return c >= 0 && illegal_char_table[c];
45 }
46
47 #ifdef HAVE_CC_LIMITS_H
48 #include <limits.h>
49 #else /* not HAVE_CC_LIMITS_H */
50 #define INT_MAX 2147483647
51 #endif /* not HAVE_CC_LIMITS_H */
52
53 /* It's not safe to rely on people getting INT_MIN right (ie signed). */
54
55 #ifdef INT_MIN
56 #undef INT_MIN
57 #endif
58
59 #ifdef CFRONT_ANSI_BUG
60
61 /* This works around a bug in cfront 2.0 used with ANSI C compilers. */
62
63 #define INT_MIN ((long)(-INT_MAX-1))
64
65 #else /* not CFRONT_ANSI_BUG */
66
67 #define INT_MIN (-INT_MAX-1)
68
69 #endif /* not CFRONT_ANSI_BUG */
70
71 /* Maximum number of digits in the decimal representation of an int
72 (not including the -). */
73
74 #define INT_DIGITS 10
75
76 /* ad_delete deletes an array of objects with destructors;
77 a_delete deletes an array of objects without destructors */
78
79 #ifdef ARRAY_DELETE_NEEDS_SIZE
80 /* for 2.0 systems */
81 #define ad_delete(size) delete [size]
82 #define a_delete delete
83 #else /* not ARRAY_DELETE_NEEDS_SIZE */
84 /* for ARM systems */
85 #define ad_delete(size) delete []
86 #define a_delete delete []
87 #endif /* not ARRAY_DELETE_NEEDS_SIZE */
88