obstack.c revision 285830
133965Sjdp/* obstack.c - subroutines used implicitly by object stack macros
278828Sobrien   Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
3218822Sdim
438889Sjdp
533965Sjdp   NOTE: This source is derived from an old version taken from the GNU C
633965Sjdp   Library (glibc).
7130561Sobrien
833965Sjdp   This program is free software; you can redistribute it and/or modify it
9130561Sobrien   under the terms of the GNU General Public License as published by the
10130561Sobrien   Free Software Foundation; either version 2, or (at your option) any
11130561Sobrien   later version.
12130561Sobrien
1333965Sjdp   This program is distributed in the hope that it will be useful,
14130561Sobrien   but WITHOUT ANY WARRANTY; without even the implied warranty of
15130561Sobrien   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16130561Sobrien   GNU General Public License for more details.
17130561Sobrien
1833965Sjdp   You should have received a copy of the GNU General Public License
19130561Sobrien   along with this program; if not, write to the Free Software
20130561Sobrien   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
21218822Sdim   USA.  */
2233965Sjdp
23218822Sdim#ifdef HAVE_CONFIG_H
24218822Sdim#include <config.h>
2533965Sjdp#endif
2633965Sjdp
2733965Sjdp#include "obstack.h"
2833965Sjdp
2933965Sjdp/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
3033965Sjdp   incremented whenever callers compiled using an old obstack.h can no
3133965Sjdp   longer properly call the functions in this obstack.c.  */
3233965Sjdp#define OBSTACK_INTERFACE_VERSION 1
3333965Sjdp
3433965Sjdp/* Comment out all this code if we are using the GNU C Library, and are not
3533965Sjdp   actually compiling the library itself, and the installed library
3633965Sjdp   supports the same library interface we do.  This code is part of the GNU
3733965Sjdp   C Library, but also included in many other GNU distributions.  Compiling
3833965Sjdp   and linking in this code is a waste when using the GNU C library
3933965Sjdp   (especially if it is a shared library).  Rather than having every GNU
4033965Sjdp   program understand `configure --with-gnu-libc' and omit the object
4133965Sjdp   files, it is simpler to just do this in the source for each such file.  */
4233965Sjdp
4333965Sjdp#include <stdio.h>		/* Random thing to get __GNU_LIBRARY__.  */
4433965Sjdp#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
4533965Sjdp#include <gnu-versions.h>
4633965Sjdp#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
4733965Sjdp#define ELIDE_CODE
4833965Sjdp#endif
4933965Sjdp#endif
5033965Sjdp
5133965Sjdp
5233965Sjdp#ifndef ELIDE_CODE
5333965Sjdp
5433965Sjdp
5533965Sjdp#define POINTER void *
5633965Sjdp
5733965Sjdp/* Determine default alignment.  */
5833965Sjdpstruct fooalign {char x; double d;};
5933965Sjdp#define DEFAULT_ALIGNMENT  \
6033965Sjdp  ((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0))
6133965Sjdp/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
6233965Sjdp   But in fact it might be less smart and round addresses to as much as
6333965Sjdp   DEFAULT_ROUNDING.  So we prepare for it to do that.  */
6433965Sjdpunion fooround {long x; double d;};
6533965Sjdp#define DEFAULT_ROUNDING (sizeof (union fooround))
6633965Sjdp
6733965Sjdp/* When we copy a long block of data, this is the unit to do it with.
6833965Sjdp   On some machines, copying successive ints does not work;
6933965Sjdp   in such a case, redefine COPYING_UNIT to `long' (if that works)
7033965Sjdp   or `char' as a last resort.  */
7133965Sjdp#ifndef COPYING_UNIT
7233965Sjdp#define COPYING_UNIT int
7333965Sjdp#endif
7433965Sjdp
7533965Sjdp
7633965Sjdp/* The functions allocating more room by calling `obstack_chunk_alloc'
7733965Sjdp   jump to the handler pointed to by `obstack_alloc_failed_handler'.
7833965Sjdp   This variable by default points to the internal function
7933965Sjdp   `print_and_abort'.  */
8033965Sjdpstatic void print_and_abort (void);
8133965Sjdpvoid (*obstack_alloc_failed_handler) (void) = print_and_abort;
8233965Sjdp
8333965Sjdp/* Exit value used when `print_and_abort' is used.  */
8433965Sjdp#if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
8533965Sjdp#include <stdlib.h>
8633965Sjdp#endif
8733965Sjdp#ifndef EXIT_FAILURE
8833965Sjdp#define EXIT_FAILURE 1
8933965Sjdp#endif
9033965Sjdpint obstack_exit_failure = EXIT_FAILURE;
9133965Sjdp
9233965Sjdp/* The non-GNU-C macros copy the obstack into this global variable
9333965Sjdp   to avoid multiple evaluation.  */
9433965Sjdp
9533965Sjdpstruct obstack *_obstack;
9633965Sjdp
9733965Sjdp/* Define a macro that either calls functions with the traditional malloc/free
9833965Sjdp   calling interface, or calls functions with the mmalloc/mfree interface
9933965Sjdp   (that adds an extra first argument), based on the state of use_extra_arg.
10033965Sjdp   For free, do not use ?:, since some compilers, like the MIPS compilers,
10133965Sjdp   do not allow (expr) ? void : void.  */
10233965Sjdp
10333965Sjdp#if defined (__STDC__) && __STDC__
10433965Sjdp#define CALL_CHUNKFUN(h, size) \
10533965Sjdp  (((h) -> use_extra_arg) \
10633965Sjdp   ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
10733965Sjdp   : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
10833965Sjdp
10933965Sjdp#define CALL_FREEFUN(h, old_chunk) \
11033965Sjdp  do { \
11133965Sjdp    if ((h) -> use_extra_arg) \
11233965Sjdp      (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
11333965Sjdp    else \
11433965Sjdp      (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
11533965Sjdp  } while (0)
11633965Sjdp#else
11733965Sjdp#define CALL_CHUNKFUN(h, size) \
11833965Sjdp  (((h) -> use_extra_arg) \
11933965Sjdp   ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
12033965Sjdp   : (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size)))
12133965Sjdp
12233965Sjdp#define CALL_FREEFUN(h, old_chunk) \
12333965Sjdp  do { \
12433965Sjdp    if ((h) -> use_extra_arg) \
12533965Sjdp      (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
12633965Sjdp    else \
12733965Sjdp      (*(void (*) ()) (h)->freefun) ((old_chunk)); \
12833965Sjdp  } while (0)
12933965Sjdp#endif
13033965Sjdp
13133965Sjdp
13260484Sobrien/* Initialize an obstack H for use.  Specify chunk size SIZE (0 means default).
13333965Sjdp   Objects start on multiples of ALIGNMENT (0 means use default).
13433965Sjdp   CHUNKFUN is the function to use to allocate chunks,
13533965Sjdp   and FREEFUN the function to free them.
13633965Sjdp
13733965Sjdp   Return nonzero if successful, zero if out of memory.
13833965Sjdp   To recover from an out of memory error,
13933965Sjdp   free up some memory, then call this again.  */
14033965Sjdp
14133965Sjdpint
14233965Sjdp_obstack_begin (struct obstack *h, int size, int alignment,
14333965Sjdp                POINTER (*chunkfun) (long), void (*freefun) (void *))
14433965Sjdp{
14533965Sjdp  register struct _obstack_chunk *chunk; /* points to new chunk */
14633965Sjdp
14733965Sjdp  if (alignment == 0)
14833965Sjdp    alignment = (int) DEFAULT_ALIGNMENT;
14933965Sjdp  if (size == 0)
15033965Sjdp    /* Default size is what GNU malloc can fit in a 4096-byte block.  */
15133965Sjdp    {
15233965Sjdp      /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
15333965Sjdp	 Use the values for range checking, because if range checking is off,
15433965Sjdp	 the extra bytes won't be missed terribly, but if range checking is on
15533965Sjdp	 and we used a larger request, a whole extra 4096 bytes would be
15633965Sjdp	 allocated.
15733965Sjdp
15833965Sjdp	 These number are irrelevant to the new GNU malloc.  I suspect it is
15933965Sjdp	 less sensitive to the size of the request.  */
16033965Sjdp      int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
16133965Sjdp		    + 4 + DEFAULT_ROUNDING - 1)
16233965Sjdp		   & ~(DEFAULT_ROUNDING - 1));
16333965Sjdp      size = 4096 - extra;
16433965Sjdp    }
16533965Sjdp
16633965Sjdp  h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
16733965Sjdp  h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
16833965Sjdp  h->chunk_size = size;
16933965Sjdp  h->alignment_mask = alignment - 1;
17033965Sjdp  h->use_extra_arg = 0;
17133965Sjdp
17233965Sjdp  chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
17333965Sjdp  if (!chunk)
17433965Sjdp    (*obstack_alloc_failed_handler) ();
17533965Sjdp  h->next_free = h->object_base = chunk->contents;
17633965Sjdp  h->chunk_limit = chunk->limit
17733965Sjdp    = (char *) chunk + h->chunk_size;
17833965Sjdp  chunk->prev = 0;
17933965Sjdp  /* The initial chunk now contains no empty object.  */
18033965Sjdp  h->maybe_empty_object = 0;
18133965Sjdp  h->alloc_failed = 0;
18233965Sjdp  return 1;
18333965Sjdp}
18433965Sjdp
18533965Sjdpint
18633965Sjdp_obstack_begin_1 (struct obstack *h, int size, int alignment,
18733965Sjdp                  POINTER (*chunkfun) (POINTER, long),
18833965Sjdp                  void (*freefun) (POINTER, POINTER), POINTER arg)
18933965Sjdp{
19033965Sjdp  register struct _obstack_chunk *chunk; /* points to new chunk */
19133965Sjdp
19233965Sjdp  if (alignment == 0)
19333965Sjdp    alignment = (int) DEFAULT_ALIGNMENT;
19433965Sjdp  if (size == 0)
19533965Sjdp    /* Default size is what GNU malloc can fit in a 4096-byte block.  */
19633965Sjdp    {
19733965Sjdp      /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
19833965Sjdp	 Use the values for range checking, because if range checking is off,
19933965Sjdp	 the extra bytes won't be missed terribly, but if range checking is on
20033965Sjdp	 and we used a larger request, a whole extra 4096 bytes would be
20133965Sjdp	 allocated.
20233965Sjdp
20333965Sjdp	 These number are irrelevant to the new GNU malloc.  I suspect it is
20433965Sjdp	 less sensitive to the size of the request.  */
20533965Sjdp      int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
20633965Sjdp		    + 4 + DEFAULT_ROUNDING - 1)
20733965Sjdp		   & ~(DEFAULT_ROUNDING - 1));
20833965Sjdp      size = 4096 - extra;
20933965Sjdp    }
21033965Sjdp
21133965Sjdp  h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
21233965Sjdp  h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
21333965Sjdp  h->chunk_size = size;
21433965Sjdp  h->alignment_mask = alignment - 1;
21533965Sjdp  h->extra_arg = arg;
21633965Sjdp  h->use_extra_arg = 1;
21733965Sjdp
21833965Sjdp  chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
21933965Sjdp  if (!chunk)
22033965Sjdp    (*obstack_alloc_failed_handler) ();
22133965Sjdp  h->next_free = h->object_base = chunk->contents;
22233965Sjdp  h->chunk_limit = chunk->limit
22333965Sjdp    = (char *) chunk + h->chunk_size;
22433965Sjdp  chunk->prev = 0;
225130561Sobrien  /* The initial chunk now contains no empty object.  */
22633965Sjdp  h->maybe_empty_object = 0;
22733965Sjdp  h->alloc_failed = 0;
22833965Sjdp  return 1;
22933965Sjdp}
23033965Sjdp
23133965Sjdp/* Allocate a new current chunk for the obstack *H
23233965Sjdp   on the assumption that LENGTH bytes need to be added
23333965Sjdp   to the current object, or a new object of length LENGTH allocated.
23433965Sjdp   Copies any partial object from the end of the old chunk
23533965Sjdp   to the beginning of the new one.  */
23633965Sjdp
23733965Sjdpvoid
23833965Sjdp_obstack_newchunk (struct obstack *h, int length)
23933965Sjdp{
24033965Sjdp  register struct _obstack_chunk *old_chunk = h->chunk;
24133965Sjdp  register struct _obstack_chunk *new_chunk;
24233965Sjdp  register long	new_size;
24333965Sjdp  register long obj_size = h->next_free - h->object_base;
24433965Sjdp  register long i;
24533965Sjdp  long already;
24633965Sjdp
24733965Sjdp  /* Compute size for new chunk.  */
24889857Sobrien  new_size = (obj_size + length) + (obj_size >> 3) + 100;
24989857Sobrien  if (new_size < h->chunk_size)
25089857Sobrien    new_size = h->chunk_size;
25133965Sjdp
25289857Sobrien  /* Allocate and initialize the new chunk.  */
25389857Sobrien  new_chunk = CALL_CHUNKFUN (h, new_size);
25489857Sobrien  if (!new_chunk)
25533965Sjdp    (*obstack_alloc_failed_handler) ();
25689857Sobrien  h->chunk = new_chunk;
25789857Sobrien  new_chunk->prev = old_chunk;
25889857Sobrien  new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
25933965Sjdp
26089857Sobrien  /* Move the existing object to the new chunk.
26189857Sobrien     Word at a time is fast and is safe if the object
26289857Sobrien     is sufficiently aligned.  */
26333965Sjdp  if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT)
26489857Sobrien    {
26589857Sobrien      for (i = obj_size / sizeof (COPYING_UNIT) - 1;
26689857Sobrien	   i >= 0; i--)
26733965Sjdp	((COPYING_UNIT *)new_chunk->contents)[i]
26889857Sobrien	  = ((COPYING_UNIT *)h->object_base)[i];
26989857Sobrien      /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT,
27089857Sobrien	 but that can cross a page boundary on a machine
27133965Sjdp	 which does not do strict alignment for COPYING_UNITS.  */
27289857Sobrien      already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT);
27389857Sobrien    }
27489857Sobrien  else
27589857Sobrien    already = 0;
27689857Sobrien  /* Copy remaining bytes one by one.  */
27789857Sobrien  for (i = already; i < obj_size; i++)
27889857Sobrien    new_chunk->contents[i] = h->object_base[i];
27933965Sjdp
28033965Sjdp  /* If the object just copied was the only data in OLD_CHUNK,
28133965Sjdp     free that chunk and remove it from the chain.
28233965Sjdp     But not if that chunk might contain an empty object.  */
28333965Sjdp  if (h->object_base == old_chunk->contents && ! h->maybe_empty_object)
28433965Sjdp    {
28533965Sjdp      new_chunk->prev = old_chunk->prev;
28689857Sobrien      CALL_FREEFUN (h, old_chunk);
28789857Sobrien    }
28833965Sjdp
28989857Sobrien  h->object_base = new_chunk->contents;
29089857Sobrien  h->next_free = h->object_base + obj_size;
29133965Sjdp  /* The new chunk certainly contains no empty object yet.  */
29289857Sobrien  h->maybe_empty_object = 0;
29389857Sobrien}
29433965Sjdp
29589857Sobrien/* Return nonzero if object OBJ has been allocated from obstack H.
296130561Sobrien   This is here for debugging.
29733965Sjdp   If you use it in a program, you are probably losing.  */
29833965Sjdp
29933965Sjdp/* Suppress -Wmissing-prototypes warning.  We don't want to declare this in
30033965Sjdp   obstack.h because it is just for debugging.  */
30133965Sjdpint _obstack_allocated_p (struct obstack *h, POINTER obj);
30233965Sjdp
30333965Sjdpint
30433965Sjdp_obstack_allocated_p (struct obstack *h, POINTER obj)
30533965Sjdp{
30633965Sjdp  register struct _obstack_chunk *lp;	/* below addr of any objects in this chunk */
307218822Sdim  register struct _obstack_chunk *plp;	/* point to previous chunk if any */
30833965Sjdp
309218822Sdim  lp = (h)->chunk;
310218822Sdim  /* We use >= rather than > since the object cannot be exactly at
311218822Sdim     the beginning of the chunk but might be an empty object exactly
312130561Sobrien     at the end of an adjacent chunk.  */
313218822Sdim  while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
314130561Sobrien    {
315218822Sdim      plp = lp->prev;
316130561Sobrien      lp = plp;
317218822Sdim    }
31860484Sobrien  return lp != 0;
319218822Sdim}
320218822Sdim
321130561Sobrien/* Free objects in obstack H, including OBJ and everything allocate
322218822Sdim   more recently than OBJ.  If OBJ is zero, free everything in H.  */
323130561Sobrien
324218822Sdim#undef obstack_free
325130561Sobrien
326218822Sdim/* This function has two names with identical definitions.
327130561Sobrien   This is the first one, called from non-ANSI code.  */
328218822Sdim
329130561Sobrienvoid
330218822Sdim_obstack_free (struct obstack *h, POINTER obj)
331130561Sobrien{
332218822Sdim  register struct _obstack_chunk *lp;	/* below addr of any objects in this chunk */
333130561Sobrien  register struct _obstack_chunk *plp;	/* point to previous chunk if any */
334218822Sdim
335130561Sobrien  lp = h->chunk;
336218822Sdim  /* We use >= because there cannot be an object at the beginning of a chunk.
337218822Sdim     But there can be an empty object at that address
338218822Sdim     at the end of another chunk.  */
339130561Sobrien  while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
340218822Sdim    {
341130561Sobrien      plp = lp->prev;
342218822Sdim      CALL_FREEFUN (h, lp);
34360484Sobrien      lp = plp;
344218822Sdim      /* If we switch chunks, we can't tell whether the new current
345130561Sobrien	 chunk contains an empty object, so assume that it may.  */
346218822Sdim      h->maybe_empty_object = 1;
34733965Sjdp    }
348218822Sdim  if (lp)
34933965Sjdp    {
350218822Sdim      h->object_base = h->next_free = (char *) (obj);
351218822Sdim      h->chunk_limit = lp->limit;
35233965Sjdp      h->chunk = lp;
35378828Sobrien    }
354130561Sobrien  else if (obj != 0)
355218822Sdim    /* obj is not in any of the chunks! */
35678828Sobrien    abort ();
357104834Sobrien}
358130561Sobrien
359218822Sdim/* This function is used from ANSI code.  */
360130561Sobrien
361218822Sdimvoid
362130561Sobrienobstack_free (struct obstack *h, POINTER obj)
363218822Sdim{
364104834Sobrien  register struct _obstack_chunk *lp;	/* below addr of any objects in this chunk */
365130561Sobrien  register struct _obstack_chunk *plp;	/* point to previous chunk if any */
366130561Sobrien
367218822Sdim  lp = h->chunk;
368130561Sobrien  /* We use >= because there cannot be an object at the beginning of a chunk.
369218822Sdim     But there can be an empty object at that address
370130561Sobrien     at the end of another chunk.  */
37133965Sjdp  while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
37233965Sjdp    {
37333965Sjdp      plp = lp->prev;
37460484Sobrien      CALL_FREEFUN (h, lp);
37560484Sobrien      lp = plp;
37660484Sobrien      /* If we switch chunks, we can't tell whether the new current
37760484Sobrien	 chunk contains an empty object, so assume that it may.  */
37860484Sobrien      h->maybe_empty_object = 1;
37960484Sobrien    }
38060484Sobrien  if (lp)
38177298Sobrien    {
382218822Sdim      h->object_base = h->next_free = (char *) (obj);
38377298Sobrien      h->chunk_limit = lp->limit;
38477298Sobrien      h->chunk = lp;
38577298Sobrien    }
38677298Sobrien  else if (obj != 0)
38777298Sobrien    /* obj is not in any of the chunks! */
38877298Sobrien    abort ();
38977298Sobrien}
39077298Sobrien
39177298Sobrienint
39277298Sobrien_obstack_memory_used (struct obstack *h)
39377298Sobrien{
39477298Sobrien  register struct _obstack_chunk* lp;
39533965Sjdp  register int nbytes = 0;
396218822Sdim
39733965Sjdp  for (lp = h->chunk; lp != 0; lp = lp->prev)
39833965Sjdp    {
39933965Sjdp      nbytes += lp->limit - (char *) lp;
40033965Sjdp    }
40133965Sjdp  return nbytes;
40233965Sjdp}
40333965Sjdp
40433965Sjdp/* Define the error handler.  */
40533965Sjdp#ifndef _
40633965Sjdp# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
40733965Sjdp#  include <libintl.h>
40833965Sjdp#  ifndef _
40933965Sjdp#   define _(Str) gettext (Str)
41033965Sjdp#  endif
41133965Sjdp# else
41233965Sjdp#  define _(Str) (Str)
41333965Sjdp# endif
41433965Sjdp#endif
41533965Sjdp
41633965Sjdpstatic void
41733965Sjdpprint_and_abort (void)
41833965Sjdp{
41933965Sjdp  fputs (_("memory exhausted\n"), stderr);
42033965Sjdp  exit (obstack_exit_failure);
42133965Sjdp}
42233965Sjdp
42333965Sjdp#if 0
42433965Sjdp/* These are now turned off because the applications do not use it
42533965Sjdp   and it uses bcopy via obstack_grow, which causes trouble on sysV.  */
42633965Sjdp
42733965Sjdp/* Now define the functional versions of the obstack macros.
42833965Sjdp   Define them to simply use the corresponding macros to do the job.  */
42933965Sjdp
430218822Sdim/* The function names appear in parentheses in order to prevent
43133965Sjdp   the macro-definitions of the names from being expanded there.  */
43277298Sobrien
43377298SobrienPOINTER (obstack_base) (struct obstack *obstack)
43477298Sobrien{
43577298Sobrien  return obstack_base (obstack);
43677298Sobrien}
43733965Sjdp
438218822SdimPOINTER (obstack_next_free) (struct obstack *obstack)
43933965Sjdp{
44077298Sobrien  return obstack_next_free (obstack);
44133965Sjdp}
44277298Sobrien
443218822Sdimint (obstack_object_size) (struct obstack *obstack)
44477298Sobrien{
44577298Sobrien  return obstack_object_size (obstack);
44677298Sobrien}
44777298Sobrien
44833965Sjdpint (obstack_room) (struct obstack *obstack)
44933965Sjdp{
45033965Sjdp  return obstack_room (obstack);
45133965Sjdp}
45233965Sjdp
45333965Sjdpint (obstack_make_room) (struct obstack *obstack, int length)
45433965Sjdp{
45533965Sjdp  return obstack_make_room (obstack, length);
45633965Sjdp}
45789857Sobrien
45889857Sobrienvoid (obstack_grow) (struct obstack *obstack, POINTER pointer, int length)
45989857Sobrien{
46089857Sobrien  obstack_grow (obstack, pointer, length);
46189857Sobrien}
46289857Sobrien
46389857Sobrienvoid (obstack_grow0) (struct obstack *obstack, POINTER pointer, int length)
46489857Sobrien{
46533965Sjdp  obstack_grow0 (obstack, pointer, length);
46633965Sjdp}
46733965Sjdp
46833965Sjdpvoid (obstack_1grow) (struct obstack *obstack, int character)
46933965Sjdp{
47033965Sjdp  obstack_1grow (obstack, character);
47133965Sjdp}
47233965Sjdp
47333965Sjdpvoid (obstack_blank) (struct obstack *obstack, int length)
47433965Sjdp{
47533965Sjdp  obstack_blank (obstack, length);
47633965Sjdp}
47733965Sjdp
47833965Sjdpvoid (obstack_1grow_fast) (struct obstack *obstack, int character)
47933965Sjdp{
48033965Sjdp  obstack_1grow_fast (obstack, character);
48133965Sjdp}
48233965Sjdp
48333965Sjdpvoid (obstack_blank_fast) (struct obstack *obstack, int length)
48433965Sjdp{
48533965Sjdp  obstack_blank_fast (obstack, length);
48633965Sjdp}
48733965Sjdp
48833965SjdpPOINTER (obstack_finish) (struct obstack *obstack)
48933965Sjdp{
49033965Sjdp  return obstack_finish (obstack);
49133965Sjdp}
49277298Sobrien
493218822SdimPOINTER (obstack_alloc) (struct obstack *obstack, int length)
49477298Sobrien{
49577298Sobrien  return obstack_alloc (obstack, length);
49677298Sobrien}
49777298Sobrien
498218822SdimPOINTER (obstack_copy) (struct obstack *obstack, POINTER pointer, int length)
49977298Sobrien{
50077298Sobrien  return obstack_copy (obstack, pointer, length);
50177298Sobrien}
50233965Sjdp
50333965SjdpPOINTER (obstack_copy0) (struct obstack *obstack, POINTER pointer, int length)
50433965Sjdp{
50533965Sjdp  return obstack_copy0 (obstack, pointer, length);
50633965Sjdp}
50760484Sobrien
50860484Sobrien#endif /* 0 */
50960484Sobrien
51060484Sobrien#endif	/* !ELIDE_CODE */
51160484Sobrien