ncmpc  0.29
Typedefs | Functions
gidle.h File Reference
#include <mpd/client.h>

Go to the source code of this file.

Typedefs

typedef void(* mpd_glib_callback_t) (enum mpd_error error, enum mpd_server_error server_error, const char *message, enum mpd_idle events, void *ctx)
 

Functions

struct mpd_glib_source * mpd_glib_new (struct mpd_connection *connection, mpd_glib_callback_t callback, void *callback_ctx)
 
void mpd_glib_free (struct mpd_glib_source *source)
 
bool mpd_glib_enter (struct mpd_glib_source *source)
 
bool mpd_glib_leave (struct mpd_glib_source *source)
 

Typedef Documentation

◆ mpd_glib_callback_t

typedef void(* mpd_glib_callback_t) (enum mpd_error error, enum mpd_server_error server_error, const char *message, enum mpd_idle events, void *ctx)

Function Documentation

◆ mpd_glib_new()

struct mpd_glib_source* mpd_glib_new ( struct mpd_connection *  connection,
mpd_glib_callback_t  callback,
void *  callback_ctx 
)

◆ mpd_glib_free()

void mpd_glib_free ( struct mpd_glib_source *  source)

◆ mpd_glib_enter()

bool mpd_glib_enter ( struct mpd_glib_source *  source)

Enters idle mode.

Returns
true if idle mode has been entered, false if not (e.g. blocked during the callback, or I/O error)

◆ mpd_glib_leave()

bool mpd_glib_leave ( struct mpd_glib_source *  source)

Leaves idle mode and invokes the callback if there were events.

Returns
true on success, false if this object was deleted by the callback