/**
 * File:	cfg_providers.scr
 * Summary:	Agent for reading/writing /etc/sysconfig/network/providers/*
 * Author:	Michal Svec <msvec@suse.cz>
 * Access:	read / write
 *
 * General syntax:
 *	# comment
 *	[provider_name]
 *	key=value
 *
 * $Id: cfg_providers.scr 12980 2003-12-06 20:51:23Z msvec $
 *
 * <p>Reads dialup providers from files
 * /etc/sysconfig/network/providers/*.</p>
 */
.sysconfig.network.providers

`ag_ini(
    `IniAgent( [ "/etc/sysconfig/network/providers/*" ],
	$[
	    /* toplevel values */
	    "options" : [ "global_values", "comments_last" ],
	    /* empty lines and whole-line comments */
	    "comments": [ "^[ \t]*#.*", "^[ \t]*$" ],
	    /* matching rules */
	    "params" : [
		$[ "match" : [ "^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*)='(.*)'[ \t]*", "%s='%s'"], ],
		$[ "match" : [ "^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*)=\"([^\"`\\$]*)\"[ \t]*", "%s='%s'"], ],
		$[ "match" : [ "^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*)=([^ \t\"$`'\\#]*)", "%s='%s'"], ],
		// $[ "match" : [ "^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*)=\"([^\"]*)\"", "%s='%s'"], ],
		// $[ "match" : [ "^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*)=([^\"]*[^ \t\"]|)[ \t]*$", "%s='%s'"], ],
	    ],
	    /* rewrite rules */
	    "rewrite"	: [
		[ "/etc/sysconfig/network/providers/(.*)$", "/etc/sysconfig/network/providers/%s" ],
	    ],
	]
    )
)
