* src/devices/grolbp/lbp.cc (set_papersizes): Add declaration of
[s-roff.git] / src / include / lib.h
blobbfc57c35f5ec05f558c3d59bfe4b5e1137b351b0
1 // -*- C++ -*-
2 /* Copyright (C) 1989-2000 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
10 version.
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.
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. */
21 extern "C" {
22 #ifndef strerror
23 char *strerror(int);
24 #endif
25 const char *i_to_a(int);
26 const char *if_to_a(int, int);
29 #include <groff-getopt.h>
31 char *strsave(const char *s);
32 int is_prime(unsigned);
34 #include <stdio.h>
36 FILE *xtmpfile(char **namep=0, char *postfix=0, int do_unlink=1);
37 char *xtmptemplate(char *extension=0);
39 #ifndef STDIO_H_DECLARES_POPEN
41 extern "C" { FILE *popen(const char *, const char *); }
43 #endif /* not STDIO_H_DECLARES_POPEN */
45 #ifndef STDIO_H_DECLARES_PCLOSE
47 extern "C" { int pclose (FILE *); }
49 #endif /* not STDIO_H_DECLARES_PCLOSE */
51 int interpret_lf_args(const char *p);
53 extern char illegal_char_table[];
55 inline int illegal_input_char(int c)
57 return c >= 0 && illegal_char_table[c];
60 #ifndef HAVE_STRCASECMP
61 #define strcasecmp(a,b) strcmp((a),(b))
62 #endif
64 #ifndef HAVE_STRNCASECMP
65 #define strncasecmp(a,b,c) strncmp((a),(b),(c))
66 #endif
68 #ifdef HAVE_CC_LIMITS_H
69 #include <limits.h>
70 #else /* not HAVE_CC_LIMITS_H */
71 #define INT_MAX 2147483647
72 #endif /* not HAVE_CC_LIMITS_H */
74 /* It's not safe to rely on people getting INT_MIN right (ie signed). */
76 #ifdef INT_MIN
77 #undef INT_MIN
78 #endif
80 #ifdef CFRONT_ANSI_BUG
82 /* This works around a bug in cfront 2.0 used with ANSI C compilers. */
84 #define INT_MIN ((long)(-INT_MAX-1))
86 #else /* not CFRONT_ANSI_BUG */
88 #define INT_MIN (-INT_MAX-1)
90 #endif /* not CFRONT_ANSI_BUG */
92 /* Maximum number of digits in the decimal representation of an int
93 (not including the -). */
95 #define INT_DIGITS 10
97 #ifdef PI
98 #undef PI
99 #endif
101 const double PI = 3.14159265358979323846;
103 /* ad_delete deletes an array of objects with destructors;
104 a_delete deletes an array of objects without destructors */
106 #ifdef ARRAY_DELETE_NEEDS_SIZE
107 /* for 2.0 systems */
108 #define ad_delete(size) delete [size]
109 #define a_delete delete
110 #else /* not ARRAY_DELETE_NEEDS_SIZE */
111 /* for ARM systems */
112 #define ad_delete(size) delete []
113 #define a_delete delete []
114 #endif /* not ARRAY_DELETE_NEEDS_SIZE */