ocarina/include/core/tags/artist.h

44 lines
1.0 KiB
C
Raw Normal View History

/**
* Copyright 2014 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_TAGS_ARTIST_H
#define OCARINA_CORE_TAGS_ARTIST_H
extern "C" {
#include <core/database.h>
}
#include <string>
/**
* The Artist tag is used to store the name of artists added
* to the tag database.
*/
struct artist {
gchar *ar_name; /* This artist's name. */
gchar *ar_lower; /* This artist's name (lowercased). */
struct db_entry ar_dbe;
};
#define ARTIST(dbe) ((struct artist *)DBE_DATA(dbe))
/* Called to initialize the artist database. */
void artist_db_init();
/* Called to clean up the artist database. */
void artist_db_deinit();
/* Called to find an artist tag by name. */
struct artist *artist_find(const gchar *);
/* Called to get an artist tag with a specific index. */
struct artist *artist_get(const unsigned int);
/* Called to compare two artist tags. */
int artist_compare(struct artist *, struct artist *);
#ifdef CONFIG_TESTING
const struct db_ops *test_artist_ops();
#endif /* CONFIG_TESTING */
#endif /* OCARINA_CORE_TAGS_ARTIST_H */