2008-04-01 21:30:41 +00:00
|
|
|
#include "ecdb.h"
|
|
|
|
|
|
|
|
Ecdb_Project *
|
|
|
|
ecdb_project_new(void)
|
|
|
|
{
|
|
|
|
Ecdb_Project *proj;
|
|
|
|
|
|
|
|
proj = calloc(1, sizeof(Ecdb_Project));
|
2008-05-15 00:14:33 +00:00
|
|
|
if (!proj)
|
|
|
|
return NULL;
|
|
|
|
if (!ecdb_project_init(proj))
|
|
|
|
{
|
|
|
|
FREE(proj);
|
|
|
|
return NULL;
|
|
|
|
}
|
2008-04-01 21:30:41 +00:00
|
|
|
|
|
|
|
return proj;
|
|
|
|
}
|
|
|
|
|
2008-05-15 00:14:33 +00:00
|
|
|
int
|
|
|
|
ecdb_project_init(Ecdb_Project *proj)
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2008-06-04 01:12:34 +00:00
|
|
|
void
|
|
|
|
ecdb_project_destroy(Ecdb_Project *proj)
|
|
|
|
{
|
|
|
|
free(proj);
|
|
|
|
}
|
|
|
|
|
2008-06-10 03:33:53 +00:00
|
|
|
void
|
|
|
|
ecdb_project_type_set(Ecdb_Project *proj, unsigned int t)
|
|
|
|
{
|
|
|
|
proj->type = t;
|
|
|
|
}
|
|
|
|
|
2008-04-07 01:04:15 +00:00
|
|
|
int
|
|
|
|
ecdb_shutdown(void *data, int type, void *event)
|
2008-04-01 21:30:41 +00:00
|
|
|
{
|
|
|
|
if (em->drives)
|
|
|
|
ecore_list_destroy(em->drives);
|
|
|
|
free(em);
|
2008-06-04 01:12:34 +00:00
|
|
|
|
|
|
|
if (!ecore_file_recursive_rm("/tmp/ecdb"))
|
|
|
|
printf("Removal of temporary directory failed!\n");
|
2008-08-06 02:21:20 +00:00
|
|
|
ewl_main_quit();
|
2008-05-21 01:01:37 +00:00
|
|
|
return FALSE;
|
2008-04-01 21:30:41 +00:00
|
|
|
}
|
|
|
|
|
2008-08-04 22:18:34 +00:00
|
|
|
int
|
2008-04-01 21:30:41 +00:00
|
|
|
ecdb_burn_init(void)
|
|
|
|
{
|
2008-08-04 22:18:34 +00:00
|
|
|
if (!burn_initialize())
|
|
|
|
return 0;
|
|
|
|
|
2008-04-01 21:30:41 +00:00
|
|
|
burn_msgs_set_severities("NEVER", "SORRY", "ecdb: ");
|
|
|
|
burn_set_signal_handling("ecdb: ", NULL, 0);
|
2008-08-04 22:18:34 +00:00
|
|
|
|
|
|
|
return 1;
|
2008-04-01 21:30:41 +00:00
|
|
|
}
|
|
|
|
|
2008-08-04 22:18:34 +00:00
|
|
|
int
|
2008-04-01 21:30:41 +00:00
|
|
|
ecdb_image_init(void)
|
|
|
|
{
|
2008-08-04 22:18:34 +00:00
|
|
|
if (!iso_init())
|
|
|
|
return 0;
|
2008-04-01 21:30:41 +00:00
|
|
|
iso_set_msgs_severities("NEVER", "SORRY", "ecdb: ");
|
2008-08-04 22:18:34 +00:00
|
|
|
|
|
|
|
return 1;
|
2008-04-01 21:30:41 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 20:13:57 +00:00
|
|
|
int
|
|
|
|
ecdb_match_keyword(const char *chk, const char *key, int len)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
{
|
|
|
|
if (chk[i] != key[i])
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
char *
|
|
|
|
ecdb_strip_next_argument(const char *strip)
|
|
|
|
{
|
|
|
|
char *t1 = (char *)strip, *t2;
|
|
|
|
char *ret = NULL;
|
|
|
|
int len = 0, space = FALSE;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if (*t1 == ' ')
|
|
|
|
space = TRUE;
|
|
|
|
|
|
|
|
if ((*t1 != ' ') && (space == TRUE))
|
|
|
|
{
|
|
|
|
t2 = t1;
|
|
|
|
|
|
|
|
/* Find length of string to copy */
|
|
|
|
while ((*t2) && (*t2 != ' '))
|
|
|
|
{
|
|
|
|
len++;
|
|
|
|
t2++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Given no more args */
|
|
|
|
if (!len)
|
|
|
|
return NULL;
|
|
|
|
else
|
|
|
|
len++;
|
|
|
|
|
|
|
|
/* Make a new string and copy everything over */
|
|
|
|
ret = malloc(sizeof(char) * len);
|
|
|
|
memcpy(ret, t1, len);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
} while ((t1) && (t1++));
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|