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