3 Parses termcap capability database
5 Author: Matt Dainty <matt@bodgit-n-scarper.com>
10 Each line represents a record consisting of a number of ':'-separated fields
11 the first of which is the name or identifier for the record. The name can
12 optionally be split by '|' and each subsequent value is considered an alias
13 of the first. Records can be split across multiple lines with '\'.
20 (* All termcap capabilities are two characters, optionally preceded by *)
21 (* upto two periods and the only types are boolean, numeric or string *)
22 let cfield = /\.{0,2}([a-zA-Z0-9]{2}|[@#%&*!][a-zA-Z0-9]|k;)(#?@|#[0-9]+|=([^:\\\\^]|\\\\[0-7]{3}|\\\\[:bBcCeEfFnNrRstT0\\^]|\^.)*)?/
24 let lns = ( Util.empty | Getcap.comment | Getcap.record cfield )*
26 let filter = incl "/etc/termcap"
27 . incl "/usr/share/misc/termcap"
30 let xfm = transform lns filter
32 (* Local Variables: *)