copying.awk revision 1.1.1.2 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 (const char *, int);"
14 print ""
15 print "static void show_warranty_command (const char *, int);"
16 print ""
17 print "static void";
18 print "show_copying_command (const char *ignore, int from_tty)";
19 print "{";
20 }
21 NR == 1,/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/ {
22 if ($0 ~ //)
24 {
25 printf " printf_filtered (\"\\n\");\n";
26 }
27 else if ($0 !~ /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/)
28 {
29 printf " printf_filtered (\"";
30 for (i = 1; i < NF; i++)
31 printf "%s\\\"", $i;
32 printf "%s\\n\");\n", $NF;
33 }
34 }
35 /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/ {
36 print "}";
37 print "";
38 print "static void";
39 print "show_warranty_command (const char *ignore, int from_tty)";
40 print "{";
41 }
42 /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/, /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/{
43 if (! ($0 ~ /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/))
44 {
45 printf " printf_filtered (\"";
46 for (i = 1; i < NF; i++)
47 printf "%s\\\"", $i;
48 printf "%s\\n\");\n", $NF;
49 }
50 }
51 END {
52 print "}";
53 print "";
54 print "void"
55 print "_initialize_copying (void)";
56 print "{";
57 print " add_cmd (\"copying\", no_set_class, show_copying_command,";
58 print " _(\"Conditions for redistributing copies of GDB.\"),";
59 print " &showlist);";
60 print " add_cmd (\"warranty\", no_set_class, show_warranty_command,";
61 print " _(\"Various kinds of warranty you do not have.\"),";
62 print " &showlist);";
63 print "";
64 print " /* For old-timers, allow \"info copying\", etc. */";
65 print " add_info (\"copying\", show_copying_command,";
66 print " _(\"Conditions for redistributing copies of GDB.\"));";
67 print " add_info (\"warranty\", show_warranty_command,";
68 print " _(\"Various kinds of warranty you do not have.\"));";
69 print "}";
70 }
71