Index: trunk/scconfig/cquote.c =================================================================== --- trunk/scconfig/cquote.c (revision 18165) +++ trunk/scconfig/cquote.c (nonexistent) @@ -1,131 +0,0 @@ -/* - pcb-rnd - quote file and pack it in a C string (ANSI C code) - Copyright (C) 2016 Tibor 'Igor2' Palinkas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Project page: http://repo.hu/projects/scconfig - Contact via email: scconfig [at] igor2.repo.hu -*/ - -#include - -void copy_strlit(const char *inds, const char *varname) -{ - int c, nl = 0, qt = 1, ind = 1; - - printf("#define NL \"\\n\"\n"); - printf("const char *%s = \\\n", varname); - - while((c = getc(stdin)) != EOF) { - if (ind) { - printf("%s", inds); - 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("%s", inds); - printf("NL"); - } - printf(";\n"); -} - -void copy_chrarr(const char *inds, const char *varname) -{ - int c, col = 16000; - - printf("/* (Using character array instead of string literal for long strings) */\n"); - printf("const char %s_arr[] = {", varname); - - while((c = getc(stdin)) != EOF) { - if (col > 60) { - printf("\n%s", inds); - col = 0; - } - switch(c) { - case '\t': col+=printf("'\\t',"); break; - case '\r': break; - case '\\': col+=printf("'\\\\',"); break; - case '\'': col+=printf("'\\\'',"); break; - case '\n': - col+=printf("'\\n',"); - col = 16000; - break; - default: - if ((c < 32) || (c>126)) - col+=printf("%d,", c); - else - col+=printf("'%c',", c); - break; - } - } - printf("\n%s0};\n", inds); - printf("const char *%s = %s_arr;\n", varname, varname); - -} - - - -int main(int argc, char *argv[]) -{ - char *varname = "quoted_file"; - char *inds = "\t"; - char *banner = "/* Autogenerated by cquote.c - DO NOT EDIT */\n"; - char *cmd, *arg; - int n, lit = 0; - - for(n = 1; n < argc; n++) { - cmd = argv[n]; - arg = argv[n+1]; - while(*cmd == '-') cmd++; - switch(*cmd) { - case 'n': varname = arg; n++; break; - case 'i': inds = arg; n++; break; - case 'l': lit = 1; break; - } - } - - printf("%s", banner); - if (lit) - copy_strlit(inds, varname); - else - copy_chrarr(inds, varname); - return 0; -} Index: trunk/scconfig/Makefile =================================================================== --- trunk/scconfig/Makefile (revision 18165) +++ trunk/scconfig/Makefile (revision 18166) @@ -95,7 +95,8 @@ sccbox: src/util/sccbox.o $(CC) $(LDFLAGS) -o sccbox src/util/sccbox.o -cquote: cquote.c +cquote: src/util/cquote.c + $(CC) $(CFLAGS) $(LDFLAGS) -o cquote src/util/cquote.c clean: -rm $(OBJS) $(DEFAULT_MAIN_OBJS) configure revtest revtest.o cquote core src/util/sccbox.o Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 18165) +++ trunk/scconfig/Rev.h (revision 18166) @@ -1 +1 @@ -static const int myrev = 17960; +static const int myrev = 18166; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 18165) +++ trunk/scconfig/Rev.tab (revision 18166) @@ -1,3 +1,4 @@ +18166 configure swithc over to scconfig's cquote 17960 configure script plugin 17691 configure action code cleanup 17436 configure renamed hid_actions.[ch]