From: Richard Kettlewell Date: Sun, 7 Aug 2011 16:45:36 +0000 (+0100) Subject: Merge branch 'protogen' X-Git-Tag: branchpoint-5.1~22 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/6961095b797229842e1465ff3670625d11e95167?hp=d0f01ef61a0b9ffe7f7252e08917ed284e2f0b9e Merge branch 'protogen' --- diff --git a/cgi/disorder-cgi.h b/cgi/disorder-cgi.h index 43ad241..e9deab2 100644 --- a/cgi/disorder-cgi.h +++ b/cgi/disorder-cgi.h @@ -77,7 +77,6 @@ struct queue_entry *dcgi_findtrack(const char *id); void option_set(const char *name, const char *value); const char *option_label(const char *key); int option_label_exists(const char *key); -char **option_columns(const char *name, int *ncolumns); #define DCGI_QUEUE 0x0001 #define DCGI_PLAYING 0x0002 diff --git a/cgi/options.c b/cgi/options.c index fca5801..521ce35 100644 --- a/cgi/options.c +++ b/cgi/options.c @@ -1,6 +1,6 @@ /* * This file is part of DisOrder. - * Copyright (C) 2004-2008 Richard Kettlewell + * Copyright (C) 2004-2008, 2011 Richard Kettlewell * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,18 +24,16 @@ #include "disorder-cgi.h" -struct column { - int ncolumns; - char **columns; -}; - +/** @brief State for parsing an options file */ struct read_options_state { + /** @brief Filename */ const char *name; + + /** @brief Line number */ int line; }; static hash *labels; -static hash *columns; static void option__readfile(const char *name); @@ -49,21 +47,17 @@ static void option__include(int attribute((unused)) nvec, option__readfile(vec[0]); } -static void option__columns(int nvec, - char **vec) { - struct column c; - - c.ncolumns = nvec - 1; - c.columns = &vec[1]; - hash_add(columns, vec[0], &c, HASH_INSERT_OR_REPLACE); -} - +/** @brief Definition of an option command */ static struct option { + /** @brief Command name */ const char *name; - int minargs, maxargs; + /** @brief Minimum number of arguments */ + int minargs; + /** @brief Maximum number of arguments */ + int maxargs; + /** @brief Command handler */ void (*handler)(int nvec, char **vec); } options[] = { - { "columns", 1, INT_MAX, option__columns }, { "include", 1, 1, option__include }, { "label", 2, 2, option__label }, }; @@ -118,7 +112,6 @@ static void option__init(void) { if(!have_read_options) { have_read_options = 1; labels = hash_new(sizeof (char *)); - columns = hash_new(sizeof (struct column)); option__readfile("options"); } } @@ -186,27 +179,6 @@ int option_label_exists(const char *key) { return !!hash_find(labels, key); } -/** @brief Return a column list - * @param name Context (playing/recent/etc) - * @param ncolumns Where to store column count or NULL - * @return Pointer to column list - */ -char **option_columns(const char *name, int *ncolumns) { - struct column *c; - - option__init(); - c = hash_find(columns, name); - if(c) { - if(ncolumns) - *ncolumns = c->ncolumns; - return c->columns; - } else { - if(ncolumns) - *ncolumns = 0; - return 0; - } -} - /* Local Variables: c-basic-offset:2 diff --git a/clients/disorder.c b/clients/disorder.c index 5d47bb1..b401c62 100644 --- a/clients/disorder.c +++ b/clients/disorder.c @@ -505,9 +505,15 @@ static void cf_setup_guest(char **argv) { exit(EXIT_FAILURE); } +/** @brief A scheduled event read from the server */ struct scheduled_event { + /** @brief When event should occur */ time_t when; + + /** @brief Details of action */ struct kvp *actiondata; + + /** @brief Event ID */ char *id; }; @@ -669,12 +675,28 @@ static void cf_playlist_set(char **argv) { exit(EXIT_FAILURE); } -static const struct command { +/** @brief Command-line client's definition of a command */ +static const struct client_command { + /** @brief Command name */ const char *name; - int min, max; + + /** @brief Minimum number of argument */ + int min; + + /** @brief Maximum number of argument */ + int max; + + /** @brief Pointer to function implementing command */ void (*fn)(char **); + + /** @brief Function to recognize a valid argument, or NULL */ int (*isarg)(const char *); - const char *argstr, *desc; + + /** @brief Summary of arguments */ + const char *argstr; + + /** @brief Description */ + const char *desc; } commands[] = { { "adduser", 2, 3, cf_adduser, isarg_rights, "USERNAME PASSWORD [RIGHTS]", "Create a new user" }, diff --git a/clients/disorderfm.c b/clients/disorderfm.c index ed31dd0..14092da 100644 --- a/clients/disorderfm.c +++ b/clients/disorderfm.c @@ -73,7 +73,7 @@ static const char *nativeencoding; /* Count of errors */ static long errors; -/* Included/excluded filename patterns */ +/** @brief Included/excluded filename pattern */ static struct pattern { struct pattern *next; const char *pattern; diff --git a/clients/resample.c b/clients/resample.c index bc41013..6291c83 100644 --- a/clients/resample.c +++ b/clients/resample.c @@ -15,6 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +/** @file clients/resample.c + * @brief Audio resampler + */ #include "common.h" #include diff --git a/disobedience/misc.c b/disobedience/misc.c index a1fdf4d..3878824 100644 --- a/disobedience/misc.c +++ b/disobedience/misc.c @@ -22,8 +22,11 @@ #include "disobedience.h" #include "table.h" +/** @brief Embedded image */ struct image { + /** @brief Image name */ const char *name; + /** @brief Image data in GDK pixbuf inline format */ const guint8 *data; }; diff --git a/disobedience/playlists.c b/disobedience/playlists.c index 50e099f..c5273ae 100644 --- a/disobedience/playlists.c +++ b/disobedience/playlists.c @@ -580,7 +580,7 @@ static const char *playlist_new_valid(void) { /** @brief Get entered new-playlist details * @param namep Where to store entered name (or NULL) * @param fullnamep Where to store computed full name (or NULL) - * @param sharep Where to store 'shared' flag (or NULL) + * @param sharedp Where to store 'shared' flag (or NULL) * @param publicp Where to store 'public' flag (or NULL) * @param privatep Where to store 'private' flag (or NULL) */ @@ -664,7 +664,8 @@ static void playlist_picker_fill(const char attribute((unused)) *event, } /** @brief Update a section in the picker tree model - * @param section Section name + * @param title Display name of section + * @param key Key to search for * @param start First entry in @ref playlists * @param end Past last entry in @ref playlists */ @@ -695,8 +696,7 @@ static void playlist_picker_update_section(const char *title, const char *key, * @param title Display name of section * @param key Key to search for * @param iter Iterator to point at key - * @param create If TRUE, key will be created if it doesn't exist - * @param compare Row comparison function + * @param create Whether to create the row * @return TRUE if key exists else FALSE * * If the @p key exists then @p iter will point to it and TRUE will be diff --git a/disobedience/properties.c b/disobedience/properties.c index 92f2128..ded862b 100644 --- a/disobedience/properties.c +++ b/disobedience/properties.c @@ -61,23 +61,26 @@ struct prefdata { GtkWidget *widget; }; -/* The type of a preference is the collection of callbacks needed to get, - * display and set it */ +/** @brief Type of a track preference + * + * The type of a preference is the collection of callbacks needed to get, + * display and set it. + */ struct preftype { + /** @brief Kick off the request to fetch the pref from the server. */ void (*kickoff)(struct prefdata *f); - /* Kick off the request to fetch the pref from the server. */ + /** @brief Called when the value comes back in; creates the widget. */ void (*completed)(struct prefdata *f); - /* Called when the value comes back in; creates the widget. */ + /** @brief Get the edited value from the widget. */ const char *(*get_edited)(struct prefdata *f); - /* Get the edited value from the widget. */ /** @brief Update the edited value */ void (*set_edited)(struct prefdata *f, const char *value); + /** @brief Set the new value and (if necessary) arrange for our display to update. */ void (*set)(struct prefdata *f, const char *value); - /* Set the new value and (if necessary) arrange for our display to update. */ }; /* A namepart pref */ @@ -107,7 +110,7 @@ static const struct preftype preftype_boolean = { set_boolean }; -/* @brief The known prefs for each track */ +/** @brief The known prefs for each track */ static const struct pref { const char *label; /**< @brief user-level description */ const char *part; /**< @brief protocol-level tag */ diff --git a/disobedience/queue-generic.c b/disobedience/queue-generic.c index 333187a..2c0ac19 100644 --- a/disobedience/queue-generic.c +++ b/disobedience/queue-generic.c @@ -227,6 +227,10 @@ void ql_update_list_store(struct queuelike *ql) { } } +/** @brief Old and new queue data + * + * Used when updating a @ref queuelike with new data from the server. + */ struct newqueue_data { struct queue_entry *old, *new; }; @@ -636,7 +640,7 @@ static void ql_drag_data_get_collect(GtkTreeModel *model, * @param w Source widget (the tree view) * @param dc Drag context * @param data Where to put the answer - * @param info_ Target @c info parameter + * @param info Target @c info parameter * @param time_ Time data requested (for some reason not a @c time_t) * @param user_data The queuelike * diff --git a/doc/disorder.cgi.8.in b/doc/disorder.cgi.8.in index eecb87f..45ef8ab 100644 --- a/doc/disorder.cgi.8.in +++ b/doc/disorder.cgi.8.in @@ -30,7 +30,7 @@ without. See \fBdisorder_actions\fR(5) for a description of what the CGI does. .PP See \fBdisorder_options\fR(5) for CGI-specific configuration and -\dBdisorder_config\fR(5) for general configuration. +\fBdisorder_config\fR(5) for general configuration. .PP See \fBdisorder_templates\fR(5) for the template language used. .SH "WHERE IS IT?" diff --git a/doc/disorder_options.5.in b/doc/disorder_options.5.in index b8492b6..242c0b0 100644 --- a/doc/disorder_options.5.in +++ b/doc/disorder_options.5.in @@ -1,5 +1,5 @@ .\" -.\" Copyright (C) 2008 Richard Kettlewell +.\" Copyright (C) 2008, 2011 Richard Kettlewell .\" .\" This program is free software: you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by @@ -25,15 +25,6 @@ The general syntax is the same as the main configuration file (see .SH DIRECTIVES Valid directives are: .TP -.B columns \fINAME\fR \fIHEADING\fR... -Defines the columns used in \fB@playing@\fR and \fB@recent@\fB. -\fINAME\fR must be either \fBplaying\fR, \fBrecent\fR or \fBsearch\fR. -\fIHEADING\fR... is a list of heading names. -If a column is defined more than once then the last definitions is used. -.IP -The heading names \fBbutton\fR, \fBlength\fR, \fBwhen\fR and \fBwho\fR -are built in. -.TP .B include \fIPATH\fR Includes another file. If \fIPATH\fR starts with a \fB/\fR then it is taken as is, otherwise @@ -54,7 +45,7 @@ Otherwise the whole name is used as the value. Labels are not individually documented here, see the shipped \fIoptions.labels\fR file instead. .SH "OPTION FILES" -The shipped \fIoptions\fR file includes four standard options files. +The shipped \fIoptions\fR file includes two standard options files. In order, they are: .TP .I options.labels diff --git a/lib/configuration.h b/lib/configuration.h index 6e3a9a9..63c82c8 100644 --- a/lib/configuration.h +++ b/lib/configuration.h @@ -68,6 +68,7 @@ struct collectionlist { struct collection *s; }; +/** @brief A track name part */ struct namepart { char *part; /* part */ pcre *re; /* compiled regexp */ @@ -77,11 +78,13 @@ struct namepart { unsigned reflags; /* regexp flags */ }; +/** @brief A list of track name parts */ struct namepartlist { int n; struct namepart *s; }; +/** @brief A track name transform */ struct transform { char *type; /* track or dir */ char *context; /* sort or choose */ @@ -90,6 +93,7 @@ struct transform { unsigned flags; /* regexp flags */ }; +/** @brief A list of track name transforms */ struct transformlist { int n; struct transform *t; diff --git a/lib/eventdist.c b/lib/eventdist.c index 37893b6..e0fb0fa 100644 --- a/lib/eventdist.c +++ b/lib/eventdist.c @@ -24,10 +24,22 @@ #include "eventdist.h" #include "hash.h" +/** @brief Event data + * + * @c event_data structures form linked lists; one list per event and one node + * per handler. + */ struct event_data { + /** @brief Next handler */ struct event_data *next; + + /** @brief Name of event */ const char *event; + + /** @brief Handler callback */ event_handler *callback; + + /** @brief Passed to @ref callback */ void *callbackdata; }; diff --git a/lib/eventlog.c b/lib/eventlog.c index a56884b..9ca2292 100644 --- a/lib/eventlog.c +++ b/lib/eventlog.c @@ -28,6 +28,7 @@ #include "eventlog.h" #include "split.h" +/** @brief Linked list of event logs */ static struct eventlog_output *outputs; void eventlog_add(struct eventlog_output *lo) { @@ -44,6 +45,11 @@ void eventlog_remove(struct eventlog_output *lo) { *pp = lo->next; } +/** @brief Write to the event log + * @param keyword Distinguishing keyword for event + * @param raw Unformatted data + * @param ap Extra data, terminated by (char *)0 + */ static void veventlog(const char *keyword, const char *raw, va_list ap) { struct eventlog_output *p, *pnext; struct dynstr d; diff --git a/lib/eventlog.h b/lib/eventlog.h index 87eea51..e29fcfc 100644 --- a/lib/eventlog.h +++ b/lib/eventlog.h @@ -21,23 +21,45 @@ #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 */ diff --git a/lib/hash.c b/lib/hash.c index 573b50a..9dc3469 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -25,6 +25,7 @@ #include "log.h" #include "kvp.h" +/** @brief One entry in a hash table */ struct entry { struct entry *next; /* next entry same key */ size_t h; /* hash of KEY */ @@ -32,6 +33,7 @@ struct entry { void *value; /* value of this entry */ }; +/** @brief A hash table */ struct hash { size_t nslots; /* number of slots */ size_t nitems; /* total number of entries */ diff --git a/lib/queue.c b/lib/queue.c index 0f39b23..e39ca5f 100644 --- a/lib/queue.c +++ b/lib/queue.c @@ -194,13 +194,23 @@ static const char *marshall_origin(const struct queue_entry *q, size_t offset) { #define F(n, h) { #n, offsetof(struct queue_entry, n), marshall_##h, unmarshall_##h, free_##h } -static const struct field { +/** @brief A field in a @ref queue_entry */ +static const struct queue_field { + /** @brief Field name */ const char *name; + + /** @brief Offset of value in @ref queue_entry structure */ size_t offset; + + /** @brief Marshaling function */ const char *(*marshall)(const struct queue_entry *q, size_t offset); + + /** @brief Unmarshaling function */ int (*unmarshall)(char *data, struct queue_entry *q, size_t offset, void (*error_handler)(const char *, void *), void *u); + + /** @brief Destructor */ void (*free)(struct queue_entry *q, size_t offset); } fields[] = { /* Keep this table sorted. */ diff --git a/lib/resample.c b/lib/resample.c index 39514ed..bee3d95 100644 --- a/lib/resample.c +++ b/lib/resample.c @@ -41,10 +41,12 @@ * @param input_channels Number of input channels * @param input_signed Whether input samples are signed or unsigned * @param input_rate Frames/second in input + * @param input_endian Input endianness (@c ENDIAN_BIG or @c ENDIAN_LITTLE) * @param output_bits Bits/sample in output * @param output_channels Number of output channels * @param output_rate Frames/second in output * @param output_signed Whether output samples are signed or unsigned + * @param output_endian Output endianness (@c ENDIAN_BIG or @c ENDIAN_LITTLE) * * For formats with more than two channels it's assume that the first * two channels are left and right. No particular meaning is attached @@ -199,7 +201,7 @@ static size_t resample_put_sample(const struct resampler *rs, /** @brief Convert input samples to floats * @param rs Resampler state * @param bytes Input bytes - * @param nbytes Number of input bytes + * @param nframes Number of input frames * @param floats Where to store converted data * * @p floats must be big enough. As well as converting to floats this diff --git a/lib/resample.h b/lib/resample.h index e99aaeb..a789325 100644 --- a/lib/resample.h +++ b/lib/resample.h @@ -29,12 +29,45 @@ #include "byte-order.h" +/** @brief An audio resampler */ struct resampler { - int input_bits, input_channels, input_rate, input_signed, input_endian; - int output_bits, output_channels, output_rate, output_signed, output_endian; + /** @brief Bits/sample in input */ + int input_bits; + + /** @brief Number of input channels */ + int input_channels; + + /** @brief Frames/second in input */ + int input_rate; + + /** @brief Whether input samples are signed or unsigned */ + int input_signed; + + /** @brief Input endianness (@c ENDIAN_BIG or @c ENDIAN_LITTLE) */ + int input_endian; + + /** @brief Bits/sample in output */ + int output_bits; + + /** @brief Number of output channels */ + int output_channels; + + /** @brief Frames/second in output */ + int output_rate; + + /** @brief Whether output samples are signed or unsigned */ + int output_signed; + + /** @brief Output endianness (@c ENDIAN_BIG or @c ENDIAN_LITTLE) */ + int output_endian; + + /** @brief */ int input_bytes_per_sample; + + /** @brief */ int input_bytes_per_frame; #if HAVE_SAMPLERATE_H + /** @brief Libsamplerate handle */ SRC_STATE *state; #endif }; diff --git a/lib/signame.c b/lib/signame.c index 27f9509..316fe6a 100644 --- a/lib/signame.c +++ b/lib/signame.c @@ -26,8 +26,12 @@ #include "table.h" #include "signame.h" +/** @brief Mapping between signal names and numbers */ static const struct sigtable { + /** @brief Signal number */ int signal; + + /* @brief Signal name ("SIGwhatever") */ const char *name; } signals[] = { #define S(sig) { sig, #sig } diff --git a/lib/snprintf.c b/lib/snprintf.c index e62e3c9..f272dc7 100644 --- a/lib/snprintf.c +++ b/lib/snprintf.c @@ -30,10 +30,21 @@ #include "printf.h" #include "sink.h" +/** @brief A @ref sink that stores to a fixed buffer + * + * If there is too much output, it is truncated. + */ struct fixedstr_sink { + /** @brief Base */ struct sink s; + + /** @brief Output buffer */ char *buffer; + + /** @brief Bytes written so far */ int nbytes; + + /** @brief Size of buffer */ size_t size; }; diff --git a/lib/strptime.c b/lib/strptime.c index 83d010d..27ef40a 100644 --- a/lib/strptime.c +++ b/lib/strptime.c @@ -26,10 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ - -/* strptime() is here reimplemented because the FreeBSD (and older MacOS) one +/** @file lib/strptime.c + * @brief strptime() reimplementation + * + * strptime() is here reimplemented because the FreeBSD (and older MacOS) one * is broken and does not report errors properly. See TODO remarks below for - * some missing bits. */ + * some missing bits. + */ #include #include @@ -37,8 +40,12 @@ #include #include "strptime.h" +/** @brief Lookup table entry for locale-specific strings */ struct locale_item_match { + /** @brief Locale key to try */ nl_item key; + + /** @brief Value to return if value of @ref key matches subject string */ int value; }; diff --git a/lib/strptime.h b/lib/strptime.h index 324f88d..b2b3715 100644 --- a/lib/strptime.h +++ b/lib/strptime.h @@ -1,5 +1,8 @@ #ifndef STRPTIME_H #define STRPTIME_H +/** @file lib/strptime.h + * @brief strptime() reimplementation + */ #include diff --git a/lib/trackdb.c b/lib/trackdb.c index 4afd925..7be53c1 100644 --- a/lib/trackdb.c +++ b/lib/trackdb.c @@ -1389,6 +1389,7 @@ int trackdb_obsolete(const char *track, DB_TXN *tid) { #define H(name) { #name, offsetof(DB_HASH_STAT, name) } #define B(name) { #name, offsetof(DB_BTREE_STAT, name) } +/** @brief Table of libdb stats to return */ static const struct statinfo { const char *name; size_t offset; diff --git a/lib/validity.h b/lib/validity.h index 8ce2505..6254708 100644 --- a/lib/validity.h +++ b/lib/validity.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ -/** @file lib/validity.c +/** @file lib/validity.h * @brief Various validity checks */ #ifndef VALIDITY_H diff --git a/plugins/tracklength-flac.c b/plugins/tracklength-flac.c index a838966..31a7e9d 100644 --- a/plugins/tracklength-flac.c +++ b/plugins/tracklength-flac.c @@ -23,8 +23,12 @@ /* libFLAC's "simplified" interface is rather heavyweight... */ +/** @brief State used when computing FLAC file length */ struct flac_state { + /** @brief Duration or -1 */ long duration; + + /** @brief File being analyzed */ const char *path; }; diff --git a/plugins/tracklength.h b/plugins/tracklength.h index c8e22a4..112b652 100644 --- a/plugins/tracklength.h +++ b/plugins/tracklength.h @@ -15,6 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +/** @file plugins/tracklength.h + * @brief Plugin to compute track lengths + */ #ifndef TRACKLENGTH_H #define TRACKLENGTH_H diff --git a/python/disorder.py.in b/python/disorder.py.in index 8584c85..8a758c9 100644 --- a/python/disorder.py.in +++ b/python/disorder.py.in @@ -87,6 +87,7 @@ class Error(Exception): """Base class for DisOrder exceptions.""" class _splitError(Error): + """Error parsing a quoted string list""" # _split failed def __init__(self, value): self.value = value diff --git a/server/decode-flac.c b/server/decode-flac.c index f1399fb..9577d9d 100644 --- a/server/decode-flac.c +++ b/server/decode-flac.c @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/** @file server/decode.c +/** @file server/decode-flac.c * @brief General-purpose decoder for use by speaker process */ #include "decode.h" diff --git a/server/decode-ogg.c b/server/decode-ogg.c index d499955..efa10a7 100644 --- a/server/decode-ogg.c +++ b/server/decode-ogg.c @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/** @file server/decode.c +/** @file server/decode-ogg.c * @brief General-purpose decoder for use by speaker process */ #include "decode.h" diff --git a/server/decode-wav.c b/server/decode-wav.c index fd58a14..8fdc10e 100644 --- a/server/decode-wav.c +++ b/server/decode-wav.c @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/** @file server/decode.c +/** @file server/decode-wav.c * @brief General-purpose decoder for use by speaker process */ #include "decode.h" diff --git a/server/disorderd.c b/server/disorderd.c index 2000a2f..3e1ab44 100644 --- a/server/disorderd.c +++ b/server/disorderd.c @@ -80,8 +80,12 @@ static int handle_sigterm(ev_source attribute((unused)) *ev_, /* periodic actions --------------------------------------------------------- */ +/** @brief A job executed periodically by the server */ struct periodic_data { + /** @brief Callback to process job */ void (*callback)(ev_source *); + + /** @brief Period of job in seconds */ int period; }; diff --git a/server/plugin.c b/server/plugin.c index 7afbde9..013aa94 100644 --- a/server/plugin.c +++ b/server/plugin.c @@ -28,9 +28,15 @@ # define SOSUFFIX ".so" #endif +/** @brief A loaded plugin */ struct plugin { + /** @brief Next plugin */ struct plugin *next; + + /** @brief Handle returned from dlopen() */ void *dlhandle; + + /** @brief Plugin name */ const char *name; }; diff --git a/server/rescan.c b/server/rescan.c index 7cb24b6..71b998a 100644 --- a/server/rescan.c +++ b/server/rescan.c @@ -164,14 +164,33 @@ done: ; } +/** @brief State for the recheck phase of the rescan */ struct recheck_state { + /** @brief Collection being rechecked */ const struct collection *c; - long nobsolete, nnocollection, nlength; + + /** @brief Number of tracks obsoleted */ + long nobsolete; + + /** @brief Number of tracks belonging to no collection */ + long nnocollection; + + /** @brief Number of lengths computed */ + long nlength; + + /** @brief Linked list of tracks to recheck */ struct recheck_track *tracks; }; +/** @brief A track to recheck + * + * A node in a linked list. + */ struct recheck_track { + /** @brief Next track */ struct recheck_track *next; + + /** @brief Track */ const char *track; }; diff --git a/server/server.c b/server/server.c index 29efbbe..1169e2f 100644 --- a/server/server.c +++ b/server/server.c @@ -1845,7 +1845,8 @@ static int c_playlist_unlock(struct conn *c, return 1; } -static const struct command { +/** @brief Server's definition of a command */ +static const struct server_command { /** @brief Command name */ const char *name; diff --git a/templates/Makefile.am b/templates/Makefile.am index 1f93947..0ce7a54 100644 --- a/templates/Makefile.am +++ b/templates/Makefile.am @@ -19,8 +19,7 @@ pkgdata_DATA=about.tmpl choose.tmpl playing.tmpl recent.tmpl \ prefs.tmpl help.tmpl error.tmpl \ new.tmpl login.tmpl macros.tmpl \ - options options.labels \ - options.columns + options options.labels pkghttp_DATA=disorder.css EXTRA_DIST=${pkgdata_DATA} $(pkghttp_DATA) diff --git a/templates/about.tmpl b/templates/about.tmpl index a0842db..9056b11 100644 --- a/templates/about.tmpl +++ b/templates/about.tmpl @@ -1,7 +1,7 @@