OSDN Git Service

clean
[putex/putex.git] / src / texsourc / c-std.h
1 /* c-std.h: the first header files.
2
3    Copyright 1992 Karl Berry
4    Copyright 2007 TeX Users Group
5    Copyright 2014 Clerk Ma
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20    02110-1301 USA.  */
21
22 #ifndef C_STD_H
23   #define C_STD_H
24
25   /* Header files that essentially all of our sources need, and
26      that all implementations have.  We include these first, to help with
27      NULL being defined multiple times.  */
28   #include <math.h>
29   #include <stdio.h>
30
31   /* POSIX.1 says that <unistd.h> may require <sys/types.h>.  */
32   #include <sys/types.h>
33   
34   /* This is the symbol that X uses to determine if <sys/types.h> has been
35      read, so we define it.  */
36   #define __TYPES__
37
38   /* X uses this symbol to say whether we have <stddef.h> etc.  */
39   #ifndef STDC_HEADERS
40     #define X_NOT_STDC_ENV
41   #endif
42
43   /* Be sure we have constants from <unistd.h>.  */
44   #include "c-unistd.h"
45
46   /* Include <stdlib.h> first to help avoid NULL redefinitions.  */
47   #if STDC_HEADERS
48     #include <stdlib.h>
49     #include <stddef.h>
50 #else /* end of STDC_HEADERS */
51   extern char *getenv (const char *); /* extern char *getenv(); */
52
53   #ifndef ALLOC_RETURN_TYPE
54     #ifdef MSDOS
55       #include  <malloc.h>
56       #define ALLOC_RETURN_TYPE void
57     #else /* end of DOS case */
58       #define ALLOC_RETURN_TYPE char
59     #endif /* not DOS */
60 #endif /* not ALLOC_RETURN_TYPE */
61
62 /* extern ALLOC_RETURN_TYPE *calloc (), *malloc (), *realloc(); */
63 extern ALLOC_RETURN_TYPE *calloc (size_t, size_t);
64 extern ALLOC_RETURN_TYPE *malloc (size_t);
65 extern ALLOC_RETURN_TYPE *realloc (void *, size_t);
66 #endif /* not STDC_HEADERS */
67
68 /* strchr vs. index, memcpy vs. bcopy, etc.  */
69 #include "c-memstr.h"
70
71 /* Error numbers and errno declaration.  */
72 #include "c-errno.h"
73
74 /* Numeric minima and maxima.  */
75 #include "c-minmax.h"
76
77 /* popen is part of POSIX.2, not POSIX.1.  So STDC_HEADERS isn't enough.  */
78 /* extern FILE *popen(); */
79 /* extern double hypot(); */
80 /* extern double hypot (double, double); */     /* see math.h */
81
82 #endif /* not C_STD_H */