experimental-legacy/ecdb/trunk/src/ecdb.c

94 lines
1.6 KiB
C
Raw Normal View History

#include "ecdb.h"
2008-04-07 01:04:15 +00:00
/* Global Variables */
int ECDB_DRIVE_ACTION_FINISHED = 0;
int ECDB_DRIVE_ACTION_BEGUN = 0;
int ECDB_DRIVE_ACTION_UPDATE = 0;
Ecdb_Main *em;
int ecdb_setup();
int
main(int argc, char **argv)
{
Ecdb_Project *proj;
int i;
2008-04-07 01:04:15 +00:00
if (!ecore_init())
{
printf("Cannot initialize Ecore!\n");
return 1;
}
if (!ecore_file_init())
{
printf("Cannot initialize Ecore_File!\n");
return 1;
}
if (!ecdb_setup())
{
printf("Setup failed\n");
return 1;
}
ecdb_print_drive_info();
ecdb_burn_init();
proj = ecdb_project_new();
i = 1;
while ((i < argc) && (argv))
{
ecore_list_append(proj->files, strdup(argv[i]));
i++;
}
2008-04-07 01:04:15 +00:00
proj->simulate = TRUE;
proj->publisher_id = proj->data_preparer_id = proj->system_id =
proj->application_id = proj->copywrite_id = proj->abstract_id =
proj->biblio_id = "ecdb";
ecdb_aquire_drive(proj, 0);
2008-04-07 01:04:15 +00:00
if (ecdb_burn_project(proj))
{
printf("Burn was unsuccessful\n");
burn_finish();
ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, NULL, NULL, NULL);
return 1;
}
ecore_main_loop_begin();
/* End testing */
burn_finish();
2008-04-07 01:04:15 +00:00
ecore_shutdown();
ecore_file_shutdown();
printf("Program Done\n");
return 0;
};
int
ecdb_setup(void)
{
em = NULL;
em = calloc(1, sizeof(Ecdb_Main));
em->drives = NULL;
em->projects = ecore_list_new();
2008-04-07 01:04:15 +00:00
ECDB_DRIVE_ACTION_FINISHED = ecore_event_type_new();
ECDB_DRIVE_ACTION_BEGUN = ecore_event_type_new();
ECDB_DRIVE_ACTION_UPDATE = ecore_event_type_new();
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, ecdb_shutdown,
NULL);
if (!ecdb_aquire_drive_info())
{
printf("Aquiring drives failed!\n");
return 0;
}
return 1;
}