.TP 12
\fI@filename@
The name of the input file currently being processed (e.g. foo.h).
+.TP 12
+\fI@basename@
+The base name of the input file currently being processed (e.g. foo.h). (Since: 2.22)
.SS Trigraph extensions
Some C comments are treated specially in the parsed enum definitions, such comments
#!@PERL_PATH@ -w
+use File::Basename;
+
# glib-mkenums.pl
# Information about the current enumeration
my $flags; # Is enumeration a bitmask?
print " \@Type\@ either Enum or Flags\n";
print " \@TYPE\@ either ENUM or FLAGS\n";
print " \@filename\@ name of current input file\n";
+ print " \@basename\@ base name of the current input file (Since: 2.22)\n";
exit 0;
}
if (length($fhead)) {
my $prod = $fhead;
+ my $base = basename ($ARGV[0]);
$prod =~ s/\@filename\@/$ARGV[0]/g;
+ $prod =~ s/\@basename\@/$base/g;
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
chomp ($prod);
if (length($fprod)) {
my $prod = $fprod;
+ my $base = basename ($ARGV);
$prod =~ s/\@filename\@/$ARGV/g;
+ $prod =~ s/\@basename\@/$base/g;
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
chomp ($prod);
if (length($ftail)) {
my $prod = $ftail;
+ my $base = basename ($ARGV);
$prod =~ s/\@filename\@/$ARGV/g;
+ $prod =~ s/\@basename\@/$base/g;
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
chomp ($prod);