2008-12-15 23:42:19 +00:00
|
|
|
/* A _very_ skeleton file to demonstrate building tagcache db on host. */
|
|
|
|
|
2009-10-07 16:54:15 +00:00
|
|
|
#include <stdbool.h>
|
2008-12-15 23:42:19 +00:00
|
|
|
#include <stdio.h>
|
2012-07-31 08:33:27 +00:00
|
|
|
#include <errno.h>
|
2009-08-06 18:28:38 +00:00
|
|
|
#include <sys/stat.h>
|
2012-07-31 08:33:27 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
2008-12-15 23:42:19 +00:00
|
|
|
#include "tagcache.h"
|
2012-07-31 08:33:27 +00:00
|
|
|
#include "dir.h"
|
|
|
|
|
|
|
|
/* This is meant to be run on the root of the dap. it'll put the db files into
|
|
|
|
* a .rockbox subdir */
|
2008-12-15 23:42:19 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
2012-07-31 08:33:27 +00:00
|
|
|
(void)argc;
|
|
|
|
(void)argv;
|
|
|
|
|
|
|
|
errno = 0;
|
|
|
|
if (mkdir(ROCKBOX_DIR) == -1 && errno != EEXIST)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
/* / is actually ., will get translated in io.c
|
|
|
|
* (with the help of sim_root_dir below */
|
2023-05-25 20:03:33 +00:00
|
|
|
const char *paths[] = { "/", NULL };
|
2008-12-15 23:42:19 +00:00
|
|
|
tagcache_init();
|
2012-07-31 08:33:27 +00:00
|
|
|
do_tagcache_build(paths);
|
2008-12-15 23:42:19 +00:00
|
|
|
tagcache_reverse_scan();
|
2023-05-25 20:03:33 +00:00
|
|
|
|
2008-12-15 23:42:19 +00:00
|
|
|
return 0;
|
|
|
|
}
|