obstack_escape: escape M4 characters

* src/muscle-tab.h (MUSCLE_OBSTACK_SGROW): This is not related to
muscles, so move to, and rename as...
* src/system.h (obstack_escape): this.
Adjust dependencies.
This commit is contained in:
Akim Demaille
2012-07-26 11:19:18 +02:00
parent dba9149595
commit 13b712d7d4
4 changed files with 30 additions and 24 deletions

View File

@@ -192,6 +192,27 @@ typedef size_t uintptr_t;
} 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)
/*-----------------------------------------.
| Extensions to use for the output files. |