chiark / gitweb /
protogen: more consistent arg passing + fix login commands.
[disorder] / lib / client-stubs.c
index 3d021396b6a7bf137687b174c85cf6bd29a54b3e..92dd3e2251fc7b97827cc8dd9cae66180d214bed 100644 (file)
@@ -1,6 +1,11 @@
+/*
+ * Automatically generated file, see scripts/protocol
+ *
+ * DO NOT EDIT.
+ */
 /*
  * This file is part of DisOrder.
- * Copyright (C) 2010 Richard Kettlewell
+ * Copyright (C) 2010-11 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
@@ -31,7 +36,7 @@ int disorder_allfiles(disorder_client *c, const char *dir, const char *re, char
 int disorder_confirm(disorder_client *c, const char *confirmation) {
   char *u;
   int rc;
-  if((rc = disorder_simple(c, &u, "confirm", confirmation  )))
+  if((rc = disorder_simple(c, &u, "confirm", confirmation, (char *)0)))
     return rc;
   c->user = u;
   return 0;
@@ -40,7 +45,7 @@ int disorder_confirm(disorder_client *c, const char *confirmation) {
 int disorder_cookie(disorder_client *c, const char *cookie) {
   char *u;
   int rc;
-  if((rc = disorder_simple(c, &u, "cookie", cookie  )))
+  if((rc = disorder_simple(c, &u, "cookie", cookie, (char *)0)))
     return rc;
   c->user = u;
   return 0;
@@ -94,10 +99,37 @@ int disorder_get_global(disorder_client *c, const char *pref, char **valuep) {
   return dequote(disorder_simple(c, valuep, "get-global", pref, (char *)0), valuep);
 }
 
+int disorder_length(disorder_client *c, const char *track, long *lengthp) {
+  char *v;
+  int rc;
+
+  if((rc = disorder_simple(c, &v, "length", track, (char *)0)))
+    return rc;
+  *lengthp = atol(v);
+  xfree(v);
+  return 0;
+}
+
 int disorder_make_cookie(disorder_client *c, char **cookiep) {
   return dequote(disorder_simple(c, cookiep, "make-cookie", (char *)0), cookiep);
 }
 
+int disorder_move(disorder_client *c, const char *track, long delta) {
+  char buf_delta[16];
+  byte_snprintf(buf_delta, sizeof buf_delta, "%ld", delta);
+  return disorder_simple(c, 0, "move", track, buf_delta, (char *)0);
+}
+
+int disorder_moveafter(disorder_client *c, const char *target, char **ids, int nids) {
+  return disorder_simple(c, 0, "moveafter", target, disorder_list, ids, nids, (char *)0);
+}
+
+int disorder_new_tracks(disorder_client *c, long max, char ***tracksp, int *ntracksp) {
+  char buf_max[16];
+  byte_snprintf(buf_max, sizeof buf_max, "%ld", max);
+  return disorder_simple_list(c, tracksp, ntracksp, "new", buf_max, (char *)0);
+}
+
 int disorder_nop(disorder_client *c) {
   return disorder_simple(c, 0, "nop", (char *)0);
 }
@@ -114,6 +146,14 @@ int disorder_play(disorder_client *c, const char *track, char **idp) {
   return dequote(disorder_simple(c, idp, "play", track, (char *)0), idp);
 }
 
+int disorder_playafter(disorder_client *c, const char *target, char **tracks, int ntracks) {
+  return disorder_simple(c, 0, "playafter", target, disorder_list, tracks, ntracks, (char *)0);
+}
+
+int disorder_playing(disorder_client *c, struct queue_entry **playingp) {
+  return onequeue(c, "playing", playingp);
+}
+
 int disorder_playlist_delete(disorder_client *c, const char *playlist) {
   return disorder_simple(c, 0, "playlist-delete", playlist, (char *)0);
 }
@@ -130,6 +170,10 @@ int disorder_playlist_lock(disorder_client *c, const char *playlist) {
   return disorder_simple(c, 0, "playlist-lock", playlist, (char *)0);
 }
 
+int disorder_playlist_set(disorder_client *c, const char *playlist, char **tracks, int ntracks) {
+  return disorder_simple(c, 0, "playlist-set", playlist, disorder_body, tracks, ntracks, (char *)0);
+}
+
 int disorder_playlist_set_share(disorder_client *c, const char *playlist, const char *share) {
   return disorder_simple(c, 0, "playlist-set-share", playlist, share, (char *)0);
 }
@@ -142,6 +186,14 @@ int disorder_playlists(disorder_client *c, char ***playlistsp, int *nplaylistsp)
   return disorder_simple_list(c, playlistsp, nplaylistsp, "playlists", (char *)0);
 }
 
+int disorder_prefs(disorder_client *c, const char *track, struct kvp **prefsp) {
+  return pairlist(c, prefsp, "prefs", track, (char *)0);
+}
+
+int disorder_queue(disorder_client *c, struct queue_entry **queuep) {
+  return somequeue(c, "queue", queuep);
+}
+
 int disorder_random_disable(disorder_client *c) {
   return disorder_simple(c, 0, "random-disable", (char *)0);
 }
@@ -158,6 +210,10 @@ int disorder_random_enabled(disorder_client *c, int *enabledp) {
   return boolean("random-enabled", v, enabledp);
 }
 
+int disorder_recent(disorder_client *c, struct queue_entry **recentp) {
+  return somequeue(c, "recent", recentp);
+}
+
 int disorder_reconfigure(disorder_client *c) {
   return disorder_simple(c, 0, "reconfigure", (char *)0);
 }
@@ -198,6 +254,10 @@ int disorder_schedule_del(disorder_client *c, const char *event) {
   return disorder_simple(c, 0, "schedule-del", event, (char *)0);
 }
 
+int disorder_schedule_get(disorder_client *c, const char *id, struct kvp **actiondatap) {
+  return pairlist(c, actiondatap, "schedule-get", id, (char *)0);
+}
+
 int disorder_schedule_list(disorder_client *c, char ***idsp, int *nidsp) {
   return disorder_simple_list(c, idsp, nidsp, "schedule-list", (char *)0);
 }