2001-12-11 20:47:02 +00:00
|
|
|
/^\$set/ {
|
|
|
|
major++
|
|
|
|
minor = 0
|
|
|
|
|
|
|
|
if (major > 1)
|
|
|
|
printf "\n" > output
|
2003-10-04 12:44:47 +00:00
|
|
|
else if (codeset)
|
|
|
|
printf "$ codeset=%s\n", codeset > output
|
2002-04-04 18:20:33 +00:00
|
|
|
printf "$set %d %s\n", major, $3 >> output
|
2001-12-11 20:47:02 +00:00
|
|
|
|
|
|
|
if (header) {
|
|
|
|
majorName = substr($3, 2)
|
|
|
|
if (major > 1)
|
|
|
|
printf "\n" > header
|
2002-04-04 18:20:33 +00:00
|
|
|
printf "\t%sSet = %#x,\n", majorName, major >> header
|
2001-12-11 20:47:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/^\$ #/ {
|
|
|
|
minor++
|
|
|
|
|
|
|
|
if (header) {
|
|
|
|
minorName = substr($2, 2)
|
2002-04-04 18:20:33 +00:00
|
|
|
printf "\t%s%s = %#x,\n", majorName, minorName, minor >> header
|
2001-12-11 20:47:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/^#/ {
|
|
|
|
text = substr($0, 3)
|
|
|
|
printf "%d %s\n", minor, text > output
|
|
|
|
}
|
|
|
|
|
|
|
|
! /^(\$|#)/ { print > output }
|
|
|
|
|