/usr/share/augeas/lenses/dist/channels.aug is in augeas-lenses 1.2.0-0ubuntu1.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | (*
Module: Channels
Parses channels.conf files
Author: Raphael Pinson <raphink@gmail.com>
About: Reference
See http://linuxtv.org/vdrwiki/index.php/Syntax_of_channels.conf
About: License
This file is licenced under the LGPL v2+, like the rest of Augeas.
About: Lens Usage
To be documented
About: Configuration files
This lens applies to channels.conf files.
About: Examples
The <Test_Channels> file contains various examples and tests.
*)
module Channels =
(************************************************************************
* Group: USEFUL PRIMITIVES
*************************************************************************)
(* View: eol *)
let eol = Util.eol
(* View: comment *)
let comment = Util.comment_generic /;[ \t]*/ "; "
(* View: equal *)
let equal = Sep.equal
(* View: colon *)
let colon = Sep.colon
(* View: comma *)
let comma = Sep.comma
(* View: semicol *)
let semicol = Util.del_str ";"
(* View: plus *)
let plus = Util.del_str "+"
(* View: arroba *)
let arroba = Util.del_str "@"
(* View: no_colon *)
let no_colon = /[^: \t\n][^:\n]*[^: \t\n]|[^:\n]/
(* View: no_semicolon *)
let no_semicolon = /[^;\n]+/
(************************************************************************
* Group: FUNCTIONS
*************************************************************************)
(* View: field
A generic field *)
let field (name:string) (sto:regexp) = [ label name . store sto ]
(* View: field_no_colon
A <field> storing <no_colon> *)
let field_no_colon (name:string) = field name no_colon
(* View: field_int
A <field> storing <Rx.integer> *)
let field_int (name:string) = field name Rx.integer
(* View: field_word
A <field> storing <Rx.word> *)
let field_word (name:string) = field name Rx.word
(************************************************************************
* Group: ENTRIES
*************************************************************************)
(* View: vpid *)
let vpid =
let codec =
[ equal . label "codec" . store Rx.integer ]
in let vpid_entry (lbl:string) =
[ label lbl . store Rx.integer . codec? ]
in vpid_entry "vpid"
. ( plus . vpid_entry "vpid_pcr" )?
(* View: langs *)
let langs =
let lang =
[ label "lang" . store Rx.word ]
in Build.opt_list lang plus
(* View: apid *)
let apid =
let codec =
[ arroba . label "codec" . store Rx.integer ]
in let options =
equal . ( (langs . codec?) | codec )
in let apid_entry (lbl:string) =
[ label lbl . store Rx.integer . options? ]
in Build.opt_list (apid_entry "apid") comma
. ( semicol
. Build.opt_list (apid_entry "apid_dolby") comma )?
(* View: tpid *)
let tpid =
let tpid_bylang =
[ label "tpid_bylang" . store Rx.integer
. (equal . langs)? ]
in field_int "tpid"
. ( semicol . Build.opt_list tpid_bylang comma )?
(* View: caid *)
let caid =
let caid_entry =
[ label "caid" . store Rx.word ]
in Build.opt_list caid_entry comma
(* View: entry *)
let entry = [ label "entry" . store no_semicolon
. (semicol . field_no_colon "provider")? . colon
. field_int "frequency" . colon
. field_word "parameter" . colon
. field_word "signal_source" . colon
. field_int "symbol_rate" . colon
. vpid . colon
. apid . colon
. tpid . colon
. caid . colon
. field_int "sid" . colon
. field_int "nid" . colon
. field_int "tid" . colon
. field_int "rid" . eol ]
(* View: entry_or_comment *)
let entry_or_comment = entry | comment
(* View: group *)
let group =
[ Util.del_str ":" . label "group"
. store no_colon . eol
. entry_or_comment* ]
(* View: lns *)
let lns = entry_or_comment* . group*
|