src/database.h File Reference

#include "gcc.h"
#include <glib.h>
#include <sys/time.h>
#include <stdbool.h>

Go to the source code of this file.

Functions

bool db_init (const struct config_param *path, GError **error_r)
 Initialize the database library.
void db_finish (void)
G_GNUC_PURE struct directorydb_get_root (void)
 Returns the root directory object.
 gcc_nonnull (1) G_GNUC_PURE struct directory *db_get_directory(const char *name)
 Caller must lock the db_mutex.
 gcc_nonnull (1, 2) bool db_visit(const struct db_selection *selection
 Reads data from the stream into the caller-supplied buffer.
bool db_save (GError **error_r)
bool db_load (GError **error)
G_GNUC_PURE time_t db_get_mtime (void)
static G_GNUC_PURE bool db_exists (void)
 Returns true if there is a valid database file on the disk.

Variables

struct db_visitorvisitor
struct db_visitor void * ctx
struct db_visitor void GError ** error_r

Function Documentation

static G_GNUC_PURE bool db_exists ( void   )  [inline, static]

Returns true if there is a valid database file on the disk.

Definition at line 94 of file database.h.

void db_finish ( void   ) 
G_GNUC_PURE time_t db_get_mtime ( void   ) 
G_GNUC_PURE struct directory* db_get_root ( void   )  [read]

Returns the root directory object.

Returns NULL if there is no configured music directory.

bool db_init ( const struct config_param path,
GError **  error_r 
)

Initialize the database library.

Parameters:
path the absolute path of the database file
bool db_load ( GError **  error  ) 
bool db_save ( GError **  error_r  ) 
gcc_nonnull ( ,
 
) const

Reads data from the stream into the caller-supplied buffer.

Wrapper for input_stream_tag() which locks and unlocks the mutex; the caller must not be holding it already.

Returns 0 on error or eof (check with input_stream_eof()).

The caller must lock the mutex.

Parameters:
is the input_stream object
ptr the buffer to read into
size the maximum number of bytes to read
Returns:
the number of bytes read
gcc_nonnull (  )  const

Caller must lock the db_mutex.

Duplicate the struct locate_item_list object and convert all needles with g_utf8_casefold().

Returns true if the next read operation will not block: either data is available, or end-of-stream has been reached, or an error has occurred.

Wrapper for input_stream_tag() which locks and unlocks the mutex; the caller must not be holding it already.

Reads the tag from the stream.

Wrapper for input_stream_eof() which locks and unlocks the mutex; the caller must not be holding it already.

Returns true if the stream has reached end-of-file.

Wrapper for input_stream_seek() which locks and unlocks the mutex; the caller must not be holding it already.

Seeks to the specified position in the stream.

Wrapper for input_stream_wait_locked() which locks and unlocks the mutex; the caller must not be holding it already.

Wait until the stream becomes ready.

Update the public attributes.

Check for errors that may have occurred in the I/O thread.

Returns:
false on error

Call before accessing attributes such as "ready" or "offset".

The caller must lock the mutex.

This will most likely fail if the "seekable" flag is false.

The caller must lock the mutex.

Parameters:
is the input_stream object
offset the relative offset
whence the base of the seek, one of SEEK_SET, SEEK_CUR, SEEK_END

The caller must lock the mutex.

Returns:
a tag object which must be freed with tag_free(), or NULL if the tag has not changed since the last call

Definition at line 118 of file input_stream.h.


Variable Documentation

struct db_visitor void * ctx [read]

Definition at line 70 of file database.h.

void size_t GError ** error_r [read]

Definition at line 70 of file database.h.

struct db_visitor * visitor [read]

Definition at line 70 of file database.h.


Generated on 17 Jul 2013 for MPD by  doxygen 1.6.1