From 7c5fafb3a13d58cdfc96f90b74972f7d9f7adef1 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 11 Nov 2008 22:09:00 +0100 Subject: [PATCH] Add some more souce code documentation. --- adu.c | 30 ++++++++++++++++++++++++++++++ select.c | 7 +++++++ 2 files changed, 37 insertions(+) diff --git a/adu.c b/adu.c index bc06893..cd77fd9 100644 --- a/adu.c +++ b/adu.c @@ -18,6 +18,12 @@ #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; diff --git a/select.c b/select.c index 5fd763c..d5ce3e4 100644 --- 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) -- 2.39.5