annotate kpathsea/c-std.h @ 1315:611d403c7f3d

[project @ 1995-06-25 19:56:32 by jwe]
author jwe
date Sun, 25 Jun 1995 19:56:32 +0000
parents 69501f98669d
children 1573640a9994
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1267
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
1 /* c-std.h: the first header files.
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
2
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
3 Copyright (C) 1992, 93, 94 Free Software Foundation, Inc.
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
4
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
7 the Free Software Foundation; either version 2, or (at your option)
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
8 any later version.
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
9
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
13 GNU General Public License for more details.
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
14
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
16 along with this program; if not, write to the Free Software
1315
611d403c7f3d [project @ 1995-06-25 19:56:32 by jwe]
jwe
parents: 1267
diff changeset
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
1267
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
18
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
19 #ifndef KPATHSEA_C_STD_H
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
20 #define KPATHSEA_C_STD_H
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
21
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
22 /* Header files that essentially all of our sources need, and
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
23 that all implementations have. We include these first, to help with
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
24 NULL being defined multiple times. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
25 #include <math.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
26 #include <stdio.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
27
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
28 /* Be sure we have constants from <unistd.h>. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
29 #include <kpathsea/c-unistd.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
30
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
31 #if HAVE_STDLIB_H
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
32 #include <stdlib.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
33 /* Include <stdlib.h> before <stddef.h>, to help avoid NULL
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
34 redefinitions on some systems. (We don't include <stddef.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
35 ourselves any more, but FYI.) */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
36 #else
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
37 /* It's impossible to say for sure what the system will deign to put in
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
38 <stdlib.h>, but let's hope it's at least these. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
39 extern char *getenv ();
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
40
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
41 #ifndef ALLOC_RETURN_TYPE
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
42 #ifdef DOS
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
43 #define ALLOC_RETURN_TYPE void
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
44 #else
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
45 #define ALLOC_RETURN_TYPE char
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
46 #endif /* not DOS */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
47 #endif /* not ALLOC_RETURN_TYPE */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
48
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
49 #ifndef _MALLOC_INTERNAL
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
50 /* Don't bother to declare these if we are compiling gmalloc.c itself. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
51 extern ALLOC_RETURN_TYPE *calloc (), *malloc (), *realloc ();
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
52 #endif
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
53
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
54 #endif /* not STDC_HEADERS */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
55
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
56 /* SunOS 4.1.1 gets STDC_HEADERS defined, but it doesn't provide
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
57 EXIT_FAILURE. So far no system has defined one of EXIT_FAILURE and
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
58 EXIT_SUCCESS without the other. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
59 #ifndef EXIT_SUCCESS
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
60 #ifdef VMS
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
61 #define EXIT_SUCCESS 1
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
62 #define EXIT_FAILURE 0
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
63 #else
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
64 #define EXIT_SUCCESS 0
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
65 #define EXIT_FAILURE 1
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
66 #endif
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
67 #endif /* not EXIT_SUCCESS */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
68
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
69 /* strchr vs. index, memcpy vs. bcopy, etc. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
70 #include <kpathsea/c-memstr.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
71
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
72 /* Error numbers and errno declaration. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
73 #include <kpathsea/c-errno.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
74
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
75 /* Numeric minima and maxima. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
76 #include <kpathsea/c-minmax.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
77
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
78 /* Assertions are too useful to not make generally available. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
79 #ifdef HAVE_ASSERT_H
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
80 #include <assert.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
81 #else
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
82 #define assert(expr) /* as nothing */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
83 #endif
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
84
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
85 #ifdef VMS
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
86 #include <unixlib.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
87 #include <unixio.h>
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
88 #else
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
89 /* `popen' and `pclose' are part of POSIX.2, not POSIX.1. So
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
90 STDC_HEADERS isn't enough. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
91 extern FILE *popen ();
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
92 extern int pclose ();
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
93 #endif
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
94
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
95 #ifndef hypot
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
96 /* hypot appears not to have made it into POSIX.2, even. */
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
97 extern double hypot ();
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
98 #endif
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
99
69501f98669d [project @ 1995-04-20 19:10:05 by jwe]
jwe
parents:
diff changeset
100 #endif /* not KPATHSEA_C_STD_H */