chiark / gitweb /
uaudio: newer compiler spotted a short memcpy
[disorder] / lib / client-stubs.c
CommitLineData
ff75e16e
RK
1/*
2 * Automatically generated file, see scripts/protocol
3 *
4 * DO NOT EDIT.
5 */
7788b7c7
RK
6/*
7 * This file is part of DisOrder.
ff75e16e 8 * Copyright (C) 2010-11 Richard Kettlewell
7788b7c7
RK
9 *
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.
14 *
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.
19 *
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/>.
22 */
d0f01ef6
RK
23/** @file lib/client-stubs.c
24 * @brief Generated client API implementation
25 */
7788b7c7
RK
26
27int disorder_adopt(disorder_client *c, const char *id) {
c12575c6 28 return disorder_simple(c, NULL, "adopt", id, (char *)NULL);
7788b7c7
RK
29}
30
31int disorder_adduser(disorder_client *c, const char *user, const char *password, const char *rights) {
c12575c6 32 return disorder_simple(c, NULL, "adduser", user, password, rights, (char *)NULL);
7788b7c7
RK
33}
34
3680ef53 35int disorder_allfiles(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
c12575c6
RK
36 int rc = disorder_simple(c, NULL, "allfiles", dir, re, (char *)NULL);
37 if(rc)
38 return rc;
39 if(readlist(c, filesp, nfilesp))
40 return -1;
41 return 0;
3680ef53
RK
42}
43
7788b7c7 44int disorder_confirm(disorder_client *c, const char *confirmation) {
dab87ecc
RK
45 char **v;
46 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "confirm", confirmation, (char *)NULL);
c12575c6 47 if(rc)
7788b7c7 48 return rc;
c12575c6 49 c->user = v[0];
e721e6b9
RK
50 v[0] = NULL;
51 free_strings(nv, v);
7788b7c7
RK
52 return 0;
53}
54
55int disorder_cookie(disorder_client *c, const char *cookie) {
dab87ecc
RK
56 char **v;
57 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "cookie", cookie, (char *)NULL);
c12575c6 58 if(rc)
7788b7c7 59 return rc;
c12575c6 60 c->user = v[0];
e721e6b9
RK
61 v[0] = NULL;
62 free_strings(nv, v);
7788b7c7
RK
63 return 0;
64}
65
66int disorder_deluser(disorder_client *c, const char *user) {
c12575c6 67 return disorder_simple(c, NULL, "deluser", user, (char *)NULL);
7788b7c7
RK
68}
69
3680ef53 70int disorder_dirs(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
c12575c6
RK
71 int rc = disorder_simple(c, NULL, "dirs", dir, re, (char *)NULL);
72 if(rc)
73 return rc;
74 if(readlist(c, filesp, nfilesp))
75 return -1;
76 return 0;
3680ef53
RK
77}
78
7788b7c7 79int disorder_disable(disorder_client *c) {
c12575c6 80 return disorder_simple(c, NULL, "disable", (char *)NULL);
7788b7c7
RK
81}
82
83int disorder_edituser(disorder_client *c, const char *username, const char *property, const char *value) {
c12575c6 84 return disorder_simple(c, NULL, "edituser", username, property, value, (char *)NULL);
7788b7c7
RK
85}
86
87int disorder_enable(disorder_client *c) {
c12575c6 88 return disorder_simple(c, NULL, "enable", (char *)NULL);
7788b7c7
RK
89}
90
91int disorder_enabled(disorder_client *c, int *enabledp) {
dab87ecc
RK
92 char **v;
93 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "enabled", (char *)NULL);
c12575c6 94 if(rc)
7788b7c7 95 return rc;
c12575c6
RK
96 if(boolean("enabled", v[0], enabledp))
97 return -1;
e721e6b9 98 free_strings(nv, v);
c12575c6 99 return 0;
7788b7c7
RK
100}
101
102int disorder_exists(disorder_client *c, const char *track, int *existsp) {
dab87ecc
RK
103 char **v;
104 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "exists", track, (char *)NULL);
c12575c6 105 if(rc)
7788b7c7 106 return rc;
c12575c6
RK
107 if(boolean("exists", v[0], existsp))
108 return -1;
e721e6b9 109 free_strings(nv, v);
c12575c6 110 return 0;
7788b7c7
RK
111}
112
3680ef53 113int disorder_files(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
c12575c6
RK
114 int rc = disorder_simple(c, NULL, "files", dir, re, (char *)NULL);
115 if(rc)
116 return rc;
117 if(readlist(c, filesp, nfilesp))
118 return -1;
119 return 0;
3680ef53
RK
120}
121
7788b7c7 122int disorder_get(disorder_client *c, const char *track, const char *pref, char **valuep) {
dab87ecc
RK
123 char **v;
124 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "get", track, pref, (char *)NULL);
c12575c6
RK
125 if(rc)
126 return rc;
c12575c6 127 *valuep = v[0];
e721e6b9
RK
128 v[0] = NULL;
129 free_strings(nv, v);
c12575c6 130 return 0;
7788b7c7
RK
131}
132
133int disorder_get_global(disorder_client *c, const char *pref, char **valuep) {
dab87ecc
RK
134 char **v;
135 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "get-global", pref, (char *)NULL);
c12575c6
RK
136 if(rc)
137 return rc;
c12575c6 138 *valuep = v[0];
e721e6b9
RK
139 v[0] = NULL;
140 free_strings(nv, v);
c12575c6 141 return 0;
7788b7c7
RK
142}
143
711a4497 144int disorder_length(disorder_client *c, const char *track, long *lengthp) {
dab87ecc
RK
145 char **v;
146 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "length", track, (char *)NULL);
c12575c6 147 if(rc)
711a4497 148 return rc;
c12575c6 149 *lengthp = atol(v[0]);
e721e6b9 150 free_strings(nv, v);
711a4497
RK
151 return 0;
152}
153
7788b7c7 154int disorder_make_cookie(disorder_client *c, char **cookiep) {
dab87ecc
RK
155 char **v;
156 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "make-cookie", (char *)NULL);
c12575c6
RK
157 if(rc)
158 return rc;
c12575c6 159 *cookiep = v[0];
e721e6b9
RK
160 v[0] = NULL;
161 free_strings(nv, v);
c12575c6 162 return 0;
7788b7c7
RK
163}
164
0bc1d67c 165int disorder_move(disorder_client *c, const char *track, long delta) {
bcb2af72 166 return disorder_simple(c, NULL, "move", track, disorder__integer, delta, (char *)NULL);
0bc1d67c
RK
167}
168
169int disorder_moveafter(disorder_client *c, const char *target, char **ids, int nids) {
ad131c25 170 return disorder_simple(c, NULL, "moveafter", target, disorder__list, ids, nids, (char *)NULL);
0bc1d67c
RK
171}
172
ff75e16e 173int disorder_new_tracks(disorder_client *c, long max, char ***tracksp, int *ntracksp) {
bcb2af72 174 int rc = disorder_simple(c, NULL, "new", disorder__integer, max, (char *)NULL);
c12575c6
RK
175 if(rc)
176 return rc;
177 if(readlist(c, tracksp, ntracksp))
178 return -1;
179 return 0;
ff75e16e
RK
180}
181
7788b7c7 182int disorder_nop(disorder_client *c) {
c12575c6 183 return disorder_simple(c, NULL, "nop", (char *)NULL);
7788b7c7
RK
184}
185
186int disorder_part(disorder_client *c, const char *track, const char *context, const char *part, char **partp) {
dab87ecc
RK
187 char **v;
188 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "part", track, context, part, (char *)NULL);
c12575c6
RK
189 if(rc)
190 return rc;
c12575c6 191 *partp = v[0];
e721e6b9
RK
192 v[0] = NULL;
193 free_strings(nv, v);
c12575c6 194 return 0;
7788b7c7
RK
195}
196
197int disorder_pause(disorder_client *c) {
c12575c6 198 return disorder_simple(c, NULL, "pause", (char *)NULL);
7788b7c7
RK
199}
200
00861dcb 201int disorder_play(disorder_client *c, const char *track, char **idp) {
c12575c6 202 return disorder_simple(c, idp, "play", track, (char *)NULL);
00861dcb
RK
203}
204
0bc1d67c 205int disorder_playafter(disorder_client *c, const char *target, char **tracks, int ntracks) {
ad131c25 206 return disorder_simple(c, NULL, "playafter", target, disorder__list, tracks, ntracks, (char *)NULL);
0bc1d67c
RK
207}
208
ec9c0462
RK
209int disorder_playing(disorder_client *c, struct queue_entry **playingp) {
210 return onequeue(c, "playing", playingp);
211}
212
7788b7c7 213int disorder_playlist_delete(disorder_client *c, const char *playlist) {
c12575c6 214 return disorder_simple(c, NULL, "playlist-delete", playlist, (char *)NULL);
7788b7c7
RK
215}
216
3680ef53 217int disorder_playlist_get(disorder_client *c, const char *playlist, char ***tracksp, int *ntracksp) {
c12575c6
RK
218 int rc = disorder_simple(c, NULL, "playlist-get", playlist, (char *)NULL);
219 if(rc)
220 return rc;
221 if(readlist(c, tracksp, ntracksp))
222 return -1;
223 return 0;
7788b7c7
RK
224}
225
226int disorder_playlist_get_share(disorder_client *c, const char *playlist, char **sharep) {
c12575c6 227 return disorder_simple(c, sharep, "playlist-get-share", playlist, (char *)NULL);
7788b7c7
RK
228}
229
3680ef53 230int disorder_playlist_lock(disorder_client *c, const char *playlist) {
c12575c6 231 return disorder_simple(c, NULL, "playlist-lock", playlist, (char *)NULL);
3680ef53
RK
232}
233
08af2413 234int disorder_playlist_set(disorder_client *c, const char *playlist, char **tracks, int ntracks) {
ad131c25 235 return disorder_simple(c, NULL, "playlist-set", playlist, disorder__body, tracks, ntracks, (char *)NULL);
08af2413
RK
236}
237
7788b7c7 238int disorder_playlist_set_share(disorder_client *c, const char *playlist, const char *share) {
c12575c6 239 return disorder_simple(c, NULL, "playlist-set-share", playlist, share, (char *)NULL);
7788b7c7
RK
240}
241
242int disorder_playlist_unlock(disorder_client *c) {
c12575c6 243 return disorder_simple(c, NULL, "playlist-unlock", (char *)NULL);
7788b7c7
RK
244}
245
3680ef53 246int disorder_playlists(disorder_client *c, char ***playlistsp, int *nplaylistsp) {
c12575c6
RK
247 int rc = disorder_simple(c, NULL, "playlists", (char *)NULL);
248 if(rc)
249 return rc;
250 if(readlist(c, playlistsp, nplaylistsp))
251 return -1;
252 return 0;
3680ef53
RK
253}
254
5dc19ffd 255int disorder_prefs(disorder_client *c, const char *track, struct kvp **prefsp) {
c12575c6 256 return pairlist(c, prefsp, "prefs", track, (char *)NULL);
5dc19ffd
RK
257}
258
08af2413 259int disorder_queue(disorder_client *c, struct queue_entry **queuep) {
c12575c6
RK
260 int rc = disorder_simple(c, NULL, "queue", (char *)NULL);
261 if(rc)
262 return rc;
263 if(readqueue(c, queuep))
264 return -1;
265 return 0;
08af2413
RK
266}
267
7788b7c7 268int disorder_random_disable(disorder_client *c) {
c12575c6 269 return disorder_simple(c, NULL, "random-disable", (char *)NULL);
7788b7c7
RK
270}
271
272int disorder_random_enable(disorder_client *c) {
c12575c6 273 return disorder_simple(c, NULL, "random-enable", (char *)NULL);
7788b7c7
RK
274}
275
276int disorder_random_enabled(disorder_client *c, int *enabledp) {
dab87ecc
RK
277 char **v;
278 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "random-enabled", (char *)NULL);
c12575c6 279 if(rc)
7788b7c7 280 return rc;
c12575c6
RK
281 if(boolean("random-enabled", v[0], enabledp))
282 return -1;
e721e6b9 283 free_strings(nv, v);
c12575c6 284 return 0;
7788b7c7
RK
285}
286
08af2413 287int disorder_recent(disorder_client *c, struct queue_entry **recentp) {
c12575c6
RK
288 int rc = disorder_simple(c, NULL, "recent", (char *)NULL);
289 if(rc)
290 return rc;
291 if(readqueue(c, recentp))
292 return -1;
293 return 0;
08af2413
RK
294}
295
7788b7c7 296int disorder_reconfigure(disorder_client *c) {
c12575c6 297 return disorder_simple(c, NULL, "reconfigure", (char *)NULL);
7788b7c7
RK
298}
299
300int disorder_register(disorder_client *c, const char *username, const char *password, const char *email, char **confirmationp) {
dab87ecc
RK
301 char **v;
302 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "register", username, password, email, (char *)NULL);
c12575c6
RK
303 if(rc)
304 return rc;
c12575c6 305 *confirmationp = v[0];
e721e6b9
RK
306 v[0] = NULL;
307 free_strings(nv, v);
c12575c6 308 return 0;
7788b7c7
RK
309}
310
311int disorder_reminder(disorder_client *c, const char *username) {
c12575c6 312 return disorder_simple(c, NULL, "reminder", username, (char *)NULL);
7788b7c7
RK
313}
314
315int disorder_remove(disorder_client *c, const char *id) {
c12575c6 316 return disorder_simple(c, NULL, "remove", id, (char *)NULL);
7788b7c7
RK
317}
318
319int disorder_rescan(disorder_client *c) {
c12575c6 320 return disorder_simple(c, NULL, "rescan", (char *)NULL);
7788b7c7
RK
321}
322
323int disorder_resolve(disorder_client *c, const char *track, char **resolvedp) {
dab87ecc
RK
324 char **v;
325 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "resolve", track, (char *)NULL);
c12575c6
RK
326 if(rc)
327 return rc;
c12575c6 328 *resolvedp = v[0];
e721e6b9
RK
329 v[0] = NULL;
330 free_strings(nv, v);
c12575c6 331 return 0;
7788b7c7
RK
332}
333
334int disorder_resume(disorder_client *c) {
c12575c6 335 return disorder_simple(c, NULL, "resume", (char *)NULL);
7788b7c7
RK
336}
337
338int disorder_revoke(disorder_client *c) {
c12575c6
RK
339 return disorder_simple(c, NULL, "revoke", (char *)NULL);
340}
341
342int disorder_rtp_address(disorder_client *c, char **addressp, char **portp) {
dab87ecc
RK
343 char **v;
344 int nv, rc = disorder_simple_split(c, &v, &nv, 2, "rtp-address", (char *)NULL);
c12575c6
RK
345 if(rc)
346 return rc;
c12575c6 347 *addressp = v[0];
e721e6b9 348 v[0] = NULL;
c12575c6 349 *portp = v[1];
e721e6b9
RK
350 v[1] = NULL;
351 free_strings(nv, v);
c12575c6 352 return 0;
7788b7c7
RK
353}
354
b0116b5c
RK
355int disorder_rtp_cancel(disorder_client *c) {
356 return disorder_simple(c, NULL, "rtp-cancel", (char *)NULL);
357}
358
359int disorder_rtp_request(disorder_client *c, const char *address, const char *port) {
360 return disorder_simple(c, NULL, "rtp-request", address, port, (char *)NULL);
361}
362
7788b7c7 363int disorder_scratch(disorder_client *c, const char *id) {
c12575c6 364 return disorder_simple(c, NULL, "scratch", id, (char *)NULL);
7788b7c7
RK
365}
366
4d80373d 367int disorder_schedule_add_play(disorder_client *c, time_t when, const char *priority, const char *track) {
bcb2af72 368 return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "play", track, (char *)NULL);
4d80373d
RK
369}
370
371int disorder_schedule_add_set_global(disorder_client *c, time_t when, const char *priority, const char *pref, const char *value) {
bcb2af72 372 return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "set-global", pref, value, (char *)NULL);
4d80373d
RK
373}
374
375int disorder_schedule_add_unset_global(disorder_client *c, time_t when, const char *priority, const char *pref) {
bcb2af72 376 return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "set-global", pref, (char *)NULL);
4d80373d
RK
377}
378
7788b7c7 379int disorder_schedule_del(disorder_client *c, const char *event) {
c12575c6 380 return disorder_simple(c, NULL, "schedule-del", event, (char *)NULL);
7788b7c7
RK
381}
382
5dc19ffd 383int disorder_schedule_get(disorder_client *c, const char *id, struct kvp **actiondatap) {
c12575c6 384 return pairlist(c, actiondatap, "schedule-get", id, (char *)NULL);
5dc19ffd
RK
385}
386
3680ef53 387int disorder_schedule_list(disorder_client *c, char ***idsp, int *nidsp) {
c12575c6
RK
388 int rc = disorder_simple(c, NULL, "schedule-list", (char *)NULL);
389 if(rc)
390 return rc;
391 if(readlist(c, idsp, nidsp))
392 return -1;
393 return 0;
3680ef53
RK
394}
395
396int disorder_search(disorder_client *c, const char *terms, char ***tracksp, int *ntracksp) {
c12575c6
RK
397 int rc = disorder_simple(c, NULL, "search", terms, (char *)NULL);
398 if(rc)
399 return rc;
400 if(readlist(c, tracksp, ntracksp))
401 return -1;
402 return 0;
3680ef53
RK
403}
404
7788b7c7 405int disorder_set(disorder_client *c, const char *track, const char *pref, const char *value) {
c12575c6 406 return disorder_simple(c, NULL, "set", track, pref, value, (char *)NULL);
7788b7c7
RK
407}
408
409int disorder_set_global(disorder_client *c, const char *pref, const char *value) {
c12575c6 410 return disorder_simple(c, NULL, "set-global", pref, value, (char *)NULL);
7788b7c7
RK
411}
412
eea34c08 413int disorder_shutdown(disorder_client *c) {
c12575c6 414 return disorder_simple(c, NULL, "shutdown", (char *)NULL);
eea34c08
RK
415}
416
3680ef53 417int disorder_stats(disorder_client *c, char ***statsp, int *nstatsp) {
c12575c6
RK
418 int rc = disorder_simple(c, NULL, "stats", (char *)NULL);
419 if(rc)
420 return rc;
421 if(readlist(c, statsp, nstatsp))
422 return -1;
423 return 0;
3680ef53
RK
424}
425
426int disorder_tags(disorder_client *c, char ***tagsp, int *ntagsp) {
c12575c6
RK
427 int rc = disorder_simple(c, NULL, "tags", (char *)NULL);
428 if(rc)
429 return rc;
430 if(readlist(c, tagsp, ntagsp))
431 return -1;
432 return 0;
3680ef53
RK
433}
434
7788b7c7 435int disorder_unset(disorder_client *c, const char *track, const char *pref) {
c12575c6 436 return disorder_simple(c, NULL, "unset", track, pref, (char *)NULL);
7788b7c7
RK
437}
438
439int disorder_unset_global(disorder_client *c, const char *pref) {
c12575c6 440 return disorder_simple(c, NULL, "unset-global", pref, (char *)NULL);
7788b7c7
RK
441}
442
443int disorder_userinfo(disorder_client *c, const char *username, const char *property, char **valuep) {
dab87ecc
RK
444 char **v;
445 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "userinfo", username, property, (char *)NULL);
c12575c6
RK
446 if(rc)
447 return rc;
c12575c6 448 *valuep = v[0];
e721e6b9
RK
449 v[0] = NULL;
450 free_strings(nv, v);
c12575c6 451 return 0;
7788b7c7
RK
452}
453
3680ef53 454int disorder_users(disorder_client *c, char ***usersp, int *nusersp) {
c12575c6
RK
455 int rc = disorder_simple(c, NULL, "users", (char *)NULL);
456 if(rc)
457 return rc;
458 if(readlist(c, usersp, nusersp))
459 return -1;
460 return 0;
3680ef53
RK
461}
462
7788b7c7 463int disorder_version(disorder_client *c, char **versionp) {
dab87ecc
RK
464 char **v;
465 int nv, rc = disorder_simple_split(c, &v, &nv, 1, "version", (char *)NULL);
c12575c6
RK
466 if(rc)
467 return rc;
c12575c6 468 *versionp = v[0];
e721e6b9
RK
469 v[0] = NULL;
470 free_strings(nv, v);
c12575c6
RK
471 return 0;
472}
473
474int disorder_set_volume(disorder_client *c, long left, long right) {
bcb2af72 475 return disorder_simple(c, NULL, "volume", disorder__integer, left, disorder__integer, right, (char *)NULL);
c12575c6
RK
476}
477
478int disorder_get_volume(disorder_client *c, long *leftp, long *rightp) {
dab87ecc
RK
479 char **v;
480 int nv, rc = disorder_simple_split(c, &v, &nv, 2, "volume", (char *)NULL);
c12575c6
RK
481 if(rc)
482 return rc;
c12575c6
RK
483 *leftp = atol(v[0]);
484 *rightp = atol(v[1]);
e721e6b9 485 free_strings(nv, v);
c12575c6 486 return 0;
7788b7c7
RK
487}
488