gcc-2.4.3.1 subdirectories
[unix-history] / gnu / usr.bin / cc / libgcc / _new_handler.c
CommitLineData
9bf86ebb
PR
1extern int target_flags;
2
3enum reg_class
4{
5 NO_REGS,
6 AREG, DREG, CREG, BREG,
7 Q_REGS,
8 SIREG, DIREG,
9 INDEX_REGS,
10 GENERAL_REGS,
11 FP_TOP_REG, FP_SECOND_REG,
12 FLOAT_REGS,
13 ALL_REGS, LIM_REG_CLASSES
14};
15extern enum reg_class regclass_map[17 ];
16
17
18extern struct rtx_def *i386_compare_op0, *i386_compare_op1;
19extern struct rtx_def *(*i386_compare_gen)(), *(*i386_compare_gen_eq)();
20extern char *hi_reg_name[];
21extern char *qi_reg_name[];
22extern char *qi_high_reg_name[];
23
24enum machine_mode {
25 VOIDmode ,
26 QImode ,
27 HImode ,
28 PSImode ,
29 SImode ,
30 PDImode ,
31 DImode ,
32 TImode ,
33 OImode ,
34 QFmode ,
35 HFmode ,
36 SFmode ,
37 DFmode ,
38 XFmode ,
39 TFmode ,
40 SCmode ,
41 DCmode ,
42 XCmode ,
43 TCmode ,
44 CQImode ,
45 CHImode ,
46 CSImode ,
47 CDImode ,
48 CTImode ,
49 COImode ,
50 BLKmode ,
51 CCmode ,
52 CCFPEQmode ,
53MAX_MACHINE_MODE };
54extern char *mode_name[];
55enum mode_class { MODE_RANDOM, MODE_INT, MODE_FLOAT, MODE_PARTIAL_INT, MODE_CC,
56 MODE_COMPLEX_INT, MODE_COMPLEX_FLOAT, MAX_MODE_CLASS};
57extern enum mode_class mode_class[];
58extern int mode_size[];
59extern int mode_unit_size[];
60extern enum machine_mode mode_wider_mode[];
61extern enum machine_mode mode_for_size (unsigned int, enum mode_class, int) ;
62extern enum machine_mode get_best_mode (int, int, int, enum machine_mode, int) ;
63extern enum machine_mode class_narrowest_mode[];
64extern enum machine_mode byte_mode;
65extern enum machine_mode word_mode;
66typedef int ptrdiff_t;
67typedef unsigned int size_t;
68typedef short unsigned int wchar_t;
69typedef unsigned int UQItype __attribute__ ((mode (QI)));
70typedef int SItype __attribute__ ((mode (SI)));
71typedef unsigned int USItype __attribute__ ((mode (SI)));
72typedef int DItype __attribute__ ((mode (DI)));
73typedef unsigned int UDItype __attribute__ ((mode (DI)));
74typedef float SFtype __attribute__ ((mode (SF)));
75typedef float DFtype __attribute__ ((mode (DF)));
76typedef int word_type __attribute__ ((mode (SI)));
77 struct DIstruct {SItype low, high;};
78typedef union
79{
80 struct DIstruct s;
81 DItype ll;
82} DIunion;
83extern DItype __fixunssfdi (SFtype a);
84extern DItype __fixunsdfdi (DFtype a);
85typedef void *__gnuc_va_list;
86typedef size_t;
87
88typedef long fpos_t;
89struct __sbuf {
90 unsigned char *_base;
91 int _size;
92};
93typedef struct __sFILE {
94 unsigned char *_p;
95 int _r;
96 int _w;
97 short _flags;
98 short _file;
99 struct __sbuf _bf;
100 int _lbfsize;
101
102 void *_cookie;
103 int (*_close) (void *) ;
104 int (*_read) (void *, char *, int) ;
105 fpos_t (*_seek) (void *, fpos_t, int) ;
106 int (*_write) (void *, const char *, int) ;
107
108 struct __sbuf _ub;
109 unsigned char *_up;
110 int _ur;
111
112 unsigned char _ubuf[3];
113 unsigned char _nbuf[1];
114
115 struct __sbuf _lb;
116
117 int _blksize;
118 int _offset;
119} FILE;
120extern FILE __sF[];
121
122void clearerr (FILE *) ;
123int fclose (FILE *) ;
124int feof (FILE *) ;
125int ferror (FILE *) ;
126int fflush (FILE *) ;
127int fgetc (FILE *) ;
128int fgetpos (FILE *, fpos_t *) ;
129char *fgets (char *, size_t, FILE *) ;
130FILE *fopen (const char *, const char *) ;
131int fprintf (FILE *, const char *, ...) ;
132int fputc (int, FILE *) ;
133int fputs (const char *, FILE *) ;
134int fread (void *, size_t, size_t, FILE *) ;
135FILE *freopen (const char *, const char *, FILE *) ;
136int fscanf (FILE *, const char *, ...) ;
137int fseek (FILE *, long, int) ;
138int fsetpos (FILE *, const fpos_t *) ;
139long ftell (const FILE *) ;
140int fwrite (const void *, size_t, size_t, FILE *) ;
141int getc (FILE *) ;
142int getchar (void) ;
143char *gets (char *) ;
144extern int sys_nerr;
145extern char *sys_errlist[];
146void perror (const char *) ;
147int printf (const char *, ...) ;
148int putc (int, FILE *) ;
149int putchar (int) ;
150int puts (const char *) ;
151int remove (const char *) ;
152int rename (const char *, const char *) ;
153void rewind (FILE *) ;
154int scanf (const char *, ...) ;
155void setbuf (FILE *, char *) ;
156int setvbuf (FILE *, char *, int, size_t) ;
157int sprintf (char *, const char *, ...) ;
158int sscanf (char *, const char *, ...) ;
159FILE *tmpfile (void) ;
160char *tmpnam (char *) ;
161int ungetc (int, FILE *) ;
162int vfprintf (FILE *, const char *, __gnuc_va_list) ;
163int vprintf (const char *, __gnuc_va_list) ;
164int vsprintf (char *, const char *, __gnuc_va_list) ;
165char *ctermid (char *) ;
166FILE *fdopen (int, const char *) ;
167int fileno (FILE *) ;
168char *fgetline (FILE *, size_t *) ;
169int fpurge (FILE *) ;
170int getw (FILE *) ;
171int pclose (FILE *) ;
172FILE *popen (const char *, const char *) ;
173int putw (int, FILE *) ;
174void setbuffer (FILE *, char *, int) ;
175int setlinebuf (FILE *) ;
176char *tempnam (const char *, const char *) ;
177int snprintf (char *, size_t, const char *, ...) ;
178int vsnprintf (char *, size_t, const char *, __gnuc_va_list) ;
179int vscanf (const char *, __gnuc_va_list) ;
180int vsscanf (const char *, const char *, __gnuc_va_list) ;
181FILE *funopen (const void *,
182 int (*)(void *, char *, int),
183 int (*)(void *, const char *, int),
184 fpos_t (*)(void *, fpos_t, int),
185 int (*)(void *)) ;
186int __srget (FILE *) ;
187int __svfscanf (FILE *, const char *, __gnuc_va_list) ;
188int __swbuf (int, FILE *) ;
189static inline int __sputc(int _c, FILE *_p) {
190 if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
191 return (*_p->_p++ = _c);
192 else
193 return (__swbuf(_c, _p));
194}
195typedef void (*vfp)(void);
196extern void *__builtin_new (size_t);
197static void default_new_handler (void);
198vfp __new_handler = default_new_handler;
199vfp
200__set_new_handler (handler)
201 vfp handler;
202{
203 vfp prev_handler;
204 prev_handler = __new_handler;
205 if (handler == 0) handler = default_new_handler;
206 __new_handler = handler;
207 return prev_handler;
208}
209vfp
210set_new_handler (handler)
211 vfp handler;
212{
213 return __set_new_handler (handler);
214}
215static void
216default_new_handler ()
217{
218
219
220 write (2, "Virtual memory exceeded in `new'\n" , sizeof ("Virtual memory exceeded in `new'\n" ));
221
222 _exit (-1);
223}