libmpdclient 2.22
connection.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2// Copyright The Music Player Daemon Project
3
10#ifndef MPD_CONNECTION_H
11#define MPD_CONNECTION_H
12
13#include "protocol.h"
14#include "error.h"
15#include "compiler.h"
16
17#include <stdbool.h>
18
19struct mpd_async;
20
65struct mpd_connection;
66
67#ifdef __cplusplus
68extern "C" {
69#endif
70
95mpd_malloc
96struct mpd_connection *
97mpd_connection_new(const char *host, unsigned port, unsigned timeout_ms);
98
112mpd_malloc
113struct mpd_connection *
114mpd_connection_new_async(struct mpd_async *async, const char *welcome);
115
121void mpd_connection_free(struct mpd_connection *connection);
122
129const struct mpd_settings *
131
147bool
149 bool keepalive);
150
164 unsigned timeout_ms);
165
188mpd_pure
189int
190mpd_connection_get_fd(const struct mpd_connection *connection);
191
201mpd_pure
202struct mpd_async *
204
209mpd_pure
210enum mpd_error
211mpd_connection_get_error(const struct mpd_connection *connection);
212
223mpd_pure
224const char *
226
232mpd_pure
235
244mpd_pure
245unsigned
247
255mpd_pure
256int
258
267bool
269
274mpd_pure
275const unsigned *
277
284mpd_pure
285int
287 unsigned major, unsigned minor,
288 unsigned patch);
289
290#ifdef __cplusplus
291}
292#endif
293
294#endif
enum mpd_server_error mpd_connection_get_server_error(const struct mpd_connection *connection)
const struct mpd_settings * mpd_connection_get_settings(const struct mpd_connection *connection)
const unsigned * mpd_connection_get_server_version(const struct mpd_connection *connection)
void mpd_connection_free(struct mpd_connection *connection)
const char * mpd_connection_get_error_message(const struct mpd_connection *connection)
struct mpd_connection * mpd_connection_new_async(struct mpd_async *async, const char *welcome)
void mpd_connection_set_timeout(struct mpd_connection *connection, unsigned timeout_ms)
int mpd_connection_cmp_server_version(const struct mpd_connection *connection, unsigned major, unsigned minor, unsigned patch)
bool mpd_connection_set_keepalive(struct mpd_connection *connection, bool keepalive)
int mpd_connection_get_fd(const struct mpd_connection *connection)
unsigned mpd_connection_get_server_error_location(const struct mpd_connection *connection)
int mpd_connection_get_system_error(const struct mpd_connection *connection)
struct mpd_connection * mpd_connection_new(const char *host, unsigned port, unsigned timeout_ms)
bool mpd_connection_clear_error(struct mpd_connection *connection)
struct mpd_async * mpd_connection_get_async(struct mpd_connection *connection)
enum mpd_error mpd_connection_get_error(const struct mpd_connection *connection)
MPD client library.
mpd_error
Definition error.h:14
MPD client library.
mpd_server_error
Definition protocol.h:14