-#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)
+# 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)
+
+# define obstack_fgrow4(Obs, Format, Arg1, Arg2, Arg3, Arg4) \
+ do { \
+ char buf[4096]; \
+ sprintf (buf, Format, Arg1, Arg2, Arg3, Arg4); \
+ obstack_grow (Obs, buf, strlen (buf)); \
+ } while (0)
+
+
+/* Output Str escaped for our postprocessing (i.e., escape M4 special
+ characters).
+
+ For instance "[foo]" -> "@{foo@}", "$$" -> "$][$][". */
+
+# define obstack_escape(Obs, Str) \
+ do { \
+ char const *p; \
+ for (p = Str; *p; p++) \
+ switch (*p) \
+ { \
+ case '$': obstack_sgrow (Obs, "$]["); break; \
+ case '@': obstack_sgrow (Obs, "@@" ); break; \
+ case '[': obstack_sgrow (Obs, "@{" ); break; \
+ case ']': obstack_sgrow (Obs, "@}" ); break; \
+ default: obstack_1grow (Obs, *p ); break; \
+ } \
+ } while (0)