- printf "const char *%s[] = {\n" "$3"
- sed -e 's/"/\\"/g' -e 's/^/"/' -e 's/$/",/' $1
- printf "NULL };\n"
- printf "#define print_%s() { \\" $3
- printf "\n\tconst char **__s = %s; \\" $3
- printf "\n\tfor (; *__s; __s++) \\"
- printf "\n\t\tputs(*__s); \\"
- printf "\n}\n"
+ printf "\n#define %s { \\" $3
+ printf "\n"
+ sed -e 's/"/\\"/g' -e 's/^/"/' -e 's/$/\\n", \\/' $1
+ printf "NULL }\n"
+ printf "\n#define print_%s() { \\" $3
+ printf "\n\tconst char **__sp, *__s[] = %s; \\" $3
+ printf "\n\tfor (__sp = __s; *__sp; __sp++) \\"
+ printf "\n\t\tprintf(\"%s\", *__sp); \\" "%s"
+ printf "\n}\n\n"