#! /usr/bin/perl
use strict;
use warnings;
my %codecs;
while (<STDIN>) {
my %codec;
if (/^\s+REGISTER_(\w+)\s*\(([^,]+),\s*([^\)]+)\)/) {
my ($type, $codec_name) = ($1, $3);
$codec{name} = $codec_name;
$codec{is_decoder} = $codec_name if $type =~ /ENCDEC|DECODER/;
$codec{is_encoder} = $codec_name if $type =~ /ENCDEC|ENCODER/;
$codecs{$codec_name} = \%codec;
}
}
foreach my $name (sort keys %codecs) {
my $codec = $codecs{$name};
print "\@item $codec->{name}" .
" \@tab " . ($$codec{is_decoder} ? "X" : "") .
" \@tab " . ($$codec{is_encoder} ? "X" : "") .
"\n";
}
Add a code snippet to your website: www.paste.org