free(tplg_pp);
}
-int init_pre_precessor(struct tplg_pre_processor **tplg_pp, snd_output_type_t type,
+int init_pre_processor(struct tplg_pre_processor **tplg_pp, snd_output_type_t type,
const char *output_file)
{
struct tplg_pre_processor *_tplg_pp;
return ret;
}
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
static int pre_process_defines(struct tplg_pre_processor *tplg_pp, const char *pre_processor_defs,
snd_config_t *top)
{
return 0;
}
+#endif /* version < 1.2.6 */
int pre_process(struct tplg_pre_processor *tplg_pp, char *config, size_t config_size,
const char *pre_processor_defs, const char *inc_path)
tplg_pp->input_cfg = top;
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
/* parse command line definitions */
err = pre_process_defines(tplg_pp, pre_processor_defs, tplg_pp->input_cfg);
if (err < 0) {
fprintf(stderr, "Failed to expand pre-processor definitions in input config\n");
goto err;
}
+#endif
err = pre_process_config(tplg_pp, tplg_pp->input_cfg);
if (err < 0) {
"-u, --dump=FILE dump (reparse) configuration file\n"
"-v, --verbose=LEVEL set verbosity level (0...1)\n"
"-o, --output=FILE set output file\n"
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+"-D, --define=ARGS define variables (VAR1=VAL1[,VAR2=VAL2] ...)\n"
+#endif
"-s, --sort sort the identifiers in the normalized output\n"
"-g, --group save configuration by group indexes\n"
"-x, --nocheck save configuration without additional integrity checks\n"
int main(int argc, char *argv[])
{
- static const char short_options[] = "hc:d:n:u:v:o:pP:sgxzVD:";
+ static const char short_options[] = "hc:d:n:u:v:o:pP:sgxzV"
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+ "D:"
+#endif
+ ;
static const struct option long_options[] = {
{"help", 0, NULL, 'h'},
{"verbose", 1, NULL, 'v'},
{"normalize", 1, NULL, 'n'},
{"dump", 1, NULL, 'u'},
{"output", 1, NULL, 'o'},
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+ {"define", 1, NULL, 'D'},
+#endif
{"sort", 0, NULL, 's'},
{"group", 0, NULL, 'g'},
{"nocheck", 0, NULL, 'x'},
case 'x':
sflags |= SND_TPLG_SAVE_NOCHECK;
break;
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
case 'D':
pre_processor_defs = optarg;
break;
+#endif
case 'V':
version(argv[0]);
return 0;