00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FIXINC_SYSTEM_H
00025 #define FIXINC_SYSTEM_H
00026
00027
00028 #include <stdarg.h>
00029
00030 #ifdef HAVE_STDDEF_H
00031 # include <stddef.h>
00032 #endif
00033
00034 #include <stdio.h>
00035
00036
00037 #ifndef NULL
00038 #define NULL 0
00039 #endif
00040
00041
00042 #define fopen(PATH,MODE) fopen_unlocked(PATH,MODE)
00043 #define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE)
00044 #define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM)
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #if defined HAVE_DECL_PUTC_UNLOCKED && HAVE_DECL_PUTC_UNLOCKED
00060
00061 # ifdef HAVE_PUTC_UNLOCKED
00062 # undef putc
00063 # define putc(C, Stream) putc_unlocked (C, Stream)
00064 # endif
00065 # ifdef HAVE_PUTCHAR_UNLOCKED
00066 # undef putchar
00067 # define putchar(C) putchar_unlocked (C)
00068 # endif
00069 # ifdef HAVE_GETC_UNLOCKED
00070 # undef getc
00071 # define getc(Stream) getc_unlocked (Stream)
00072 # endif
00073 # ifdef HAVE_GETCHAR_UNLOCKED
00074 # undef getchar
00075 # define getchar() getchar_unlocked ()
00076 # endif
00077 # ifdef HAVE_FPUTC_UNLOCKED
00078 # undef fputc
00079 # define fputc(C, Stream) fputc_unlocked (C, Stream)
00080 # endif
00081
00082 # ifdef HAVE_CLEARERR_UNLOCKED
00083 # undef clearerr
00084 # define clearerr(Stream) clearerr_unlocked (Stream)
00085 # if defined (HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED
00086 extern void clearerr_unlocked (FILE *);
00087 # endif
00088 # endif
00089 # ifdef HAVE_FEOF_UNLOCKED
00090 # undef feof
00091 # define feof(Stream) feof_unlocked (Stream)
00092 # if defined (HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED
00093 extern int feof_unlocked (FILE *);
00094 # endif
00095 # endif
00096 # ifdef HAVE_FILENO_UNLOCKED
00097 # undef fileno
00098 # define fileno(Stream) fileno_unlocked (Stream)
00099 # if defined (HAVE_DECL_FILENO_UNLOCKED) && !HAVE_DECL_FILENO_UNLOCKED
00100 extern int fileno_unlocked (FILE *);
00101 # endif
00102 # endif
00103 # ifdef HAVE_FFLUSH_UNLOCKED
00104 # undef fflush
00105 # define fflush(Stream) fflush_unlocked (Stream)
00106 # if defined (HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED
00107 extern int fflush_unlocked (FILE *);
00108 # endif
00109 # endif
00110 # ifdef HAVE_FGETC_UNLOCKED
00111 # undef fgetc
00112 # define fgetc(Stream) fgetc_unlocked (Stream)
00113 # if defined (HAVE_DECL_FGETC_UNLOCKED) && !HAVE_DECL_FGETC_UNLOCKED
00114 extern int fgetc_unlocked (FILE *);
00115 # endif
00116 # endif
00117 # ifdef HAVE_FGETS_UNLOCKED
00118 # undef fgets
00119 # define fgets(S, n, Stream) fgets_unlocked (S, n, Stream)
00120 # if defined (HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED
00121 extern char *fgets_unlocked (char *, int, FILE *);
00122 # endif
00123 # endif
00124 # ifdef HAVE_FPUTS_UNLOCKED
00125 # undef fputs
00126 # define fputs(String, Stream) fputs_unlocked (String, Stream)
00127 # if defined (HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
00128 extern int fputs_unlocked (const char *, FILE *);
00129 # endif
00130 # endif
00131 # ifdef HAVE_FERROR_UNLOCKED
00132 # undef ferror
00133 # define ferror(Stream) ferror_unlocked (Stream)
00134 # if defined (HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED
00135 extern int ferror_unlocked (FILE *);
00136 # endif
00137 # endif
00138 # ifdef HAVE_FREAD_UNLOCKED
00139 # undef fread
00140 # define fread(Ptr, Size, N, Stream) fread_unlocked (Ptr, Size, N, Stream)
00141 # if defined (HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED
00142 extern size_t fread_unlocked (void *, size_t, size_t, FILE *);
00143 # endif
00144 # endif
00145 # ifdef HAVE_FWRITE_UNLOCKED
00146 # undef fwrite
00147 # define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream)
00148 # if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
00149 extern size_t fwrite_unlocked (const void *, size_t, size_t, FILE *);
00150 # endif
00151 # endif
00152 # ifdef HAVE_FPRINTF_UNLOCKED
00153 # undef fprintf
00154
00155
00156 # define fprintf fprintf_unlocked
00157 # if defined (HAVE_DECL_FPRINTF_UNLOCKED) && !HAVE_DECL_FPRINTF_UNLOCKED
00158 extern int fprintf_unlocked (FILE *, const char *, ...);
00159 # endif
00160 # endif
00161
00162 #endif
00163
00164
00165
00166 #undef fread_unlocked
00167 #undef fwrite_unlocked
00168
00169 #include <sys/types.h>
00170 #include <errno.h>
00171
00172 #if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
00173 extern int errno;
00174 #endif
00175
00176
00177
00178 #define __NO_STRING_INLINES
00179
00180 #ifdef HAVE_STRING_H
00181 # include <string.h>
00182 #else
00183 # ifdef HAVE_STRINGS_H
00184 # include <strings.h>
00185 # endif
00186 #endif
00187
00188 #ifdef HAVE_STDLIB_H
00189 # include <stdlib.h>
00190 #endif
00191
00192 #ifdef HAVE_UNISTD_H
00193 # include <unistd.h>
00194 #endif
00195
00196 #ifdef HAVE_FCNTL_H
00197 # include <fcntl.h>
00198 #else
00199 # ifdef HAVE_SYS_FILE_H
00200 # include <sys/file.h>
00201 # endif
00202 #endif
00203
00204
00205
00206
00207
00208
00209 #if defined (HAVE_DECL_ABORT) && !HAVE_DECL_ABORT
00210 extern void abort (void);
00211 #endif
00212
00213 #if HAVE_SYS_STAT_H
00214 # include <sys/stat.h>
00215 #endif
00216
00217
00218 #ifndef S_ISREG
00219 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
00220 #endif
00221
00222
00223 #include "filenames.h"
00224
00225
00226 #include "libiberty.h"
00227 #include "safe-ctype.h"
00228
00229 #endif