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