Fixed a debug statement: the PO_CR register must be read as a byte, not a word.
[AROS.git] / scripts / copyright.awk
blob9c6e103faa3c1b5ced8e3264d869c4899275b0c7
1 BEGIN {
2 for (arg=1; arg<ARGC; arg++)
4 copyright=" Copyright © 1995-2001, The AROS Development Team. All rights reserved.";
5 id=" $Id$";
6 logtxt=" $Log$
7 logtxt=" Revision 1.3 2001/10/30 20:28:20 chodorowski
8 logtxt=" Fixed copyright notice.
9 logtxt="
10 logtxt=" Revision 1.2 1998/10/20 16:46:36 hkiel
11 logtxt=" Amiga Research OS
12 logtxt="
13 logtxt=" Revision 1.1 1996/08/12 09:59:05 digulla
14 logtxt=" Some scripts
15 logtxt="";
16 desc=" Desc:";
17 lang=" Lang:";
19 filename=ARGV[arg];
20 out=filename ".new";
22 print "Processing " filename "..."
24 getline line < filename
26 if (match (line, /^[ \t]*\/\*[ \t]*$/))
28 #print "#1"
29 done=0
30 while (!done && (getline line < filename) > 0)
32 #print "#2 |" line "|"
33 again=1;
34 while (again)
36 #print "#3 again=" again
37 again=0;
38 if (match (line, /^[ \t]*[(]C[)]/))
40 #print "#4"
43 else if (match (line, /^[ \t]*\$Id/))
45 #print "#5"
48 else if (match (line, /^[ \t]*\$Log/))
50 #print "#6"
53 else if (match (line, /^[ \t]*Desc:/))
55 #print "#7"
56 desc=line;
57 while ((getline line < filename) > 0)
59 if (match (line, /^[ \t]*([(]C[)]|\$Id|\$Log|Desc:|Lang:)/))
60 break;
61 else if (match(line,/^[ \t]*\*\/[ \t]*$/))
63 done = 1;
64 break;
67 desc=desc "\n" line;
70 again=1;
72 else if (match (line, /^[ \t]*Lang:/))
74 #print "#8"
75 lang=line;
76 while ((getline line < filename) > 0)
78 if (match (line, /^[ \t]*([(]C[)]|\$Id|\$Log|Desc:|Lang:)/))
79 break;
80 else if (match(line,/^[ \t]*\*\/[ \t]*$/))
82 done = 1;
83 break;
86 lang=lang "\n" line;
89 again=1;
91 else if (match(line,/^[ \t]*\*\/[ \t]*$/))
93 #print "#done" line
94 done=1;
99 if (!done)
101 print "Error: done is not set"
104 firstline="";
106 else
107 firstline=line;
108 #print "#9" line
110 print "/*" > out
111 print copyright >> out
112 print id >> out
113 print logtxt >> out
114 print desc >> out
115 print lang >> out
116 print "*/" >> out
117 if (firstline!="")
118 print firstline >> out
120 while ((getline line < filename) > 0)
122 #print "#10" line
123 print line >> out
126 close (out);
128 #print "#11" line
129 system ("mv " out " " filename);