gdb/copying.awk - gdb

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