libmpdclient  2.23
async.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: BSD-2-Clause
2 // Copyright The Music Player Daemon Project
3 
16 #ifndef MPD_ASYNC_H
17 #define MPD_ASYNC_H
18 
19 #include "error.h"
20 #include "compiler.h"
21 
22 #include <stdbool.h>
23 #include <stdarg.h>
24 #include <stddef.h>
25 
32 
35 
38 
41 };
42 
49 struct mpd_async;
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
62 mpd_malloc
63 struct mpd_async *
64 mpd_async_new(int fd);
65 
69 void
70 mpd_async_free(struct mpd_async *async);
71 
76 mpd_pure
77 enum mpd_error
78 mpd_async_get_error(const struct mpd_async *async);
79 
91 mpd_pure
92 const char *
93 mpd_async_get_error_message(const struct mpd_async *async);
94 
102 mpd_pure
103 int
104 mpd_async_get_system_error(const struct mpd_async *async);
105 
112 mpd_pure
113 int
114 mpd_async_get_fd(const struct mpd_async *async);
115 
131 bool
132 mpd_async_set_keepalive(struct mpd_async *async,
133  bool keepalive);
134 
138 mpd_pure
139 enum mpd_async_event
140 mpd_async_events(const struct mpd_async *async);
141 
149 bool
150 mpd_async_io(struct mpd_async *async, enum mpd_async_event events);
151 
162 bool
163 mpd_async_send_command_v(struct mpd_async *async, const char *command,
164  va_list args);
165 
175 mpd_sentinel
176 bool
177 mpd_async_send_command(struct mpd_async *async, const char *command, ...);
178 
189 mpd_malloc
190 char *
191 mpd_async_recv_line(struct mpd_async *async);
192 
205 size_t
206 mpd_async_recv_raw(struct mpd_async *async, void *dest, size_t length);
207 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #endif
size_t mpd_async_recv_raw(struct mpd_async *async, void *dest, size_t length)
struct mpd_async * mpd_async_new(int fd)
mpd_error
Definition: error.h:14
bool mpd_async_io(struct mpd_async *async, enum mpd_async_event events)
mpd_async_event
Definition: async.h:29
mpd_sentinel bool mpd_async_send_command(struct mpd_async *async, const char *command,...)
MPD client library.
bool mpd_async_send_command_v(struct mpd_async *async, const char *command, va_list args)
void mpd_async_free(struct mpd_async *async)
enum mpd_error mpd_async_get_error(const struct mpd_async *async)
bool mpd_async_set_keepalive(struct mpd_async *async, bool keepalive)
char * mpd_async_recv_line(struct mpd_async *async)
int mpd_async_get_system_error(const struct mpd_async *async)
const char * mpd_async_get_error_message(const struct mpd_async *async)
enum mpd_async_event mpd_async_events(const struct mpd_async *async)
int mpd_async_get_fd(const struct mpd_async *async)