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 */
|
|
|
|
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();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-07-31 08:33:27 +00:00
|
|
|
/* needed for io.c */
|
|
|
|
const char *sim_root_dir = ".";
|
2008-12-15 23:42:19 +00:00
|
|
|
|
|
|
|
/* stubs to avoid including thread-sdl.c */
|
|
|
|
#include "kernel.h"
|
|
|
|
void mutex_init(struct mutex *m)
|
|
|
|
{
|
|
|
|
(void)m;
|
|
|
|
}
|
|
|
|
|
|
|
|
void mutex_lock(struct mutex *m)
|
|
|
|
{
|
|
|
|
(void)m;
|
|
|
|
}
|
|
|
|
|
|
|
|
void mutex_unlock(struct mutex *m)
|
|
|
|
{
|
|
|
|
(void)m;
|
|
|
|
}
|
|
|
|
|
2010-05-15 22:25:06 +00:00
|
|
|
void sim_thread_lock(void *me)
|
2008-12-15 23:42:19 +00:00
|
|
|
{
|
|
|
|
(void)me;
|
|
|
|
}
|
|
|
|
|
2010-05-15 22:25:06 +00:00
|
|
|
void * sim_thread_unlock(void)
|
2008-12-15 23:42:19 +00:00
|
|
|
{
|
|
|
|
return (void*)1;
|
|
|
|
}
|
|
|
|
|