use warnings;
use strict;
my $basedir = "docs/log-message-tags";
my $serial_file = "$basedir/next-number";
my $orig_serial = $serial;
my %tags;
next;
}
}
my $list = "";
}
exit 0;
sub process
{
my $file = shift;
#print STDERR "processing $file\n";
my $modified;
$modified = 1;
}
my $lineno = $.;
my $tag = $1;
while (1) {
if ($line =~ s/.*?
APLOGNO\(\s*
(\d+)
\s*\)
(
(?: [\s\n]*
(?:"
(?:\\"|[^"])+ # a string constant
"
|
\w+ # things like APR_SIZE_T_FMT
)
)* # zero or more string fragments. We allow
# zero because some logging constructs may
# use things like:
# logno=APLOGNO(...);
# ap_log_...(..., "%s...", logno, ...)
)
[\s\n]*
[,);:\\] # the "," before the next argument,
# or the closing brace of ap_log...(),
# or the end of a statement (if used
# outside of ap_log_...),
# or ":" in things like:
# cond ? "msg1" : "msg2",
# or "\" at the end of a macro line
//xs) {
my $match = $&;
last;
}
else {
# log format inside preprocessor #if, that's too complicated
last;
}
}
};
}
else {
}
}
}
sub gen_tag
{
my $file = shift;
my $msg = shift;
}
sub note_tag
{
my $file = shift;
my $lineno = shift;
my $tag = shift;
my $msg = shift;
$msg =~ s/^[\s\n]+//s;
$oneline .= $1;
}
$oneline .= $1;
}
}
print STDERR "WARNING: Duplicate tag $tag at $tags{$tag}->{file}:$tags{$tag}->{line} and $file:$lineno\n";
}
print STDERR "WARNING: next-number $serial inconsistent with tag $tag at $file:$lineno, adjusting\n";
}
}
sub write_file
{
my $file = shift;
my $data = shift;
}
sub read_serial
{
my $name = shift;
return $num;
}