commit 77f95b05cf452789229f9bd82b23a516c9b6dfdc
parent 04bf0176e7eeb0dbc5a52f716c10ca6a119fe162
Author: nibo <nibo@relim.de>
Date: Sat, 25 Jan 2025 12:25:23 +0100
Ignore {x_*} directives completely by not logging
Diffstat:
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/chordpro.c b/chordpro.c
@@ -180,6 +180,7 @@ static const char *directive_type_enums[] = {
"DT_FONT",
"DT_CHORD",
"DT_OUTPUT",
+ "DT_EXTENSION",
"DT_CUSTOM"
};
@@ -3549,6 +3550,10 @@ cho_directive_parse(const char *name)
directive->ttype = TT_TEXT;
return directive;
}
+ if (str_starts_with(name, "x_")) {
+ directive->dtype = DT_EXTENSION;
+ return directive;
+ }
directive->dtype = DT_CUSTOM;
return directive;
}
@@ -4027,6 +4032,9 @@ cho_songs_parse(FILE *fp, const char *chordpro_filepath, struct Config *config)
(*lines)[li]->btype = directive->btype;
}
break;
+ case DT_EXTENSION:
+ // INFO: Such a directive should not be logged.
+ break;
case DT_CUSTOM:
cho_log(LOG_INFO, "Ignoring custom directive '%s'.", directive_name);
break;
@@ -4386,6 +4394,9 @@ cho_songs_parse(FILE *fp, const char *chordpro_filepath, struct Config *config)
case DT_OUTPUT:
cho_log(LOG_ERR, "Directive '%s' can't have a value.", directive_name);
return NULL;
+ case DT_EXTENSION:
+ // INFO: Such a directive should not be logged.
+ break;
case DT_CUSTOM:
cho_log(LOG_INFO, "Ignoring custom directive '%s'.", directive_name);
break;
diff --git a/chordpro.h b/chordpro.h
@@ -94,6 +94,7 @@ enum DirectiveType {
DT_FONT,
DT_CHORD,
DT_OUTPUT,
+ DT_EXTENSION,
DT_CUSTOM
};