libmpdclient  2.17
Functions
mount.h File Reference

MPD client library. More...

Go to the source code of this file.

Functions

mpd_malloc struct mpd_mountmpd_mount_begin (const struct mpd_pair *pair)
 
bool mpd_mount_feed (struct mpd_mount *mnt, const struct mpd_pair *pair)
 
void mpd_mount_free (struct mpd_mount *mnt)
 
mpd_pure const char * mpd_mount_get_uri (const struct mpd_mount *mnt)
 
mpd_pure const char * mpd_mount_get_storage (const struct mpd_mount *mnt)
 
bool mpd_send_list_mounts (struct mpd_connection *connection)
 
mpd_malloc struct mpd_mountmpd_recv_mount (struct mpd_connection *connection)
 
bool mpd_send_mount (struct mpd_connection *connection, const char *uri, const char *storage)
 
bool mpd_run_mount (struct mpd_connection *connection, const char *uri, const char *storage)
 
bool mpd_send_unmount (struct mpd_connection *connection, const char *uri)
 
bool mpd_run_unmount (struct mpd_connection *connection, const char *uri)
 

Detailed Description

MPD client library.

Do not include this header directly. Use mpd/client.h instead.

Definition in file mount.h.

Function Documentation

◆ mpd_mount_begin()

mpd_malloc struct mpd_mount* mpd_mount_begin ( const struct mpd_pair pair)

Begins parsing a new mpd_mount.

Parameters
pairthe first pair in this mount point
Returns
the new mpd_mount object, or NULL on error (out of memory, or wrong pair name)
Since
libmpdclient 2.16

◆ mpd_mount_feed()

bool mpd_mount_feed ( struct mpd_mount mnt,
const struct mpd_pair pair 
)

Parses the pair, adding its information to the specified mpd_mount object.

Returns
true if the pair was parsed and added to the mount (or if the pair was not understood and ignored), false if this pair is the beginning of the next mount
Since
libmpdclient 2.16

◆ mpd_mount_free()

void mpd_mount_free ( struct mpd_mount mnt)

Frees a mpd_mount object returned from mpd_recv_mount().

Since
libmpdclient 2.16

◆ mpd_mount_get_uri()

mpd_pure const char* mpd_mount_get_uri ( const struct mpd_mount mnt)
Returns
the mount point URI of the specified mpd_mount object
Since
libmpdclient 2.16

◆ mpd_mount_get_storage()

mpd_pure const char* mpd_mount_get_storage ( const struct mpd_mount mnt)
Returns
the mounted storage URI of the specified mpd_mount object; may be NULL if MPD did not reveal it
Since
libmpdclient 2.16

◆ mpd_send_list_mounts()

bool mpd_send_list_mounts ( struct mpd_connection connection)

Sends the "listmounts" command to MPD. Call mpd_recv_mount() to read the response.

Parameters
connectiona valid and connected mpd_connection.
Returns
true on success
Since
libmpdclient 2.16, MPD 0.19

◆ mpd_recv_mount()

mpd_malloc struct mpd_mount* mpd_recv_mount ( struct mpd_connection connection)

Reads the next mpd_mount from the MPD response. Free the return value with mpd_mount_free().

Returns
a mpd_mount object on success, NULL on error or end-of-response
Since
libmpdclient 2.16, MPD 0.19

◆ mpd_send_mount()

bool mpd_send_mount ( struct mpd_connection connection,
const char *  uri,
const char *  storage 
)

Sends the "mount" command to MPD.

Parameters
connectiona valid and connected mpd_connection.
urithe mount point URI
storagethe mounted storage URI
Returns
true on success
Since
libmpdclient 2.16, MPD 0.19

◆ mpd_run_mount()

bool mpd_run_mount ( struct mpd_connection connection,
const char *  uri,
const char *  storage 
)

Shortcut for mpd_send_mount() and mpd_response_finish().

Parameters
connectionA valid and connected mpd_connection.
urithe mount point URI
storagethe mounted storage URI
Returns
true on success
Since
libmpdclient 2.16, MPD 0.19

◆ mpd_send_unmount()

bool mpd_send_unmount ( struct mpd_connection connection,
const char *  uri 
)

Sends the "unmount" command to MPD.

Parameters
connectiona valid and connected mpd_connection.
urithe mount point URI
Returns
true on success
Since
libmpdclient 2.16, MPD 0.19

◆ mpd_run_unmount()

bool mpd_run_unmount ( struct mpd_connection connection,
const char *  uri 
)

Shortcut for mpd_send_unmount() and mpd_response_finish().

Parameters
connectionA valid and connected mpd_connection.
urithe mount point URI
Returns
true on success
Since
libmpdclient 2.16, MPD 0.19