summaryrefslogtreecommitdiffstats
path: root/pgsql
diff options
context:
space:
mode:
authorlaforge <laforge>2003-09-28 15:19:25 +0000
committerlaforge <laforge>2003-09-28 15:19:25 +0000
commita6fbeb96e8894f6d2c953196c99a59644798ac04 (patch)
treea148482775e0c3f69ffe0791d372d6abbdbdbfe6 /pgsql
parentf425910af1a22cf8666852a7c31a93a368c2b891 (diff)
new configuration file syntax (Magnus Boden)
Diffstat (limited to 'pgsql')
-rw-r--r--pgsql/ulogd_PGSQL.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/pgsql/ulogd_PGSQL.c b/pgsql/ulogd_PGSQL.c
index 7ac5084..6d2523b 100644
--- a/pgsql/ulogd_PGSQL.c
+++ b/pgsql/ulogd_PGSQL.c
@@ -1,4 +1,4 @@
-/* ulogd_PGSQL.c, Version $Revision: 1.6 $
+/* ulogd_PGSQL.c, Version $Revision: 1.7 $
*
* ulogd output plugin for logging to a PGSQL database
*
@@ -45,23 +45,23 @@ static char *stmt_val;
static char *stmt_ins;
/* our configuration directives */
-static config_entry_t db_ce = { NULL, "pgsqldb", CONFIG_TYPE_STRING,
+static config_entry_t db_ce = { NULL, "db", CONFIG_TYPE_STRING,
CONFIG_OPT_MANDATORY, 0,
{ } };
-static config_entry_t host_ce = { &db_ce, "pgsqlhost", CONFIG_TYPE_STRING,
+static config_entry_t host_ce = { &db_ce, "host", CONFIG_TYPE_STRING,
CONFIG_OPT_MANDATORY, 0,
{ } };
-static config_entry_t user_ce = { &host_ce, "pgsqluser", CONFIG_TYPE_STRING,
+static config_entry_t user_ce = { &host_ce, "user", CONFIG_TYPE_STRING,
CONFIG_OPT_MANDATORY, 0,
{ } };
-static config_entry_t pass_ce = { &user_ce, "pgsqlpass", CONFIG_TYPE_STRING,
+static config_entry_t pass_ce = { &user_ce, "pass", CONFIG_TYPE_STRING,
CONFIG_OPT_MANDATORY, 0,
{ } };
-static config_entry_t table_ce = { &pass_ce, "pgsqltable", CONFIG_TYPE_STRING,
+static config_entry_t table_ce = { &pass_ce, "table", CONFIG_TYPE_STRING,
CONFIG_OPT_MANDATORY, 0,
{ } };
@@ -317,11 +317,8 @@ static ulog_output_t _pgsql_plugin = { NULL, "pgsql", &_pgsql_output, NULL };
void _init(void)
{
- /* register our configfile options here */
- config_register_key(&table_ce);
-
/* have the opts parsed */
- config_parse_file(0);
+ config_parse_file("PGSQL", &table_ca);
if (_pgsql_open_db(host_ce.u.string, user_ce.u.string,
pass_ce.u.string, db_ce.u.string)) {