Index: scconfig/Makefile =================================================================== --- scconfig/Makefile (revision 1472) +++ scconfig/Makefile (revision 1473) @@ -11,7 +11,7 @@ USER_OBJS = src/util/arg_auto_set.o # what to build - a ./configure -all: configure +all: configure cquote # This line imports scconfig core and default tests include src/default/Makefile.plugin @@ -75,6 +75,8 @@ hooks.o: plugin_3state.h plugins.h +cquote: cquote.c + clean: rm $(OBJS) configure Index: scconfig/cquote.c =================================================================== --- scconfig/cquote.c (nonexistent) +++ scconfig/cquote.c (revision 1473) @@ -0,0 +1,53 @@ +#include + +void copy() +{ + int c, nl = 0, qt = 1, ind = 1; + while((c = getc(stdin)) != EOF) { + if (ind) { + printf("\t"); + if (!nl) + printf(" "); + ind = 0; + } + if (nl) { + printf("NL "); + nl = 0; + } + if (qt) { + printf("\""); + qt = 0; + } + switch(c) { + case '\t': printf(" "); break; + case '\n': printf("\"\n"); nl = qt = ind = 1; break; + case '\r': break; + case '\\': printf("\\\\"); break; + case '"': printf("\\\""); break; + default: + if ((c < 32) || (c>126)) + printf("\\%3o", c); + else + putc(c, stdout); + } + } + if (!qt) + printf("\""); + if (nl) { + if (ind) + printf("\t"); + printf("NL"); + } + printf(";\n"); +} + + + +int main(int argc, char *argv[]) +{ + + printf("#define NL \"\\n\"\n"); + + copy(); + return 0; +}