copying.awk revision 1.1.1.1 1 BEGIN {
2 FS="\"";
3 print "/* ==> Do not modify this file!! " \
4 "-*- buffer-read-only: t -*- vi" \
5 ":set ro:";
6 print " It is created automatically by copying.awk.";
7 print " Modify copying.awk instead. <== */";
8 print ""
9 print "#include \"defs.h\""
10 print "#include \"command.h\""
11 print "#include \"gdbcmd.h\""
12 print ""
13 print "static void show_copying_command (char *, int);"
14 print ""
15 print "static void show_warranty_command (char *, int);"
16 print ""
17 print "void _initialize_copying (void);"
18 print ""
19 print "static void";
20 print "show_copying_command (char *ignore, int from_tty)";
21 print "{";
22 }
23 NR == 1,/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/ {
24 if ($0 ~ //)
26 {
27 printf " printf_filtered (\"\\n\");\n";
28 }
29 else if ($0 !~ /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/)
30 {
31 printf " printf_filtered (\"";
32 for (i = 1; i < NF; i++)
33 printf "%s\\\"", $i;
34 printf "%s\\n\");\n", $NF;
35 }
36 }
37 /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/ {
38 print "}";
39 print "";
40 print "static void";
41 print "show_warranty_command (char *ignore, int from_tty)";
42 print "{";
43 }
44 /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/, /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/{
45 if (! ($0 ~ /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/))
46 {
47 printf " printf_filtered (\"";
48 for (i = 1; i < NF; i++)
49 printf "%s\\\"", $i;
50 printf "%s\\n\");\n", $NF;
51 }
52 }
53 END {
54 print "}";
55 print "";
56 print "void"
57 print "_initialize_copying (void)";
58 print "{";
59 print " add_cmd (\"copying\", no_set_class, show_copying_command,";
60 print " _(\"Conditions for redistributing copies of GDB.\"),";
61 print " &showlist);";
62 print " add_cmd (\"warranty\", no_set_class, show_warranty_command,";
63 print " _(\"Various kinds of warranty you do not have.\"),";
64 print " &showlist);";
65 print "";
66 print " /* For old-timers, allow \"info copying\", etc. */";
67 print " add_info (\"copying\", show_copying_command,";
68 print " _(\"Conditions for redistributing copies of GDB.\"));";
69 print " add_info (\"warranty\", show_warranty_command,";
70 print " _(\"Various kinds of warranty you do not have.\"));";
71 print "}";
72 }
73