1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
$NetBSD: patch-ac,v 1.4 2003/12/31 18:07:47 ben Exp $
--- genclr.c.orig 1998-08-08 05:53:59.000000000 -0700
+++ genclr.c
@@ -181,13 +181,12 @@ static FILE *emitopen (char *file, char
perror ("");
exit (1);
}
- fprintf (fp, "\
-/*\n\
- * Do not edit this file. It was automatically generated by running:\n\
- * %s %s %s\n\
- */\n\
-\n\
-",
+ fprintf (fp,
+ "/*\n"
+ " * Do not edit this file. It was automatically generated by running:\n"
+ " * %s %s %s\n"
+ " */\n"
+ "\n",
argv[0], argv[1], argv[2]);
return fp;
}
@@ -280,31 +279,26 @@ int main (int argc, char **argv)
* Emit .c file.
*/
fp = emitopen (cfile, argv);
- fprintf (fp, "\
-#include <curses.h>\n\
-#include <stdio.h>\n\
-#include <stdlib.h>\n\
-
-#include \"%s\"\n\
-
-void clrgen_init (void)\n\
-""{\n\
- if (%d > COLOR_PAIRS - 1) {\n\
- endwin();
- fputs (\"Too many color pairs!\\n\", stderr);\n\
- exit (1);\n\
- }\n\
-",
+ fprintf (fp,
+ "#include <curses.h>\n"
+ "#include <stdio.h>\n"
+ "#include <stdlib.h>\n"
+ "\n"
+ "#include \"%s\"\n"
+ "\n"
+ "void clrgen_init (void)\n"
+ "{\n"
+ " if (%d > COLOR_PAIRS - 1) {\n"
+ " endwin();\n"
+ " fputs (\"Too many color pairs!\\n\", stderr);\n"
+ " exit (1);\n"
+ " }\n",
hfile, ncpairs);
for (i = 0; i < ncpairs; i++)
- fprintf (fp, "\
- init_pair (%d, COLOR_%s, COLOR_%s);\n\
-",
+ fprintf (fp,
+ " init_pair (%d, COLOR_%s, COLOR_%s);\n",
cpairs[i]->idx, cpairs[i]->cfg, cpairs[i]->cbg);
- fputs ("\
-""}\n\
-",
- fp);
+ fputs ("}\n", fp);
emitclose (fp, cfile);
/*
@@ -318,10 +312,8 @@ void clrgen_init (void)\n\
strlen (pair->ofg) + strlen (pair->obg) > 10 ? "" : "\t",
pair->idx, pair->boldfg ? "|A_BOLD" : "");
}
- fputs ("\
-\n\
-extern void clrgen_init (void);\n\
-",
+ fputs ("\n"
+ "extern void clrgen_init (void);\n",
fp);
emitclose (fp, hfile);
|