Commit | Line | Data |
---|---|---|
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 | |
27 | int disorder_adopt(disorder_client *c, const char *id) { | |
c12575c6 | 28 | return disorder_simple(c, NULL, "adopt", id, (char *)NULL); |
7788b7c7 RK |
29 | } |
30 | ||
31 | int 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 | 35 | int 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 | 44 | int 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 | ||
55 | int 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 | ||
66 | int disorder_deluser(disorder_client *c, const char *user) { | |
c12575c6 | 67 | return disorder_simple(c, NULL, "deluser", user, (char *)NULL); |
7788b7c7 RK |
68 | } |
69 | ||
3680ef53 | 70 | int 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 | 79 | int disorder_disable(disorder_client *c) { |
c12575c6 | 80 | return disorder_simple(c, NULL, "disable", (char *)NULL); |
7788b7c7 RK |
81 | } |
82 | ||
83 | int 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 | ||
87 | int disorder_enable(disorder_client *c) { | |
c12575c6 | 88 | return disorder_simple(c, NULL, "enable", (char *)NULL); |
7788b7c7 RK |
89 | } |
90 | ||
91 | int 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 | ||
102 | int 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 | 113 | int 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 | 122 | int 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 | ||
133 | int 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 | 144 | int 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 | 154 | int 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 | 165 | int 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 | ||
169 | int 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 | 173 | int 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 | 182 | int disorder_nop(disorder_client *c) { |
c12575c6 | 183 | return disorder_simple(c, NULL, "nop", (char *)NULL); |
7788b7c7 RK |
184 | } |
185 | ||
186 | int 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 | ||
197 | int disorder_pause(disorder_client *c) { | |
c12575c6 | 198 | return disorder_simple(c, NULL, "pause", (char *)NULL); |
7788b7c7 RK |
199 | } |
200 | ||
00861dcb | 201 | int 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 | 205 | int 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 |
209 | int disorder_playing(disorder_client *c, struct queue_entry **playingp) { |
210 | return onequeue(c, "playing", playingp); | |
211 | } | |
212 | ||
7788b7c7 | 213 | int 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 | 217 | int 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 | ||
226 | int 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 | 230 | int 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 | 234 | int 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 | 238 | int 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 | ||
242 | int disorder_playlist_unlock(disorder_client *c) { | |
c12575c6 | 243 | return disorder_simple(c, NULL, "playlist-unlock", (char *)NULL); |
7788b7c7 RK |
244 | } |
245 | ||
3680ef53 | 246 | int 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 | 255 | int 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 | 259 | int 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 | 268 | int disorder_random_disable(disorder_client *c) { |
c12575c6 | 269 | return disorder_simple(c, NULL, "random-disable", (char *)NULL); |
7788b7c7 RK |
270 | } |
271 | ||
272 | int disorder_random_enable(disorder_client *c) { | |
c12575c6 | 273 | return disorder_simple(c, NULL, "random-enable", (char *)NULL); |
7788b7c7 RK |
274 | } |
275 | ||
276 | int 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 | 287 | int 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 | 296 | int disorder_reconfigure(disorder_client *c) { |
c12575c6 | 297 | return disorder_simple(c, NULL, "reconfigure", (char *)NULL); |
7788b7c7 RK |
298 | } |
299 | ||
300 | int 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 | ||
311 | int disorder_reminder(disorder_client *c, const char *username) { | |
c12575c6 | 312 | return disorder_simple(c, NULL, "reminder", username, (char *)NULL); |
7788b7c7 RK |
313 | } |
314 | ||
315 | int disorder_remove(disorder_client *c, const char *id) { | |
c12575c6 | 316 | return disorder_simple(c, NULL, "remove", id, (char *)NULL); |
7788b7c7 RK |
317 | } |
318 | ||
319 | int disorder_rescan(disorder_client *c) { | |
c12575c6 | 320 | return disorder_simple(c, NULL, "rescan", (char *)NULL); |
7788b7c7 RK |
321 | } |
322 | ||
323 | int 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 | ||
334 | int disorder_resume(disorder_client *c) { | |
c12575c6 | 335 | return disorder_simple(c, NULL, "resume", (char *)NULL); |
7788b7c7 RK |
336 | } |
337 | ||
338 | int disorder_revoke(disorder_client *c) { | |
c12575c6 RK |
339 | return disorder_simple(c, NULL, "revoke", (char *)NULL); |
340 | } | |
341 | ||
342 | int 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 | ||
355 | int disorder_scratch(disorder_client *c, const char *id) { | |
c12575c6 | 356 | return disorder_simple(c, NULL, "scratch", id, (char *)NULL); |
7788b7c7 RK |
357 | } |
358 | ||
4d80373d | 359 | int disorder_schedule_add_play(disorder_client *c, time_t when, const char *priority, const char *track) { |
bcb2af72 | 360 | return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "play", track, (char *)NULL); |
4d80373d RK |
361 | } |
362 | ||
363 | int disorder_schedule_add_set_global(disorder_client *c, time_t when, const char *priority, const char *pref, const char *value) { | |
bcb2af72 | 364 | return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "set-global", pref, value, (char *)NULL); |
4d80373d RK |
365 | } |
366 | ||
367 | int disorder_schedule_add_unset_global(disorder_client *c, time_t when, const char *priority, const char *pref) { | |
bcb2af72 | 368 | return disorder_simple(c, NULL, "schedule-add", disorder__time, when, priority, "set-global", pref, (char *)NULL); |
4d80373d RK |
369 | } |
370 | ||
7788b7c7 | 371 | int disorder_schedule_del(disorder_client *c, const char *event) { |
c12575c6 | 372 | return disorder_simple(c, NULL, "schedule-del", event, (char *)NULL); |
7788b7c7 RK |
373 | } |
374 | ||
5dc19ffd | 375 | int disorder_schedule_get(disorder_client *c, const char *id, struct kvp **actiondatap) { |
c12575c6 | 376 | return pairlist(c, actiondatap, "schedule-get", id, (char *)NULL); |
5dc19ffd RK |
377 | } |
378 | ||
3680ef53 | 379 | int disorder_schedule_list(disorder_client *c, char ***idsp, int *nidsp) { |
c12575c6 RK |
380 | int rc = disorder_simple(c, NULL, "schedule-list", (char *)NULL); |
381 | if(rc) | |
382 | return rc; | |
383 | if(readlist(c, idsp, nidsp)) | |
384 | return -1; | |
385 | return 0; | |
3680ef53 RK |
386 | } |
387 | ||
388 | int disorder_search(disorder_client *c, const char *terms, char ***tracksp, int *ntracksp) { | |
c12575c6 RK |
389 | int rc = disorder_simple(c, NULL, "search", terms, (char *)NULL); |
390 | if(rc) | |
391 | return rc; | |
392 | if(readlist(c, tracksp, ntracksp)) | |
393 | return -1; | |
394 | return 0; | |
3680ef53 RK |
395 | } |
396 | ||
7788b7c7 | 397 | int disorder_set(disorder_client *c, const char *track, const char *pref, const char *value) { |
c12575c6 | 398 | return disorder_simple(c, NULL, "set", track, pref, value, (char *)NULL); |
7788b7c7 RK |
399 | } |
400 | ||
401 | int disorder_set_global(disorder_client *c, const char *pref, const char *value) { | |
c12575c6 | 402 | return disorder_simple(c, NULL, "set-global", pref, value, (char *)NULL); |
7788b7c7 RK |
403 | } |
404 | ||
eea34c08 | 405 | int disorder_shutdown(disorder_client *c) { |
c12575c6 | 406 | return disorder_simple(c, NULL, "shutdown", (char *)NULL); |
eea34c08 RK |
407 | } |
408 | ||
3680ef53 | 409 | int disorder_stats(disorder_client *c, char ***statsp, int *nstatsp) { |
c12575c6 RK |
410 | int rc = disorder_simple(c, NULL, "stats", (char *)NULL); |
411 | if(rc) | |
412 | return rc; | |
413 | if(readlist(c, statsp, nstatsp)) | |
414 | return -1; | |
415 | return 0; | |
3680ef53 RK |
416 | } |
417 | ||
418 | int disorder_tags(disorder_client *c, char ***tagsp, int *ntagsp) { | |
c12575c6 RK |
419 | int rc = disorder_simple(c, NULL, "tags", (char *)NULL); |
420 | if(rc) | |
421 | return rc; | |
422 | if(readlist(c, tagsp, ntagsp)) | |
423 | return -1; | |
424 | return 0; | |
3680ef53 RK |
425 | } |
426 | ||
7788b7c7 | 427 | int disorder_unset(disorder_client *c, const char *track, const char *pref) { |
c12575c6 | 428 | return disorder_simple(c, NULL, "unset", track, pref, (char *)NULL); |
7788b7c7 RK |
429 | } |
430 | ||
431 | int disorder_unset_global(disorder_client *c, const char *pref) { | |
c12575c6 | 432 | return disorder_simple(c, NULL, "unset-global", pref, (char *)NULL); |
7788b7c7 RK |
433 | } |
434 | ||
435 | int disorder_userinfo(disorder_client *c, const char *username, const char *property, char **valuep) { | |
dab87ecc RK |
436 | char **v; |
437 | int nv, rc = disorder_simple_split(c, &v, &nv, 1, "userinfo", username, property, (char *)NULL); | |
c12575c6 RK |
438 | if(rc) |
439 | return rc; | |
c12575c6 | 440 | *valuep = v[0]; |
e721e6b9 RK |
441 | v[0] = NULL; |
442 | free_strings(nv, v); | |
c12575c6 | 443 | return 0; |
7788b7c7 RK |
444 | } |
445 | ||
3680ef53 | 446 | int disorder_users(disorder_client *c, char ***usersp, int *nusersp) { |
c12575c6 RK |
447 | int rc = disorder_simple(c, NULL, "users", (char *)NULL); |
448 | if(rc) | |
449 | return rc; | |
450 | if(readlist(c, usersp, nusersp)) | |
451 | return -1; | |
452 | return 0; | |
3680ef53 RK |
453 | } |
454 | ||
7788b7c7 | 455 | int disorder_version(disorder_client *c, char **versionp) { |
dab87ecc RK |
456 | char **v; |
457 | int nv, rc = disorder_simple_split(c, &v, &nv, 1, "version", (char *)NULL); | |
c12575c6 RK |
458 | if(rc) |
459 | return rc; | |
c12575c6 | 460 | *versionp = v[0]; |
e721e6b9 RK |
461 | v[0] = NULL; |
462 | free_strings(nv, v); | |
c12575c6 RK |
463 | return 0; |
464 | } | |
465 | ||
466 | int disorder_set_volume(disorder_client *c, long left, long right) { | |
bcb2af72 | 467 | return disorder_simple(c, NULL, "volume", disorder__integer, left, disorder__integer, right, (char *)NULL); |
c12575c6 RK |
468 | } |
469 | ||
470 | int disorder_get_volume(disorder_client *c, long *leftp, long *rightp) { | |
dab87ecc RK |
471 | char **v; |
472 | int nv, rc = disorder_simple_split(c, &v, &nv, 2, "volume", (char *)NULL); | |
c12575c6 RK |
473 | if(rc) |
474 | return rc; | |
c12575c6 RK |
475 | *leftp = atol(v[0]); |
476 | *rightp = atol(v[1]); | |
e721e6b9 | 477 | free_strings(nv, v); |
c12575c6 | 478 | return 0; |
7788b7c7 RK |
479 | } |
480 |