async.h
Go to the documentation of this file.
/* libmpdclient
(c) 2003-2015 The Music Player Daemon Project
This project's homepage is: http://www.musicpd.org
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MPD_ASYNC_H
#define MPD_ASYNC_H
#include <mpd/error.h>
#include <mpd/compiler.h>
#include <stdbool.h>
#include <stdarg.h>
enum mpd_async_event {
MPD_ASYNC_EVENT_READ = 1,
MPD_ASYNC_EVENT_WRITE = 2,
MPD_ASYNC_EVENT_HUP = 4,
MPD_ASYNC_EVENT_ERROR = 8,
};
struct mpd_async;
#ifdef __cplusplus
extern "C" {
#endif
mpd_malloc
struct mpd_async *
mpd_async_new(int fd);
void
mpd_async_free(struct mpd_async *async);
mpd_pure
enum mpd_error
mpd_async_get_error(const struct mpd_async *async);
mpd_pure
const char *
mpd_async_get_error_message(const struct mpd_async *async);
mpd_pure
int
mpd_async_get_system_error(const struct mpd_async *async);
mpd_pure
int
mpd_async_get_fd(const struct mpd_async *async);
void mpd_async_set_keepalive(struct mpd_async *async,
bool keepalive);
mpd_pure
enum mpd_async_event
mpd_async_events(const struct mpd_async *async);
bool
mpd_async_io(struct mpd_async *async, enum mpd_async_event events);
bool
mpd_async_send_command_v(struct mpd_async *async, const char *command,
va_list args);
mpd_sentinel
bool
mpd_async_send_command(struct mpd_async *async, const char *command, ...);
mpd_malloc
char *
mpd_async_recv_line(struct mpd_async *async);
#ifdef __cplusplus
}
#endif
#endif
MPD_ASYNC_EVENT_WRITE
Definition: async.h:58
MPD_ASYNC_EVENT_READ
Definition: async.h:55
MPD_ASYNC_EVENT_ERROR
Definition: async.h:64
mpd_error
mpd_error
Definition: error.h:39
mpd_async_io
bool mpd_async_io(struct mpd_async *async, enum mpd_async_event events)
mpd_async_get_error_message
mpd_pure const char * mpd_async_get_error_message(const struct mpd_async *async)
mpd_async_event
mpd_async_event
Definition: async.h:53
mpd_async_get_fd
mpd_pure int mpd_async_get_fd(const struct mpd_async *async)
mpd_async_send_command
mpd_sentinel bool mpd_async_send_command(struct mpd_async *async, const char *command,...)
error.h
MPD client library.
mpd_async_send_command_v
bool mpd_async_send_command_v(struct mpd_async *async, const char *command, va_list args)
compiler.h
Compiler specific definitions.
mpd_async_free
void mpd_async_free(struct mpd_async *async)
MPD_ASYNC_EVENT_HUP
Definition: async.h:61
mpd_async_events
mpd_pure enum mpd_async_event mpd_async_events(const struct mpd_async *async)
mpd_async_set_keepalive
void mpd_async_set_keepalive(struct mpd_async *async, bool keepalive)
mpd_async_get_system_error
mpd_pure int mpd_async_get_system_error(const struct mpd_async *async)
mpd_async_recv_line
mpd_malloc char * mpd_async_recv_line(struct mpd_async *async)
mpd_async_new
mpd_malloc struct mpd_async * mpd_async_new(int fd)
mpd_async_get_error
mpd_pure enum mpd_error mpd_async_get_error(const struct mpd_async *async)
mpd_async