core/containers: Move database into the containers/ directory
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
f02853e9c7
commit
c34f0c160d
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2013 (c) Anna Schumaker.
|
* Copyright 2013 (c) Anna Schumaker.
|
||||||
*/
|
*/
|
||||||
#include <core/database.h>
|
#include <core/containers/database.h>
|
||||||
|
|
||||||
#define DB_ENTRY_AT(db, index) \
|
#define DB_ENTRY_AT(db, index) \
|
||||||
(struct db_entry *)g_ptr_array_index(db->db_entries, index)
|
(struct db_entry *)g_ptr_array_index(db->db_entries, index)
|
||||||
|
@ -20,7 +20,7 @@ static void __dbe_free(struct database *db, struct db_entry *dbe)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct db_entry *__dbe_next(const struct database *db, unsigned int index)
|
static struct db_entry *__dbe_next(const struct database *db, unsigned int index)
|
||||||
{
|
{
|
||||||
if (!db->db_entries)
|
if (!db->db_entries)
|
||||||
return NULL;
|
return NULL;
|
|
@ -2,7 +2,7 @@
|
||||||
* Copyright 2014 (c) Anna Schumaker.
|
* Copyright 2014 (c) Anna Schumaker.
|
||||||
*/
|
*/
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <core/database.h>
|
#include <core/containers/database.h>
|
||||||
#include <core/idle.h>
|
#include <core/idle.h>
|
||||||
}
|
}
|
||||||
#include <core/index.h>
|
#include <core/index.h>
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
*
|
*
|
||||||
* The database class will add a newline after each struct db_entry.
|
* The database class will add a newline after each struct db_entry.
|
||||||
*/
|
*/
|
||||||
#ifndef OCARINA_CORE_DATABASE_H
|
#ifndef OCARINA_CORE_CONTAINERS_DATABASE_H
|
||||||
#define OCARINA_CORE_DATABASE_H
|
#define OCARINA_CORE_CONTAINERS_DATABASE_H
|
||||||
|
|
||||||
#include <core/file.h>
|
#include <core/file.h>
|
||||||
|
|
||||||
|
@ -144,4 +144,4 @@ struct db_entry *db_next(const struct database *, struct db_entry *);
|
||||||
ent != NULL; \
|
ent != NULL; \
|
||||||
ent = next, next = db_next(db, ent))
|
ent = next, next = db_next(db, ent))
|
||||||
|
|
||||||
#endif /* OCARINA_CORE_DATABASE_H */
|
#endif /* OCARINA_CORE_CONTAINERS_DATABASE_H */
|
|
@ -7,8 +7,8 @@
|
||||||
#ifndef OCARINA_CORE_INDEX_H
|
#ifndef OCARINA_CORE_INDEX_H
|
||||||
#define OCARINA_CORE_INDEX_H
|
#define OCARINA_CORE_INDEX_H
|
||||||
|
|
||||||
|
#include <core/containers/database.h>
|
||||||
#include <core/containers/set.h>
|
#include <core/containers/set.h>
|
||||||
#include <core/database.h>
|
|
||||||
|
|
||||||
|
|
||||||
struct index_entry {
|
struct index_entry {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#ifndef OCARINA_CORE_TAGS_ALBUM_H
|
#ifndef OCARINA_CORE_TAGS_ALBUM_H
|
||||||
#define OCARINA_CORE_TAGS_ALBUM_H
|
#define OCARINA_CORE_TAGS_ALBUM_H
|
||||||
|
|
||||||
#include <core/database.h>
|
#include <core/containers/database.h>
|
||||||
|
|
||||||
struct album {
|
struct album {
|
||||||
unsigned int al_year; /* This album's year. */
|
unsigned int al_year; /* This album's year. */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#ifndef OCARINA_CORE_TAGS_ARTIST_H
|
#ifndef OCARINA_CORE_TAGS_ARTIST_H
|
||||||
#define OCARINA_CORE_TAGS_ARTIST_H
|
#define OCARINA_CORE_TAGS_ARTIST_H
|
||||||
|
|
||||||
#include <core/database.h>
|
#include <core/containers/database.h>
|
||||||
|
|
||||||
struct artist {
|
struct artist {
|
||||||
gchar *ar_name; /* This artist's name. */
|
gchar *ar_name; /* This artist's name. */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#ifndef OCARINA_CORE_TAGS_GENRE_H
|
#ifndef OCARINA_CORE_TAGS_GENRE_H
|
||||||
#define OCARINA_CORE_TAGS_GENRE_H
|
#define OCARINA_CORE_TAGS_GENRE_H
|
||||||
|
|
||||||
#include <core/database.h>
|
#include <core/containers/database.h>
|
||||||
|
|
||||||
struct genre {
|
struct genre {
|
||||||
gchar *ge_name; /* This genre's name. */
|
gchar *ge_name; /* This genre's name. */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#ifndef OCARINA_CORE_TAGS_LIBRARY_H
|
#ifndef OCARINA_CORE_TAGS_LIBRARY_H
|
||||||
#define OCARINA_CORE_TAGS_LIBRARY_H
|
#define OCARINA_CORE_TAGS_LIBRARY_H
|
||||||
|
|
||||||
#include <core/database.h>
|
#include <core/containers/database.h>
|
||||||
|
|
||||||
struct library {
|
struct library {
|
||||||
unsigned int li_size; /* This library's track count. */
|
unsigned int li_size; /* This library's track count. */
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef OCARINA_CORE_TAGS_TRACK_H
|
#ifndef OCARINA_CORE_TAGS_TRACK_H
|
||||||
#define OCARINA_CORE_TAGS_TRACK_H
|
#define OCARINA_CORE_TAGS_TRACK_H
|
||||||
|
|
||||||
#include <core/database.h>
|
#include <core/containers/database.h>
|
||||||
#include <core/date.h>
|
#include <core/date.h>
|
||||||
#include <core/tags/album.h>
|
#include <core/tags/album.h>
|
||||||
#include <core/tags/artist.h>
|
#include <core/tags/artist.h>
|
||||||
|
|
|
@ -20,7 +20,6 @@ res += [ CoreTest("file", "file.c") ]
|
||||||
res += [ CoreTest("date", "date.c") ]
|
res += [ CoreTest("date", "date.c") ]
|
||||||
|
|
||||||
res += SConscript("containers/Sconscript")
|
res += SConscript("containers/Sconscript")
|
||||||
res += [ CoreTest("database", "database.c") ]
|
|
||||||
res += [ CoreTest("index", "index.c") ]
|
res += [ CoreTest("index", "index.c") ]
|
||||||
res += [ CoreTest("filter", "filter.c") ]
|
res += [ CoreTest("filter", "filter.c") ]
|
||||||
res += [ CoreTest("idle", "idle.c") ]
|
res += [ CoreTest("idle", "idle.c") ]
|
||||||
|
|
|
@ -12,5 +12,6 @@ def ContainerTest(name, source):
|
||||||
return run
|
return run
|
||||||
|
|
||||||
res = [ ContainerTest("set", "set.c") ]
|
res = [ ContainerTest("set", "set.c") ]
|
||||||
|
res = [ ContainerTest("database", "database.c") ]
|
||||||
|
|
||||||
Return("res")
|
Return("res")
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Copyright 2014 (c) Anna Schumaker.
|
* Copyright 2014 (c) Anna Schumaker.
|
||||||
* Test a Database
|
* Test a Database
|
||||||
*/
|
*/
|
||||||
#include <core/database.h>
|
#include <core/containers/database.h>
|
||||||
#include <core/string.h>
|
#include <core/string.h>
|
||||||
#include <tests/test.h>
|
#include <tests/test.h>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user