Set a global preference.
Requires the \fBglobal prefs\fR right.
.TP
+.B shutdown
+Requests server shutdown.
+Requires the \fBadmin\fR right.
+.TP
.B stats
Send server statistics in plain text in a response body.
.TP
return disorder_simple(c, 0, "set-global", pref, value, (char *)0);
}
+int disorder_shutdown(disorder_client *c) {
+ return disorder_simple(c, 0, "shutdown", (char *)0);
+}
+
int disorder_stats(disorder_client *c, char ***statsp, int *nstatsp) {
return disorder_simple_list(c, statsp, nstatsp, "stats", (char *)0);
}
*/
int disorder_set_global(disorder_client *c, const char *pref, const char *value);
+/** @brief Request server shutdown
+ *
+ * Requires the 'admin' right.
+ *
+ * @return 0 on success, non-0 on error
+ */
+int disorder_shutdown(disorder_client *c);
+
/** @brief Get server statistics
*
* The details of what the server reports are not really defined. The returned strings are intended to be printed out one to a line..
return disorder_simple(c, 0, "move", track, d, (char *)0);
}
-/** @brief Shut down the server
- * @param c Client
- * @return 0 on success, non-0 on error
- */
-int disorder_shutdown(disorder_client *c) {
- return disorder_simple(c, 0, "shutdown", (char *)0);
-}
-
static void client_error(const char *msg,
void attribute((unused)) *u) {
disorder_error(0, "error parsing reply: %s", msg);
[["pref", "Preference name"],
["value", "New value"]]);
-# TODO shutdown (also needs documenting)
+simple("shutdown",
+ "Request server shutdown",
+ "Requires the 'admin' right.",
+ []);
list("stats",
"Get server statistics",