2 * Automatically generated file, see scripts/protocol
7 * This file is part of DisOrder.
8 * Copyright (C) 2010-11 Richard Kettlewell
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 int disorder_adopt(disorder_client *c, const char *id) {
25 return disorder_simple(c, NULL, "adopt", id, (char *)NULL);
28 int disorder_adduser(disorder_client *c, const char *user, const char *password, const char *rights) {
29 return disorder_simple(c, NULL, "adduser", user, password, rights, (char *)NULL);
32 int disorder_allfiles(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
33 int rc = disorder_simple(c, NULL, "allfiles", dir, re, (char *)NULL);
36 if(readlist(c, filesp, nfilesp))
41 int disorder_confirm(disorder_client *c, const char *confirmation) {
43 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "confirm", confirmation, (char *)NULL);
52 int disorder_cookie(disorder_client *c, const char *cookie) {
54 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "cookie", cookie, (char *)NULL);
63 int disorder_deluser(disorder_client *c, const char *user) {
64 return disorder_simple(c, NULL, "deluser", user, (char *)NULL);
67 int disorder_dirs(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
68 int rc = disorder_simple(c, NULL, "dirs", dir, re, (char *)NULL);
71 if(readlist(c, filesp, nfilesp))
76 int disorder_disable(disorder_client *c) {
77 return disorder_simple(c, NULL, "disable", (char *)NULL);
80 int disorder_edituser(disorder_client *c, const char *username, const char *property, const char *value) {
81 return disorder_simple(c, NULL, "edituser", username, property, value, (char *)NULL);
84 int disorder_enable(disorder_client *c) {
85 return disorder_simple(c, NULL, "enable", (char *)NULL);
88 int disorder_enabled(disorder_client *c, int *enabledp) {
90 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "enabled", (char *)NULL);
93 if(boolean("enabled", v[0], enabledp))
99 int disorder_exists(disorder_client *c, const char *track, int *existsp) {
101 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "exists", track, (char *)NULL);
104 if(boolean("exists", v[0], existsp))
110 int disorder_files(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
111 int rc = disorder_simple(c, NULL, "files", dir, re, (char *)NULL);
114 if(readlist(c, filesp, nfilesp))
119 int disorder_get(disorder_client *c, const char *track, const char *pref, char **valuep) {
121 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "get", track, pref, (char *)NULL);
130 int disorder_get_global(disorder_client *c, const char *pref, char **valuep) {
132 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "get-global", pref, (char *)NULL);
141 int disorder_length(disorder_client *c, const char *track, long *lengthp) {
143 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "length", track, (char *)NULL);
146 *lengthp = atol(v[0]);
151 int disorder_make_cookie(disorder_client *c, char **cookiep) {
153 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "make-cookie", (char *)NULL);
162 int disorder_move(disorder_client *c, const char *track, long delta) {
163 return disorder_simple(c, NULL, "move", track, disorder__integer, delta, (char *)NULL);
166 int disorder_moveafter(disorder_client *c, const char *target, char **ids, int nids) {
167 return disorder_simple(c, NULL, "moveafter", target, disorder__list, ids, nids, (char *)NULL);
170 int disorder_new_tracks(disorder_client *c, long max, char ***tracksp, int *ntracksp) {
171 int rc = disorder_simple(c, NULL, "new", disorder__integer, max, (char *)NULL);
174 if(readlist(c, tracksp, ntracksp))
179 int disorder_nop(disorder_client *c) {
180 return disorder_simple(c, NULL, "nop", (char *)NULL);
183 int disorder_part(disorder_client *c, const char *track, const char *context, const char *part, char **partp) {
185 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "part", track, context, part, (char *)NULL);
194 int disorder_pause(disorder_client *c) {
195 return disorder_simple(c, NULL, "pause", (char *)NULL);
198 int disorder_play(disorder_client *c, const char *track, char **idp) {
199 return disorder_simple(c, idp, "play", track, (char *)NULL);
202 int disorder_playafter(disorder_client *c, const char *target, char **tracks, int ntracks) {
203 return disorder_simple(c, NULL, "playafter", target, disorder__list, tracks, ntracks, (char *)NULL);
206 int disorder_playing(disorder_client *c, struct queue_entry **playingp) {
207 return onequeue(c, "playing", playingp);
210 int disorder_playlist_delete(disorder_client *c, const char *playlist) {
211 return disorder_simple(c, NULL, "playlist-delete", playlist, (char *)NULL);
214 int disorder_playlist_get(disorder_client *c, const char *playlist, char ***tracksp, int *ntracksp) {
215 int rc = disorder_simple(c, NULL, "playlist-get", playlist, (char *)NULL);
218 if(readlist(c, tracksp, ntracksp))
223 int disorder_playlist_get_share(disorder_client *c, const char *playlist, char **sharep) {
224 return disorder_simple(c, sharep, "playlist-get-share", playlist, (char *)NULL);
227 int disorder_playlist_lock(disorder_client *c, const char *playlist) {
228 return disorder_simple(c, NULL, "playlist-lock", playlist, (char *)NULL);
231 int disorder_playlist_set(disorder_client *c, const char *playlist, char **tracks, int ntracks) {
232 return disorder_simple(c, NULL, "playlist-set", playlist, disorder__body, tracks, ntracks, (char *)NULL);
235 int disorder_playlist_set_share(disorder_client *c, const char *playlist, const char *share) {
236 return disorder_simple(c, NULL, "playlist-set-share", playlist, share, (char *)NULL);
239 int disorder_playlist_unlock(disorder_client *c) {
240 return disorder_simple(c, NULL, "playlist-unlock", (char *)NULL);
243 int disorder_playlists(disorder_client *c, char ***playlistsp, int *nplaylistsp) {
244 int rc = disorder_simple(c, NULL, "playlists", (char *)NULL);
247 if(readlist(c, playlistsp, nplaylistsp))
252 int disorder_prefs(disorder_client *c, const char *track, struct kvp **prefsp) {
253 return pairlist(c, prefsp, "prefs", track, (char *)NULL);
256 int disorder_queue(disorder_client *c, struct queue_entry **queuep) {
257 int rc = disorder_simple(c, NULL, "queue", (char *)NULL);
260 if(readqueue(c, queuep))
265 int disorder_random_disable(disorder_client *c) {
266 return disorder_simple(c, NULL, "random-disable", (char *)NULL);
269 int disorder_random_enable(disorder_client *c) {
270 return disorder_simple(c, NULL, "random-enable", (char *)NULL);
273 int disorder_random_enabled(disorder_client *c, int *enabledp) {
275 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "random-enabled", (char *)NULL);
278 if(boolean("random-enabled", v[0], enabledp))
284 int disorder_recent(disorder_client *c, struct queue_entry **recentp) {
285 int rc = disorder_simple(c, NULL, "recent", (char *)NULL);
288 if(readqueue(c, recentp))
293 int disorder_reconfigure(disorder_client *c) {
294 return disorder_simple(c, NULL, "reconfigure", (char *)NULL);
297 int disorder_register(disorder_client *c, const char *username, const char *password, const char *email, char **confirmationp) {
299 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "register", username, password, email, (char *)NULL);
302 *confirmationp = v[0];
308 int disorder_reminder(disorder_client *c, const char *username) {
309 return disorder_simple(c, NULL, "reminder", username, (char *)NULL);
312 int disorder_remove(disorder_client *c, const char *id) {
313 return disorder_simple(c, NULL, "remove", id, (char *)NULL);
316 int disorder_rescan(disorder_client *c) {
317 return disorder_simple(c, NULL, "rescan", (char *)NULL);
320 int disorder_resolve(disorder_client *c, const char *track, char **resolvedp) {
322 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "resolve", track, (char *)NULL);
331 int disorder_resume(disorder_client *c) {
332 return disorder_simple(c, NULL, "resume", (char *)NULL);
335 int disorder_revoke(disorder_client *c) {
336 return disorder_simple(c, NULL, "revoke", (char *)NULL);
339 int disorder_rtp_address(disorder_client *c, char **addressp, char **portp) {
341 int nv, rc = disorder_simple_split(c, &v, &nv, 2, "rtp-address", (char *)NULL);
352 int disorder_scratch(disorder_client *c, const char *id) {
353 return disorder_simple(c, NULL, "scratch", id, (char *)NULL);
356 int disorder_schedule_add_play(disorder_client *c, time_t when, const char *priority, const char *track) {
357 return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "play", track, (char *)NULL);
360 int disorder_schedule_add_set_global(disorder_client *c, time_t when, const char *priority, const char *pref, const char *value) {
361 return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "set-global", pref, value, (char *)NULL);
364 int disorder_schedule_add_unset_global(disorder_client *c, time_t when, const char *priority, const char *pref) {
365 return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "set-global", pref, (char *)NULL);
368 int disorder_schedule_del(disorder_client *c, const char *event) {
369 return disorder_simple(c, NULL, "schedule-del", event, (char *)NULL);
372 int disorder_schedule_get(disorder_client *c, const char *id, struct kvp **actiondatap) {
373 return pairlist(c, actiondatap, "schedule-get", id, (char *)NULL);
376 int disorder_schedule_list(disorder_client *c, char ***idsp, int *nidsp) {
377 int rc = disorder_simple(c, NULL, "schedule-list", (char *)NULL);
380 if(readlist(c, idsp, nidsp))
385 int disorder_search(disorder_client *c, const char *terms, char ***tracksp, int *ntracksp) {
386 int rc = disorder_simple(c, NULL, "search", terms, (char *)NULL);
389 if(readlist(c, tracksp, ntracksp))
394 int disorder_set(disorder_client *c, const char *track, const char *pref, const char *value) {
395 return disorder_simple(c, NULL, "set", track, pref, value, (char *)NULL);
398 int disorder_set_global(disorder_client *c, const char *pref, const char *value) {
399 return disorder_simple(c, NULL, "set-global", pref, value, (char *)NULL);
402 int disorder_shutdown(disorder_client *c) {
403 return disorder_simple(c, NULL, "shutdown", (char *)NULL);
406 int disorder_stats(disorder_client *c, char ***statsp, int *nstatsp) {
407 int rc = disorder_simple(c, NULL, "stats", (char *)NULL);
410 if(readlist(c, statsp, nstatsp))
415 int disorder_tags(disorder_client *c, char ***tagsp, int *ntagsp) {
416 int rc = disorder_simple(c, NULL, "tags", (char *)NULL);
419 if(readlist(c, tagsp, ntagsp))
424 int disorder_unset(disorder_client *c, const char *track, const char *pref) {
425 return disorder_simple(c, NULL, "unset", track, pref, (char *)NULL);
428 int disorder_unset_global(disorder_client *c, const char *pref) {
429 return disorder_simple(c, NULL, "unset-global", pref, (char *)NULL);
432 int disorder_userinfo(disorder_client *c, const char *username, const char *property, char **valuep) {
434 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "userinfo", username, property, (char *)NULL);
443 int disorder_users(disorder_client *c, char ***usersp, int *nusersp) {
444 int rc = disorder_simple(c, NULL, "users", (char *)NULL);
447 if(readlist(c, usersp, nusersp))
452 int disorder_version(disorder_client *c, char **versionp) {
454 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "version", (char *)NULL);
463 int disorder_set_volume(disorder_client *c, long left, long right) {
464 return disorder_simple(c, NULL, "volume", disorder__integer, left, disorder__integer, right, (char *)NULL);
467 int disorder_get_volume(disorder_client *c, long *leftp, long *rightp) {
469 int nv, rc = disorder_simple_split(c, &v, &nv, 2, "volume", (char *)NULL);
473 *rightp = atol(v[1]);