X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/e48c28bb4dcffdd4bf7df5beada0f129d47c4673..fdf98378d2d8c8550661f657d30ec5186ff642f1:/lib/client.c?ds=inline diff --git a/lib/client.c b/lib/client.c index fcb0dba..e5822e9 100644 --- a/lib/client.c +++ b/lib/client.c @@ -70,9 +70,9 @@ struct disorder_client { * @param verbose If nonzero, write extra junk to stderr * @return Pointer to new client * - * You must call disorder_connect() or disorder_connect_cookie() to - * connect it. Use disorder_close() to dispose of the client when - * finished with it. + * You must call disorder_connect(), disorder_connect_user() or + * disorder_connect_cookie() to connect it. Use disorder_close() to + * dispose of the client when finished with it. */ disorder_client *disorder_new(int verbose) { disorder_client *c = xmalloc(sizeof (struct disorder_client)); @@ -310,6 +310,21 @@ error: return -1; } +/** @brief Connect a client with a specified username and password + * @param c Client + * @param username Username to log in with + * @param password Password to log in with + * @return 0 on success, non-0 on error + */ +int disorder_connect_user(disorder_client *c, + const char *username, + const char *password) { + return disorder_connect_generic(c, + username, + password, + 0); +} + /** @brief Connect a client * @param c Client * @return 0 on success, non-0 on error @@ -391,12 +406,6 @@ int disorder_close(disorder_client *c) { return 0; } -int disorder_become(disorder_client *c, const char *user) { - if(disorder_simple(c, 0, "become", user, (char *)0)) return -1; - c->user = xstrdup(user); - return 0; -} - /** @brief Play a track * @param c Client * @param track Track to play (UTF-8)