/**
 * File:        bt_hcid.scr
 * Summary:     Agent for rading and writing of /etc/bluetooth/hcid.conf file
 * Author:      Ladislav Slezak <lslezak@suse.cz>
 * Access:      read, write
 *
 * $Id: bt_hcid.scr 18331 2004-08-02 08:38:06Z lslezak $
 *
 * This file is based on dns_named.conf
 */
.bluetooth.hcid

// TODO: INI agent isn't optimal, in this file multiple occurences of one key
//       in one section may be possible, section on one line is handled as a
//       single value, and many many other problems are to be expected....
//       should be replaced in future by some better agent

`ag_ini(
    `IniAgent( "/etc/bluetooth/hcid.conf",
	$[
	    "options"	: [ "global_values", "repeat_names" ],
	    "comments"	: [ "^[ \t]*#.*$", "^[ \t]*$" ],
	    "params"    : [
		$[ "match" : [ "([^ \t]+)[ \t]([^ \t]+(.*[^ \t]+)+)[ \t]*;$", "%s %s;" ]],
		// (...)* made the agent crash when it did not match,
		// changed it to ((...)*), #39597
		// Still don't know why this is here at all
		$[ "match" : [ "([^ \t]+)((.*[^ \t]+)*)[ \t]*\\{.*\\}[ \t]*;", "%s %s;" ]],
	    ],
	    "sections" : [
		$[
		    "begin" : [ "[ \t]*([^ \t]+(.*[^ \t]+)*)[ \t]*\\{$", "%s {" ],
		    "end"   : [ "^[ \t]*\\}", "}" ],
		 ],
	    ],
	    "subindent"	: "\t"
	]
))

