OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / user / a60 / comm.h
1 /*
2  * Copyright (C) 1991,1992 Erik Schoenfelder (schoenfr@ibr.cs.tu-bs.de)
3  *
4  * This file is part of NASE A60.
5  * 
6  * NASE A60 is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * NASE A60 is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with NASE A60; see the file COPYING.  If not, write to the Free
18  * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  * comm.h:                                      oct '90
21  *
22  * Erik Schoenfelder (schoenfr@ibr.cs.tu-bs.de)
23  *
24  * some common stuff for the sources.
25  */
26
27 #ifndef COMM_H_HOOK
28 #define COMM_H_HOOK
29
30 #include <stdio.h>
31 #include <math.h>
32
33
34 #ifdef AMIGA
35 /* not in stdio.h: */
36 extern FILE *freopen ();
37 #endif
38
39
40 /*
41  * define NO_ENUMS, if the header files are changed (see ENUM.README).
42  */
43
44 #ifdef NO_ENUMS
45 #define ENUM
46 #else /* ! NO_ENUMS */
47 #define ENUM enum
48 #endif /* ! NO_ENUMS */
49
50 /*
51  * use prototypes with ANSI C  (e.g. GNU C):
52  */
53
54 #ifndef USE_PROTOTYPES
55 #ifdef __GNUC__
56 #ifdef __STDC__
57 #ifdef unix
58 #define USE_PROTOTYPES
59 #endif /* unix */
60 #endif /* __STDC__ */
61 #endif /* __GNUC__ */
62 #endif /* ! USE_PROTOTYPES */
63
64
65
66 #ifdef USE_PROTOTYPES
67 #ifndef _POSIX_SOURCE
68
69 #ifdef __STDC__
70 #define P(s) s
71 typedef void *VOID_P;
72 #else
73 #define P(s) ()
74 typedef char *VOID_P;
75 #endif
76
77 #ifndef THIS_IS_A60_LEX
78 extern char *malloc P((unsigned int n));
79 extern char *calloc P((unsigned int n, unsigned int s));
80 extern char *realloc P((char *p, unsigned int n));
81 extern int free P((char *p));
82 #endif
83
84 /*
85  * most of the following declarations are originally from Stefan Petri
86  * (petri@ibr.cs.tu-bs.de) - thanks.
87  */
88
89 extern int strlen P((const char *));
90 extern int strcmp P((const char *, const char *));
91 extern int strncmp P((char *, char *, int));
92 extern char *strcat P((char *, char *));
93
94 #ifdef USG
95 extern void exit P((int s));
96 extern void perror P((char *s));
97 #else
98 extern void exit P((const int s));
99 extern int perror P((char *s));
100 extern int bcopy P((char *s1, char *s2, int n));
101 #endif
102
103 extern int sleep P((unsigned s));
104
105 #include <setjmp.h>
106 extern int setjmp P((jmp_buf env));
107 #ifdef sun
108 extern void longjmp P((jmp_buf env, int val));
109 #else /* ! sun */
110 extern int longjmp P((jmp_buf, int));
111 #endif /* ! sun */
112
113 extern int system P((char *s));
114 extern int pclose P((FILE *f));
115 extern FILE *popen P((char *c, char *t));
116 extern FILE *fopen P((char *s, char *m));
117 extern int printf P((char *s, ...));
118 extern int fprintf P((FILE *f, char *s, ...));
119 extern int _filbuf P((FILE *f));        /* to keep gcc -Wall happy */
120 extern int _flsbuf P((unsigned char c, FILE *f));
121 extern int setbuf P((FILE *f, char *b));
122 extern int fflush P((FILE *f));
123 extern int fgetc P((FILE *f));
124 extern int read P((int, char *, int));
125 extern int ungetc P((int c, FILE *f));
126 extern int atoi P((char *s));
127 extern int sscanf P((char *s, char *f, ...));
128 extern int scanf P((char *f, ...));
129 extern int fscanf P((FILE *, char *f, ...));
130 extern int fputs P((char *s, FILE *f));
131 extern int fputc P((int c, FILE *f));
132 extern int fseek P((FILE *f, long o, int p));
133 extern int fclose P((FILE *f));
134 extern int puts P((char *s));
135 extern long time P((long *));
136 extern int dup2 P((int, int));
137
138 #endif /* ! _POSIX_SOURCE */
139 #else /* ! USE_PROTOTYPES */
140
141 /*
142  * some externals:
143  * (this is surely not the best choice...)
144  */
145 #ifdef __STDC__
146 #include <string.h>
147 #else /* ! __STDC__ */
148 extern strlen ();
149 extern strcmp ();
150 extern char *strcpy ();
151 extern char *strcat ();
152 #endif /* ! __STDC__ */
153
154 #ifndef __STDC__
155 #ifndef MSDOS
156 extern printf ();
157 extern fprintf ();
158 extern sscanf ();
159 extern fputs ();
160 extern read ();
161 extern void exit ();
162 #endif /* MSDOS */
163 #endif /* __STDC__ */
164
165 #endif /* ! USE_PROTOTYPES */
166
167 #undef P
168
169 #endif /* COMM_H_HOOK */