]> git.saurik.com Git - bison.git/blobdiff - src/system.h
Typos in ChangeLog.
[bison.git] / src / system.h
index ae02b6199829f3d96a98aa552604fcbe1516baef..dfa287bb92d2329e51974b8a59607c7773576a68 100644 (file)
@@ -24,6 +24,8 @@
 
 #include <stdio.h>
 
+#include <assert.h>
+
 #ifdef MSDOS
 # include <io.h>
 #endif
@@ -159,3 +161,36 @@ 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)
+
+#define obstack_fgrow2(Obs, Format, Arg1, Arg2)        \
+do {                                           \
+  char buf[4096];                              \
+  sprintf (buf, Format, Arg1, Arg2);           \
+  obstack_grow (Obs, buf, strlen (buf));       \
+} while (0)
+
+#define obstack_fgrow3(Obs, Format, Arg1, Arg2, Arg3)  \
+do {                                                   \
+  char buf[4096];                                      \
+  sprintf (buf, Format, Arg1, Arg2, Arg3);             \
+  obstack_grow (Obs, buf, strlen (buf));               \
+} while (0)