2 /* Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.com)
5 This file is part of groff.
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
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
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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
25 const char *i_to_a(int);
26 const char *if_to_a(int, int);
29 /* stdio.h on IRIX, OSF/1, and UWIN includes getopt.h */
31 #if !(defined(__sgi) \
32 || (defined(__osf__) && defined(__alpha)) \
34 #include <groff-getopt.h>
37 char *strsave(const char *s
);
38 int is_prime(unsigned);
46 FILE *xtmpfile(char **namep
=0, char *postfix
=0, int do_unlink
=1);
47 char *xtmptemplate(char *extension
=0);
49 #ifdef NEED_DECLARATION_POPEN
51 extern "C" { FILE *popen(const char *, const char *); }
53 #endif /* NEED_DECLARATION_POPEN */
55 #ifdef NEED_DECLARATION_PCLOSE
57 extern "C" { int pclose (FILE *); }
59 #endif /* NEED_DECLARATION_PCLOSE */
61 int interpret_lf_args(const char *p
);
63 extern char illegal_char_table
[];
65 inline int illegal_input_char(int c
)
67 return c
>= 0 && illegal_char_table
[c
];
70 #if !defined(_AIX) && !defined(sinix) && !defined(__sinix__)
71 #ifdef HAVE_STRNCASECMP
72 #ifdef NEED_DECLARATION_STRNCASECMP
74 // SunOS's string.h fails to declare this.
75 int strncasecmp(const char *, const char *, int);
77 #endif /* NEED_DECLARATION_STRNCASECMP */
78 #endif /* HAVE_STRNCASECMP */
79 #endif /* !_AIX && !sinix && !__sinix__ */
81 #ifndef HAVE_STRCASECMP
82 #define strcasecmp(a,b) strcmp((a),(b))
85 #ifndef HAVE_STRNCASECMP
86 #define strncasecmp(a,b,c) strncmp((a),(b),(c))
89 #ifdef HAVE_CC_LIMITS_H
91 #else /* not HAVE_CC_LIMITS_H */
92 #define INT_MAX 2147483647
93 #endif /* not HAVE_CC_LIMITS_H */
95 /* It's not safe to rely on people getting INT_MIN right (ie signed). */
101 #ifdef CFRONT_ANSI_BUG
103 /* This works around a bug in cfront 2.0 used with ANSI C compilers. */
105 #define INT_MIN ((long)(-INT_MAX-1))
107 #else /* not CFRONT_ANSI_BUG */
109 #define INT_MIN (-INT_MAX-1)
111 #endif /* not CFRONT_ANSI_BUG */
113 /* Maximum number of digits in the decimal representation of an int
114 (not including the -). */
116 #define INT_DIGITS 10
122 const double PI
= 3.14159265358979323846;
124 /* ad_delete deletes an array of objects with destructors;
125 a_delete deletes an array of objects without destructors */
127 #ifdef ARRAY_DELETE_NEEDS_SIZE
128 /* for 2.0 systems */
129 #define ad_delete(size) delete [size]
130 #define a_delete delete
131 #else /* not ARRAY_DELETE_NEEDS_SIZE */
132 /* for ARM systems */
133 #define ad_delete(size) delete []
134 #define a_delete delete []
135 #endif /* not ARRAY_DELETE_NEEDS_SIZE */