async.h
Go to the documentation of this file.
// SPDX-License-Identifier: BSD-2-Clause
// Copyright The Music Player Daemon Project
#ifndef MPD_ASYNC_H
#define MPD_ASYNC_H
#include "error.h"
#include "compiler.h"
#include <stdbool.h>
#include <stdarg.h>
#include <stddef.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);
bool
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);
size_t
mpd_async_recv_raw(struct mpd_async *async, void *dest, size_t length);
#ifdef __cplusplus
}
#endif
#endif
mpd_async_get_error_message
const char * mpd_async_get_error_message(const struct mpd_async *async)
mpd_async_io
bool mpd_async_io(struct mpd_async *async, enum mpd_async_event events)
mpd_async_get_fd
int mpd_async_get_fd(const struct mpd_async *async)
mpd_async_free
void mpd_async_free(struct mpd_async *async)
mpd_async_get_system_error
int mpd_async_get_system_error(const struct mpd_async *async)
mpd_async_get_error
enum mpd_error mpd_async_get_error(const struct mpd_async *async)
mpd_async_send_command
mpd_sentinel bool mpd_async_send_command(struct mpd_async *async, const char *command,...)
mpd_async_recv_line
char * mpd_async_recv_line(struct mpd_async *async)
mpd_async_send_command_v
bool mpd_async_send_command_v(struct mpd_async *async, const char *command, va_list args)
mpd_async_new
struct mpd_async * mpd_async_new(int fd)
mpd_async_events
enum mpd_async_event mpd_async_events(const struct mpd_async *async)
mpd_async_set_keepalive
bool mpd_async_set_keepalive(struct mpd_async *async, bool keepalive)
mpd_async_event
mpd_async_event
Definition async.h:29
MPD_ASYNC_EVENT_ERROR
@ MPD_ASYNC_EVENT_ERROR
Definition async.h:40
MPD_ASYNC_EVENT_READ
@ MPD_ASYNC_EVENT_READ
Definition async.h:31
MPD_ASYNC_EVENT_HUP
@ MPD_ASYNC_EVENT_HUP
Definition async.h:37
MPD_ASYNC_EVENT_WRITE
@ MPD_ASYNC_EVENT_WRITE
Definition async.h:34
mpd_async_recv_raw
size_t mpd_async_recv_raw(struct mpd_async *async, void *dest, size_t length)
error.h
MPD client library.
mpd_error
mpd_error
Definition error.h:14
mpd_async