Add payload/libtools launching prerequisites
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user