mount.h File Reference

MPD client library. More...

`#include "compiler.h"`
`#include <stdbool.h>`

Go to the source code of this file.

## Functions

struct mpd_mount * | mpd_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 *mount)
const char * | mpd_mount_get_uri (const struct mpd_mount *mnt)
const char * | mpd_mount_get_storage (const struct mpd_mount *mnt)
bool | mpd_send_list_mounts (struct mpd_connection *connection)
struct mpd_mount * | mpd_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()

struct mpd_mount* mpd_mount_begin | ( | const struct mpd_pair * | pair | ) |

Begins parsing a new mpd_mount.

Parameters

  pair | the 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 * | mount | ) |

Frees a mpd_mount object returned from mpd_recv_mount() or mpd_mount_begin().

Since
  libmpdclient 2.16

## mpd_mount_get_uri()

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()

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

  connection | a valid and connected mpd_connection.

Returns
  true on success

Since
  libmpdclient 2.16, MPD 0.19

## mpd_recv_mount()

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

  connection | a valid and connected mpd_connection.
  uri | the mount point URI
  storage | the 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

  connection | A valid and connected mpd_connection.
  uri | the mount point URI
  storage | the 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

  connection | a valid and connected mpd_connection.
  uri | the 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

  connection | A valid and connected mpd_connection.
  uri | the mount point URI

Returns
  true on success

Since
  libmpdclient 2.16, MPD 0.19