aboutsummaryrefslogtreecommitdiffstats
path: root/structs/ioctl2desc
blob: 5575ee0ac681fa75d881a58e45559dee2f2e72ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl
use strict;

my ($name,$type);

while (<>) {
	($name,$type) = m/\#define\s+(\w+)\s+_IO\w+\s*\([^,]+,\s*\d+,\s*(.*?)\)/
	  or next;

	$type =~ s/struct /desc_/;

	print "[_IOC_NR($name)] = {\n";
	print "\t.name = \"$name\",\n";
	print "\t.desc = $type,\n";
	print "},\n";
}

Privacy Policy