• Mauro Carvalho Chehab's avatar
    [media] drx-j: Get rid of typedefs on drxh.h · b3ce3a83
    Mauro Carvalho Chehab authored
    This were fixed with the help of this small perl script:
    
    	#!/usr/bin/perl
    	my $dir = shift or die "need a dir";
    	my $type = shift or die "need type";
    	my $var = shift or die "need var";
    	sub handle_file {
    		my $file = shift;
    		my $out;
    		open IN, $file or die "can't open $file";
    		$out .= $_ while (<IN>);
    		close IN;
    		$out =~ s/\btypedef\s+($type)\s+\{([\d\D]+?)\s*\}\s+\b($var)[^\;]+\;/$type $var \{\2\};/;
    		$out =~ s,\b($var)_t\s+,$type \1 ,g;
    		$out =~ s,\bp_*($var)_t\s+,$type \1 *,g;
    		$out =~ s,\b($var)_t\b,$type \1,g;
    		$out =~ s,\bp_*($var)_t\b,$type \1 *,g;
    		open OUT, ">$file" or die "can't open $file";
    		print OUT $out;
    		close OUT;
    	}
    	sub parse_dir {
    		my $file = $File::Find::name;
    		return if (!($file =~ /.[ch]$/));
    		handle_file $file;
    	}
    	find({wanted => \&parse_dir, no_chdir => 1}, $dir);
    
    Some manual work were needed.
    Acked-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
    b3ce3a83
drxj.c 474 KB