#!/usr/bin/env perl

use warnings;

for (grep /(\.cc|spl-data\.h)$/, `git ls-files`)
{
    chomp;
    open IN, "<", $_ or die "Can't read $_\n";
    { undef local $/; $_ = <IN>; }
    close IN;

    for (/\bTILEG_[A-Z0-9_]+\b/g)
    {
        s/^TILEG_//;
        $tile{$_}=1;
        if (/^([A-Z0-9_]+)_ON$/)
        {
            $tile{"${1}_OFF"}  =1;
            $tile{"${1}_FOCUS"}=1;
            $tile{"${1}_MAX"}  =1;
            $tile{"${1}_INACTIVE"}=1;
        }
    }
}

print "$_\n" for sort keys %tile;
