Add payload/libtools launching prerequisites

This commit is contained in:
Kostas Missos
2018-08-21 04:45:19 +03:00
parent 463383abca
commit c5a6ad823e
4 changed files with 177 additions and 19 deletions

View File

@@ -236,3 +236,33 @@ void ini_free_section(ini_sec_t *cfg)
cfg = NULL;
}
char *ini_check_payload_section(ini_sec_t *cfg)
{
char *path = NULL;
if (cfg == NULL)
return NULL;
LIST_FOREACH_ENTRY(ini_kv_t, kv, &cfg->kvs, link)
{
if (!strcmp("payload", kv->key))
{
if (!path)
path = _strdup(kv->val);
}
}
if (path)
{
if (strlen(path) > 1)
return path;
else
{
free(path);
return NULL;
}
}
else
return NULL;
}

View File

@@ -47,6 +47,7 @@ int ini_parse(link_t *dst, char *ini_path, bool is_dir);
void ini_free(link_t *dst);
ini_sec_t *ini_clone_section(ini_sec_t *cfg);
void ini_free_section(ini_sec_t *cfg);
char *ini_check_payload_section(ini_sec_t *cfg);
#endif