X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/7751df38d656c9cf06fa8b545420303e69e72528..59cf25c47fbda22f3f4e14399f0436cc6ed2c56f:/cgi/actions.c diff --git a/cgi/actions.c b/cgi/actions.c index 7634010..f63e519 100644 --- a/cgi/actions.c +++ b/cgi/actions.c @@ -15,13 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/** @file server/actions.c +/** @file cgi/actions.c * @brief DisOrder web actions * * Actions are anything that the web interface does beyond passive template * expansion and inspection of state recieved from the server. This means * playing tracks, editing prefs etc but also setting extra headers e.g. to * auto-refresh the playing list. + * + * See @ref lib/macros-builtin.c for docstring syntax. */ #include "disorder-cgi.h" @@ -45,14 +47,14 @@ static void redirect(const char *url) { fatal(errno, "error writing to stdout"); } -/*! playing +/*$ playing * * Expands \fIplaying.tmpl\fR as if there was no special 'playing' action, but * adds a Refresh: field to the HTTP header. The maximum refresh interval is * defined by \fBrefresh\fR (see \fBdisorder_config\fR(5)) but may be less if * the end of the track is near. */ -/*! manage +/*$ manage * * Expands \fIplaying.tmpl\fR (NB not \fImanage.tmpl\fR) as if there was no * special 'playing' action, and adds a Refresh: field to the HTTP header. The @@ -103,7 +105,7 @@ static void act_playing(void) { dcgi_expand("playing", 1); } -/*! disable +/*$ disable * * Disables play. */ @@ -113,7 +115,7 @@ static void act_disable(void) { redirect(0); } -/*! enable +/*$ enable * * Enables play. */ @@ -123,7 +125,7 @@ static void act_enable(void) { redirect(0); } -/*! random-disable +/*$ random-disable * * Disables random play. */ @@ -133,7 +135,7 @@ static void act_random_disable(void) { redirect(0); } -/*! random-enable +/*$ random-enable * * Enables random play. */ @@ -143,7 +145,7 @@ static void act_random_enable(void) { redirect(0); } -/*! pause +/*$ pause * * Pauses the current track (if there is one and it's not paused already). */ @@ -153,7 +155,7 @@ static void act_pause(void) { redirect(0); } -/*! resume +/*$ resume * * Resumes the current track (if there is one and it's paused). */ @@ -163,7 +165,7 @@ static void act_resume(void) { redirect(0); } -/*! remove +/*$ remove * * Removes the track given by the \fBid\fR argument. If this is the currently * playing track then it is scratched. @@ -199,7 +201,7 @@ static void act_remove(void) { redirect(0); } -/*! move +/*$ move * * Moves the track given by the \fBid\fR argument the distance given by the * \fBdelta\fR argument. If this is positive the track is moved earlier in the @@ -229,7 +231,7 @@ static void act_move(void) { redirect(0); } -/*! play +/*$ play * * Play the track given by the \fBtrack\fR argument, or if that is not set all * the tracks in the directory given by the \fBdir\fR argument. @@ -262,7 +264,7 @@ static int clamp(int n, int min, int max) { return n; } -/*! volume +/*$ volume * * If the \fBdelta\fR argument is set: adjust both channels by that amount (up * if positive, down if negative). @@ -324,7 +326,7 @@ static int login_as(const char *username, const char *password) { return 0; /* OK */ } -/*! login +/*$ login * * If \fBusername\fR and \fBpassword\fR are set (and the username isn't * "guest") then attempt to log in using those credentials. On success, @@ -359,7 +361,7 @@ static void act_login(void) { } } -/*! logout +/*$ logout * * Logs out the current user and expands \fIlogin.tmpl\fR with \fBstatus\fR or * \fB@error\fR set according to the result. @@ -384,7 +386,7 @@ static void act_logout(void) { dcgi_expand("login", 1); } -/*! register +/*$ register * * Register a new user using \fBusername\fR, \fBpassword1\fR, \fBpassword2\fR * and \fBemail\fR and expands \fIlogin.tmpl\fR with \fBstatus\fR or @@ -451,7 +453,7 @@ static void act_register(void) { dcgi_expand("login", 1); } -/*! confirm +/*$ confirm * * Confirm a user registration using the nonce supplied in \fBc\fR and expands * \fIlogin.tmpl\fR with \fBstatus\fR or \fB@error\fR set according to the @@ -487,7 +489,7 @@ static void act_confirm(void) { dcgi_expand("login", 1); } -/*! edituser +/*$ edituser * * Edit user details using \fBusername\fR, \fBchangepassword1\fR, * \fBchangepassword2\fR and \fBemail\fR and expands \fIlogin.tmpl\fR with @@ -548,7 +550,7 @@ static void act_edituser(void) { dcgi_expand("login", 1); } -/*! reminder +/*$ reminder * * Issue an email password reminder to \fBusername\fR and expands * \fIlogin.tmpl\fR with \fBstatus\fR or \fB@error\fR set according to the @@ -630,7 +632,7 @@ static int process_prefs(int numfile) { return 0; } -/*! prefs +/*$ prefs * * Set preferences on a number of tracks. *