Introduce obstacks.

Change each use of `faction' into a use of `action_obstack'.
* lib/obstack.h, lib/obstack.c: New files.
* src/files.c (faction): Remove.
(action_obstack): New.
Adjust all dependencies.
This commit is contained in:
Akim Demaille
2000-11-01 16:03:50 +00:00
parent 77aee78982
commit 8c7ebe4946
9 changed files with 1412 additions and 78 deletions

View File

@@ -161,3 +161,22 @@ extern int errno;
# define FALSE (0)
#endif
typedef int bool;
/*-----------.
| Obstacks. |
`-----------*/
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
#include "obstack.h"
#define obstack_grow_literal_string(Obs, Str) \
obstack_grow (Obs, Str, sizeof (Str) - 1)
#define obstack_fgrow1(Obs, Format, Arg1) \
do { \
char buf[4096]; \
sprintf (buf, Format, Arg1); \
obstack_grow (Obs, buf, strlen (buf)); \
} while (0)