File: cmds.awk

package info (click to toggle)
brltty 6.7-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 31,240 kB
  • sloc: ansic: 148,859; java: 13,418; sh: 9,623; xml: 5,699; tcl: 2,634; makefile: 2,333; awk: 713; lisp: 366; python: 321; ml: 301
file content (101 lines) | stat: -rw-r--r-- 3,049 bytes parent folder | download | duplicates (3)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
###############################################################################
# BRLTTY - A background process providing access to the console screen (when in
#          text mode) for a blind person using a refreshable braille display.
#
# Copyright (C) 1995-2024 by The BRLTTY Developers.
#
# BRLTTY comes with ABSOLUTELY NO WARRANTY.
#
# This is free software, placed under the terms of the
# GNU Lesser General Public License, as published by the Free Software
# Foundation; either version 2.1 of the License, or (at your option) any
# later version. Please see the file LICENSE-LGPL for details.
#
# Web Page: http://brltty.app/
#
# This software is maintained by Dave Mielke <dave@mielke.cc>.
###############################################################################

function writeCommandField(name, value) {
  print "  ." name " = " value ","
}

function writeCommandAttribute(attribute) {
  writeCommandField("is" attribute, "1")
}

function writeCommandEntry(name, symbol, value, help) {
  if (help ~ /^deprecated /) return

  print "{ // " symbol
  writeCommandField("name", "\"" name "\"")
  writeCommandField("code", value)

  if (help ~ /^set .*\//) writeCommandAttribute("Toggle")
  if (help ~ /^bring /) writeCommandAttribute("Routing")

  if (help ~ /^go /) {
    writeCommandAttribute("Motion")
    if (help ~ / (up|down|top|bottom) /) writeCommandAttribute("Vertical")
    if (help ~ / (left|right|beginning|end) /) writeCommandAttribute("Horizontal")
    if (help ~ / (backward|forward) /) writeCommandAttribute("Panning")
  }

  if (symbol ~ /^BRL_BLK_/) {
    if (symbol ~ /^BRL_BLK_PASS/) {
      if (symbol ~ /PASS(CHAR|DOTS|KEY)/) {
        writeCommandAttribute("Input")
      }

      if (symbol ~ /PASSCHAR/) {
        writeCommandAttribute("Character")
      }

      if (symbol ~ /PASSDOTS/) {
        writeCommandAttribute("Braille")
      }

      if (symbol ~ /PASS(XT|AT|PS2)/) {
        writeCommandAttribute("Keyboard")
      }
    } else if (help ~ / character$/) {
      writeCommandAttribute("Column")
    } else if (help ~ / characters /) {
      writeCommandAttribute("Range")
    } else if (help ~ / line$/) {
      writeCommandAttribute("Row")
      writeCommandAttribute("Vertical")
    } else {
      writeCommandAttribute("Offset")
    }
  } else if (symbol ~ /^BRL_KEY_/) {
    writeCommandAttribute("Input")

    if (symbol ~ /_FUNCTION/) {
      writeCommandAttribute("Offset")
    }
  }

  print "  " makeTranslatorNote("This is the description of the " name " command.")
  writeCommandField("description", "strtext(\"" help "\")")
  print "},"
  print ""
}

function brlCommand(name, symbol, value, help) {
  writeCommandEntry(name, symbol, symbol, help)
}

function brlBlock(name, symbol, value, help) {
  writeCommandEntry(name, symbol, "BRL_CMD_BLK(" name ")", help)
}

function brlKey(name, symbol, value, help) {
  writeCommandEntry("KEY_" name, symbol, "BRL_CMD_KEY(" name ")", help)
}

function brlFlag(name, symbol, value, help) {
}

function brlDot(number, symbol, value, help) {
}