Merge branch 'ff/local'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 5 Feb 2009 21:54:24 +0000 (22:54 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 5 Feb 2009 21:54:24 +0000 (22:54 +0100)
1  2 
src/utils_db_query.c

diff --combined src/utils_db_query.c
@@@ -217,6 -217,7 +217,6 @@@ static void udb_result_submit (udb_resu
      }
    }
  
 -  vl.time = time (NULL);
    sstrncpy (vl.host, q->host, sizeof (vl.host));
    sstrncpy (vl.plugin, q->plugin, sizeof (vl.plugin));
    sstrncpy (vl.plugin_instance, q->db_name, sizeof (vl.type_instance));
@@@ -539,7 -540,8 +539,8 @@@ void udb_query_free_one (udb_query_t *q
   * Query public functions
   */
  int udb_query_create (udb_query_t ***ret_query_list, /* {{{ */
-     size_t *ret_query_list_len, oconfig_item_t *ci)
+     size_t *ret_query_list_len, oconfig_item_t *ci,
+     udb_query_create_callback_t cb)
  {
    udb_query_t **query_list;
    size_t        query_list_len;
            q->name);
        status = udb_config_set_uint (&q->max_version, child);
      }
+     else if (cb != NULL)
+     {
+       status = (*cb) (q, child);
+       if (status != 0)
+       {
+         WARNING ("db query utils: The configuration callback failed "
+             "to handle `%s'.", child->key);
+       }
+     }
      else
      {
        WARNING ("db query utils: Query `%s': Option `%s' not allowed here.",