obstacks: simplifications

* src/system.h (obstack_finish0): New.
Use it to simplify several uses.
* src/muscle-tab.h (MUSCLE_INSERTF): New.
* src/muscle-tab.c: Use obstack_printf where simpler.
This commit is contained in:
Akim Demaille
2012-08-11 09:02:19 +02:00
parent c7324354fb
commit 6fbe73b6a0
10 changed files with 37 additions and 72 deletions

View File

@@ -173,6 +173,8 @@ typedef size_t uintptr_t;
#define obstack_chunk_free free
#include <obstack.h>
/* String-grow: append Str to Obs. */
#define obstack_sgrow(Obs, Str) \
obstack_grow (Obs, Str, strlen (Str))
@@ -217,6 +219,11 @@ typedef size_t uintptr_t;
} while (0)
/* Append the ending 0, finish Obs, and return the string. */
# define obstack_finish0(Obs) \
(obstack_1grow (Obs, '\0'), (char *) obstack_finish (Obs))