MPD

- Main Page
- Data Structures
- Files

- File List
- Globals

Data Structures | Defines | Functions

# src/directory.h File Reference

`#include "check.h"`
`#include "dirvec.h"`
`#include "songvec.h"`
`#include "playlist_vector.h"`
`#include <stdbool.h>`
`#include <sys/types.h>`

Go to the source code of this file.

## Data Structures
struct | directory
## Defines
#define | DIRECTORY_DIR "directory: "
#define | DEVICE_INARCHIVE (dev_t)(-1)
#define | DEVICE_CONTAINER (dev_t)(-2)
## Functions
static bool | isRootDirectory (const char *name)
struct directory * | directory_new (const char *dirname, struct directory *parent)
void | directory_free (struct directory *directory)
static bool | directory_is_empty (const struct directory *directory)
static const char * | directory_get_path (const struct directory *directory)
static bool | directory_is_root (const struct directory *directory)
| Is this the root directory of the music database?
const char * | directory_get_name (const struct directory *directory)
| Returns the base name of the directory.
static struct directory * | directory_get_child (const struct directory *directory, const char *name)
static struct directory * | directory_new_child (struct directory *directory, const char *name)
void | directory_prune_empty (struct directory *directory)
struct directory * | directory_lookup_directory (struct directory *directory, const char *uri)
| Looks up a directory by its relative URI.
struct song * | directory_lookup_song (struct directory *directory, const char *uri)
| Looks up a song by its relative URI.
void | directory_sort (struct directory *directory)
int | directory_walk (struct directory *directory, int(*forEachSong)(struct song *, void *), int(*forEachDir)(struct directory *, void *), void *data)

## Define Documentation

#define DEVICE_CONTAINER (dev_t)(-2)

Definition at line 34 of file directory.h.

#define DEVICE_INARCHIVE (dev_t)(-1)

Definition at line 33 of file directory.h.

#define DIRECTORY_DIR "directory: "

Definition at line 31 of file directory.h.

## Function Documentation

void directory_free | ( | struct directory * | directory | ) |

static struct directory* directory_get_child | ( | const struct directory * | directory,
|  | const char * | name
| ) |  | `[static, read]`

Definition at line 90 of file directory.h.

const char* directory_get_name | ( | const struct directory * | directory | ) |

Returns the base name of the directory.

static const char* directory_get_path | ( | const struct directory * | directory | ) | `[inline, static]`

Definition at line 69 of file directory.h.

static bool directory_is_empty | ( | const struct directory * | directory | ) | `[inline, static]`

Definition at line 63 of file directory.h.

static bool directory_is_root | ( | const struct directory * | directory | ) | `[inline, static]`

Is this the root directory of the music database?

Definition at line 78 of file directory.h.

struct directory* directory_lookup_directory | ( | struct directory * | directory,
|  | const char * | uri
| ) |  | `[read]`

Looks up a directory by its relative URI.

Parameters:

  directory | the parent (or grandparent, ...) directory
  uri | the relative URI

Returns:
  the directory, or NULL if none was found

struct song* directory_lookup_song | ( | struct directory * | directory,
|  | const char * | uri
| ) |  | `[read]`

Looks up a song by its relative URI.

Parameters:

  directory | the parent (or grandparent, ...) directory
  uri | the relative URI

Returns:
  the song, or NULL if none was found

struct directory* directory_new | ( | const char * | dirname,
|  | struct directory * | parent
| ) |  | `[read]`

static struct directory* directory_new_child | ( | struct directory * | directory,
|  | const char * | name
| ) |  | `[static, read]`

Definition at line 96 of file directory.h.

void directory_prune_empty | ( | struct directory * | directory | ) |

void directory_sort | ( | struct directory * | directory | ) |

int directory_walk | ( | struct directory * | directory,
|  | int(*)(struct song *, void *) | forEachSong,
|  | int(*)(struct directory *, void *) | forEachDir,
|  | void * | data
| ) |  |

static bool isRootDirectory | ( | const char * | name | ) | `[inline, static]`

Definition at line 51 of file directory.h.