Home | History | Annotate | Line # | Download | only in gdb
copying.awk revision 1.8
      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 \"command.h\""
     10 	  print "#include \"cli/cli-cmds.h\""
     11 	  print ""
     12 	  print "static void show_copying_command (const char *, int);"
     13 	  print ""
     14 	  print "static void show_warranty_command (const char *, int);"
     15 	  print ""
     16 	  print "static void";
     17 	  print "show_copying_command (const char *ignore, int from_tty)";
     18 	  print "{";
     19 	}
     20 NR == 1,/^[ 	]*15\. Disclaimer of Warranty\.[ 	]*$/	{
     21 	  if ($0 ~ //)
     23 	    {
     24 	      printf "  gdb_printf (\"\\n\");\n";
     25 	    }
     26 	  else if ($0 !~ /^[ 	]*15\. Disclaimer of Warranty\.[ 	]*$/) 
     27 	    {
     28 	      printf "  gdb_printf (\"";
     29 	      for (i = 1; i < NF; i++)
     30 		printf "%s\\\"", $i;
     31 	      printf "%s\\n\");\n", $NF;
     32 	    }
     33 	}
     34 /^[	 ]*15\. Disclaimer of Warranty\.[ 	]*$/	{
     35 	  print "}";
     36 	  print "";
     37 	  print "static void";
     38 	  print "show_warranty_command (const char *ignore, int from_tty)";
     39 	  print "{";
     40 	}
     41 /^[ 	]*15\. Disclaimer of Warranty\.[ 	]*$/, /^[ 	]*END OF TERMS AND CONDITIONS[ 	]*$/{  
     42 	  if (! ($0 ~ /^[ 	]*END OF TERMS AND CONDITIONS[ 	]*$/)) 
     43 	    {
     44 	      printf "  gdb_printf (\"";
     45 	      for (i = 1; i < NF; i++)
     46 		printf "%s\\\"", $i;
     47 	      printf "%s\\n\");\n", $NF;
     48 	    }
     49 	}
     50 END	{
     51 	  print "}";
     52 	  print "";
     53 	  print "void _initialize_copying ();"
     54 	  print "void"
     55 	  print "_initialize_copying ()";
     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