From e1afd42340c0b2c22660744e0f88258a44617e88 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 6 Dec 2009 13:18:36 +0200 Subject: Comment expansion. * src/triplet.c: New keyword "comment". --- src/triplet.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/triplet.c b/src/triplet.c index 048cdcb..1b0fb18 100644 --- a/src/triplet.c +++ b/src/triplet.c @@ -499,7 +499,16 @@ expand_report (struct metadef *def, void *data) { return report_string; } - + +static const char * +expand_comment (struct metadef *def, void *data) +{ + struct file_triplet *trp = data; + if (directive_get_value (trp, "comment", (const char**) &def->value)) + def->value = ""; + return def->value; +} + #define DECL_EXPAND_TIMER(what) \ static const char * \ __cat2__(expand_timer_,what) (struct metadef *def, void *data) \ @@ -531,6 +540,7 @@ struct metadef triplet_default_meta[] = { { "dir", NULL, expand_relative_dir, NULL }, { "dest-dir", NULL, expand_dest_dir, NULL }, { "source-dir", NULL, expand_source_dir, NULL }, + { "comment", NULL, expand_comment, NULL }, { NULL } }; @@ -561,6 +571,7 @@ struct metadef triplet_meta[] = { { "user:real-name", NULL, expand_user_real_name, NULL }, { "user:email", NULL, expand_user_email, NULL }, { "report", NULL, expand_report, NULL }, + { "comment", NULL, expand_comment, NULL }, DECL_FULL_TIMER(wydawca), DECL_FULL_TIMER(triplet), DECL_FULL_TIMER(spool), -- cgit v1.2.1