]> git.tuebingen.mpg.de Git - adu.git/commitdiff
Add some more souce code documentation.
authorAndre Noll <maan@systemlinux.org>
Tue, 11 Nov 2008 21:09:00 +0000 (22:09 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 11 Nov 2008 21:09:00 +0000 (22:09 +0100)
adu.c
select.c

diff --git a/adu.c b/adu.c
index bc0689320ffe1823da87e04f7682d5648f51a3f8..cd77fd9f9f4741b7c9f805072737bc4216f1f36e 100644 (file)
--- a/adu.c
+++ b/adu.c
 #include "error.h"
 
 DEFINE_ERRLIST;
+
+/**
+ * The error code of the last osl library function.
+ *
+ * \sa osl().
+ */
 int osl_errno;
 
 /** In case a signal is received, its number is stored here. */
@@ -131,6 +137,12 @@ static void signal_handler(int s)
        signum = s;
 }
 
+/**
+ * Check whether to terminate adu.
+ *
+ * Check whether a signal was caught that should terminate the
+ * adu process. If yes, close all osl tables and exit gracefully.
+ */
 void check_signals(void)
 {
        if (likely(!signum))
@@ -151,6 +163,13 @@ static int init_signals(void)
        return 1;
 }
 
+/**
+ * Open the directory table.
+ *
+ * \param create If non-zero, create the table first.
+ *
+ * \return Standard.
+ */
 int open_dir_table(int create)
 {
 
@@ -221,6 +240,17 @@ static int print_complete_help_and_die(void)
        exit(EXIT_FAILURE);
 }
 
+/**
+ * The main function of adu.
+ *
+ * \param argc Usual argument count.
+ * \param argv Usual argument vector.
+ *
+ * Check command line options, init the signal handlers and
+ * call the main function of the selected mode.
+ *
+ * \return \p EXIT_SUCCESS on success, \p EXIT_FAILURE otherwise.
+ */
 int main(int argc, char **argv)
 {
        int ret;
index 5fd763c1b104cc519e0a06af08adddf3451df86e..d5ce3e45d4300af7ebf5ba7fece05cc5e9ac2aef 100644 (file)
--- a/select.c
+++ b/select.c
@@ -20,6 +20,7 @@
 #include "user.h"
 #include "select.cmdline.h"
 
+/** \cond */
 /* global list */
 #define GLOBAL_LIST_ATOMS \
        ATOM(size, SIZE) \
@@ -103,6 +104,8 @@ struct atom user_summary_atoms[] = {
 enum user_summary_atoms {USER_SUMMARY_ATOMS};
 #undef ATOM
 
+/** \endcond */
+
 struct global_list_info {
        uint32_t count;
        int ret;
@@ -892,9 +895,13 @@ out:
        return ret;
 }
 
+/** Default format string for global_list mode. */
 #define GLOBAL_LIST_DFLT_FMT "%(size:r:8) %(files:r:8) %(dirname)\n"
+/** Default format string for global_summary mode. */
 #define GLOBAL_SUMMARY_DFLT_FMT "#directories: %(dirs), #files: %(files), size: %(size)\n\n"
+/** Default format string for user_list mode. */
 #define USER_LIST_DFLT_FMT "%(size:r:5) %(files:r:5) %(dirname)\n"
+/** Default format string for user_summary mode. */
 #define USER_SUMMARY_DFLT_FMT "%(pw_name:l:16) %(uid:r:5) %(dirs:r:5) %(files:r:5) %(size:r:5)\n"
 
 static int setup_format_string(char *fmt, struct format_info **fi)