KernelNewbies
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Kernel Hacking

  • Frontpage

  • Kernel Hacking

  • Kernel Documentation

  • Kernel Glossary

  • FAQ

  • Found a bug?

  • Kernel Changelog

  • Upstream Merge Guide

Projects

  • KernelJanitors

  • KernelMentors

  • KernelProjects

Community

  • Why a community?

  • Regional Kernelnewbies

  • Personal Pages

  • Upcoming Events

References

  • Mailing Lists

  • Related Sites

  • Programming Links

Wiki

  • Recent Changes

  • Site Editors

  • Side Bar

  • Tips for Editors

  • Hosted by WikiWall

Navigation

  • RecentChanges
  • FindPage
  • HelpContents
KernelNewbies:
  • attachment:find_voidp_funcs.pl of KernelJanitors/Todo/VoidPointerConvs

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.
  • [get | view] (2017-12-30 01:18:39, 0.6 KB) [[attachment:find_voidp_funcs.pl]]
  • [get | view] (2017-12-30 01:18:39, 17.0 KB) [[attachment:type-convs.pl]]
  • [get | view] (2017-12-30 01:18:38, 1.1 KB) [[attachment:voidp_vars.pl]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01