static void setup (void) { pg_rmdb_path = strndup (tiz_rcfile_get_value("resource-management", "rmdb"), PATH_MAX); pg_sqlite_script = strndup (tiz_rcfile_get_value("resource-management", "rmdb.sqlite_script"), PATH_MAX); pg_init_script = strndup (tiz_rcfile_get_value("resource-management", "rmdb.init_script"), PATH_MAX); pg_rmd_path = strndup (tiz_rcfile_get_value("resource-management", "rmd.path"), PATH_MAX); pg_dump_script = strndup (tiz_rcfile_get_value("resource-management", "rmdb.dbdump_script"), PATH_MAX); if (!pg_rmdb_path || !pg_sqlite_script || !pg_init_script || !pg_rmd_path || !pg_dump_script) { TIZ_LOG(TIZ_TRACE, "Test data not available..."); fail_if(0); } else { TIZ_LOG(TIZ_TRACE, "RM daemon [%s] ...", pg_rmd_path); } }
static bool init_test_data() { bool rv = false; const char *p_testfile1 = NULL; const char *p_testfile2 = NULL; p_testfile1 = tiz_rcfile_get_value("plugins-data", "OMX.Aratelia.file_writer.binary.testfile1_uri"); p_testfile2 = tiz_rcfile_get_value("plugins-data", "OMX.Aratelia.file_writer.binary.testfile2_uri"); if (!p_testfile1 || !p_testfile1) { TIZ_LOG(TIZ_TRACE, "Test data not available..."); } else { pg_files[0] = p_testfile1; pg_files[1] = p_testfile2; TIZ_LOG(TIZ_TRACE, "Test data available [%s]", pg_files[0]); TIZ_LOG(TIZ_TRACE, "Test data available [%s]", pg_files[1]); rv = true; } return rv; }
static bool refresh_rm_db (void) { bool rv = false; const char *p_rmdb_path = NULL; const char *p_sqlite_path = NULL; const char *p_init_path = NULL; const char *p_rmd_path = NULL; p_rmdb_path = tiz_rcfile_get_value("resource-management", "rmdb"); p_sqlite_path = tiz_rcfile_get_value("resource-management", "rmdb.sqlite_script"); p_init_path = tiz_rcfile_get_value("resource-management", "rmdb.init_script"); p_rmd_path = tiz_rcfile_get_value("resource-management", "rmd.path"); if (!p_rmdb_path || !p_sqlite_path || !p_init_path || !p_rmd_path) { TIZ_LOG(TIZ_PRIORITY_TRACE, "Test data not available..."); } else { pg_rmd_path = strndup (p_rmd_path, PATH_MAX); TIZ_LOG(TIZ_PRIORITY_TRACE, "RM daemon [%s] ...", pg_rmd_path); /* Re-fresh the rm db */ size_t total_len = strlen (p_init_path) + strlen (p_sqlite_path) + strlen (p_rmdb_path) + 4; char *p_cmd = tiz_mem_calloc (1, total_len); if (p_cmd) { snprintf(p_cmd, total_len -1, "%s %s %s", p_init_path, p_sqlite_path, p_rmdb_path); if (-1 != system (p_cmd)) { TIZ_LOG(TIZ_PRIORITY_TRACE, "Successfully run [%s] script...", p_cmd); rv = true; } else { TIZ_LOG(TIZ_PRIORITY_TRACE, "Error while executing db init shell script..."); } tiz_mem_free (p_cmd); } } return rv; }
void retrieve_config_from_rc_file (const char *rc_section, const char *rc_key, std::string &container) { assert (rc_section); assert (rc_key); const char *p_key = tiz_rcfile_get_value (rc_section, rc_key); if (p_key) { container.assign (p_key); } }
static bool init_test_data() { bool rv = false; const char *p_testfile1 = NULL; p_testfile1 = tiz_rcfile_get_value("plugins-data", "OMX.Aratelia.yuv_renderer.overlay.testfile1_uri"); if (!p_testfile1) { TIZ_LOG(TIZ_PRIORITY_TRACE, "Test data not available..."); } else { pg_files[0] = p_testfile1; pg_files[1] = p_testfile1; TIZ_LOG(TIZ_PRIORITY_TRACE, "Test data available [%s]", pg_files[0]); TIZ_LOG(TIZ_PRIORITY_TRACE, "Test data available [%s]", pg_files[1]); rv = true; } return rv; }