| libdmapsharing Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
#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);
#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.
|
Object which is subject to casting. |
#define IS_DMAP_DB(o)
Checks whether a valid GTypeInstance pointer is of type TYPE_DMAP_DB.
|
Instance to check for being a TYPE_DMAP_DB.
|
#define DMAP_DB_GET_INTERFACE(o)
Get the insterface structure associated to a DMAPDb instance.
|
a DMAPDb instance. |
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;
typedef struct {
gchar *value;
const char *(*record_get_value) (DMAPRecord *record);
} FilterDefinition;
gint dmap_db_add (DMAPDb *db, DMAPRecord *record);
Add a record to the database.
|
A media database. |
|
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. |
DMAPRecord * dmap_db_lookup_by_id (DMAPDb *db,
guint id);
|
A media database. |
|
A record ID. |
Returns : |
the database record corresponding to id. This record should
be unrefed by the calling code when no longer required.
|
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.
|
A media database. |
|
The function to apply to each record in the database. |
|
User data to pass to the function. |
gulong dmap_db_count (const DMAPDb *db);
|
A media database. |
Returns : |
the number of records in the database. |