File: copying.awk

package info (click to toggle)
xconq 7.2.2-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 8,296 kB
  • ctags: 9,199
  • sloc: ansic: 107,849; sh: 2,108; perl: 2,057; makefile: 1,177; sed: 161; csh: 50; awk: 49; lisp: 39
file content (49 lines) | stat: -rw-r--r-- 1,165 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
BEGIN	{
	  FS="\"";
	  print "/* ==> Do not modify this file!!  It is created automatically";
	  print "   by copying.awk.  Modify copying.awk instead.  <== */";
	  print ""
	  print "#include \"conq.h\""
	  print ""
	  print "void";
	  print "describe_copyright(arg, key, buf)";
	  print "int arg;";
	  print "char *key;";
	  print "TextBuffer *buf;";
	  print "{";
	}
NR == 1,/^[ 	]*NO WARRANTY[ 	]*$/	{
	  if ($0 ~ //)
	    {
	      printf "  tbcat(buf, \"\\n\");\n";
	    }
	  else if ($0 !~ /^[ 	]*NO WARRANTY[ 	]*$/) 
	    {
	      printf "  tbcat(buf, \"";
	      for (i = 1; i < NF; i++)
		printf "%s\\\"", $i;
	      printf "%s\\n\");\n", $NF;
	    }
	}
/^[	 ]*NO WARRANTY[ 	]*$/	{
	  print "}";
	  print "";
	  print "void";
	  print "describe_warranty(arg, key, buf)";
	  print "int arg;";
	  print "char *key;";
	  print "TextBuffer *buf;";
	  print "{";
	}
/^[ 	]*NO WARRANTY[ 	]*$/, /^[ 	]*END OF TERMS AND CONDITIONS[ 	]*$/{  
	  if (! ($0 ~ /^[ 	]*END OF TERMS AND CONDITIONS[ 	]*$/)) 
	    {
	      printf "  tbcat(buf, \"";
	      for (i = 1; i < NF; i++)
		printf "%s\\\"", $i;
	      printf "%s\\n\");\n", $NF;
	    }
	}
END	{
	  print "}";
	}