Fix typo.
[adu.git] / interactive.c
index 4c0392784604d4af06701dcdee355197d7ba868a..08f700f7a6cd2d423d0a37e84e9ee09727536745 100644 (file)
@@ -4,12 +4,15 @@
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
+/** \file interactive.c \brief Commands for interactive mode. */
+
 #include <ctype.h> /* isspace() */
 
 #include "adu.h"
 #include "format.h"
 #include "user.h"
 #include "string.h"
+#include "cmdline.h"
 #include "select.cmdline.h"
 #include "select.h"
 #include "error.h"
@@ -32,6 +35,7 @@ struct interactive_command {
 static struct uid_range *admissible_uids;
 static struct format_info *fi;
 
+/** The set of supported interactive commands. */
 #define INTERACTIVE_COMMANDS \
        INTERACTIVE_COMMAND(set, "change the current configuration") \
        INTERACTIVE_COMMAND(reset, "reset configuration to defaults") \
@@ -40,6 +44,7 @@ static struct format_info *fi;
        INTERACTIVE_COMMAND(source, "read and execute interactive commands from a file")
 
 
+/** \cond doxygen is not smart enough for this */
 #define INTERACTIVE_COMMAND(name, desc) \
        static int icom_ ## name (char *line);
 
@@ -58,7 +63,9 @@ struct interactive_command icmds[] = {
        INTERACTIVE_COMMANDS
        {.name  = NULL}
 };
+/** \endcond */
 
+/** Iterate over the list of all interactive commands. */
 #define FOR_EACH_COMMAND(c) for (c = icmds; c->name; c++)
 
 static int read_input_line(char *line, size_t size)
@@ -80,6 +87,9 @@ static int icom_help(__a_unused char *line)
        return 1;
 }
 
+/**
+ * Print the list of commands with short descriptions.
+ */
 void print_interactive_help(void)
 {
        struct interactive_command *c;
@@ -190,6 +200,11 @@ out:
        return ret;
 }
 
+/**
+ * The main function for interactive mode.
+ *
+ * \return Standard.
+ */
 int com_interactive(void)
 {
        char line[255];
@@ -199,7 +214,7 @@ int com_interactive(void)
        ret = parse_select_options(NULL, NULL, &admissible_uids, &fi);
        if (ret< 0)
                return ret;
-       ret = read_uid_file();
+       ret = read_uid_file(conf.database_dir_arg);
        if (ret < 0)
                return ret;
        while (read_input_line(line, sizeof(line)) >= 0) {