L | |
label_opt_list, Syslog | |
label_opt_list_or, Syslog | |
lbracket, Keepalived | |
lens_block, Keepalived | |
list | |
list_sto, Mke2fs | |
lns | |
lns_noempty, IniFile | |
loghost, Syslog | |
logic_construct_condition, Reprepro_Uploaders | |
logic_construct_field, Reprepro_Uploaders | |
logprogram, Syslog | |
lvs_conf, Keepalived | |
M | |
map_line, Grub | |
menu_setting, Grub | |
method, Pg_Hba | |
minute, Cron | |
modpath, Solaris_System | |
module_line, Grub | |
month, Cron | |
multiboot_arg, Grub | |
N | |
name_re, AptConf | |
name_re_colons, AptConf | |
named_block, Keepalived | |
named_block_arg, Keepalived | |
named_block_arg_title, Keepalived | |
nameserver, Resolv | |
negate_node, Sudoers | |
netgroup, Access | |
netmask, Resolv | |
O | |
opt_eol, Keepalived | |
opt_list, Build | |
opt_ws, Grub | |
option | |
options | |
origin_list, Access |
Uses Build.opt_list to generate a list of labels
let label_opt_list (l:string) (r:lens) (s:lens) = Build.opt_list [ label l . r ] s
Either label_opt_list matches something or it emits a single label with the “or” string.
let label_opt_list_or (l:string) (r:lens) (s:lens) (or:string) = ( label_opt_list l r s | [ label l . store or ] )
A generic block with a title lens
let lens_block (title:lens) (sto:lens) = [ indent . title . opt_eol . lbracket . (sto | empty | comment)+ . indent . rbracket . eol ]
Build a list of identical lenses separated with a given separator (at least 2 elements)
let list (lns:lens) (sep:lens) = lns . ( sep . lns )+
A list of items
let list (kw:regexp) (elem:string) = let list_elems = Build.opt_list [seq elem . store Rx.word] (Sep.comma) in Build.key_value_line kw Sep.space list_elems
A list of values with given lens
let list_sto (kw:regexp) (lns:lens) = counter "item" . entry kw (Build.opt_list [lns] Sep.comma)
The crypttab lens
let lns = ( empty | comment | record ) *
The access.conf lens, any amount of
let lns = (comment|empty|entry) *
let lns = (comment | empty | alias)*
let lns = (empty | comment | kv) *
The apt.conf lens
let lns = (empty|comment|entry|include|clear)*
let lns = ( Util.empty | Util.comment | record ) *
The main lens, any amount of
let lns = ( empty | comment | user_record | group_record )*
The cron lens
let lns = ( empty | comment | shellvar | entry )*
Any number of empty lines, comments, and records.
let lns = ( empty | comment | record ) *
let lns = (comment | empty | menu_setting | boot | debian)*
let lns = ( Util.empty | Util.comment | entry )*
let lns = [ label "hostname" . store Rx.word . Util.eol ]
let lns = (Util.empty | Util.comment | entry)*
Generic INI File lens
let lns (record:lens) (comment:lens) = lns_noempty record (comment|empty)
The options lens
let lns = ( empty | comment | option )*
The keepalived lens
let lns = ( empty | comment | global_conf | vrrpd_conf | lvs_conf )*
The login.defs lens
let lns = (record | Util.comment | Util.empty) *
The mke2fs lens
let lns = (empty|comment)* . (defaults|fs_types)*
let lns = (comment|empty|entry)*
let lns = ( Util.empty | Util.comment | record ) *
main structure
let lns = ( Util.empty | Util.comment | param )*
let lns = ( Util.empty | Util.comment | entry )*
The Nrpe lens
let lns = ( command | item | include | include_dir | comment | empty ) *
let lns = ( empty | comment | database )*
The pbuilder lens
let lns = Shellvars.lns
The pg_hba.conf lens
let lns = ( record | Util.comment | Util.empty ) *
The lens is made of Util.empty, Util.comment and entry lines
let lns = (Util.empty|Util.comment|entry)*
let lns = ( empty | comment | entry )*
An IniFile.lns
let lns = IniFile.lns record comment
The services lens is either empty, comment or record
let lns = ( empty | comment | record )*
The shells lens
let lns = ( empty | comment | shell )*
let lns = ( empty | comment | cmd_moddir | cmd_kv "rootdev" Rx.fspath | cmd_kv "rootfs" Rx.word | cmd_kv "exclude" Rx.fspath | cmd_kv "include" Rx.fspath | cmd_kv "forceload" Rx.fspath | cmd_set )*
The sudoers lens, any amount of
let lns = ( empty | comment | includedir | alias | defaults | spec )*
generic entries then programs or hostnames matching blocs
let lns = entries . ( program | hostname )*
The xorg.conf lens
let lns = ( empty | comment | section )*
Generic INI File lens with no empty lines
let lns_noempty (record:lens) (comment:lens) = comment* . record*
a loghost is an @ sign followed by the hostname and a possible port
let loghost = at . [ label "hostname" . store loghost_r ] . (colon . [ label "port" . store /[0-9]+/ ] )?
A logical construction for condition and condition_list
let logic_construct_condition (kw:string) (lns:lens) = [ label kw . lns ] . [ Sep.space . key kw . Sep.space . lns ]*
A generic definition for condition_field
let logic_construct_field (kw:string) (sep:string) (lns:lens) = [ label kw . lns ] . [ Build.xchgs sep kw . lns ]*
a log program begins with a pipe
let logprogram = pipe . [ label "program" . store /[^ \t\n][^\n]+[^ \t\n]/ ]
contains subblocks of Virtual server group(s) and Virtual server(s)
let lvs_conf = virtual_server | virtual_server_group
let map_line = [ command "map" "\t" . spc . [ label "from" . store /[()A-za-z0-9]+/ ] . spc . [ label "to" . store /[()A-za-z0-9]+/ ] . eol ]
let menu_setting = kw_menu_arg "default" | kw_menu_arg "fallback" | kw_pres "hiddenmenu" | kw_menu_arg "timeout" | kw_menu_arg "splashimage" | kw_menu_arg "gfxmenu" | kw_menu_arg "background" | serial | terminal | password_arg | color | device
can contain an option
let method = [ label "method" . store Rx.word . ( Sep.tab . option )? ]
let minute = [ label "minute" . store num ]
Individual moddir search path entry
let modpath = [ seq "modpath" . store /[^ :\t\n]+/ ]
Solaris extension adds module$ and kernel$ for variable interpolation
let module_line = [ command /module\$?/ "\t" . spc . kernel_args ]
let month = [ label "month" . store alphanum ]
Permits a second form for Solaris multiboot kernels that take a path (with a slash) as their first arg, e.g.
let multiboot_arg = [ label "@path" . store (Rx.word . "/" . Rx.no_spaces) ]
Regex for entry names
let name_re = /[A-Za-z][A-Za-z-]*/
Regex for entry names with colons
let name_re_colons = /[A-Za-z][A-Za-z:-]*/
A block with a block title and name
let named_block (kw:string) (sto:lens) = lens_block (key kw . sep_spc . sto_word) sto
A block with a block title, a name and an argument
let named_block_arg (kw:string) (name:string) (arg:string) (sto:lens) = lens_block (named_block_arg_title kw name arg) sto
A title lens for named_block_arg
let named_block_arg_title (kw:string) (name:string) (arg:string) = key kw . sep_spc . [ label name . sto_word ] . sep_spc . [ label arg . sto_word ]
A nameserver entry
let nameserver = Build.key_value_line_comment "nameserver" Sep.space (store Rx.ip) comment_eol
Negation of boolean values for defaults.
let negate_node = [ del "!" "!" . label "negate" ]
Format is @NETGROUP[@@NISDOMAIN]
let netgroup = [ label "netgroup" . Util.del_str "@" . store user_re . [ label "nisdomain" . Util.del_str "@@" . store Rx.word ]? ]
A network mask for IP addresses
let netmask = [ label "netmask" . Util.del_str "/" . store Rx.ip ]
let opt_eol = del /[ \t]*\n?/ " "
Same as list, but there might be only one element in the list
let opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*
let opt_ws = Util.del_opt_ws ""
part of method
let option = [ label "option" . store word ]
let option = [ indent . del /[oO]ption/ "Option" . label "Option" . sep_spc . quoted_string_val . [ label "value" . sep_spc . quoted_string_val ]* . eol ]
let options = let opt_value = /[^#" \t\n\\\\]+|"[^#"\n\\\\]*"/ in let option = [ key Rx.word . (Util.del_str "=" . store opt_value)? ] in [ key "options" . sep_space . sto_no_spaces . (sep_space . option)* . Util.comment_or_eol ]
Options values
let options = let options_entry = Build.key_value ("ndots"|"timeout"|"attempts") (Util.del_str ":") (store Rx.integer) | Build.flag ("debug"|"rotate"|"no-check-names" |"inet6"|"ip6-bytestring"|"edns0") | ip6_dotint in Build.key_value_line_comment "options" Sep.space (Build.opt_list options_entry Sep.space) comment_eol
origin_list can be a single ipaddr/originname/domain/fqdn or a list of those values
let origin_list = let origin_re = Rx.no_spaces - /[Ee][Xx][Cc][Ee][Pp][Tt]/ in Build.opt_list [ label "origin" . store origin_re ] Sep.space