Som kind of shell - act

This commit is contained in:
2022-08-24 16:24:57 +02:00
parent 86956ff1ce
commit 57890907ae
7 changed files with 69 additions and 200 deletions

View File

@ -495,6 +495,21 @@ int cw_cfg_load(const char *filename, cw_Cfg_t * cfg)
return errno;
}
int cw_cfg_read_from_string(const char *str, cw_Cfg_t *cfg)
{
int errs;
FILE * f = fmemopen((void*)str,strlen(str),"rb");
if(!f)
return errno;
errs = cw_cfg_read_from_file(f, cfg);
fclose(f);
if (errs)
errno = EINVAL;
return errno;
}
int cw_cfg_write_to_file(FILE *f, cw_Cfg_t * cfg)
{
mavliter_t it;