/** @brief Marker for a command body */
static const char disorder_body[1];
+/** @brief Marker for a list of args */
+static const char disorder_list[1];
+
/** @brief Issue a command and parse a simple response
* @param c Client
* @param rp Where to store result, or NULL
*
* Put @ref disorder_body in the argument list followed by a char **
* and int giving the body to follow the command. If the int is @c -1
- * then the list is assumed to be NULL-terminated.
+ * then the list is assumed to be NULL-terminated. This may be used
+ * only once.
+ *
+ * Put @ref disorder_list in the argument list followed by a char **
+ * and int giving a list of arguments to include. If the int is @c -1
+ * then the list is assumed to be NULL-terminated. This may be used
+ * any number of times.
*
* Usually you would call this via one of the following interfaces:
* - disorder_simple()
body = va_arg(ap, char **);
nbody = va_arg(ap, int);
has_body = 1;
+ } else if(arg == disorder_list) {
+ char **list = va_arg(ap, char **);
+ int nlist = va_arg(ap, int);
+ if(nlist < 0) {
+ for(nlist = 0; list[nlist]; ++nlist)
+ ;
+ }
+ for(int n = 0; n < nlist; ++n) {
+ dynstr_append(&d, ' ');
+ dynstr_append_string(&d, quoteutf8(arg));
+ }
} else {
dynstr_append(&d, ' ');
dynstr_append_string(&d, quoteutf8(arg));
return ret;
}
-/** @brief Move a track
- * @param c Client
- * @param track Track to move (UTF-8)
- * @param delta Distance to move by
- * @return 0 on success, non-0 on error
- */
-int disorder_move(disorder_client *c, const char *track, int delta) {
- char d[16];
-
- byte_snprintf(d, sizeof d, "%d", delta);
- return disorder_simple(c, 0, "move", track, d, (char *)0);
-}
-
static void client_error(const char *msg,
void attribute((unused)) *u) {
disorder_error(0, "error parsing reply: %s", msg);