- cf = configfile_exists();
- if (cf) {
- void *map;
- size_t sz;
- int cf_argc;
- char **cf_argv;
- ret = mmap_full_file(cf, O_RDONLY, &map, &sz, NULL);
- if (ret != -E_EMPTY) {
- if (ret < 0)
- goto out;
- ret = lls(lls_convert_config(map, sz, NULL, &cf_argv,
- &errctx));
- para_munmap(map, sz);
- if (ret < 0) {
- PARA_ERROR_LOG("syntax error in %s\n", cf);
- goto out;
- }
- cf_argc = ret;
- ret = lls(lls_parse(cf_argc, cf_argv, cmd, &lpr2,
- &errctx));
- lls_free_argv(cf_argv);
- if (ret < 0) {
- PARA_ERROR_LOG("parse error in %s\n", cf);
- goto out;
- }
- ret = lls(lls_merge(lpr1, lpr2, cmd, &lpr3, &errctx));
- lls_free_parse_result(lpr2, cmd);
- if (ret < 0)
- goto out;
- lls_free_parse_result(lpr1, cmd);
- lpr = lpr3;
- loglevel = OPT_UINT32_VAL(LOGLEVEL);
- }
- }
+ ret = lsu_merge_config_file_options(NULL, "audioc.conf",
+ &lpr, CMD_PTR, audioc_suite, 0 /* default flags */);
+ if (ret < 0)
+ goto fail;
+ loglevel = OPT_UINT32_VAL(LOGLEVEL);