]> git.saurik.com Git - bison.git/blobdiff - src/system.h
Typos in ChangeLog.
[bison.git] / src / system.h
index 56a0ba0ea9b548c353804822c03e3373c310300a..dfa287bb92d2329e51974b8a59607c7773576a68 100644 (file)
@@ -24,6 +24,8 @@
 
 #include <stdio.h>
 
+#include <assert.h>
+
 #ifdef MSDOS
 # include <io.h>
 #endif
@@ -148,3 +150,47 @@ extern int errno;
 #define        SETBIT(x, i)    ((x)[(i)/BITS_PER_WORD] |= (1<<((i) % BITS_PER_WORD)))
 #define RESETBIT(x, i) ((x)[(i)/BITS_PER_WORD] &= ~(1<<((i) % BITS_PER_WORD)))
 #define BITISSET(x, i) (((x)[(i)/BITS_PER_WORD] & (1<<((i) % BITS_PER_WORD))) != 0)
+
+
+/*-----------.
+| Booleans.  |
+`-----------*/
+
+#ifndef TRUE
+# define TRUE  (1)
+# 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)