File: cmds.awk

package info (click to toggle)
brltty 2.99.5-2woody1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,260 kB
  • ctags: 3,541
  • sloc: ansic: 44,081; cpp: 3,245; makefile: 581; sh: 488; yacc: 310; tcl: 262; awk: 53; python: 29
file content (20 lines) | stat: -rw-r--r-- 457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
BEGIN {
  OFS = ""
}
/^ *CMD_/ {
  if (x = match($0, "/.*/")) {
    print "{", $1, ", \"", substr($1,5), "\", \"", substr($0, RSTART+3, RLENGTH-6), "\"},"
  }
  next
}
/#define[ \t]*CR_/ {
  if (x = match($0, "/.*/")) {
    print "{", $2, ", \"", substr($2,4), "\", \"", substr($0, RSTART+3, RLENGTH-6), "\"},"
  }
  next
}
/^ *VPK_/ {
  gsub(",", "", $1)
  print "{VAL_PASSKEY+", $1, ", \"", substr($1,5), "\", \"send ", substr($1, 5), " key\"},"
  next
}