Eina_List *snd_dirs = NULL;
Eina_List *img_dirs = NULL;
Eina_List *fnt_dirs = NULL;
+Eina_List *data_dirs = NULL;
Eina_List *defines = NULL;
char *file_in = NULL;
char *tmp_dir = NULL;
"-id image/directory Add a directory to look in for relative path images\n"
"-fd font/directory Add a directory to look in for relative path fonts\n"
"-sd sound/directory Add a directory to look in for relative path sounds samples\n"
+ "-dd data/directory Add a directory to look in for relative path data.file entries\n"
"-td temp/directory Directory to store temporary files\n"
"-v Verbose output\n"
"-no-lossy Do NOT allow images to be lossy\n"
i++;
snd_dirs = eina_list_append(snd_dirs, argv[i]);
}
+ else if ((!strcmp(argv[i], "-dd") || !strcmp(argv[i], "--data_dir")) && (i < (argc - 1)))
+ {
+ i++;
+ data_dirs = eina_list_append(data_dirs, argv[i]);
+ }
else if ((!strcmp(argv[i], "-td") || !strcmp(argv[i], "--tmp_dir")) && (i < (argc - 1)))
{
i++;
extern Eina_List *img_dirs;
extern Eina_List *fnt_dirs;
extern Eina_List *snd_dirs;
+extern Eina_List *data_dirs;
extern char *file_in;
extern char *tmp_dir;
extern char *file_out;
fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0)
{
- ERR("%s:%i when opening file \"%s\": \"%s\"",
- file_in, line, filename, strerror(errno));
- exit(-1);
+ char path[PATH_MAX], *dir;
+ Eina_List *l;
+ EINA_LIST_FOREACH(data_dirs, l, dir)
+ {
+ snprintf(path, sizeof(path), "%s/%s", dir, filename);
+ fd = open(path, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
+ if (fd >= 0)
+ break;
+ }
+
+ if (fd < 0)
+ {
+ ERR("%s:%i when opening file \"%s\": \"%s\"",
+ file_in, line, filename, strerror(errno));
+ exit(-1);
+ }
}
if (fstat(fd, &buf))