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/>.
23 /** @file lib/client-stubs.c
24 * @brief Generated client API implementation
27 int disorder_adopt(disorder_client *c, const char *id) {
28 return disorder_simple(c, NULL, "adopt", id, (char *)NULL);
31 int disorder_adduser(disorder_client *c, const char *user, const char *password, const char *rights) {
32 return disorder_simple(c, NULL, "adduser", user, password, rights, (char *)NULL);
35 int disorder_allfiles(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
36 int rc = disorder_simple(c, NULL, "allfiles", dir, re, (char *)NULL);
39 if(readlist(c, filesp, nfilesp))
44 int disorder_confirm(disorder_client *c, const char *confirmation) {
46 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "confirm", confirmation, (char *)NULL);
55 int disorder_cookie(disorder_client *c, const char *cookie) {
57 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "cookie", cookie, (char *)NULL);
66 int disorder_deluser(disorder_client *c, const char *user) {
67 return disorder_simple(c, NULL, "deluser", user, (char *)NULL);
70 int disorder_dirs(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
71 int rc = disorder_simple(c, NULL, "dirs", dir, re, (char *)NULL);
74 if(readlist(c, filesp, nfilesp))
79 int disorder_disable(disorder_client *c) {
80 return disorder_simple(c, NULL, "disable", (char *)NULL);
83 int disorder_edituser(disorder_client *c, const char *username, const char *property, const char *value) {
84 return disorder_simple(c, NULL, "edituser", username, property, value, (char *)NULL);
87 int disorder_enable(disorder_client *c) {
88 return disorder_simple(c, NULL, "enable", (char *)NULL);
91 int disorder_enabled(disorder_client *c, int *enabledp) {
93 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "enabled", (char *)NULL);
96 if(boolean("enabled", v[0], enabledp))
102 int disorder_exists(disorder_client *c, const char *track, int *existsp) {
104 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "exists", track, (char *)NULL);
107 if(boolean("exists", v[0], existsp))
113 int disorder_files(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
114 int rc = disorder_simple(c, NULL, "files", dir, re, (char *)NULL);
117 if(readlist(c, filesp, nfilesp))
122 int disorder_get(disorder_client *c, const char *track, const char *pref, char **valuep) {
124 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "get", track, pref, (char *)NULL);
133 int disorder_get_global(disorder_client *c, const char *pref, char **valuep) {
135 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "get-global", pref, (char *)NULL);
144 int disorder_length(disorder_client *c, const char *track, long *lengthp) {
146 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "length", track, (char *)NULL);
149 *lengthp = atol(v[0]);
154 int disorder_make_cookie(disorder_client *c, char **cookiep) {
156 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "make-cookie", (char *)NULL);
165 int disorder_move(disorder_client *c, const char *track, long delta) {
166 return disorder_simple(c, NULL, "move", track, disorder__integer, delta, (char *)NULL);
169 int disorder_moveafter(disorder_client *c, const char *target, char **ids, int nids) {
170 return disorder_simple(c, NULL, "moveafter", target, disorder__list, ids, nids, (char *)NULL);
173 int disorder_new_tracks(disorder_client *c, long max, char ***tracksp, int *ntracksp) {
174 int rc = disorder_simple(c, NULL, "new", disorder__integer, max, (char *)NULL);
177 if(readlist(c, tracksp, ntracksp))
182 int disorder_nop(disorder_client *c) {
183 return disorder_simple(c, NULL, "nop", (char *)NULL);
186 int disorder_part(disorder_client *c, const char *track, const char *context, const char *part, char **partp) {
188 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "part", track, context, part, (char *)NULL);
197 int disorder_pause(disorder_client *c) {
198 return disorder_simple(c, NULL, "pause", (char *)NULL);
201 int disorder_play(disorder_client *c, const char *track, char **idp) {
202 return disorder_simple(c, idp, "play", track, (char *)NULL);
205 int disorder_playafter(disorder_client *c, const char *target, char **tracks, int ntracks) {
206 return disorder_simple(c, NULL, "playafter", target, disorder__list, tracks, ntracks, (char *)NULL);
209 int disorder_playing(disorder_client *c, struct queue_entry **playingp) {
210 return onequeue(c, "playing", playingp);
213 int disorder_playlist_delete(disorder_client *c, const char *playlist) {
214 return disorder_simple(c, NULL, "playlist-delete", playlist, (char *)NULL);
217 int disorder_playlist_get(disorder_client *c, const char *playlist, char ***tracksp, int *ntracksp) {
218 int rc = disorder_simple(c, NULL, "playlist-get", playlist, (char *)NULL);
221 if(readlist(c, tracksp, ntracksp))
226 int disorder_playlist_get_share(disorder_client *c, const char *playlist, char **sharep) {
227 return disorder_simple(c, sharep, "playlist-get-share", playlist, (char *)NULL);
230 int disorder_playlist_lock(disorder_client *c, const char *playlist) {
231 return disorder_simple(c, NULL, "playlist-lock", playlist, (char *)NULL);
234 int disorder_playlist_set(disorder_client *c, const char *playlist, char **tracks, int ntracks) {
235 return disorder_simple(c, NULL, "playlist-set", playlist, disorder__body, tracks, ntracks, (char *)NULL);
238 int disorder_playlist_set_share(disorder_client *c, const char *playlist, const char *share) {
239 return disorder_simple(c, NULL, "playlist-set-share", playlist, share, (char *)NULL);
242 int disorder_playlist_unlock(disorder_client *c) {
243 return disorder_simple(c, NULL, "playlist-unlock", (char *)NULL);
246 int disorder_playlists(disorder_client *c, char ***playlistsp, int *nplaylistsp) {
247 int rc = disorder_simple(c, NULL, "playlists", (char *)NULL);
250 if(readlist(c, playlistsp, nplaylistsp))
255 int disorder_prefs(disorder_client *c, const char *track, struct kvp **prefsp) {
256 return pairlist(c, prefsp, "prefs", track, (char *)NULL);
259 int disorder_queue(disorder_client *c, struct queue_entry **queuep) {
260 int rc = disorder_simple(c, NULL, "queue", (char *)NULL);
263 if(readqueue(c, queuep))
268 int disorder_random_disable(disorder_client *c) {
269 return disorder_simple(c, NULL, "random-disable", (char *)NULL);
272 int disorder_random_enable(disorder_client *c) {
273 return disorder_simple(c, NULL, "random-enable", (char *)NULL);
276 int disorder_random_enabled(disorder_client *c, int *enabledp) {
278 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "random-enabled", (char *)NULL);
281 if(boolean("random-enabled", v[0], enabledp))
287 int disorder_recent(disorder_client *c, struct queue_entry **recentp) {
288 int rc = disorder_simple(c, NULL, "recent", (char *)NULL);
291 if(readqueue(c, recentp))
296 int disorder_reconfigure(disorder_client *c) {
297 return disorder_simple(c, NULL, "reconfigure", (char *)NULL);
300 int disorder_register(disorder_client *c, const char *username, const char *password, const char *email, char **confirmationp) {
302 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "register", username, password, email, (char *)NULL);
305 *confirmationp = v[0];
311 int disorder_reminder(disorder_client *c, const char *username) {
312 return disorder_simple(c, NULL, "reminder", username, (char *)NULL);
315 int disorder_remove(disorder_client *c, const char *id) {
316 return disorder_simple(c, NULL, "remove", id, (char *)NULL);
319 int disorder_rescan(disorder_client *c) {
320 return disorder_simple(c, NULL, "rescan", (char *)NULL);
323 int disorder_resolve(disorder_client *c, const char *track, char **resolvedp) {
325 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "resolve", track, (char *)NULL);
334 int disorder_resume(disorder_client *c) {
335 return disorder_simple(c, NULL, "resume", (char *)NULL);
338 int disorder_revoke(disorder_client *c) {
339 return disorder_simple(c, NULL, "revoke", (char *)NULL);
342 int disorder_rtp_address(disorder_client *c, char **addressp, char **portp) {
344 int nv, rc = disorder_simple_split(c, &v, &nv, 2, "rtp-address", (char *)NULL);
355 int disorder_rtp_cancel(disorder_client *c) {
356 return disorder_simple(c, NULL, "rtp-cancel", (char *)NULL);
359 int disorder_rtp_request(disorder_client *c, const char *address, const char *port) {
360 return disorder_simple(c, NULL, "rtp-request", address, port, (char *)NULL);
363 int disorder_scratch(disorder_client *c, const char *id) {
364 return disorder_simple(c, NULL, "scratch", id, (char *)NULL);
367 int disorder_schedule_add_play(disorder_client *c, time_t when, const char *priority, const char *track) {
368 return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "play", track, (char *)NULL);
371 int disorder_schedule_add_set_global(disorder_client *c, time_t when, const char *priority, const char *pref, const char *value) {
372 return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "set-global", pref, value, (char *)NULL);
375 int disorder_schedule_add_unset_global(disorder_client *c, time_t when, const char *priority, const char *pref) {
376 return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "set-global", pref, (char *)NULL);
379 int disorder_schedule_del(disorder_client *c, const char *event) {
380 return disorder_simple(c, NULL, "schedule-del", event, (char *)NULL);
383 int disorder_schedule_get(disorder_client *c, const char *id, struct kvp **actiondatap) {
384 return pairlist(c, actiondatap, "schedule-get", id, (char *)NULL);
387 int disorder_schedule_list(disorder_client *c, char ***idsp, int *nidsp) {
388 int rc = disorder_simple(c, NULL, "schedule-list", (char *)NULL);
391 if(readlist(c, idsp, nidsp))
396 int disorder_search(disorder_client *c, const char *terms, char ***tracksp, int *ntracksp) {
397 int rc = disorder_simple(c, NULL, "search", terms, (char *)NULL);
400 if(readlist(c, tracksp, ntracksp))
405 int disorder_set(disorder_client *c, const char *track, const char *pref, const char *value) {
406 return disorder_simple(c, NULL, "set", track, pref, value, (char *)NULL);
409 int disorder_set_global(disorder_client *c, const char *pref, const char *value) {
410 return disorder_simple(c, NULL, "set-global", pref, value, (char *)NULL);
413 int disorder_shutdown(disorder_client *c) {
414 return disorder_simple(c, NULL, "shutdown", (char *)NULL);
417 int disorder_stats(disorder_client *c, char ***statsp, int *nstatsp) {
418 int rc = disorder_simple(c, NULL, "stats", (char *)NULL);
421 if(readlist(c, statsp, nstatsp))
426 int disorder_tags(disorder_client *c, char ***tagsp, int *ntagsp) {
427 int rc = disorder_simple(c, NULL, "tags", (char *)NULL);
430 if(readlist(c, tagsp, ntagsp))
435 int disorder_unset(disorder_client *c, const char *track, const char *pref) {
436 return disorder_simple(c, NULL, "unset", track, pref, (char *)NULL);
439 int disorder_unset_global(disorder_client *c, const char *pref) {
440 return disorder_simple(c, NULL, "unset-global", pref, (char *)NULL);
443 int disorder_userinfo(disorder_client *c, const char *username, const char *property, char **valuep) {
445 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "userinfo", username, property, (char *)NULL);
454 int disorder_users(disorder_client *c, char ***usersp, int *nusersp) {
455 int rc = disorder_simple(c, NULL, "users", (char *)NULL);
458 if(readlist(c, usersp, nusersp))
463 int disorder_version(disorder_client *c, char **versionp) {
465 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "version", (char *)NULL);
474 int disorder_set_volume(disorder_client *c, long left, long right) {
475 return disorder_simple(c, NULL, "volume", disorder__integer, left, disorder__integer, right, (char *)NULL);
478 int disorder_get_volume(disorder_client *c, long *leftp, long *rightp) {
480 int nv, rc = disorder_simple_split(c, &v, &nv, 2, "volume", (char *)NULL);
484 *rightp = atol(v[1]);