]> git.tue.mpg.de Git - dss.git/commitdiff
Dedoxify the source.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 22 Oct 2024 18:01:10 +0000 (20:01 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 1 Feb 2025 19:11:59 +0000 (20:11 +0100)
The doxygen comments actually make the source code harder to read,
because they tend to document the obvious. Besides, they are not used
uniformly accross the code base anyway.

18 files changed:
daemon.c
daemon.h
df.h
dss.c
err.h
exec.c
exec.h
file.c
file.h
gcc-compat.h
ipc.h
log.h
sig.c
snap.c
snap.h
str.c
str.h
tv.c

index ad73061c14ec5916284f2ab67438306d6484827d..f6678700e009983608b46516c135c5c6249f81b7 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
-/** \file daemon.c Some helpers for programs that detach from the console. */
-
 #include <string.h>
 #include <stdlib.h>
 #include <pwd.h>
 #include "str.h"
 #include "daemon.h"
 
-/**
- * Do the usual stuff to become a daemon.
- *
- * Fork, become session leader, dup fd 0, 1, 2 to /dev/null.
- *
- * \sa fork(2), setsid(2), dup(2).
+/*
+ * Do the usual stuff to become a daemon: Fork, become session leader, dup fd
+ * 0, 1, 2 to /dev/null.
  */
 int daemon_init(void)
 {
@@ -76,12 +71,9 @@ err:
        exit(EXIT_FAILURE);
 }
 
-/**
- * fopen() the given file in append mode.
- *
- * \param logfile_name The name of the file to open.
- *
- * \return Either calls exit() or returns a valid file handle.
+/*
+ * fopen() the given file in append mode. Either calls exit() or returns a
+ * valid file handle.
  */
 FILE *open_log(const char *logfile_name)
 {
@@ -98,12 +90,8 @@ FILE *open_log(const char *logfile_name)
        return logfile;
 }
 
-/**
- * Close the log file of the daemon.
- *
- * \param logfile The log file handle.
- *
- * It's OK to call this with logfile == \p NULL.
+/*
+ * It's OK to call this with logfile == NULL.
  */
 void close_log(FILE* logfile)
 {
@@ -113,9 +101,6 @@ void close_log(FILE* logfile)
        fclose(logfile);
 }
 
-/**
- * Log the startup message.
- */
 void log_welcome(int loglevel)
 {
        DSS_INFO_LOG(("***** welcome to dss ******\n"));
index 6fab6abc8c3bf8b5a5b3349dca6a572c1d3c816d..49d794d29f2c1067d17ef93af57472361053de66 100644 (file)
--- a/daemon.h
+++ b/daemon.h
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
-/** \file daemon.h exported symbols from daemon.c */
-
 int daemon_init(void);
 FILE *open_log(const char *logfile_name);
 void close_log(FILE* logfile);
diff --git a/df.h b/df.h
index 390134d4cf345e73d7088d7c389cad02869490c4..776752aec07517efb8220b017daf661b9f1395fd 100644 (file)
--- a/df.h
+++ b/df.h
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+
 struct disk_space {
        unsigned total_mb;
        unsigned free_mb;
diff --git a/dss.c b/dss.c
index 477df6f1a5f3e8f356af352e400a0ee73dcdf6ac..253c234192bd252b42b3b964922ada9b7b401cdf 100644 (file)
--- a/dss.c
+++ b/dss.c
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -57,42 +58,42 @@ struct dss_user_data {int (*handler)(void);};
  */
 static struct lls_parse_result *cmdline_lpr, *lpr;
 
-/** Parsed subcommand options. */
+/* Parsed subcommand options. */
 static struct lls_parse_result *cmdline_sublpr, *sublpr;
 /* The executing subcommand (NULL at startup). */
 static const struct lls_command *subcmd;
-/** Wether daemon_init() was called. */
+/* Wether daemon_init() was called. */
 static bool daemonized;
-/** Non-NULL if we log to a file. */
+/* Non-NULL if we log to a file. */
 static FILE *logfile;
 /* Realpath of the config file. */
 static char *config_file;
 /* derived from config file path */
 uint32_t ipc_key;
-/** The read end of the signal pipe */
+/* The read end of the signal pipe */
 static int signal_pipe;
-/** Process id of current pre-create-hook/rsync/post-create-hook process. */
+/* Process id of current pre-create-hook/rsync/post-create-hook process. */
 static pid_t create_pid;
-/** Whether the pre-create-hook/rsync/post-create-hook is currently stopped. */
+/* Whether the pre-create-hook/rsync/post-create-hook is currently stopped. */
 static int create_process_stopped;
-/** How many times in a row the rsync command failed. */
+/* How many times in a row the rsync command failed. */
 static int num_consecutive_rsync_errors;
-/** Process id of current pre-remove/rm/post-remove process. */
+/* Process id of current pre-remove/rm/post-remove process. */
 static pid_t remove_pid;
-/** When the next snapshot is due. */
+/* When the next snapshot is due. */
 static int64_t next_snapshot_time;
-/** When to try to remove something. */
+/* When to try to remove something. */
 static struct timeval next_removal_check;
-/** Creation time of the snapshot currently being created. */
+/* Creation time of the snapshot currently being created. */
 static int64_t current_snapshot_creation_time;
 /* Set by the pre-rm hook, cleared by handle_remove_exit(). */
 struct snapshot *snapshot_currently_being_removed;
-/** Needed by the post-create hook. */
+/* Needed by the post-create hook. */
 static char *path_to_last_complete_snapshot;
 static char *name_of_reference_snapshot;
-/** \sa \ref snap.h for details. */
+/* See snap.h for details. */
 enum hook_status snapshot_creation_status;
-/** \sa \ref snap.h for details. */
+/* See snap.h for details. */
 enum hook_status snapshot_removal_status;
 
 
@@ -224,14 +225,7 @@ void dss_log_set_params(int ll, const char *file, int line, const char *func)
        location_func = func;
 }
 
-/**
- * The log function of dss.
- *
- * \param ll Loglevel.
- * \param fml Usual format string.
- *
- * All DSS_XXX_LOG() macros use this function.
- */
+/* All DSS_XXX_LOG() macros use this function. */
 __printf_1_2 void dss_log(const char* fmt,...)
 {
        va_list argp;
@@ -263,9 +257,7 @@ __printf_1_2 void dss_log(const char* fmt,...)
        va_end(argp);
 }
 
-/**
- * Print a message either to stdout or to the log file.
- */
+/* Print a message either to stdout or to the log file. */
 static __printf_1_2 void dss_msg(const char* fmt,...)
 {
        FILE *outfd = logfile? logfile : stdout;
@@ -864,9 +856,6 @@ static void restart_create_process(void)
        create_process_stopped = 0;
 }
 
-/**
- * Print a log message about the exit status of a child.
- */
 static void log_termination_msg(pid_t pid, int status)
 {
        if (WIFEXITED(status))
diff --git a/err.h b/err.h
index bd22554dd90d8ee2e282ff3c8c24b2fd56b7d5cd..f5676717eb18b93d941773713e27ceeecf0fff5e 100644 (file)
--- a/err.h
+++ b/err.h
@@ -1,30 +1,24 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+
 extern char *dss_errlist[];
 extern char *dss_error_txt;
 
 void dss_log_set_params(int ll, const char *file, int line, const char *func);
 __printf_1_2 void dss_log(const char* fmt,...);
 
-/**
+/*
  * This bit indicates whether a number is considered a system error number
  * If yes, the system errno is just the result of clearing this bit from
  * the given number.
  */
 #define SYSTEM_ERROR_BIT 30
 
-/** Check whether the system error bit is set. */
+/* Check whether the system error bit is set. */
 #define IS_SYSTEM_ERROR(num) (!!((num) & (1 << SYSTEM_ERROR_BIT)))
 
-/** Set the system error bit for the given number. */
+/* Set the system error bit for the given number. */
 #define ERRNO_TO_DSS_ERROR(num) ((num) | (1 << SYSTEM_ERROR_BIT))
 
-/**
- * dss' version of strerror(3).
- *
- * \param num The error number.
- *
- * \return The error text of \a num.
- */
 static inline char *dss_strerror(int num)
 {
        assert(num > 0);
@@ -59,9 +53,9 @@ static inline char *dss_strerror(int num)
        DSS_ERROR(TOO_MANY_RSYNC_ERRORS, "too many consecutive rsync errors"), \
        DSS_ERROR(LOPSUB, "lopsub error")
 
-/**
+/*
  * This is temporarily defined to expand to its first argument (prefixed by
- * 'E_') and gets later redefined to expand to the error text only
+ * 'E_') and gets later redefined to expand to the error text only.
  */
 #define DSS_ERROR(err, msg) E_ ## err
 
diff --git a/exec.c b/exec.c
index ece7ec29aa233051cf10bd5c4f3b1b6adfd14cfe..c538eab18c24de41b3455cafd7939b7633ed4115 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
-/** \file exec.c Helper functions for spawning new processes. */
-
 #include <string.h>
 #include <unistd.h>
 #include <assert.h>
 #include "str.h"
 #include "exec.h"
 
-/**
- * Spawn a new process using execvp().
- *
- * \param pid Will hold the pid of the created process upon return.
- * \param file Path of the executable to execute.
- * \param args The argument array for the command.
- *
- * \return Standard.
- *
- * \sa fork(2), exec(3).
- */
+/* Spawn a new process using execvp(). */
 void dss_exec(pid_t *pid, const char *file, char *const *const args)
 {
        if ((*pid = fork()) < 0) {
@@ -42,15 +30,9 @@ void dss_exec(pid_t *pid, const char *file, char *const *const args)
        _exit(EXIT_FAILURE);
 }
 
-/**
- * Exec the command given as a command line.
- *
- * \param pid Will hold the pid of the created process upon return.
- * \param cmdline Holds the command and its arguments, separated by spaces.
- *
- * This function uses fork/exec to create a new process.
- *
- * \return Standard.
+/*
+ * Execute the space-separated command line. On return, the pid pointer is
+ * initialized to pid of the newly created process.
  */
 void dss_exec_cmdline_pid(pid_t *pid, const char *cmdline)
 {
diff --git a/exec.h b/exec.h
index 4d6ee88c28998eef5393306193ac6fe947f48eda..e8685ea8d42ddbb393fdb576246561d21a304098 100644 (file)
--- a/exec.h
+++ b/exec.h
@@ -1,3 +1,4 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+
 void dss_exec(pid_t *pid, const char *file, char *const *const args);
 void dss_exec_cmdline_pid(pid_t *pid, const char *cmdline);
diff --git a/file.c b/file.c
index cd1e43ef7c32c835266bdd3ae73ac34f614371a0..3283cde053be55aa90b0eb7ea96945238277e1bb 100644 (file)
--- a/file.c
+++ b/file.c
 #include "str.h"
 #include "file.h"
 
-/**
+/*
  * Call a function for each subdirectory of the current working directory.
  *
- * \param dirname The directory to traverse.
- * \param func The function to call for each subdirectory.
- * \param private_data Pointer to an arbitrary data structure.
+ * For each top-level directory under dirname, the supplied callback function
+ * is called, passing the full path to the subdirectory and the private_data
+ * pointer.
  *
- * For each top-level directory under \a dirname, the supplied function \a func is
- * called.  The full path of the subdirectory and the \a private_data pointer
- * are passed to \a func.
- *
- * \return This function returns immediately if \a func returned a negative
- * value. In this case \a func must set error_txt and this negative value is
- * returned to the caller. Otherwise the function returns when all
- * subdirectories have been passed to \a func.
+ * If the callback returns a negative error value, the loop is terminated and
+ * that negative value is returned to the caller. If the iteration completes
+ * with no errors, the function returns non-negative.
  */
-
 int for_each_subdir(int (*func)(const char *, void *), void *private_data)
 {
        struct dirent *entry;
@@ -66,13 +60,7 @@ out:
        return ret;
 }
 
-/**
- * Set a file descriptor to non-blocking mode.
- *
- * \param fd The file descriptor.
- *
- * \return Standard.
- */
+/* Set a file descriptor to non-blocking mode. */
 __must_check int mark_fd_nonblocking(int fd)
 {
        int flags = fcntl(fd, F_GETFL);
@@ -84,23 +72,11 @@ __must_check int mark_fd_nonblocking(int fd)
        return 1;
 }
 
-/**
- * dss' wrapper for select(2).
- *
- * It calls select(2) (with no exceptfds) and starts over if select() was
- * interrupted by a signal.
- *
- * \param n The highest-numbered descriptor in any of the two sets, plus 1.
- * \param readfds fds that should be checked for readability.
- * \param writefds fds that should be checked for writablility.
- * \param timeout_tv upper bound on the amount of time elapsed before select()
- * returns.
- *
- * \return The return value of the underlying select() call on success, the
- * negative system error code on errors.
- *
- * All arguments are passed verbatim to select(2).
- * \sa select(2) select_tut(2).
+/*
+ * Call select(2) with no exceptfds and start over if the call was interrupted
+ * by a signal. All arguments are passed verbatim to select(2). Returns the
+ * return value of the underlying select call on success, a negative error code
+ * on error.
  */
 int dss_select(int n, fd_set *readfds, fd_set *writefds,
                struct timeval *timeout_tv)
diff --git a/file.h b/file.h
index d8f1092ee18d78544aedbfdf3a75732161e50532..cceeef573f3a9e107cfafa0ba2eda90202cf9eae 100644 (file)
--- a/file.h
+++ b/file.h
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+
 int for_each_subdir(int (*func)(const char *, void *), void *private_data);
 __must_check int mark_fd_nonblocking(int fd);
 static inline int dss_rename(const char *old_path, const char *new_path)
index 1ce032da387f721059014ea5eafc102294d134b3..a70519aa1abbb41e38cc6ad9b8528e91a0101c41 100644 (file)
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+
 #define HAVE_GNUC(maj, min) \
        defined(__GNUC__) && \
        (__GNUC__ > maj || (__GNUC__ == maj && __GNUC_MINOR__ >= min))
@@ -9,9 +10,9 @@
 # define __malloc
 #endif
 
-/* 
- * p is the number of the "format string" parameter, and q is 
- * the number of the first variadic parameter 
+/*
+ * p is the number of the "format string" parameter, and q is
+ * the number of the first variadic parameter.
  */
 #if HAVE_GNUC(2,3)
 # define __printf(p,q) __attribute__ ((format (printf, p, q)))
diff --git a/ipc.h b/ipc.h
index 234b652310295bbc8c9b9f4ff1a339fa6eb41694..ed80b7687d8a4356a7c467ddb2b2edfea866e529 100644 (file)
--- a/ipc.h
+++ b/ipc.h
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+
 uint32_t super_fast_hash(const uint8_t *data, uint32_t len, uint32_t hash);
 int lock_dss(uint32_t key);
 int get_dss_pid(uint32_t key, pid_t *pid);
diff --git a/log.h b/log.h
index 47a3b7ac0e5786c7721d8d262252642da7f993bb..3077c2e766e86b2b36b923b4b5c743fa63f8e0f7 100644 (file)
--- a/log.h
+++ b/log.h
@@ -1,21 +1,21 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
-/** debug loglevel, gets really noisy */
+/* debug loglevel, gets really noisy */
 #define DEBUG 1
-/** still noisy, but won't fill your disk */
+/* still noisy, but won't fill your disk */
 #define INFO  2
-/** normal, but significant event */
+/* normal, but significant event */
 #define NOTICE 3
-/** unexpected event that can be handled */
+/* unexpected event that can be handled */
 #define WARNING 4
-/** unhandled error condition */
+/* unhandled error condition */
 #define ERROR 5
-/** system might be unreliable */
+/* system might be unreliable */
 #define CRIT 6
-/** last message before exit */
+/* last message before exit */
 #define EMERG 7
 
-/** Not all compilers support __func__ or an equivalent. */
+/* Not all compilers support __func__ or an equivalent. */
 #if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) && !defined(__GNUC__)
 # if defined(_MSC_VER) && _MSC_VER >= 1300
 #  define __func__ __FUNCTION__
diff --git a/sig.c b/sig.c
index fe7fcede927b574391ce0cf4ee8e5035916d4fd1..90a88118a8c7d5f10190b30a5dfe6b2010291f67 100644 (file)
--- a/sig.c
+++ b/sig.c
 
 static int signal_pipe[2];
 
-/**
+/*
  * Initialize the signal subsystem.
  *
  * This function creates a pipe, the signal pipe, to deliver pending signals to
- * the application (Bernstein's trick). It should be called during the
- * application's startup part, followed by subsequent calls to
- * install_sighandler() for each signal that should be caught.
+ * the application (Bernstein's trick). It is called at startup, followed by
+ * subsequent calls to install_sighandler() for each signal that should be
+ * caught.
  *
  * signal_init() installs a generic signal handler which is used for all
  * signals simultaneously. When a signal arrives, this generic signal handler
  * writes the corresponding signal number to the signal pipe so that the
- * application can test for pending signals simply by checking the signal pipe
- * for reading, e.g. by using the select(2) system call.
+ * application can test for pending signals by checking the signal pipe for
+ * reading, e.g. by using the select(2) system call.
  *
- * \return This function either succeeds or calls exit(2) to terminate
- * the current process. On success, the file descriptor of the signal pipe is
- * returned.
+ * This function either succeeds or calls exit(2) to terminate the current
+ * process. On success, the file descriptor of the signal pipe is returned.
  */
 int signal_init(void)
 {
@@ -83,19 +82,13 @@ static void generic_signal_handler(int s)
        exit(EXIT_FAILURE);
 }
 
-/**
- * Reap one child.
+/*
+ * If there is a child to reap, return its pid and exit status via the pointer
+ * arguments.
  *
- * \param pid In case a child died, its pid is returned here.
- *
- * Call waitpid() and print a log message containing the pid and the cause of
- * the child's death.
- *
- * \return A (negative) error code on errors, zero, if no child died, one
- * otherwise. If and only if the function returns one, the content of \a pid is
- * meaningful.
- *
- * \sa waitpid(2)
+ * Returns a negative error code on errors, zero, if there was no child to
+ * reap, one if a child was reaped successfully. Only if the function returns
+ * one, the contents of pid and status are meaningful.
  */
 int reap_child(pid_t *pid, int *status)
 {
@@ -116,15 +109,9 @@ int reap_child(pid_t *pid, int *status)
        return 1;
 }
 
-/**
- * Wrapper around signal(2)
- *
- * \param sig The number of the signal to catch.
- *
- * This installs the generic signal handler for the given signal.
- *
- * \return This function returns 1 on success and \p -E_SIGNAL_SIG_ERR on errors.
- * \sa signal(2)
+/*
+ * Install the generic signal handler for the given signal, return 1 on success
+ * and -E_SIGNAL_SIG_ERR on errors.
  */
 int install_sighandler(int sig)
 {
@@ -134,14 +121,11 @@ int install_sighandler(int sig)
        return -E_SIGNAL_SIG_ERR;
 }
 
-/**
- * Return number of next pending signal.
- *
+/*
  * This should be called if the fd for the signal pipe is ready for reading.
- *
- * \return On success, the number of the received signal is returned.
- * If the read was interrupted by another signal the function returns 0.
- * Otherwise a negative error code is returned.
+ * It returns the number of the next pending signal. If the read was
+ * interrupted by another signal, the function returns 0. On errors, a negative
+ * error code is returned.
  */
 int next_signal(void)
 {
@@ -161,9 +145,7 @@ int next_signal(void)
        return -ERRNO_TO_DSS_ERROR(err);
 }
 
-/**
- * Close the signal pipe.
- */
+/* Close the signal pipe. */
 void signal_shutdown(void)
 {
        close(signal_pipe[1]);
diff --git a/snap.c b/snap.c
index da95c1f342dc09bcc01d1eef58a075dd721472ef..ef3c2bc5d327ded0387d760c2d45d3f104945510 100644 (file)
--- a/snap.c
+++ b/snap.c
@@ -16,7 +16,7 @@
 #include "tv.h"
 #include "file.h"
 
-/**
+/*
  * Wrapper for isdigit.
  * NetBSD needs this.
  *
  */
 #define dss_isdigit(c) isdigit((int)(unsigned char)(c))
 
-
-/**
- * Return the desired number of snapshots of an interval.
- */
 unsigned desired_number_of_snapshots(int interval_num, int num_intervals)
 {
        unsigned n;
@@ -113,7 +109,6 @@ struct add_snapshot_data {
        struct snapshot_list *sl;
 };
 
-/** Compute the minimum of \a a and \a b. */
 #define DSS_MIN(a,b) ((a) < (b) ? (a) : (b))
 
 static int add_snapshot(const char *dirname, void *private)
diff --git a/snap.h b/snap.h
index 27045a3ca5542ad1c3a72b7b3ed667ab5b583fd2..370bbe4b54971c585780ff9705a5782ee1478dea 100644 (file)
--- a/snap.h
+++ b/snap.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
-/** The possible states for snapshot creation/removal. */
+/* The possible states for snapshot creation/removal. */
 #define HOOK_STATUS_ARRAY \
        HSA_ITEM(HS_READY, "ready for action"), \
        HSA_ITEM(HS_PRE_RUNNING, "pre-hook running"), \
@@ -17,7 +17,7 @@ enum hook_status {HOOK_STATUS_ARRAY};
 #define HSA_ITEM(x, y) y
 
 
-/**
+/*
  * The status of a snapshot.
  *
  * The snapshot directories come in four different flavours, depending
@@ -29,26 +29,26 @@ enum hook_status {HOOK_STATUS_ARRAY};
  * incomplete, being deleted: 1204565370-incomplete.being_deleted.
  */
 enum snapshot_status_flags {
-       /** The rsync process terminated successfully. */
+       /* The rsync process terminated successfully. */
        SS_COMPLETE = 1,
-       /** The rm process is running to remove this snapshot. */
+       /* The rm process is running to remove this snapshot. */
        SS_BEING_DELETED = 2
 };
 
-/** Describes one snapshot. */
+/* Describes one snapshot. */
 struct snapshot {
-       /** The name of the directory, relative to the destination dir. */
+       /* The name of the directory, relative to the destination dir. */
        char *name;
-       /** Seconds after the epoch when this snapshot was created. */
+       /* Seconds after the epoch when this snapshot was created. */
        int64_t creation_time;
-       /**
+       /*
         * Seconds after the epoch when creation of this snapshot completed.
         * Only meaningful if the SS_COMPLETE bit is set.
         */
        int64_t completion_time;
-       /** See \ref snapshot_status_flags. */
+       /* See snapshot_status_flags. */
        enum snapshot_status_flags flags;
-       /** The interval this snapshot belongs to. */
+       /* The interval this snapshot belongs to. */
        unsigned interval;
 };
 
@@ -57,20 +57,21 @@ struct snapshot_list {
        unsigned num_snapshots;
        unsigned array_size;
        struct snapshot **snapshots;
-       /**
+       /*
         * Array of size num_intervals + 1
         *
-        * It contains the number of snapshots in each interval. interval_count[num_intervals]
-        * is the number of snapshots which belong to any interval greater than num_intervals.
+        * It contains the number of snapshots in each interval.
+        * interval_count[num_intervals] is the number of snapshots which
+        * belong to any interval greater than num_intervals.
         */
        unsigned *interval_count;
 };
 
-/** Iterate over all snapshots in a snapshot list. */
+/* Iterate over all snapshots in a snapshot list. */
 #define FOR_EACH_SNAPSHOT(s, i, sl) \
        for ((i) = 0; (i) < (sl)->num_snapshots && ((s) = (sl)->snapshots[(i)]); (i)++)
 
-/** Iterate backwards over all snapshots in a snapshot list. */
+/* Iterate backwards over all snapshots in a snapshot list. */
 #define FOR_EACH_SNAPSHOT_REVERSE(s, i, sl) \
        for ((i) = (sl)->num_snapshots; (i) > 0 && ((s) = (sl)->snapshots[(i - 1)]); (i)--)
 
@@ -85,7 +86,7 @@ int complete_name(int64_t start, int64_t end, char **result);
 __malloc char *name_of_newest_complete_snapshot(struct snapshot_list *sl);
 int num_complete_snapshots(struct snapshot_list *sl);
 
-/**
+/*
  * Get the newest snapshot in a snapshot list.
  */
 static inline struct snapshot *get_newest_snapshot(struct snapshot_list *sl)
diff --git a/str.c b/str.c
index eeb635cfa97dd7b09096b405df651bcb52a5deb1..ed04e4797f19b02afdc193148d85e825dfbb08bd 100644 (file)
--- a/str.c
+++ b/str.c
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include "err.h"
 #include "str.h"
 
-/**
- * dss' version of realloc().
- *
- * \param p Pointer to the memory block, may be \p NULL.
- * \param size The desired new size.
- *
- * A wrapper for realloc(3). It calls \p exit(\p EXIT_FAILURE) on errors,
- * i.e. there is no need to check the return value in the caller.
- *
- * \return A pointer to  the newly allocated memory, which is suitably aligned
- * for any kind of variable and may be different from \a p.
- *
- * \sa realloc(3).
+/*
+ * A wrapper for realloc(3) which exits on errors so that there is no need to
+ * check the return value in the caller.
  */
 __must_check __malloc void *dss_realloc(void *p, size_t size)
 {
        /*
         * No need to check for NULL pointers: If p is NULL, the  call
-        * to realloc is equivalent to malloc(size)
+        * to realloc is equivalent to malloc(size).
         */
        assert(size);
        if (!(p = realloc(p, size))) {
@@ -45,18 +36,7 @@ __must_check __malloc void *dss_realloc(void *p, size_t size)
        return p;
 }
 
-/**
- * dss' version of malloc().
- *
- * \param size The desired new size.
- *
- * A wrapper for malloc(3) which exits on errors.
- *
- * \return A pointer to the allocated memory, which is suitably aligned for any
- * kind of variable.
- *
- * \sa malloc(3).
- */
+/* A wrapper for malloc(3) which exits on errors. */
 __must_check __malloc void *dss_malloc(size_t size)
 {
        void *p;
@@ -71,18 +51,7 @@ __must_check __malloc void *dss_malloc(size_t size)
        return p;
 }
 
-/**
- * dss' version of calloc().
- *
- * \param size The desired new size.
- *
- * A wrapper for calloc(3) which exits on errors.
- *
- * \return A pointer to the allocated and zeroed-out memory, which is suitably
- * aligned for any kind of variable.
- *
- * \sa calloc(3)
- */
+/* Allocate zeroed-out memory. */
 __must_check __malloc void *dss_calloc(size_t size)
 {
        void *ret = dss_malloc(size);
@@ -91,20 +60,10 @@ __must_check __malloc void *dss_calloc(size_t size)
        return ret;
 }
 
-/**
- * dss' version of strdup().
- *
- * \param s The string to be duplicated.
- *
- * A wrapper for strdup(3). It calls \p exit(EXIT_FAILURE) on errors, i.e.
- * there is no need to check the return value in the caller.
- *
- * \return A pointer to the duplicated string. If \p s was the NULL pointer,
- * an pointer to an empty string is returned.
- *
- * \sa strdup(3)
+/*
+ * A wrapper for strdup(3) which exits on errors. If NULL is passed as the
+ * string to duplicate, a pointer to an empty string is returned.
  */
-
 __must_check __malloc char *dss_strdup(const char *s)
 {
        char *ret;
@@ -115,18 +74,10 @@ __must_check __malloc char *dss_strdup(const char *s)
        exit(EXIT_FAILURE);
 }
 
-/**
- * Allocate a sufficiently large string and print into it.
- *
- * \param fmt A usual format string.
- *
- * Produce output according to \p fmt. No artificial bound on the length of the
- * resulting string is imposed.
- *
- * \return This function either returns a pointer to a string that must be
- * freed by the caller or aborts without returning.
- *
- * \sa printf(3).
+/*
+ * Allocate a sufficiently large string and print into it. No artificial bound
+ * on the length of the resulting string is imposed. Either returns a pointer
+ * to a string which must be freed by the caller, or aborts without returning.
  */
 __must_check __printf_1_2 __malloc char *make_message(const char *fmt, ...)
 {
@@ -166,16 +117,7 @@ __must_check __malloc char *get_homedir(void)
        exit(EXIT_FAILURE);
 }
 
-/**
- * Convert a string to a 64-bit signed integer value.
- *
- * \param str The string to be converted.
- * \param value Result pointer.
- *
- * \return Standard.
- *
- * \sa strtol(3), atoi(3).
- */
+/* Convert a string to a 64-bit signed integer value. */
 int dss_atoi64(const char *str, int64_t *value)
 {
        char *endptr;
@@ -209,19 +151,16 @@ __must_check __malloc char *dss_logname(void)
        return dss_strdup(logname);
 }
 
-/**
- * Split string and return pointers to its parts.
- *
- * \param args The string to be split.
- * \param argv_ptr Pointer to the list of substrings.
+/*
+ * Split a string and return pointers to its parts.
  *
  * This function modifies the string given by the first argument by replacing
  * all occurrences of space and '\t' characters by '\0'. A NULL-terminated
  * array of pointers to char * is allocated dynamically, and these pointers are
- * initialized to point to the broken-up substrings.  A pointer to this array
+ * initialized to point to the broken-up substrings. A pointer to this array
  * is returned via the last argument.
  *
- * \return The number of substrings found.
+ * Returns the number of substrings found.
  */
 unsigned split_args(char *args, char *** const argv_ptr)
 {
diff --git a/str.h b/str.h
index 7b121efb00d1e19c5b92e1711b25c23cd29a8092..1339cfcc4f60ede700a94be47e621b9b918b8a74 100644 (file)
--- a/str.h
+++ b/str.h
@@ -10,13 +10,9 @@ int dss_atoi64(const char *str, int64_t *value);
 __must_check __malloc char *dss_logname(void);
 unsigned split_args(char *args, char *** const argv_ptr);
 
-
-/** \cond LLONG_MAX and LLONG_LIN might not be defined. */
 #ifndef LLONG_MAX
 #define LLONG_MAX (1 << (sizeof(long) - 1))
 #endif
 #ifndef LLONG_MIN
 #define LLONG_MIN (-LLONG_MAX - 1LL)
 #endif
-/** \endcond */
-
diff --git a/tv.c b/tv.c
index 538202c9fe99dd1326b2fb19aee2168dcbf0ec20..6214ff63da55ab0c2fe7c43b2bcc5f34a502b66b 100644 (file)
--- a/tv.c
+++ b/tv.c
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+
 #include <sys/time.h>
 #include <time.h>
 #include <inttypes.h>
 #include "log.h"
 #include "time.h"
 
-/**
- * Compute the difference of two time values.
- *
- * \param b Minuend.
- * \param a Subtrahend.
- * \param diff Result pointer.
- *
- * If \a diff is not \p NULL, it contains the absolute value |\a b - \a a| on
- * return.
- *
- * \return If \a b < \a a, this function returns -1, otherwise it returns 1.
+/*
+ * Compute the difference of two time values.  If b < a the function returns
+ * -1, otherwise it returns 1. If diff is not NULL, |b - a| is returned through
+ * this pointer.
  */
 int tv_diff(const struct timeval *b, const struct timeval *a, struct timeval *diff)
 {