summaryrefslogtreecommitdiff
path: root/nls/convert.awk
diff options
context:
space:
mode:
Diffstat (limited to 'nls/convert.awk')
-rw-r--r--nls/convert.awk32
1 files changed, 32 insertions, 0 deletions
diff --git a/nls/convert.awk b/nls/convert.awk
new file mode 100644
index 0000000..744179c
--- /dev/null
+++ b/nls/convert.awk
@@ -0,0 +1,32 @@
1/^\$set/ {
2 major++
3 minor = 0
4
5 if (major > 1)
6 printf "\n" > output
7 printf "$set %d %s\n", major, $3 > output
8
9 if (header) {
10 majorName = substr($3, 2)
11 if (major > 1)
12 printf "\n" > header
13 printf "#define %sSet %#x\n", majorName, major > header
14 }
15}
16
17/^\$ #/ {
18 minor++
19
20 if (header) {
21 minorName = substr($2, 2)
22 printf "#define %s%s %#x\n", majorName, minorName, minor > header
23 }
24}
25
26/^#/ {
27 text = substr($0, 3)
28 printf "%d %s\n", minor, text > output
29}
30
31! /^(\$|#)/ { print > output }
32