Attachment 'find_voidp_funcs.pl'
Download 1 #!/usr/bin/perl
2 #
3 # Finds all functions returning a (void*).
4 # To be used with the type-convs.pl script, which looks for
5 # type-changed assignments of such functions - like this:
6 # type *x = (type*) function().
7 # According to http://kernelnewbies.org/KernelJanitors/Todo
8 # this is deprecated.
9
10 $kernel_dir=shift || die "Need a directory argument (kernel sources).\n";
11
12 @ARGV=split(/\0/, `find "$kernel_dir" -type f -iname "*.c" -print0`);
13 die "No sources found.\n" unless @ARGV;
14
15 # Print output sorted.
16 open(STDOUT, "| sort -u") || die "Cannot start sort: $!\n";
17
18 $/=undef;
19 while (<>)
20 {
21 print "$1\n" while
22 m{
23 void \s* \* \s*
24 (\w+) \s* \(
25 }xg;
26 }
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.