dmap-db

dmap-db

Synopsis

#define             TYPE_DMAP_DB
#define             DMAP_DB                             (o)
#define             IS_DMAP_DB                          (o)
#define             DMAP_DB_GET_INTERFACE               (o)
                    DMAPDb;
                    DMAPDbInterface;
const char *        (*RecordGetValueFunc)               (DMAPRecord *record);
                    FilterDefinition;
GType               dmap_db_get_type                    (void);
gint                dmap_db_add                         (DMAPDb *db,
                                                         DMAPRecord *record);
DMAPRecord *        dmap_db_lookup_by_id                (DMAPDb *db,
                                                         guint id);
void                dmap_db_foreach                     (const DMAPDb *db,
                                                         void (fngpointer id,DMAPRecord *record,gpointer data) (),
                                                         gpointer data);
gulong              dmap_db_count                       (const DMAPDb *db);

Object Hierarchy

  GInterface
   +----DMAPDb

Description

Details

TYPE_DMAP_DB

#define TYPE_DMAP_DB		 (dmap_db_get_type ())

The type for DMAPDb.


DMAP_DB()

#define             DMAP_DB(o)

Casts a DMAPDb or derived pointer into a (DMAPDb *) pointer. Depending on the current debugging level, this function may invoke certain runtime checks to identify invalid casts.

o :

Object which is subject to casting.

IS_DMAP_DB()

#define             IS_DMAP_DB(o)

Checks whether a valid GTypeInstance pointer is of type TYPE_DMAP_DB.

o :

Instance to check for being a TYPE_DMAP_DB.

DMAP_DB_GET_INTERFACE()

#define             DMAP_DB_GET_INTERFACE(o)

Get the insterface structure associated to a DMAPDb instance.

o :

a DMAPDb instance.

DMAPDb

typedef struct _DMAPDb DMAPDb;


DMAPDbInterface

typedef struct {
	GTypeInterface parent;

	gint (*add)			(DMAPDb *db, DMAPRecord *record);
	DMAPRecord *(*lookup_by_id)	(DMAPDb *db, guint id);
	void (*foreach)			(const DMAPDb *db,
					 void (*fn) (gpointer id,
					 	     DMAPRecord *record,
					 	     gpointer data),
					 gpointer data);
	gint64 (*count) 		(const DMAPDb *db);
} DMAPDbInterface;


RecordGetValueFunc ()

const char *        (*RecordGetValueFunc)               (DMAPRecord *record);

record :

Returns :


FilterDefinition

typedef struct {
	gchar *value;
	const char *(*record_get_value) (DMAPRecord *record);
} FilterDefinition;


dmap_db_get_type ()

GType               dmap_db_get_type                    (void);

Returns :


dmap_db_add ()

gint                dmap_db_add                         (DMAPDb *db,
                                                         DMAPRecord *record);

Add a record to the database.

db :

A media database.

record :

A database record.

Returns :

The ID for the newly added record. A reference to the record will be retained by the database (if required; an adapter-type implementation may not want to retain a reference as the record data may be placed elsewhere). In all cases, the record should be unrefed by the calling code.

dmap_db_lookup_by_id ()

DMAPRecord *        dmap_db_lookup_by_id                (DMAPDb *db,
                                                         guint id);

db :

A media database.

id :

A record ID.

Returns :

the database record corresponding to id. This record should be unrefed by the calling code when no longer required.

dmap_db_foreach ()

void                dmap_db_foreach                     (const DMAPDb *db,
                                                         void (fngpointer id,DMAPRecord *record,gpointer data) (),
                                                         gpointer data);

Apply a function to each record in a media database.

db :

A media database.

fn :

The function to apply to each record in the database.

data :

User data to pass to the function.

dmap_db_count ()

gulong              dmap_db_count                       (const DMAPDb *db);

db :

A media database.

Returns :

the number of records in the database.