Mercurial > hg > octave-kai > gnulib-hg
annotate lib/obstack.c @ 2979:9c55c384b97b
Update from GNU libc.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Fri, 10 Nov 2000 11:10:39 +0000 |
parents | a78fcdeb63d2 |
children | 7fed086612ed |
rev | line source |
---|---|
334 | 1 /* obstack.c - subroutines used implicitly by object stack macros |
2915 | 2 Copyright (C) 1988-1994,96,97,98,99,2000 Free Software Foundation, Inc. |
334 | 3 |
881 | 4 This file is part of the GNU C Library. Its master source is NOT part of |
5 the C library, however. The master source lives in /gd/gnu/lib. | |
6 | |
7 The GNU C Library is free software; you can redistribute it and/or | |
8 modify it under the terms of the GNU Library General Public License as | |
9 published by the Free Software Foundation; either version 2 of the | |
10 License, or (at your option) any later version. | |
334 | 11 |
881 | 12 The GNU C Library is distributed in the hope that it will be useful, |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 Library General Public License for more details. | |
334 | 16 |
881 | 17 You should have received a copy of the GNU Library General Public |
18 License along with the GNU C Library; see the file COPYING.LIB. If not, | |
19 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
20 Boston, MA 02111-1307, USA. */ | |
334 | 21 |
2475 | 22 #ifdef HAVE_CONFIG_H |
23 # include <config.h> | |
24 #endif | |
25 | |
334 | 26 #include "obstack.h" |
27 | |
779 | 28 /* NOTE BEFORE MODIFYING THIS FILE: This version number must be |
29 incremented whenever callers compiled using an old obstack.h can no | |
30 longer properly call the functions in this obstack.c. */ | |
31 #define OBSTACK_INTERFACE_VERSION 1 | |
334 | 32 |
33 /* Comment out all this code if we are using the GNU C Library, and are not | |
779 | 34 actually compiling the library itself, and the installed library |
35 supports the same library interface we do. This code is part of the GNU | |
36 C Library, but also included in many other GNU distributions. Compiling | |
334 | 37 and linking in this code is a waste when using the GNU C library |
38 (especially if it is a shared library). Rather than having every GNU | |
779 | 39 program understand `configure --with-gnu-libc' and omit the object |
40 files, it is simpler to just do this in the source for each such file. */ | |
334 | 41 |
779 | 42 #include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */ |
43 #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 | |
2475 | 44 # include <gnu-versions.h> |
45 # if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION | |
46 # define ELIDE_CODE | |
47 # endif | |
779 | 48 #endif |
49 | |
50 | |
51 #ifndef ELIDE_CODE | |
334 | 52 |
53 | |
2475 | 54 # if defined (__STDC__) && __STDC__ |
55 # define POINTER void * | |
56 # else | |
57 # define POINTER char * | |
58 # endif | |
334 | 59 |
60 /* Determine default alignment. */ | |
61 struct fooalign {char x; double d;}; | |
2475 | 62 # define DEFAULT_ALIGNMENT \ |
881 | 63 ((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0)) |
334 | 64 /* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT. |
65 But in fact it might be less smart and round addresses to as much as | |
66 DEFAULT_ROUNDING. So we prepare for it to do that. */ | |
67 union fooround {long x; double d;}; | |
2475 | 68 # define DEFAULT_ROUNDING (sizeof (union fooround)) |
334 | 69 |
70 /* When we copy a long block of data, this is the unit to do it with. | |
71 On some machines, copying successive ints does not work; | |
72 in such a case, redefine COPYING_UNIT to `long' (if that works) | |
73 or `char' as a last resort. */ | |
2475 | 74 # ifndef COPYING_UNIT |
75 # define COPYING_UNIT int | |
76 # endif | |
334 | 77 |
881 | 78 |
79 /* The functions allocating more room by calling `obstack_chunk_alloc' | |
80 jump to the handler pointed to by `obstack_alloc_failed_handler'. | |
2475 | 81 This can be set to a user defined function which should either |
82 abort gracefully or use longjump - but shouldn't return. This | |
83 variable by default points to the internal function | |
881 | 84 `print_and_abort'. */ |
2475 | 85 # if defined (__STDC__) && __STDC__ |
881 | 86 static void print_and_abort (void); |
87 void (*obstack_alloc_failed_handler) (void) = print_and_abort; | |
2475 | 88 # else |
881 | 89 static void print_and_abort (); |
90 void (*obstack_alloc_failed_handler) () = print_and_abort; | |
2475 | 91 # endif |
881 | 92 |
93 /* Exit value used when `print_and_abort' is used. */ | |
2475 | 94 # if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H |
95 # include <stdlib.h> | |
96 # endif | |
97 # ifndef EXIT_FAILURE | |
98 # define EXIT_FAILURE 1 | |
99 # endif | |
881 | 100 int obstack_exit_failure = EXIT_FAILURE; |
101 | |
334 | 102 /* The non-GNU-C macros copy the obstack into this global variable |
103 to avoid multiple evaluation. */ | |
104 | |
105 struct obstack *_obstack; | |
106 | |
107 /* Define a macro that either calls functions with the traditional malloc/free | |
108 calling interface, or calls functions with the mmalloc/mfree interface | |
109 (that adds an extra first argument), based on the state of use_extra_arg. | |
110 For free, do not use ?:, since some compilers, like the MIPS compilers, | |
111 do not allow (expr) ? void : void. */ | |
112 | |
2475 | 113 # if defined (__STDC__) && __STDC__ |
114 # define CALL_CHUNKFUN(h, size) \ | |
881 | 115 (((h) -> use_extra_arg) \ |
116 ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ | |
117 : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size))) | |
118 | |
2475 | 119 # define CALL_FREEFUN(h, old_chunk) \ |
881 | 120 do { \ |
121 if ((h) -> use_extra_arg) \ | |
122 (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ | |
123 else \ | |
124 (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \ | |
125 } while (0) | |
2475 | 126 # else |
127 # define CALL_CHUNKFUN(h, size) \ | |
334 | 128 (((h) -> use_extra_arg) \ |
129 ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ | |
779 | 130 : (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size))) |
334 | 131 |
2475 | 132 # define CALL_FREEFUN(h, old_chunk) \ |
334 | 133 do { \ |
134 if ((h) -> use_extra_arg) \ | |
135 (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ | |
136 else \ | |
779 | 137 (*(void (*) ()) (h)->freefun) ((old_chunk)); \ |
334 | 138 } while (0) |
2475 | 139 # endif |
334 | 140 |
141 | |
142 /* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). | |
143 Objects start on multiples of ALIGNMENT (0 means use default). | |
144 CHUNKFUN is the function to use to allocate chunks, | |
145 and FREEFUN the function to free them. | |
146 | |
2475 | 147 Return nonzero if successful, calls obstack_alloc_failed_handler if |
148 allocation fails. */ | |
334 | 149 |
150 int | |
151 _obstack_begin (h, size, alignment, chunkfun, freefun) | |
152 struct obstack *h; | |
153 int size; | |
154 int alignment; | |
2475 | 155 # if defined (__STDC__) && __STDC__ |
881 | 156 POINTER (*chunkfun) (long); |
157 void (*freefun) (void *); | |
2475 | 158 # else |
334 | 159 POINTER (*chunkfun) (); |
160 void (*freefun) (); | |
2475 | 161 # endif |
334 | 162 { |
881 | 163 register struct _obstack_chunk *chunk; /* points to new chunk */ |
334 | 164 |
165 if (alignment == 0) | |
2475 | 166 alignment = (int) DEFAULT_ALIGNMENT; |
334 | 167 if (size == 0) |
168 /* Default size is what GNU malloc can fit in a 4096-byte block. */ | |
169 { | |
170 /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. | |
171 Use the values for range checking, because if range checking is off, | |
172 the extra bytes won't be missed terribly, but if range checking is on | |
173 and we used a larger request, a whole extra 4096 bytes would be | |
174 allocated. | |
175 | |
176 These number are irrelevant to the new GNU malloc. I suspect it is | |
177 less sensitive to the size of the request. */ | |
178 int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) | |
179 + 4 + DEFAULT_ROUNDING - 1) | |
180 & ~(DEFAULT_ROUNDING - 1)); | |
181 size = 4096 - extra; | |
182 } | |
183 | |
2475 | 184 # if defined (__STDC__) && __STDC__ |
881 | 185 h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun; |
186 h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; | |
2475 | 187 # else |
334 | 188 h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; |
189 h->freefun = freefun; | |
2475 | 190 # endif |
334 | 191 h->chunk_size = size; |
192 h->alignment_mask = alignment - 1; | |
193 h->use_extra_arg = 0; | |
194 | |
195 chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); | |
196 if (!chunk) | |
881 | 197 (*obstack_alloc_failed_handler) (); |
334 | 198 h->next_free = h->object_base = chunk->contents; |
199 h->chunk_limit = chunk->limit | |
200 = (char *) chunk + h->chunk_size; | |
201 chunk->prev = 0; | |
202 /* The initial chunk now contains no empty object. */ | |
203 h->maybe_empty_object = 0; | |
881 | 204 h->alloc_failed = 0; |
334 | 205 return 1; |
206 } | |
207 | |
208 int | |
209 _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg) | |
210 struct obstack *h; | |
211 int size; | |
212 int alignment; | |
2475 | 213 # if defined (__STDC__) && __STDC__ |
881 | 214 POINTER (*chunkfun) (POINTER, long); |
215 void (*freefun) (POINTER, POINTER); | |
2475 | 216 # else |
334 | 217 POINTER (*chunkfun) (); |
218 void (*freefun) (); | |
2475 | 219 # endif |
334 | 220 POINTER arg; |
221 { | |
881 | 222 register struct _obstack_chunk *chunk; /* points to new chunk */ |
334 | 223 |
224 if (alignment == 0) | |
2475 | 225 alignment = (int) DEFAULT_ALIGNMENT; |
334 | 226 if (size == 0) |
227 /* Default size is what GNU malloc can fit in a 4096-byte block. */ | |
228 { | |
229 /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. | |
230 Use the values for range checking, because if range checking is off, | |
231 the extra bytes won't be missed terribly, but if range checking is on | |
232 and we used a larger request, a whole extra 4096 bytes would be | |
233 allocated. | |
234 | |
235 These number are irrelevant to the new GNU malloc. I suspect it is | |
236 less sensitive to the size of the request. */ | |
237 int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) | |
238 + 4 + DEFAULT_ROUNDING - 1) | |
239 & ~(DEFAULT_ROUNDING - 1)); | |
240 size = 4096 - extra; | |
241 } | |
242 | |
2475 | 243 # if defined(__STDC__) && __STDC__ |
881 | 244 h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun; |
245 h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; | |
2475 | 246 # else |
334 | 247 h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; |
248 h->freefun = freefun; | |
2475 | 249 # endif |
334 | 250 h->chunk_size = size; |
251 h->alignment_mask = alignment - 1; | |
252 h->extra_arg = arg; | |
253 h->use_extra_arg = 1; | |
254 | |
255 chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); | |
256 if (!chunk) | |
881 | 257 (*obstack_alloc_failed_handler) (); |
334 | 258 h->next_free = h->object_base = chunk->contents; |
259 h->chunk_limit = chunk->limit | |
260 = (char *) chunk + h->chunk_size; | |
261 chunk->prev = 0; | |
262 /* The initial chunk now contains no empty object. */ | |
263 h->maybe_empty_object = 0; | |
881 | 264 h->alloc_failed = 0; |
334 | 265 return 1; |
266 } | |
267 | |
268 /* Allocate a new current chunk for the obstack *H | |
269 on the assumption that LENGTH bytes need to be added | |
270 to the current object, or a new object of length LENGTH allocated. | |
271 Copies any partial object from the end of the old chunk | |
272 to the beginning of the new one. */ | |
273 | |
274 void | |
275 _obstack_newchunk (h, length) | |
276 struct obstack *h; | |
277 int length; | |
278 { | |
881 | 279 register struct _obstack_chunk *old_chunk = h->chunk; |
280 register struct _obstack_chunk *new_chunk; | |
334 | 281 register long new_size; |
2475 | 282 register long obj_size = h->next_free - h->object_base; |
283 register long i; | |
284 long already; | |
2915 | 285 char *object_base; |
334 | 286 |
287 /* Compute size for new chunk. */ | |
2915 | 288 new_size = (obj_size + length) + (obj_size >> 3) + h->alignment_mask + 100; |
334 | 289 if (new_size < h->chunk_size) |
290 new_size = h->chunk_size; | |
291 | |
292 /* Allocate and initialize the new chunk. */ | |
293 new_chunk = CALL_CHUNKFUN (h, new_size); | |
294 if (!new_chunk) | |
881 | 295 (*obstack_alloc_failed_handler) (); |
334 | 296 h->chunk = new_chunk; |
297 new_chunk->prev = old_chunk; | |
298 new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size; | |
299 | |
2915 | 300 /* Compute an aligned object_base in the new chunk */ |
301 object_base = | |
302 __INT_TO_PTR ((__PTR_TO_INT (new_chunk->contents) + h->alignment_mask) | |
303 & ~ (h->alignment_mask)); | |
304 | |
334 | 305 /* Move the existing object to the new chunk. |
306 Word at a time is fast and is safe if the object | |
307 is sufficiently aligned. */ | |
308 if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT) | |
309 { | |
310 for (i = obj_size / sizeof (COPYING_UNIT) - 1; | |
311 i >= 0; i--) | |
2915 | 312 ((COPYING_UNIT *)object_base)[i] |
334 | 313 = ((COPYING_UNIT *)h->object_base)[i]; |
314 /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT, | |
315 but that can cross a page boundary on a machine | |
316 which does not do strict alignment for COPYING_UNITS. */ | |
317 already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT); | |
318 } | |
319 else | |
320 already = 0; | |
321 /* Copy remaining bytes one by one. */ | |
322 for (i = already; i < obj_size; i++) | |
2915 | 323 object_base[i] = h->object_base[i]; |
334 | 324 |
325 /* If the object just copied was the only data in OLD_CHUNK, | |
326 free that chunk and remove it from the chain. | |
327 But not if that chunk might contain an empty object. */ | |
328 if (h->object_base == old_chunk->contents && ! h->maybe_empty_object) | |
329 { | |
330 new_chunk->prev = old_chunk->prev; | |
331 CALL_FREEFUN (h, old_chunk); | |
332 } | |
333 | |
2915 | 334 h->object_base = object_base; |
334 | 335 h->next_free = h->object_base + obj_size; |
336 /* The new chunk certainly contains no empty object yet. */ | |
337 h->maybe_empty_object = 0; | |
338 } | |
339 | |
340 /* Return nonzero if object OBJ has been allocated from obstack H. | |
341 This is here for debugging. | |
342 If you use it in a program, you are probably losing. */ | |
343 | |
2475 | 344 # if defined (__STDC__) && __STDC__ |
334 | 345 /* Suppress -Wmissing-prototypes warning. We don't want to declare this in |
346 obstack.h because it is just for debugging. */ | |
347 int _obstack_allocated_p (struct obstack *h, POINTER obj); | |
2475 | 348 # endif |
334 | 349 |
350 int | |
351 _obstack_allocated_p (h, obj) | |
352 struct obstack *h; | |
353 POINTER obj; | |
354 { | |
881 | 355 register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ |
356 register struct _obstack_chunk *plp; /* point to previous chunk if any */ | |
334 | 357 |
358 lp = (h)->chunk; | |
359 /* We use >= rather than > since the object cannot be exactly at | |
360 the beginning of the chunk but might be an empty object exactly | |
881 | 361 at the end of an adjacent chunk. */ |
362 while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj)) | |
334 | 363 { |
364 plp = lp->prev; | |
365 lp = plp; | |
366 } | |
367 return lp != 0; | |
368 } | |
369 | |
370 /* Free objects in obstack H, including OBJ and everything allocate | |
371 more recently than OBJ. If OBJ is zero, free everything in H. */ | |
372 | |
2475 | 373 # undef obstack_free |
334 | 374 |
375 /* This function has two names with identical definitions. | |
376 This is the first one, called from non-ANSI code. */ | |
377 | |
378 void | |
379 _obstack_free (h, obj) | |
380 struct obstack *h; | |
381 POINTER obj; | |
382 { | |
881 | 383 register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ |
384 register struct _obstack_chunk *plp; /* point to previous chunk if any */ | |
334 | 385 |
386 lp = h->chunk; | |
387 /* We use >= because there cannot be an object at the beginning of a chunk. | |
388 But there can be an empty object at that address | |
389 at the end of another chunk. */ | |
881 | 390 while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj)) |
334 | 391 { |
392 plp = lp->prev; | |
393 CALL_FREEFUN (h, lp); | |
394 lp = plp; | |
395 /* If we switch chunks, we can't tell whether the new current | |
396 chunk contains an empty object, so assume that it may. */ | |
397 h->maybe_empty_object = 1; | |
398 } | |
399 if (lp) | |
400 { | |
881 | 401 h->object_base = h->next_free = (char *) (obj); |
334 | 402 h->chunk_limit = lp->limit; |
403 h->chunk = lp; | |
404 } | |
405 else if (obj != 0) | |
406 /* obj is not in any of the chunks! */ | |
407 abort (); | |
408 } | |
409 | |
410 /* This function is used from ANSI code. */ | |
411 | |
412 void | |
413 obstack_free (h, obj) | |
414 struct obstack *h; | |
415 POINTER obj; | |
416 { | |
881 | 417 register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ |
418 register struct _obstack_chunk *plp; /* point to previous chunk if any */ | |
334 | 419 |
420 lp = h->chunk; | |
421 /* We use >= because there cannot be an object at the beginning of a chunk. | |
422 But there can be an empty object at that address | |
423 at the end of another chunk. */ | |
881 | 424 while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj)) |
334 | 425 { |
426 plp = lp->prev; | |
427 CALL_FREEFUN (h, lp); | |
428 lp = plp; | |
429 /* If we switch chunks, we can't tell whether the new current | |
430 chunk contains an empty object, so assume that it may. */ | |
431 h->maybe_empty_object = 1; | |
432 } | |
433 if (lp) | |
434 { | |
881 | 435 h->object_base = h->next_free = (char *) (obj); |
334 | 436 h->chunk_limit = lp->limit; |
437 h->chunk = lp; | |
438 } | |
439 else if (obj != 0) | |
440 /* obj is not in any of the chunks! */ | |
441 abort (); | |
442 } | |
443 | |
881 | 444 int |
445 _obstack_memory_used (h) | |
446 struct obstack *h; | |
447 { | |
448 register struct _obstack_chunk* lp; | |
449 register int nbytes = 0; | |
450 | |
451 for (lp = h->chunk; lp != 0; lp = lp->prev) | |
452 { | |
453 nbytes += lp->limit - (char *) lp; | |
454 } | |
455 return nbytes; | |
456 } | |
457 | |
458 /* Define the error handler. */ | |
2475 | 459 # ifndef _ |
2916 | 460 # if defined HAVE_LIBINTL_H || defined _LIBC |
2475 | 461 # include <libintl.h> |
462 # ifndef _ | |
463 # define _(Str) gettext (Str) | |
464 # endif | |
465 # else | |
466 # define _(Str) (Str) | |
881 | 467 # endif |
468 # endif | |
2475 | 469 # if defined _LIBC && defined USE_IN_LIBIO |
470 # include <libio/iolibio.h> | |
471 # define fputs(s, f) _IO_fputs (s, f) | |
472 # endif | |
881 | 473 |
474 static void | |
475 print_and_abort () | |
476 { | |
2813
f776657fc3ba
(print_and_abort): Use "memory exhausted", not "virtual memory exhausted".
Jim Meyering <jim@meyering.net>
parents:
2793
diff
changeset
|
477 fputs (_("memory exhausted"), stderr); |
2475 | 478 fputc ('\n', stderr); |
881 | 479 exit (obstack_exit_failure); |
480 } | |
481 | |
2475 | 482 # if 0 |
334 | 483 /* These are now turned off because the applications do not use it |
484 and it uses bcopy via obstack_grow, which causes trouble on sysV. */ | |
485 | |
486 /* Now define the functional versions of the obstack macros. | |
487 Define them to simply use the corresponding macros to do the job. */ | |
488 | |
2475 | 489 # if defined (__STDC__) && __STDC__ |
334 | 490 /* These function definitions do not work with non-ANSI preprocessors; |
491 they won't pass through the macro names in parentheses. */ | |
492 | |
493 /* The function names appear in parentheses in order to prevent | |
494 the macro-definitions of the names from being expanded there. */ | |
495 | |
496 POINTER (obstack_base) (obstack) | |
497 struct obstack *obstack; | |
498 { | |
499 return obstack_base (obstack); | |
500 } | |
501 | |
502 POINTER (obstack_next_free) (obstack) | |
503 struct obstack *obstack; | |
504 { | |
505 return obstack_next_free (obstack); | |
506 } | |
507 | |
508 int (obstack_object_size) (obstack) | |
509 struct obstack *obstack; | |
510 { | |
511 return obstack_object_size (obstack); | |
512 } | |
513 | |
514 int (obstack_room) (obstack) | |
515 struct obstack *obstack; | |
516 { | |
517 return obstack_room (obstack); | |
518 } | |
519 | |
881 | 520 int (obstack_make_room) (obstack, length) |
521 struct obstack *obstack; | |
522 int length; | |
523 { | |
524 return obstack_make_room (obstack, length); | |
525 } | |
526 | |
2979 | 527 void (obstack_grow) (obstack, data, length) |
334 | 528 struct obstack *obstack; |
2979 | 529 const POINTER data; |
334 | 530 int length; |
531 { | |
2979 | 532 obstack_grow (obstack, data, length); |
334 | 533 } |
534 | |
2979 | 535 void (obstack_grow0) (obstack, data, length) |
334 | 536 struct obstack *obstack; |
2979 | 537 const POINTER data; |
334 | 538 int length; |
539 { | |
2979 | 540 obstack_grow0 (obstack, data, length); |
334 | 541 } |
542 | |
543 void (obstack_1grow) (obstack, character) | |
544 struct obstack *obstack; | |
545 int character; | |
546 { | |
547 obstack_1grow (obstack, character); | |
548 } | |
549 | |
550 void (obstack_blank) (obstack, length) | |
551 struct obstack *obstack; | |
552 int length; | |
553 { | |
554 obstack_blank (obstack, length); | |
555 } | |
556 | |
557 void (obstack_1grow_fast) (obstack, character) | |
558 struct obstack *obstack; | |
559 int character; | |
560 { | |
561 obstack_1grow_fast (obstack, character); | |
562 } | |
563 | |
564 void (obstack_blank_fast) (obstack, length) | |
565 struct obstack *obstack; | |
566 int length; | |
567 { | |
568 obstack_blank_fast (obstack, length); | |
569 } | |
570 | |
571 POINTER (obstack_finish) (obstack) | |
572 struct obstack *obstack; | |
573 { | |
574 return obstack_finish (obstack); | |
575 } | |
576 | |
577 POINTER (obstack_alloc) (obstack, length) | |
578 struct obstack *obstack; | |
579 int length; | |
580 { | |
581 return obstack_alloc (obstack, length); | |
582 } | |
583 | |
2979 | 584 POINTER (obstack_copy) (obstack, address, length) |
334 | 585 struct obstack *obstack; |
2979 | 586 const POINTER address; |
334 | 587 int length; |
588 { | |
2979 | 589 return obstack_copy (obstack, address, length); |
334 | 590 } |
591 | |
2979 | 592 POINTER (obstack_copy0) (obstack, address, length) |
334 | 593 struct obstack *obstack; |
2979 | 594 const POINTER address; |
334 | 595 int length; |
596 { | |
2979 | 597 return obstack_copy0 (obstack, address, length); |
334 | 598 } |
599 | |
2475 | 600 # endif /* __STDC__ */ |
334 | 601 |
2475 | 602 # endif /* 0 */ |
334 | 603 |
779 | 604 #endif /* !ELIDE_CODE */ |