diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-12-06 13:18:36 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-12-06 13:18:36 +0200 |
commit | e1afd42340c0b2c22660744e0f88258a44617e88 (patch) | |
tree | f4c3b398e79e03aaea0e47ef7378700022befc27 | |
parent | a1d560a878d1dfe4ed751cb3f99b1ee67755f489 (diff) | |
download | wydawca-e1afd42340c0b2c22660744e0f88258a44617e88.tar.gz wydawca-e1afd42340c0b2c22660744e0f88258a44617e88.tar.bz2 |
Comment expansion.
* src/triplet.c: New keyword "comment".
-rw-r--r-- | src/triplet.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/triplet.c b/src/triplet.c index 048cdcb..1b0fb18 100644 --- a/src/triplet.c +++ b/src/triplet.c | |||
@@ -500,6 +500,15 @@ expand_report (struct metadef *def, void *data) | |||
500 | return report_string; | 500 | return report_string; |
501 | } | 501 | } |
502 | 502 | ||
503 | static const char * | ||
504 | expand_comment (struct metadef *def, void *data) | ||
505 | { | ||
506 | struct file_triplet *trp = data; | ||
507 | if (directive_get_value (trp, "comment", (const char**) &def->value)) | ||
508 | def->value = ""; | ||
509 | return def->value; | ||
510 | } | ||
511 | |||
503 | #define DECL_EXPAND_TIMER(what) \ | 512 | #define DECL_EXPAND_TIMER(what) \ |
504 | static const char * \ | 513 | static const char * \ |
505 | __cat2__(expand_timer_,what) (struct metadef *def, void *data) \ | 514 | __cat2__(expand_timer_,what) (struct metadef *def, void *data) \ |
@@ -531,6 +540,7 @@ struct metadef triplet_default_meta[] = { | |||
531 | { "dir", NULL, expand_relative_dir, NULL }, | 540 | { "dir", NULL, expand_relative_dir, NULL }, |
532 | { "dest-dir", NULL, expand_dest_dir, NULL }, | 541 | { "dest-dir", NULL, expand_dest_dir, NULL }, |
533 | { "source-dir", NULL, expand_source_dir, NULL }, | 542 | { "source-dir", NULL, expand_source_dir, NULL }, |
543 | { "comment", NULL, expand_comment, NULL }, | ||
534 | { NULL } | 544 | { NULL } |
535 | }; | 545 | }; |
536 | 546 | ||
@@ -561,6 +571,7 @@ struct metadef triplet_meta[] = { | |||
561 | { "user:real-name", NULL, expand_user_real_name, NULL }, | 571 | { "user:real-name", NULL, expand_user_real_name, NULL }, |
562 | { "user:email", NULL, expand_user_email, NULL }, | 572 | { "user:email", NULL, expand_user_email, NULL }, |
563 | { "report", NULL, expand_report, NULL }, | 573 | { "report", NULL, expand_report, NULL }, |
574 | { "comment", NULL, expand_comment, NULL }, | ||
564 | DECL_FULL_TIMER(wydawca), | 575 | DECL_FULL_TIMER(wydawca), |
565 | DECL_FULL_TIMER(triplet), | 576 | DECL_FULL_TIMER(triplet), |
566 | DECL_FULL_TIMER(spool), | 577 | DECL_FULL_TIMER(spool), |