summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-06-01 01:22:36 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-12-03 06:34:47 -0500
commit98c7505c60714d216814ababe645ed86785f2aec (patch)
tree83a8e40b07b5f50f2cda3d6a93d630bcaae93de0 /apps
parent03c225fe54a2ae4699f92473ea21da11ba043148 (diff)
downloadrockbox-98c7505c60714d216814ababe645ed86785f2aec.tar.gz
rockbox-98c7505c60714d216814ababe645ed86785f2aec.zip
tagcache: move TAGCACHE_STATEFILE define to .c file
Provide a function to remove the statefile so that external users of this define can call that instead. Change-Id: Id3e1e0564b25fe28bbc68c2e9365d8bf51e6e4f8
Diffstat (limited to 'apps')
-rw-r--r--apps/main.c2
-rw-r--r--apps/tagcache.c8
-rw-r--r--apps/tagcache.h4
-rw-r--r--apps/tree.c2
4 files changed, 11 insertions, 5 deletions
diff --git a/apps/main.c b/apps/main.c
index 6360267243..f86d91e42e 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -597,7 +597,7 @@ static void init(void)
597 CHART("<init_dircache(true)"); 597 CHART("<init_dircache(true)");
598#ifdef HAVE_TAGCACHE 598#ifdef HAVE_TAGCACHE
599 if (rc < 0) 599 if (rc < 0)
600 remove(TAGCACHE_STATEFILE); 600 tagcache_remove_statefile();
601#endif /* HAVE_TAGCACHE */ 601#endif /* HAVE_TAGCACHE */
602#endif /* HAVE_DIRCACHE */ 602#endif /* HAVE_DIRCACHE */
603 603
diff --git a/apps/tagcache.c b/apps/tagcache.c
index b9960f2ad0..c638665def 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -135,6 +135,9 @@
135/* ASCII dumpfile of the DB contents. */ 135/* ASCII dumpfile of the DB contents. */
136#define TAGCACHE_FILE_CHANGELOG ROCKBOX_DIR "/database_changelog.txt" 136#define TAGCACHE_FILE_CHANGELOG ROCKBOX_DIR "/database_changelog.txt"
137 137
138/* Serialized DB. */
139#define TAGCACHE_STATEFILE ROCKBOX_DIR "/database_state.tcd"
140
138/* Flags */ 141/* Flags */
139#define FLAG_DELETED 0x0001 /* Entry has been removed from db */ 142#define FLAG_DELETED 0x0001 /* Entry has been removed from db */
140#define FLAG_DIRCACHE 0x0002 /* Filename is a dircache pointer */ 143#define FLAG_DIRCACHE 0x0002 /* Filename is a dircache pointer */
@@ -5009,6 +5012,11 @@ void tagcache_shutdown(void)
5009#endif 5012#endif
5010} 5013}
5011 5014
5015void tagcache_remove_statefile(void)
5016{
5017 remove(TAGCACHE_STATEFILE);
5018}
5019
5012static int get_progress(void) 5020static int get_progress(void)
5013{ 5021{
5014 int total_count = -1; 5022 int total_count = -1;
diff --git a/apps/tagcache.h b/apps/tagcache.h
index f6cd03e972..11d58c01bd 100644
--- a/apps/tagcache.h
+++ b/apps/tagcache.h
@@ -50,9 +50,6 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
50#define TAGCACHE_MAX_FILTERS 4 50#define TAGCACHE_MAX_FILTERS 4
51#define TAGCACHE_MAX_CLAUSES 32 51#define TAGCACHE_MAX_CLAUSES 32
52 52
53/* Serialized DB. */
54#define TAGCACHE_STATEFILE ROCKBOX_DIR "/database_state.tcd"
55
56/* Tag to be used on untagged files. */ 53/* Tag to be used on untagged files. */
57#define UNTAGGED "<Untagged>" 54#define UNTAGGED "<Untagged>"
58 55
@@ -185,6 +182,7 @@ struct tagcache_stat* tagcache_get_stat(void);
185int tagcache_get_commit_step(void); 182int tagcache_get_commit_step(void);
186bool tagcache_prepare_shutdown(void); 183bool tagcache_prepare_shutdown(void);
187void tagcache_shutdown(void); 184void tagcache_shutdown(void);
185void tagcache_remove_statefile(void);
188 186
189void tagcache_screensync_event(void); 187void tagcache_screensync_event(void);
190void tagcache_screensync_enable(bool state); 188void tagcache_screensync_enable(bool state);
diff --git a/apps/tree.c b/apps/tree.c
index 4a80591201..1149c19104 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -1265,7 +1265,7 @@ void tree_restore(void)
1265#endif 1265#endif
1266 1266
1267#ifdef HAVE_TC_RAMCACHE 1267#ifdef HAVE_TC_RAMCACHE
1268 remove(TAGCACHE_STATEFILE); 1268 tagcache_remove_statefile();
1269#endif 1269#endif
1270 1270
1271#ifdef HAVE_DIRCACHE 1271#ifdef HAVE_DIRCACHE