chiark / gitweb /
play command
[disorder] / lib / client-stubs.c
CommitLineData
7788b7c7
RK
1/*
2 * This file is part of DisOrder.
3 * Copyright (C) 2010 Richard Kettlewell
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19int disorder_adopt(disorder_client *c, const char *id) {
20 return disorder_simple(c, 0, "adopt", id, (char *)0);
21}
22
23int disorder_adduser(disorder_client *c, const char *user, const char *password, const char *rights) {
24 return disorder_simple(c, 0, "adduser", user, password, rights, (char *)0);
25}
26
3680ef53
RK
27int disorder_allfiles(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
28 return disorder_simple_list(c, filesp, nfilesp, "allfiles", dir, re, (char *)0);
29}
30
7788b7c7
RK
31int disorder_confirm(disorder_client *c, const char *confirmation) {
32 char *u;
33 int rc;
34 if((rc = disorder_simple(c, &u, "confirm", confirmation )))
35 return rc;
36 c->user = u;
37 return 0;
38}
39
40int disorder_cookie(disorder_client *c, const char *cookie) {
41 char *u;
42 int rc;
43 if((rc = disorder_simple(c, &u, "cookie", cookie )))
44 return rc;
45 c->user = u;
46 return 0;
47}
48
49int disorder_deluser(disorder_client *c, const char *user) {
50 return disorder_simple(c, 0, "deluser", user, (char *)0);
51}
52
3680ef53
RK
53int disorder_dirs(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
54 return disorder_simple_list(c, filesp, nfilesp, "dirs", dir, re, (char *)0);
55}
56
7788b7c7
RK
57int disorder_disable(disorder_client *c) {
58 return disorder_simple(c, 0, "disable", (char *)0);
59}
60
61int disorder_edituser(disorder_client *c, const char *username, const char *property, const char *value) {
62 return disorder_simple(c, 0, "edituser", username, property, value, (char *)0);
63}
64
65int disorder_enable(disorder_client *c) {
66 return disorder_simple(c, 0, "enable", (char *)0);
67}
68
69int disorder_enabled(disorder_client *c, int *enabledp) {
70 char *v;
71 int rc;
72 if((rc = disorder_simple(c, &v, "enabled", (char *)0)))
73 return rc;
74 return boolean("enabled", v, enabledp);
75}
76
77int disorder_exists(disorder_client *c, const char *track, int *existsp) {
78 char *v;
79 int rc;
80 if((rc = disorder_simple(c, &v, "exists", track, (char *)0)))
81 return rc;
82 return boolean("exists", v, existsp);
83}
84
3680ef53
RK
85int disorder_files(disorder_client *c, const char *dir, const char *re, char ***filesp, int *nfilesp) {
86 return disorder_simple_list(c, filesp, nfilesp, "files", dir, re, (char *)0);
87}
88
7788b7c7
RK
89int disorder_get(disorder_client *c, const char *track, const char *pref, char **valuep) {
90 return dequote(disorder_simple(c, valuep, "get", track, pref, (char *)0), valuep);
91}
92
93int disorder_get_global(disorder_client *c, const char *pref, char **valuep) {
94 return dequote(disorder_simple(c, valuep, "get-global", pref, (char *)0), valuep);
95}
96
97int disorder_make_cookie(disorder_client *c, char **cookiep) {
98 return dequote(disorder_simple(c, cookiep, "make-cookie", (char *)0), cookiep);
99}
100
101int disorder_nop(disorder_client *c) {
102 return disorder_simple(c, 0, "nop", (char *)0);
103}
104
105int disorder_part(disorder_client *c, const char *track, const char *context, const char *part, char **partp) {
106 return dequote(disorder_simple(c, partp, "part", track, context, part, (char *)0), partp);
107}
108
109int disorder_pause(disorder_client *c) {
110 return disorder_simple(c, 0, "pause", (char *)0);
111}
112
00861dcb
RK
113int disorder_play(disorder_client *c, const char *track, char **idp) {
114 return dequote(disorder_simple(c, idp, "play", track, (char *)0), idp);
115}
116
7788b7c7
RK
117int disorder_playlist_delete(disorder_client *c, const char *playlist) {
118 return disorder_simple(c, 0, "playlist-delete", playlist, (char *)0);
119}
120
3680ef53
RK
121int disorder_playlist_get(disorder_client *c, const char *playlist, char ***tracksp, int *ntracksp) {
122 return disorder_simple_list(c, tracksp, ntracksp, "playlist-get", playlist, (char *)0);
7788b7c7
RK
123}
124
125int disorder_playlist_get_share(disorder_client *c, const char *playlist, char **sharep) {
126 return dequote(disorder_simple(c, sharep, "playlist-get-share", playlist, (char *)0), sharep);
127}
128
3680ef53
RK
129int disorder_playlist_lock(disorder_client *c, const char *playlist) {
130 return disorder_simple(c, 0, "playlist-lock", playlist, (char *)0);
131}
132
7788b7c7
RK
133int disorder_playlist_set_share(disorder_client *c, const char *playlist, const char *share) {
134 return disorder_simple(c, 0, "playlist-set-share", playlist, share, (char *)0);
135}
136
137int disorder_playlist_unlock(disorder_client *c) {
138 return disorder_simple(c, 0, "playlist-unlock", (char *)0);
139}
140
3680ef53
RK
141int disorder_playlists(disorder_client *c, char ***playlistsp, int *nplaylistsp) {
142 return disorder_simple_list(c, playlistsp, nplaylistsp, "playlists", (char *)0);
143}
144
7788b7c7
RK
145int disorder_random_disable(disorder_client *c) {
146 return disorder_simple(c, 0, "random-disable", (char *)0);
147}
148
149int disorder_random_enable(disorder_client *c) {
150 return disorder_simple(c, 0, "random-enable", (char *)0);
151}
152
153int disorder_random_enabled(disorder_client *c, int *enabledp) {
154 char *v;
155 int rc;
156 if((rc = disorder_simple(c, &v, "random-enabled", (char *)0)))
157 return rc;
158 return boolean("random-enabled", v, enabledp);
159}
160
161int disorder_reconfigure(disorder_client *c) {
162 return disorder_simple(c, 0, "reconfigure", (char *)0);
163}
164
165int disorder_register(disorder_client *c, const char *username, const char *password, const char *email, char **confirmationp) {
166 return dequote(disorder_simple(c, confirmationp, "register", username, password, email, (char *)0), confirmationp);
167}
168
169int disorder_reminder(disorder_client *c, const char *username) {
170 return disorder_simple(c, 0, "reminder", username, (char *)0);
171}
172
173int disorder_remove(disorder_client *c, const char *id) {
174 return disorder_simple(c, 0, "remove", id, (char *)0);
175}
176
177int disorder_rescan(disorder_client *c) {
178 return disorder_simple(c, 0, "rescan", (char *)0);
179}
180
181int disorder_resolve(disorder_client *c, const char *track, char **resolvedp) {
182 return dequote(disorder_simple(c, resolvedp, "resolve", track, (char *)0), resolvedp);
183}
184
185int disorder_resume(disorder_client *c) {
186 return disorder_simple(c, 0, "resume", (char *)0);
187}
188
189int disorder_revoke(disorder_client *c) {
190 return disorder_simple(c, 0, "revoke", (char *)0);
191}
192
193int disorder_scratch(disorder_client *c, const char *id) {
194 return disorder_simple(c, 0, "scratch", id, (char *)0);
195}
196
197int disorder_schedule_del(disorder_client *c, const char *event) {
198 return disorder_simple(c, 0, "schedule-del", event, (char *)0);
199}
200
3680ef53
RK
201int disorder_schedule_list(disorder_client *c, char ***idsp, int *nidsp) {
202 return disorder_simple_list(c, idsp, nidsp, "schedule-list", (char *)0);
203}
204
205int disorder_search(disorder_client *c, const char *terms, char ***tracksp, int *ntracksp) {
206 return disorder_simple_list(c, tracksp, ntracksp, "search", terms, (char *)0);
207}
208
7788b7c7
RK
209int disorder_set(disorder_client *c, const char *track, const char *pref, const char *value) {
210 return disorder_simple(c, 0, "set", track, pref, value, (char *)0);
211}
212
213int disorder_set_global(disorder_client *c, const char *pref, const char *value) {
214 return disorder_simple(c, 0, "set-global", pref, value, (char *)0);
215}
216
eea34c08
RK
217int disorder_shutdown(disorder_client *c) {
218 return disorder_simple(c, 0, "shutdown", (char *)0);
219}
220
3680ef53
RK
221int disorder_stats(disorder_client *c, char ***statsp, int *nstatsp) {
222 return disorder_simple_list(c, statsp, nstatsp, "stats", (char *)0);
223}
224
225int disorder_tags(disorder_client *c, char ***tagsp, int *ntagsp) {
226 return disorder_simple_list(c, tagsp, ntagsp, "tags", (char *)0);
227}
228
7788b7c7
RK
229int disorder_unset(disorder_client *c, const char *track, const char *pref) {
230 return disorder_simple(c, 0, "unset", track, pref, (char *)0);
231}
232
233int disorder_unset_global(disorder_client *c, const char *pref) {
234 return disorder_simple(c, 0, "unset-global", pref, (char *)0);
235}
236
237int disorder_userinfo(disorder_client *c, const char *username, const char *property, char **valuep) {
238 return dequote(disorder_simple(c, valuep, "userinfo", username, property, (char *)0), valuep);
239}
240
3680ef53
RK
241int disorder_users(disorder_client *c, char ***usersp, int *nusersp) {
242 return disorder_simple_list(c, usersp, nusersp, "users", (char *)0);
243}
244
7788b7c7
RK
245int disorder_version(disorder_client *c, char **versionp) {
246 return dequote(disorder_simple(c, versionp, "version", (char *)0), versionp);
247}
248