summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5b1f031)
raw | patch | inline | side by side (parent: 5b1f031)
author | Florian Forster <octo@huhu.verplant.org> | |
Fri, 25 Dec 2009 10:13:19 +0000 (11:13 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 25 Dec 2009 22:15:22 +0000 (23:15 +0100) |
src/filecount.c | patch | blob | history |
diff --git a/src/filecount.c b/src/filecount.c
index dc242ada10a54bf02f236645f7d283d0e9006e1e..9f6ea564bf8c2624df27f9844f98f5a524aa5b14 100644 (file)
--- a/src/filecount.c
+++ b/src/filecount.c
return (0);
} /* int fc_config_add_dir_size */
-static int fc_config_add_dir_recursive (fc_directory_conf_t *dir,
- oconfig_item_t *ci)
+static int fc_config_add_dir_option (fc_directory_conf_t *dir,
+ oconfig_item_t *ci, int bit)
{
if ((ci->values_num != 1)
|| (ci->values[0].type != OCONFIG_TYPE_BOOLEAN))
}
if (ci->values[0].value.boolean)
- dir->options |= FC_RECURSIVE;
- else
- dir->options &= ~FC_RECURSIVE;
-
- return (0);
-} /* int fc_config_add_dir_recursive */
-
-static int fc_config_add_dir_hidden (fc_directory_conf_t *dir,
- oconfig_item_t *ci)
-{
- if ((ci->values_num != 1)
- || (ci->values[0].type != OCONFIG_TYPE_BOOLEAN))
- {
- WARNING ("filecount plugin: The `Hidden' config options needs exactly "
- "one boolean argument.");
- return (-1);
- }
-
- if (ci->values[0].value.boolean)
- dir->options |= FC_HIDDEN;
+ dir->options |= bit;
else
- dir->options &= ~FC_HIDDEN;
+ dir->options &= ~bit;
return (0);
-} /* int fc_config_add_dir_hidden */
+} /* int fc_config_add_dir_option */
static int fc_config_add_dir (oconfig_item_t *ci)
{
else if (strcasecmp ("Size", option->key) == 0)
status = fc_config_add_dir_size (dir, option);
else if (strcasecmp ("Recursive", option->key) == 0)
- status = fc_config_add_dir_recursive (dir, option);
- else if (strcasecmp ("Hidden", option->key) == 0)
- status = fc_config_add_dir_hidden (dir, option);
+ status = fc_config_add_dir_option (dir, option, FC_RECURSIVE);
+ else if (strcasecmp ("IncludeHidden", option->key) == 0)
+ status = fc_config_add_dir_option (dir, option, FC_HIDDEN);
else
{
WARNING ("filecount plugin: fc_config_add_dir: "