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 | */ | |
23 | ||
24 | int disorder_adopt(disorder_client *c, const char *id) { | |
25 | return disorder_simple(c, 0, "adopt", id, (char *)0); | |
26 | } | |
27 | ||
28 | int disorder_adduser(disorder_client *c, const char *user, const char *password, const char *rights) { | |
29 | return disorder_simple(c, 0, "adduser", user, password, rights, (char *)0); | |
30 | } | |
31 | ||
3680ef53 RK |
32 | int disorder_allfiles(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) { |
33 | return disorder_simple_list(c, filesp, nfilesp, "allfiles", dir, re, (char *)0); | |
34 | } | |
35 | ||
7788b7c7 RK |
36 | int disorder_confirm(disorder_client *c, const char *confirmation) { |
37 | char *u; | |
38 | int rc; | |
eff6238f | 39 | if((rc = disorder_simple(c, &u, "confirm", confirmation, (char *)0))) |
7788b7c7 RK |
40 | return rc; |
41 | c->user = u; | |
42 | return 0; | |
43 | } | |
44 | ||
45 | int disorder_cookie(disorder_client *c, const char *cookie) { | |
46 | char *u; | |
47 | int rc; | |
eff6238f | 48 | if((rc = disorder_simple(c, &u, "cookie", cookie, (char *)0))) |
7788b7c7 RK |
49 | return rc; |
50 | c->user = u; | |
51 | return 0; | |
52 | } | |
53 | ||
54 | int disorder_deluser(disorder_client *c, const char *user) { | |
55 | return disorder_simple(c, 0, "deluser", user, (char *)0); | |
56 | } | |
57 | ||
3680ef53 RK |
58 | int disorder_dirs(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) { |
59 | return disorder_simple_list(c, filesp, nfilesp, "dirs", dir, re, (char *)0); | |
60 | } | |
61 | ||
7788b7c7 RK |
62 | int disorder_disable(disorder_client *c) { |
63 | return disorder_simple(c, 0, "disable", (char *)0); | |
64 | } | |
65 | ||
66 | int disorder_edituser(disorder_client *c, const char *username, const char *property, const char *value) { | |
67 | return disorder_simple(c, 0, "edituser", username, property, value, (char *)0); | |
68 | } | |
69 | ||
70 | int disorder_enable(disorder_client *c) { | |
71 | return disorder_simple(c, 0, "enable", (char *)0); | |
72 | } | |
73 | ||
74 | int disorder_enabled(disorder_client *c, int *enabledp) { | |
75 | char *v; | |
76 | int rc; | |
77 | if((rc = disorder_simple(c, &v, "enabled", (char *)0))) | |
78 | return rc; | |
79 | return boolean("enabled", v, enabledp); | |
80 | } | |
81 | ||
82 | int disorder_exists(disorder_client *c, const char *track, int *existsp) { | |
83 | char *v; | |
84 | int rc; | |
85 | if((rc = disorder_simple(c, &v, "exists", track, (char *)0))) | |
86 | return rc; | |
87 | return boolean("exists", v, existsp); | |
88 | } | |
89 | ||
3680ef53 RK |
90 | int disorder_files(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) { |
91 | return disorder_simple_list(c, filesp, nfilesp, "files", dir, re, (char *)0); | |
92 | } | |
93 | ||
7788b7c7 RK |
94 | int disorder_get(disorder_client *c, const char *track, const char *pref, char **valuep) { |
95 | return dequote(disorder_simple(c, valuep, "get", track, pref, (char *)0), valuep); | |
96 | } | |
97 | ||
98 | int disorder_get_global(disorder_client *c, const char *pref, char **valuep) { | |
99 | return dequote(disorder_simple(c, valuep, "get-global", pref, (char *)0), valuep); | |
100 | } | |
101 | ||
711a4497 RK |
102 | int disorder_length(disorder_client *c, const char *track, long *lengthp) { |
103 | char *v; | |
104 | int rc; | |
105 | ||
106 | if((rc = disorder_simple(c, &v, "length", track, (char *)0))) | |
107 | return rc; | |
108 | *lengthp = atol(v); | |
109 | xfree(v); | |
110 | return 0; | |
111 | } | |
112 | ||
7788b7c7 RK |
113 | int disorder_make_cookie(disorder_client *c, char **cookiep) { |
114 | return dequote(disorder_simple(c, cookiep, "make-cookie", (char *)0), cookiep); | |
115 | } | |
116 | ||
0bc1d67c RK |
117 | int disorder_move(disorder_client *c, const char *track, long delta) { |
118 | char buf_delta[16]; | |
119 | byte_snprintf(buf_delta, sizeof buf_delta, "%ld", delta); | |
120 | return disorder_simple(c, 0, "move", track, buf_delta, (char *)0); | |
121 | } | |
122 | ||
123 | int disorder_moveafter(disorder_client *c, const char *target, char **ids, int nids) { | |
124 | return disorder_simple(c, 0, "moveafter", target, disorder_list, ids, nids, (char *)0); | |
125 | } | |
126 | ||
ff75e16e RK |
127 | int disorder_new_tracks(disorder_client *c, long max, char ***tracksp, int *ntracksp) { |
128 | char buf_max[16]; | |
129 | byte_snprintf(buf_max, sizeof buf_max, "%ld", max); | |
130 | return disorder_simple_list(c, tracksp, ntracksp, "new", buf_max, (char *)0); | |
131 | } | |
132 | ||
7788b7c7 RK |
133 | int disorder_nop(disorder_client *c) { |
134 | return disorder_simple(c, 0, "nop", (char *)0); | |
135 | } | |
136 | ||
137 | int disorder_part(disorder_client *c, const char *track, const char *context, const char *part, char **partp) { | |
138 | return dequote(disorder_simple(c, partp, "part", track, context, part, (char *)0), partp); | |
139 | } | |
140 | ||
141 | int disorder_pause(disorder_client *c) { | |
142 | return disorder_simple(c, 0, "pause", (char *)0); | |
143 | } | |
144 | ||
00861dcb RK |
145 | int disorder_play(disorder_client *c, const char *track, char **idp) { |
146 | return dequote(disorder_simple(c, idp, "play", track, (char *)0), idp); | |
147 | } | |
148 | ||
0bc1d67c RK |
149 | int disorder_playafter(disorder_client *c, const char *target, char **tracks, int ntracks) { |
150 | return disorder_simple(c, 0, "playafter", target, disorder_list, tracks, ntracks, (char *)0); | |
151 | } | |
152 | ||
ec9c0462 RK |
153 | int disorder_playing(disorder_client *c, struct queue_entry **playingp) { |
154 | return onequeue(c, "playing", playingp); | |
155 | } | |
156 | ||
7788b7c7 RK |
157 | int disorder_playlist_delete(disorder_client *c, const char *playlist) { |
158 | return disorder_simple(c, 0, "playlist-delete", playlist, (char *)0); | |
159 | } | |
160 | ||
3680ef53 RK |
161 | int disorder_playlist_get(disorder_client *c, const char *playlist, char ***tracksp, int *ntracksp) { |
162 | return disorder_simple_list(c, tracksp, ntracksp, "playlist-get", playlist, (char *)0); | |
7788b7c7 RK |
163 | } |
164 | ||
165 | int disorder_playlist_get_share(disorder_client *c, const char *playlist, char **sharep) { | |
166 | return dequote(disorder_simple(c, sharep, "playlist-get-share", playlist, (char *)0), sharep); | |
167 | } | |
168 | ||
3680ef53 RK |
169 | int disorder_playlist_lock(disorder_client *c, const char *playlist) { |
170 | return disorder_simple(c, 0, "playlist-lock", playlist, (char *)0); | |
171 | } | |
172 | ||
08af2413 RK |
173 | int disorder_playlist_set(disorder_client *c, const char *playlist, char **tracks, int ntracks) { |
174 | return disorder_simple(c, 0, "playlist-set", playlist, disorder_body, tracks, ntracks, (char *)0); | |
175 | } | |
176 | ||
7788b7c7 RK |
177 | int disorder_playlist_set_share(disorder_client *c, const char *playlist, const char *share) { |
178 | return disorder_simple(c, 0, "playlist-set-share", playlist, share, (char *)0); | |
179 | } | |
180 | ||
181 | int disorder_playlist_unlock(disorder_client *c) { | |
182 | return disorder_simple(c, 0, "playlist-unlock", (char *)0); | |
183 | } | |
184 | ||
3680ef53 RK |
185 | int disorder_playlists(disorder_client *c, char ***playlistsp, int *nplaylistsp) { |
186 | return disorder_simple_list(c, playlistsp, nplaylistsp, "playlists", (char *)0); | |
187 | } | |
188 | ||
5dc19ffd RK |
189 | int disorder_prefs(disorder_client *c, const char *track, struct kvp **prefsp) { |
190 | return pairlist(c, prefsp, "prefs", track, (char *)0); | |
191 | } | |
192 | ||
08af2413 | 193 | int disorder_queue(disorder_client *c, struct queue_entry **queuep) { |
ec9c0462 | 194 | return somequeue(c, "queue", queuep); |
08af2413 RK |
195 | } |
196 | ||
7788b7c7 RK |
197 | int disorder_random_disable(disorder_client *c) { |
198 | return disorder_simple(c, 0, "random-disable", (char *)0); | |
199 | } | |
200 | ||
201 | int disorder_random_enable(disorder_client *c) { | |
202 | return disorder_simple(c, 0, "random-enable", (char *)0); | |
203 | } | |
204 | ||
205 | int disorder_random_enabled(disorder_client *c, int *enabledp) { | |
206 | char *v; | |
207 | int rc; | |
208 | if((rc = disorder_simple(c, &v, "random-enabled", (char *)0))) | |
209 | return rc; | |
210 | return boolean("random-enabled", v, enabledp); | |
211 | } | |
212 | ||
08af2413 | 213 | int disorder_recent(disorder_client *c, struct queue_entry **recentp) { |
ec9c0462 | 214 | return somequeue(c, "recent", recentp); |
08af2413 RK |
215 | } |
216 | ||
7788b7c7 RK |
217 | int disorder_reconfigure(disorder_client *c) { |
218 | return disorder_simple(c, 0, "reconfigure", (char *)0); | |
219 | } | |
220 | ||
221 | int disorder_register(disorder_client *c, const char *username, const char *password, const char *email, char **confirmationp) { | |
222 | return dequote(disorder_simple(c, confirmationp, "register", username, password, email, (char *)0), confirmationp); | |
223 | } | |
224 | ||
225 | int disorder_reminder(disorder_client *c, const char *username) { | |
226 | return disorder_simple(c, 0, "reminder", username, (char *)0); | |
227 | } | |
228 | ||
229 | int disorder_remove(disorder_client *c, const char *id) { | |
230 | return disorder_simple(c, 0, "remove", id, (char *)0); | |
231 | } | |
232 | ||
233 | int disorder_rescan(disorder_client *c) { | |
234 | return disorder_simple(c, 0, "rescan", (char *)0); | |
235 | } | |
236 | ||
237 | int disorder_resolve(disorder_client *c, const char *track, char **resolvedp) { | |
238 | return dequote(disorder_simple(c, resolvedp, "resolve", track, (char *)0), resolvedp); | |
239 | } | |
240 | ||
241 | int disorder_resume(disorder_client *c) { | |
242 | return disorder_simple(c, 0, "resume", (char *)0); | |
243 | } | |
244 | ||
245 | int disorder_revoke(disorder_client *c) { | |
246 | return disorder_simple(c, 0, "revoke", (char *)0); | |
247 | } | |
248 | ||
249 | int disorder_scratch(disorder_client *c, const char *id) { | |
250 | return disorder_simple(c, 0, "scratch", id, (char *)0); | |
251 | } | |
252 | ||
253 | int disorder_schedule_del(disorder_client *c, const char *event) { | |
254 | return disorder_simple(c, 0, "schedule-del", event, (char *)0); | |
255 | } | |
256 | ||
5dc19ffd RK |
257 | int disorder_schedule_get(disorder_client *c, const char *id, struct kvp **actiondatap) { |
258 | return pairlist(c, actiondatap, "schedule-get", id, (char *)0); | |
259 | } | |
260 | ||
3680ef53 RK |
261 | int disorder_schedule_list(disorder_client *c, char ***idsp, int *nidsp) { |
262 | return disorder_simple_list(c, idsp, nidsp, "schedule-list", (char *)0); | |
263 | } | |
264 | ||
265 | int disorder_search(disorder_client *c, const char *terms, char ***tracksp, int *ntracksp) { | |
266 | return disorder_simple_list(c, tracksp, ntracksp, "search", terms, (char *)0); | |
267 | } | |
268 | ||
7788b7c7 RK |
269 | int disorder_set(disorder_client *c, const char *track, const char *pref, const char *value) { |
270 | return disorder_simple(c, 0, "set", track, pref, value, (char *)0); | |
271 | } | |
272 | ||
273 | int disorder_set_global(disorder_client *c, const char *pref, const char *value) { | |
274 | return disorder_simple(c, 0, "set-global", pref, value, (char *)0); | |
275 | } | |
276 | ||
eea34c08 RK |
277 | int disorder_shutdown(disorder_client *c) { |
278 | return disorder_simple(c, 0, "shutdown", (char *)0); | |
279 | } | |
280 | ||
3680ef53 RK |
281 | int disorder_stats(disorder_client *c, char ***statsp, int *nstatsp) { |
282 | return disorder_simple_list(c, statsp, nstatsp, "stats", (char *)0); | |
283 | } | |
284 | ||
285 | int disorder_tags(disorder_client *c, char ***tagsp, int *ntagsp) { | |
286 | return disorder_simple_list(c, tagsp, ntagsp, "tags", (char *)0); | |
287 | } | |
288 | ||
7788b7c7 RK |
289 | int disorder_unset(disorder_client *c, const char *track, const char *pref) { |
290 | return disorder_simple(c, 0, "unset", track, pref, (char *)0); | |
291 | } | |
292 | ||
293 | int disorder_unset_global(disorder_client *c, const char *pref) { | |
294 | return disorder_simple(c, 0, "unset-global", pref, (char *)0); | |
295 | } | |
296 | ||
297 | int disorder_userinfo(disorder_client *c, const char *username, const char *property, char **valuep) { | |
298 | return dequote(disorder_simple(c, valuep, "userinfo", username, property, (char *)0), valuep); | |
299 | } | |
300 | ||
3680ef53 RK |
301 | int disorder_users(disorder_client *c, char ***usersp, int *nusersp) { |
302 | return disorder_simple_list(c, usersp, nusersp, "users", (char *)0); | |
303 | } | |
304 | ||
7788b7c7 RK |
305 | int disorder_version(disorder_client *c, char **versionp) { |
306 | return dequote(disorder_simple(c, versionp, "version", (char *)0), versionp); | |
307 | } | |
308 |