Mercurial > hg > octave-lojdl > gnulib-hg
annotate lib/obstack.h @ 6186:7a0537a5ad1b
* lib/regex_internal.c (re_string_reconstruct): Don't assume buffer
lengths fit in regoff_t; this isn't true if regoff_t is the same
width as size_t.
* lib/regex.c (re_search_internal): 5th arg is LAST_START
(= START + RANGE) instead of RANGE. This avoids overflow
problems when regoff_t is the same width as size_t.
All callers changed.
(re_search_2_stub): Check for overflow when adding the
sizes of the two strings.
(re_search_stub): Check for overflow when adding START
to RANGE; if it occurs, substitute the extreme value.
* config/srclist.txt: Add glibc bug 1284.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Thu, 01 Sep 2005 07:03:01 +0000 |
parents | a48fb0e98c8c |
children | 56829cd68e67 |
rev | line source |
---|---|
334 | 1 /* obstack.h - object stack macros |
5057
f4b3a4229349
Import obstack changes from libc.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4805
diff
changeset
|
2 Copyright (C) 1988-1994,1996-1999,2003,2004 Free Software Foundation, Inc. |
334 | 3 |
2991 | 4 This file is part of the GNU C Library. Its master source is NOT part of |
881 | 5 the C library, however. The master source lives in /gd/gnu/lib. |
334 | 6 |
1112 | 7 NOTE: The canonical source of this file is maintained with the GNU C Library. |
2991 | 8 Bugs can be reported to bug-glibc@gnu.org. |
334 | 9 |
4422 | 10 This program is free software; you can redistribute it and/or modify |
11 it under the terms of the GNU General Public License as published by | |
12 the Free Software Foundation; either version 2, or (at your option) | |
13 any later version. | |
1112 | 14 |
15 This program is distributed in the hope that it will be useful, | |
881 | 16 but WITHOUT ANY WARRANTY; without even the implied warranty of |
4422 | 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 GNU General Public License for more details. | |
881 | 19 |
4422 | 20 You should have received a copy of the GNU General Public License along |
21 with this program; if not, write to the Free Software Foundation, | |
5848
a48fb0e98c8c
*** empty log message ***
Paul Eggert <eggert@cs.ucla.edu>
parents:
5173
diff
changeset
|
22 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ |
334 | 23 |
24 /* Summary: | |
25 | |
26 All the apparent functions defined here are macros. The idea | |
27 is that you would use these pre-tested macros to solve a | |
28 very specific set of problems, and they would run fast. | |
29 Caution: no side-effects in arguments please!! They may be | |
30 evaluated MANY times!! | |
31 | |
32 These macros operate a stack of objects. Each object starts life | |
33 small, and may grow to maturity. (Consider building a word syllable | |
34 by syllable.) An object can move while it is growing. Once it has | |
35 been "finished" it never changes address again. So the "top of the | |
36 stack" is typically an immature growing object, while the rest of the | |
37 stack is of mature, fixed size and fixed address objects. | |
38 | |
39 These routines grab large chunks of memory, using a function you | |
40 supply, called `obstack_chunk_alloc'. On occasion, they free chunks, | |
41 by calling `obstack_chunk_free'. You must define them and declare | |
42 them before using any obstack macros. | |
43 | |
44 Each independent stack is represented by a `struct obstack'. | |
45 Each of the obstack macros expects a pointer to such a structure | |
46 as the first argument. | |
47 | |
48 One motivation for this package is the problem of growing char strings | |
49 in symbol tables. Unless you are "fascist pig with a read-only mind" | |
50 --Gosper's immortal quote from HAKMEM item 154, out of context--you | |
51 would not like to put any arbitrary upper limit on the length of your | |
52 symbols. | |
53 | |
54 In practice this often means you will build many short symbols and a | |
55 few long symbols. At the time you are reading a symbol you don't know | |
56 how long it is. One traditional method is to read a symbol into a | |
57 buffer, realloc()ating the buffer every time you try to read a symbol | |
58 that is longer than the buffer. This is beaut, but you still will | |
59 want to copy the symbol from the buffer to a more permanent | |
60 symbol-table entry say about half the time. | |
61 | |
62 With obstacks, you can work differently. Use one obstack for all symbol | |
63 names. As you read a symbol, grow the name in the obstack gradually. | |
64 When the name is complete, finalize it. Then, if the symbol exists already, | |
65 free the newly read name. | |
66 | |
67 The way we do this is to take a large chunk, allocating memory from | |
68 low addresses. When you want to build a symbol in the chunk you just | |
69 add chars above the current "high water mark" in the chunk. When you | |
70 have finished adding chars, because you got to the end of the symbol, | |
71 you know how long the chars are, and you can create a new object. | |
72 Mostly the chars will not burst over the highest address of the chunk, | |
73 because you would typically expect a chunk to be (say) 100 times as | |
74 long as an average object. | |
75 | |
76 In case that isn't clear, when we have enough chars to make up | |
77 the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed) | |
78 so we just point to it where it lies. No moving of chars is | |
79 needed and this is the second win: potentially long strings need | |
80 never be explicitly shuffled. Once an object is formed, it does not | |
81 change its address during its lifetime. | |
82 | |
83 When the chars burst over a chunk boundary, we allocate a larger | |
84 chunk, and then copy the partly formed object from the end of the old | |
85 chunk to the beginning of the new larger chunk. We then carry on | |
86 accreting characters to the end of the object as we normally would. | |
87 | |
88 A special macro is provided to add a single char at a time to a | |
89 growing object. This allows the use of register variables, which | |
90 break the ordinary 'growth' macro. | |
91 | |
92 Summary: | |
93 We allocate large chunks. | |
94 We carve out one object at a time from the current chunk. | |
95 Once carved, an object never moves. | |
96 We are free to append data of any size to the currently | |
97 growing object. | |
98 Exactly one object is growing in an obstack at any one time. | |
99 You can run one obstack per control block. | |
100 You may have as many control blocks as you dare. | |
101 Because of the way we do it, you can `unwind' an obstack | |
102 back to a previous state. (You may remove objects much | |
103 as you would with a stack.) | |
104 */ | |
105 | |
106 | |
107 /* Don't do the contents of this file more than once. */ | |
108 | |
1112 | 109 #ifndef _OBSTACK_H |
110 #define _OBSTACK_H 1 | |
111 | |
995 | 112 #ifdef __cplusplus |
113 extern "C" { | |
114 #endif | |
115 | |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
116 /* We need the type of a pointer subtraction. If __PTRDIFF_TYPE__ is |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
117 defined, as with GNU C, use that; that way we don't pollute the |
4667 | 118 namespace with <stddef.h>'s symbols. Otherwise, include <stddef.h> |
119 and use ptrdiff_t. */ | |
334 | 120 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
121 #ifdef __PTRDIFF_TYPE__ |
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
122 # define PTR_INT_TYPE __PTRDIFF_TYPE__ |
334 | 123 #else |
4667 | 124 # include <stddef.h> |
125 # define PTR_INT_TYPE ptrdiff_t | |
334 | 126 #endif |
127 | |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
128 /* If B is the base of an object addressed by P, return the result of |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
129 aligning P to the next multiple of A + 1. B and P must be of type |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
130 char *. A + 1 must be a power of 2. */ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
131 |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
132 #define __BPTR_ALIGN(B, P, A) ((B) + (((P) - (B) + (A)) & ~(A))) |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
133 |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
134 /* Similiar to _BPTR_ALIGN (B, P, A), except optimize the common case |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
135 where pointers can be converted to integers, aligned as integers, |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
136 and converted back again. If PTR_INT_TYPE is narrower than a |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
137 pointer (e.g., the AS/400), play it safe and compute the alignment |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
138 relative to B. Otherwise, use the faster strategy of computing the |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
139 alignment relative to 0. */ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
140 |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
141 #define __PTR_ALIGN(B, P, A) \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
142 __BPTR_ALIGN (sizeof (PTR_INT_TYPE) < sizeof (void *) ? (B) : (char *) 0, \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
143 P, A) |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
144 |
4667 | 145 #include <string.h> |
881 | 146 |
334 | 147 struct _obstack_chunk /* Lives at front of each chunk. */ |
148 { | |
149 char *limit; /* 1 past end of this chunk */ | |
150 struct _obstack_chunk *prev; /* address of prior chunk or NULL */ | |
151 char contents[4]; /* objects begin here */ | |
152 }; | |
153 | |
154 struct obstack /* control current object in current chunk */ | |
155 { | |
156 long chunk_size; /* preferred size to allocate chunks in */ | |
881 | 157 struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */ |
334 | 158 char *object_base; /* address of object we are building */ |
159 char *next_free; /* where to add next char to current object */ | |
160 char *chunk_limit; /* address of char after current chunk */ | |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
161 union |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
162 { |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
163 PTR_INT_TYPE tempint; |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
164 void *tempptr; |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
165 } temp; /* Temporary for some macros. */ |
334 | 166 int alignment_mask; /* Mask of alignment for each object. */ |
779 | 167 /* These prototypes vary based on `use_extra_arg', and we use |
168 casts to the prototypeless function type in all assignments, | |
169 but having prototypes here quiets -Wstrict-prototypes. */ | |
170 struct _obstack_chunk *(*chunkfun) (void *, long); | |
171 void (*freefun) (void *, struct _obstack_chunk *); | |
881 | 172 void *extra_arg; /* first arg for chunk alloc/dealloc funcs */ |
334 | 173 unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */ |
174 unsigned maybe_empty_object:1;/* There is a possibility that the current | |
175 chunk contains a zero-length object. This | |
176 prevents freeing the chunk if we allocate | |
177 a bigger chunk to replace it. */ | |
881 | 178 unsigned alloc_failed:1; /* No longer used, as we now call the failed |
179 handler on error, but retained for binary | |
180 compatibility. */ | |
334 | 181 }; |
182 | |
183 /* Declare the external functions we use; they are in obstack.c. */ | |
184 | |
185 extern void _obstack_newchunk (struct obstack *, int); | |
186 extern int _obstack_begin (struct obstack *, int, int, | |
779 | 187 void *(*) (long), void (*) (void *)); |
334 | 188 extern int _obstack_begin_1 (struct obstack *, int, int, |
779 | 189 void *(*) (void *, long), |
190 void (*) (void *, void *), void *); | |
881 | 191 extern int _obstack_memory_used (struct obstack *); |
334 | 192 |
193 void obstack_free (struct obstack *obstack, void *block); | |
194 | |
5070
57d23334289f
Remove unused vars and decls in obstack.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5065
diff
changeset
|
195 |
881 | 196 /* Error handler called when `obstack_chunk_alloc' failed to allocate |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
197 more memory. This can be set to a user defined function which |
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
198 should either abort gracefully or use longjump - but shouldn't |
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
199 return. The default action is to print a message and abort. */ |
881 | 200 extern void (*obstack_alloc_failed_handler) (void); |
201 | |
202 /* Exit value used when `print_and_abort' is used. */ | |
203 extern int obstack_exit_failure; | |
334 | 204 |
205 /* Pointer to beginning of object being allocated or to be allocated next. | |
206 Note that this might not be the final address of the object | |
207 because a new chunk might be needed to hold the final size. */ | |
208 | |
5095
0afa9dc2bdfc
(obstack_base): Cast to (void *), per documentation.
Jim Meyering <jim@meyering.net>
parents:
5070
diff
changeset
|
209 #define obstack_base(h) ((void *) (h)->object_base) |
334 | 210 |
211 /* Size for allocating ordinary chunks. */ | |
212 | |
213 #define obstack_chunk_size(h) ((h)->chunk_size) | |
214 | |
215 /* Pointer to next byte not yet allocated in current chunk. */ | |
216 | |
881 | 217 #define obstack_next_free(h) ((h)->next_free) |
334 | 218 |
219 /* Mask specifying low bits that should be clear in address of an object. */ | |
220 | |
221 #define obstack_alignment_mask(h) ((h)->alignment_mask) | |
222 | |
4667 | 223 /* To prevent prototype warnings provide complete argument list. */ |
4805
8f430f14ff21
Merge changes from glibc obstack; minor cleanups to make it easier to
Paul Eggert <eggert@cs.ucla.edu>
parents:
4804
diff
changeset
|
224 #define obstack_init(h) \ |
2990 | 225 _obstack_begin ((h), 0, 0, \ |
4550
6070487cf52f
White-space changes only; from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4432
diff
changeset
|
226 (void *(*) (long)) obstack_chunk_alloc, \ |
2990 | 227 (void (*) (void *)) obstack_chunk_free) |
779 | 228 |
4805
8f430f14ff21
Merge changes from glibc obstack; minor cleanups to make it easier to
Paul Eggert <eggert@cs.ucla.edu>
parents:
4804
diff
changeset
|
229 #define obstack_begin(h, size) \ |
2990 | 230 _obstack_begin ((h), (size), 0, \ |
4550
6070487cf52f
White-space changes only; from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4432
diff
changeset
|
231 (void *(*) (long)) obstack_chunk_alloc, \ |
2990 | 232 (void (*) (void *)) obstack_chunk_free) |
779 | 233 |
4805
8f430f14ff21
Merge changes from glibc obstack; minor cleanups to make it easier to
Paul Eggert <eggert@cs.ucla.edu>
parents:
4804
diff
changeset
|
234 #define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \ |
2990 | 235 _obstack_begin ((h), (size), (alignment), \ |
4550
6070487cf52f
White-space changes only; from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4432
diff
changeset
|
236 (void *(*) (long)) (chunkfun), \ |
2990 | 237 (void (*) (void *)) (freefun)) |
779 | 238 |
4805
8f430f14ff21
Merge changes from glibc obstack; minor cleanups to make it easier to
Paul Eggert <eggert@cs.ucla.edu>
parents:
4804
diff
changeset
|
239 #define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \ |
2990 | 240 _obstack_begin_1 ((h), (size), (alignment), \ |
241 (void *(*) (void *, long)) (chunkfun), \ | |
995 | 242 (void (*) (void *, void *)) (freefun), (arg)) |
779 | 243 |
4805
8f430f14ff21
Merge changes from glibc obstack; minor cleanups to make it easier to
Paul Eggert <eggert@cs.ucla.edu>
parents:
4804
diff
changeset
|
244 #define obstack_chunkfun(h, newchunkfun) \ |
995 | 245 ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun)) |
779 | 246 |
4805
8f430f14ff21
Merge changes from glibc obstack; minor cleanups to make it easier to
Paul Eggert <eggert@cs.ucla.edu>
parents:
4804
diff
changeset
|
247 #define obstack_freefun(h, newfreefun) \ |
995 | 248 ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun)) |
779 | 249 |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
250 #define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar)) |
334 | 251 |
252 #define obstack_blank_fast(h,n) ((h)->next_free += (n)) | |
881 | 253 |
254 #define obstack_memory_used(h) _obstack_memory_used (h) | |
334 | 255 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
256 #if defined __GNUC__ && defined __STDC__ && __STDC__ |
350 | 257 /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and |
258 does not implement __extension__. But that compiler doesn't define | |
259 __GNUC_MINOR__. */ | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
260 # if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__) |
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
261 # define __extension__ |
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
262 # endif |
334 | 263 |
264 /* For GNU C, if not -traditional, | |
265 we can define these macros to compute all args only once | |
266 without using a global variable. | |
267 Also, we can avoid using the `temp' slot, to make faster code. */ | |
268 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
269 # define obstack_object_size(OBSTACK) \ |
334 | 270 __extension__ \ |
4256
8985ae624e3d
Merge changes from Coreutils.
Jim Meyering <jim@meyering.net>
parents:
4253
diff
changeset
|
271 ({ struct obstack const *__o = (OBSTACK); \ |
334 | 272 (unsigned) (__o->next_free - __o->object_base); }) |
273 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
274 # define obstack_room(OBSTACK) \ |
334 | 275 __extension__ \ |
4256
8985ae624e3d
Merge changes from Coreutils.
Jim Meyering <jim@meyering.net>
parents:
4253
diff
changeset
|
276 ({ struct obstack const *__o = (OBSTACK); \ |
334 | 277 (unsigned) (__o->chunk_limit - __o->next_free); }) |
278 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
279 # define obstack_make_room(OBSTACK,length) \ |
881 | 280 __extension__ \ |
281 ({ struct obstack *__o = (OBSTACK); \ | |
282 int __len = (length); \ | |
283 if (__o->chunk_limit - __o->next_free < __len) \ | |
284 _obstack_newchunk (__o, __len); \ | |
285 (void) 0; }) | |
286 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
287 # define obstack_empty_p(OBSTACK) \ |
1112 | 288 __extension__ \ |
4256
8985ae624e3d
Merge changes from Coreutils.
Jim Meyering <jim@meyering.net>
parents:
4253
diff
changeset
|
289 ({ struct obstack const *__o = (OBSTACK); \ |
5173
663a1b941e51
(obstack_empty_p): Don't assume that chunk->contents is suitably
Paul Eggert <eggert@cs.ucla.edu>
parents:
5095
diff
changeset
|
290 (__o->chunk->prev == 0 \ |
663a1b941e51
(obstack_empty_p): Don't assume that chunk->contents is suitably
Paul Eggert <eggert@cs.ucla.edu>
parents:
5095
diff
changeset
|
291 && __o->next_free == __PTR_ALIGN ((char *) __o->chunk, \ |
663a1b941e51
(obstack_empty_p): Don't assume that chunk->contents is suitably
Paul Eggert <eggert@cs.ucla.edu>
parents:
5095
diff
changeset
|
292 __o->chunk->contents, \ |
663a1b941e51
(obstack_empty_p): Don't assume that chunk->contents is suitably
Paul Eggert <eggert@cs.ucla.edu>
parents:
5095
diff
changeset
|
293 __o->alignment_mask)); }) |
1112 | 294 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
295 # define obstack_grow(OBSTACK,where,length) \ |
334 | 296 __extension__ \ |
297 ({ struct obstack *__o = (OBSTACK); \ | |
298 int __len = (length); \ | |
299 if (__o->next_free + __len > __o->chunk_limit) \ | |
300 _obstack_newchunk (__o, __len); \ | |
4805
8f430f14ff21
Merge changes from glibc obstack; minor cleanups to make it easier to
Paul Eggert <eggert@cs.ucla.edu>
parents:
4804
diff
changeset
|
301 memcpy (__o->next_free, where, __len); \ |
881 | 302 __o->next_free += __len; \ |
334 | 303 (void) 0; }) |
304 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
305 # define obstack_grow0(OBSTACK,where,length) \ |
334 | 306 __extension__ \ |
307 ({ struct obstack *__o = (OBSTACK); \ | |
308 int __len = (length); \ | |
309 if (__o->next_free + __len + 1 > __o->chunk_limit) \ | |
310 _obstack_newchunk (__o, __len + 1); \ | |
4805
8f430f14ff21
Merge changes from glibc obstack; minor cleanups to make it easier to
Paul Eggert <eggert@cs.ucla.edu>
parents:
4804
diff
changeset
|
311 memcpy (__o->next_free, where, __len); \ |
881 | 312 __o->next_free += __len; \ |
313 *(__o->next_free)++ = 0; \ | |
334 | 314 (void) 0; }) |
315 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
316 # define obstack_1grow(OBSTACK,datum) \ |
334 | 317 __extension__ \ |
318 ({ struct obstack *__o = (OBSTACK); \ | |
319 if (__o->next_free + 1 > __o->chunk_limit) \ | |
320 _obstack_newchunk (__o, 1); \ | |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
321 obstack_1grow_fast (__o, datum); \ |
334 | 322 (void) 0; }) |
323 | |
2990 | 324 /* These assume that the obstack alignment is good enough for pointers |
325 or ints, and that the data added so far to the current object | |
334 | 326 shares that much alignment. */ |
479 | 327 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
328 # define obstack_ptr_grow(OBSTACK,datum) \ |
334 | 329 __extension__ \ |
330 ({ struct obstack *__o = (OBSTACK); \ | |
331 if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ | |
332 _obstack_newchunk (__o, sizeof (void *)); \ | |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
333 obstack_ptr_grow_fast (__o, datum); }) \ |
334 | 334 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
335 # define obstack_int_grow(OBSTACK,datum) \ |
334 | 336 __extension__ \ |
337 ({ struct obstack *__o = (OBSTACK); \ | |
338 if (__o->next_free + sizeof (int) > __o->chunk_limit) \ | |
339 _obstack_newchunk (__o, sizeof (int)); \ | |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
340 obstack_int_grow_fast (__o, datum); }) |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
341 |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
342 # define obstack_ptr_grow_fast(OBSTACK,aptr) \ |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
343 __extension__ \ |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
344 ({ struct obstack *__o1 = (OBSTACK); \ |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
345 *(const void **) __o1->next_free = (aptr); \ |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
346 __o1->next_free += sizeof (const void *); \ |
334 | 347 (void) 0; }) |
348 | |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
349 # define obstack_int_grow_fast(OBSTACK,aint) \ |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
350 __extension__ \ |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
351 ({ struct obstack *__o1 = (OBSTACK); \ |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
352 *(int *) __o1->next_free = (aint); \ |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
353 __o1->next_free += sizeof (int); \ |
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
354 (void) 0; }) |
334 | 355 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
356 # define obstack_blank(OBSTACK,length) \ |
334 | 357 __extension__ \ |
358 ({ struct obstack *__o = (OBSTACK); \ | |
359 int __len = (length); \ | |
360 if (__o->chunk_limit - __o->next_free < __len) \ | |
361 _obstack_newchunk (__o, __len); \ | |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
362 obstack_blank_fast (__o, __len); \ |
334 | 363 (void) 0; }) |
364 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
365 # define obstack_alloc(OBSTACK,length) \ |
334 | 366 __extension__ \ |
367 ({ struct obstack *__h = (OBSTACK); \ | |
368 obstack_blank (__h, (length)); \ | |
369 obstack_finish (__h); }) | |
370 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
371 # define obstack_copy(OBSTACK,where,length) \ |
334 | 372 __extension__ \ |
373 ({ struct obstack *__h = (OBSTACK); \ | |
374 obstack_grow (__h, (where), (length)); \ | |
375 obstack_finish (__h); }) | |
376 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
377 # define obstack_copy0(OBSTACK,where,length) \ |
334 | 378 __extension__ \ |
379 ({ struct obstack *__h = (OBSTACK); \ | |
380 obstack_grow0 (__h, (where), (length)); \ | |
381 obstack_finish (__h); }) | |
382 | |
383 /* The local variable is named __o1 to avoid a name conflict | |
384 when obstack_blank is called. */ | |
4550
6070487cf52f
White-space changes only; from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4432
diff
changeset
|
385 # define obstack_finish(OBSTACK) \ |
334 | 386 __extension__ \ |
387 ({ struct obstack *__o1 = (OBSTACK); \ | |
5057
f4b3a4229349
Import obstack changes from libc.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4805
diff
changeset
|
388 void *__value = (void *) __o1->object_base; \ |
f4b3a4229349
Import obstack changes from libc.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4805
diff
changeset
|
389 if (__o1->next_free == __value) \ |
881 | 390 __o1->maybe_empty_object = 1; \ |
391 __o1->next_free \ | |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
392 = __PTR_ALIGN (__o1->object_base, __o1->next_free, \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
393 __o1->alignment_mask); \ |
881 | 394 if (__o1->next_free - (char *)__o1->chunk \ |
395 > __o1->chunk_limit - (char *)__o1->chunk) \ | |
396 __o1->next_free = __o1->chunk_limit; \ | |
397 __o1->object_base = __o1->next_free; \ | |
5057
f4b3a4229349
Import obstack changes from libc.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4805
diff
changeset
|
398 __value; }) |
334 | 399 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
400 # define obstack_free(OBSTACK, OBJ) \ |
334 | 401 __extension__ \ |
402 ({ struct obstack *__o = (OBSTACK); \ | |
403 void *__obj = (OBJ); \ | |
404 if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \ | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
405 __o->next_free = __o->object_base = (char *)__obj; \ |
334 | 406 else (obstack_free) (__o, __obj); }) |
407 | |
408 #else /* not __GNUC__ or not __STDC__ */ | |
409 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
410 # define obstack_object_size(h) \ |
881 | 411 (unsigned) ((h)->next_free - (h)->object_base) |
334 | 412 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
413 # define obstack_room(h) \ |
334 | 414 (unsigned) ((h)->chunk_limit - (h)->next_free) |
415 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
416 # define obstack_empty_p(h) \ |
5173
663a1b941e51
(obstack_empty_p): Don't assume that chunk->contents is suitably
Paul Eggert <eggert@cs.ucla.edu>
parents:
5095
diff
changeset
|
417 ((h)->chunk->prev == 0 \ |
663a1b941e51
(obstack_empty_p): Don't assume that chunk->contents is suitably
Paul Eggert <eggert@cs.ucla.edu>
parents:
5095
diff
changeset
|
418 && (h)->next_free == __PTR_ALIGN ((char *) (h)->chunk, \ |
663a1b941e51
(obstack_empty_p): Don't assume that chunk->contents is suitably
Paul Eggert <eggert@cs.ucla.edu>
parents:
5095
diff
changeset
|
419 (h)->chunk->contents, \ |
663a1b941e51
(obstack_empty_p): Don't assume that chunk->contents is suitably
Paul Eggert <eggert@cs.ucla.edu>
parents:
5095
diff
changeset
|
420 (h)->alignment_mask)) |
1112 | 421 |
334 | 422 /* Note that the call to _obstack_newchunk is enclosed in (..., 0) |
423 so that we can avoid having void expressions | |
424 in the arms of the conditional expression. | |
425 Casting the third operand to void was tried before, | |
426 but some compilers won't accept it. */ | |
427 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
428 # define obstack_make_room(h,length) \ |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
429 ( (h)->temp.tempint = (length), \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
430 (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
431 ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0)) |
881 | 432 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
433 # define obstack_grow(h,where,length) \ |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
434 ( (h)->temp.tempint = (length), \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
435 (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
436 ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
437 memcpy ((h)->next_free, where, (h)->temp.tempint), \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
438 (h)->next_free += (h)->temp.tempint) |
334 | 439 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
440 # define obstack_grow0(h,where,length) \ |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
441 ( (h)->temp.tempint = (length), \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
442 (((h)->next_free + (h)->temp.tempint + 1 > (h)->chunk_limit) \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
443 ? (_obstack_newchunk ((h), (h)->temp.tempint + 1), 0) : 0), \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
444 memcpy ((h)->next_free, where, (h)->temp.tempint), \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
445 (h)->next_free += (h)->temp.tempint, \ |
881 | 446 *((h)->next_free)++ = 0) |
334 | 447 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
448 # define obstack_1grow(h,datum) \ |
334 | 449 ( (((h)->next_free + 1 > (h)->chunk_limit) \ |
450 ? (_obstack_newchunk ((h), 1), 0) : 0), \ | |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
451 obstack_1grow_fast (h, datum)) |
334 | 452 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
453 # define obstack_ptr_grow(h,datum) \ |
334 | 454 ( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ |
455 ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ | |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
456 obstack_ptr_grow_fast (h, datum)) |
334 | 457 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
458 # define obstack_int_grow(h,datum) \ |
334 | 459 ( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ |
460 ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ | |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
461 obstack_int_grow_fast (h, datum)) |
334 | 462 |
2990 | 463 # define obstack_ptr_grow_fast(h,aptr) \ |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
464 (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) |
2990 | 465 |
466 # define obstack_int_grow_fast(h,aint) \ | |
4804
d0a345595720
Don't use lvalue casts, as GCC plans to remove support for them in GCC 3.5.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4667
diff
changeset
|
467 (((int *) ((h)->next_free += sizeof (int)))[-1] = (aptr)) |
334 | 468 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
469 # define obstack_blank(h,length) \ |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
470 ( (h)->temp.tempint = (length), \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
471 (((h)->chunk_limit - (h)->next_free < (h)->temp.tempint) \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
472 ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
473 obstack_blank_fast (h, (h)->temp.tempint)) |
334 | 474 |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
475 # define obstack_alloc(h,length) \ |
334 | 476 (obstack_blank ((h), (length)), obstack_finish ((h))) |
477 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
478 # define obstack_copy(h,where,length) \ |
334 | 479 (obstack_grow ((h), (where), (length)), obstack_finish ((h))) |
480 | |
2477
27aa55bf95b7
update from glibc -- solely white space changes
Jim Meyering <jim@meyering.net>
parents:
1112
diff
changeset
|
481 # define obstack_copy0(h,where,length) \ |
334 | 482 (obstack_grow0 ((h), (where), (length)), obstack_finish ((h))) |
483 | |
4550
6070487cf52f
White-space changes only; from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4432
diff
changeset
|
484 # define obstack_finish(h) \ |
881 | 485 ( ((h)->next_free == (h)->object_base \ |
334 | 486 ? (((h)->maybe_empty_object = 1), 0) \ |
487 : 0), \ | |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
488 (h)->temp.tempptr = (h)->object_base, \ |
334 | 489 (h)->next_free \ |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
490 = __PTR_ALIGN ((h)->object_base, (h)->next_free, \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
491 (h)->alignment_mask), \ |
881 | 492 (((h)->next_free - (char *) (h)->chunk \ |
493 > (h)->chunk_limit - (char *) (h)->chunk) \ | |
334 | 494 ? ((h)->next_free = (h)->chunk_limit) : 0), \ |
495 (h)->object_base = (h)->next_free, \ | |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
496 (h)->temp.tempptr) |
334 | 497 |
4805
8f430f14ff21
Merge changes from glibc obstack; minor cleanups to make it easier to
Paul Eggert <eggert@cs.ucla.edu>
parents:
4804
diff
changeset
|
498 # define obstack_free(h,obj) \ |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
499 ( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
500 ((((h)->temp.tempint > 0 \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
501 && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \ |
334 | 502 ? (int) ((h)->next_free = (h)->object_base \ |
5065
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
503 = (h)->temp.tempint + (char *) (h)->chunk) \ |
4ce8ff7e5f06
Port obstack to the AS/400.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5057
diff
changeset
|
504 : (((obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0))) |
334 | 505 |
506 #endif /* not __GNUC__ or not __STDC__ */ | |
507 | |
995 | 508 #ifdef __cplusplus |
509 } /* C++ */ | |
510 #endif | |
511 | |
1112 | 512 #endif /* obstack.h */ |