ocarina/include/core/tags/genre.h
Anna Schumaker 92a53d90b4 core/database: Move database out of containers/ subdirectory
It doesn't make sense to have a subdirectory with a single file.  Let's
move it back to core/

Implements #45: Move database into core/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:01 -04:00

46 lines
1.1 KiB
C

/*
* Copyright 2014 (c) Anna Schumaker.
*
* The Genre tag is used to store the name of genres
* added to the tag database.
*
* When writing a Genre tag to disk, nol ywrite out the
* genre_name field:
*
* ... Video Game Music
* ... Game Music
*/
#ifndef OCARINA_CORE_TAGS_GENRE_H
#define OCARINA_CORE_TAGS_GENRE_H
#include <core/database.h>
struct genre {
gchar *ge_name; /* This genre's name. */
gchar *ge_lower; /* This genre's name (lowercased). */
struct db_entry ge_dbe;
};
#define GENRE(dbe) ((struct genre *)DBE_DATA(dbe))
/* Called to initialize the genre database. */
void genre_db_init();
/* Called to clean up the genre database. */
void genre_db_deinit();
/* Called to find a genre tag by name. */
struct genre *genre_find(const gchar *);
/* Called to get a genre tag with a specific index. */
struct genre *genre_get(const unsigned int);
/* Called to compare two genre tags. */
int genre_compare(struct genre *, struct genre *);
#ifdef CONFIG_TESTING
const struct db_ops *test_genre_ops();
#endif /* CONFIG_TESTING */
#endif /* OCARINA_CORE_TAGS_GENRE_H */