2023-01-27 17:04:41 -05:00
|
|
|
#!/bin/perl
|
|
|
|
|
|
|
|
$in_section = 0;
|
|
|
|
$in_heading = 0;
|
|
|
|
$section = "";
|
|
|
|
$heading = "";
|
|
|
|
$accumulated = "";
|
|
|
|
|
2023-01-27 17:07:27 -05:00
|
|
|
print "
|
2023-01-27 17:22:59 -05:00
|
|
|
/* This file was generated by tools/process-metadata */
|
2023-01-27 17:07:27 -05:00
|
|
|
void
|
|
|
|
UIConfiguration::build_metadata ()
|
|
|
|
{
|
|
|
|
|
|
|
|
#define VAR_META(name,...) { char const * _x[] { __VA_ARGS__ }; all_metadata.insert (std::make_pair<std::string,Metadata> ((name), PBD::upcase (_x))); }\n\n";
|
|
|
|
|
2023-01-27 17:04:41 -05:00
|
|
|
while (<>) {
|
2023-01-27 17:22:59 -05:00
|
|
|
if (/^#/) {
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (/\[SECTION:/) {
|
2023-01-27 17:04:41 -05:00
|
|
|
chop;
|
|
|
|
s/\[SECTION://;
|
|
|
|
s/\]//;
|
|
|
|
$section = $_;
|
|
|
|
$in_section = 1;
|
|
|
|
$in_heading = 0;
|
|
|
|
$heading = "";
|
2023-01-27 17:07:27 -05:00
|
|
|
$accumulated = "";
|
2023-01-27 17:04:41 -05:00
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$in_section) {
|
|
|
|
print "NIS\n";
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (/\[[a-z0-9_-]+\]/) {
|
|
|
|
|
|
|
|
if ($accumulated ne "") {
|
|
|
|
@arr = split (/\s+/, $accumulated);
|
|
|
|
|
2023-01-27 17:07:27 -05:00
|
|
|
print "\tVAR_META (X_(\"$heading\"), ";
|
2023-01-27 17:04:41 -05:00
|
|
|
for my $word (@arr) {
|
|
|
|
if ($word ne "") {
|
|
|
|
print "_(\"$word\"), ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print " NULL);\n";
|
|
|
|
$accumulated = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
chop;
|
|
|
|
chop;
|
|
|
|
$heading = substr ($_, 1);
|
|
|
|
$in_heading = 1;
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$in_heading) {
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
|
|
|
$accumulated .= $_;
|
|
|
|
}
|
2023-01-27 17:07:27 -05:00
|
|
|
|
|
|
|
print "\n}\n";
|