X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/e7eb3a2744aa45179daea235800753d3d1955338..aa846a75f692251355458667d28378398fd84b67:/lib/eventlog.h diff --git a/lib/eventlog.h b/lib/eventlog.h index 236943e..e29fcfc 100644 --- a/lib/eventlog.h +++ b/lib/eventlog.h @@ -15,27 +15,51 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** @file lib/eventlog.h + * @brief Event logging + */ #ifndef EVENTLOG_H #define EVENTLOG_H -/* definition of an event log output. The caller must allocate these - * (since log.c isn't allowed to perform memory allocation). */ +/** @brief An output for the event log + * + * The caller must allocate these (since log.c isn't allowed to perform memory + * allocation). They form a linked list, using eventlog_add() and + * eventlog_remove(). + */ struct eventlog_output { + /** @brief Next output */ struct eventlog_output *next; + + /** @brief Handler for this output */ void (*fn)(const char *msg, void *user); + + /** @brief Passed to @ref fn */ void *user; }; +/** @brief Add an event log output + * @param lo Pointer to output to add + */ void eventlog_add(struct eventlog_output *lo); -/* add a log output */ +/** @brief Remove an event log output + * @param lo Pointer to output to remove + */ void eventlog_remove(struct eventlog_output *lo); -/* remove a log output */ +/** @brief Send a message to the event log + * @param keyword Distinguishing keyword for event + * @param ... Extra data, terminated by (char *)0 + */ void eventlog(const char *keyword, ...); + +/** @brief Send a message to the event log + * @param keyword Distinguishing keyword for event + * @param raw Unformatted data + * @param ... Extra data, terminated by (char *)0 + */ void eventlog_raw(const char *keyword, const char *raw, ...); -/* send a message to the event log */ #endif /* EVENTLOG_H */