summaryrefslogtreecommitdiff
path: root/tools/database/database.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/database/database.c')
-rw-r--r--tools/database/database.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/tools/database/database.c b/tools/database/database.c
index 0f9304eb0a..30f1c39626 100644
--- a/tools/database/database.c
+++ b/tools/database/database.c
@@ -2,26 +2,37 @@
2 2
3#include <stdbool.h> 3#include <stdbool.h>
4#include <stdio.h> 4#include <stdio.h>
5#include <errno.h>
5#include <sys/stat.h> 6#include <sys/stat.h>
7
8#include "config.h"
6#include "tagcache.h" 9#include "tagcache.h"
10#include "dir.h"
11
12/* This is meant to be run on the root of the dap. it'll put the db files into
13 * a .rockbox subdir */
7 14
8int main(int argc, char **argv) 15int main(int argc, char **argv)
9{ 16{
17 (void)argc;
18 (void)argv;
19
20 errno = 0;
21 if (mkdir(ROCKBOX_DIR) == -1 && errno != EEXIST)
22 return 1;
23
24 /* / is actually ., will get translated in io.c
25 * (with the help of sim_root_dir below */
26 const char *paths[] = { "/", NULL };
10 tagcache_init(); 27 tagcache_init();
11 tagcache_build("."); 28 do_tagcache_build(paths);
12 tagcache_reverse_scan(); 29 tagcache_reverse_scan();
13 30
14 return 0; 31 return 0;
15} 32}
16 33
17/* stub to avoid including all of apps/misc.c */ 34/* needed for io.c */
18bool file_exists(const char *file) 35const char *sim_root_dir = ".";
19{
20 struct stat s;
21 if (!stat(file, &s))
22 return true;
23 return false;
24}
25 36
26/* stubs to avoid including thread-sdl.c */ 37/* stubs to avoid including thread-sdl.c */
27#include "kernel.h" 38#include "kernel.h"