File: ioctl2desc

package info (click to toggle)
xawtv 3.107-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,204 kB
  • sloc: ansic: 46,254; perl: 749; sh: 422; cpp: 184; makefile: 126; xml: 74
file content (16 lines) | stat: -rw-r--r-- 289 bytes parent folder | download | duplicates (13)
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";
}