Skip to content

Simple tool to quickly show the definition of a function (or other stuff) in C/C++/Perl source files

License

Notifications You must be signed in to change notification settings

phrounz/funfind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

funfind

Very simple command-line program displaying the definition or the declaration of something on global scope, in C/C++ source files.

Works on Linux, Windows, using gcc. Port to other compilers or operating systems is probably easy.

Source under MIT license.

Compilation

   gcc funfind.c -o funfind

Syntax

   funfind <pattern> <file-1> [<file-2> [...]]

Basically, pattern must be a part (or the entirety) of what is before the first bracket (or the semicolon, whatever comes first).

Examples

   # show the main function in foo.c
   funfind main foo.c         
   
   ---> will display for example:
       int main(int argc, char* argv[])
       {
         printf("Hello world\n");
         return 0;
       }
   
   # show the processFile function in foo.c or foo.h
   funfind processFile foo.c foo.h  
   
   # show functions returning void or having parameters with void (or voidOfTheUniverse) in it
   funfind void foo.c
   
   # show the main function in foo.c (but only if it matches this pattern)
   funfind "main(int argc" foo.c    
   
   # show all typedefs on the global scope
   funfind typedef foo.c            
   
   # show the Bar class definition/declaration (if it is not a nested class)
   funfind "class Bar" foo.h

Bugs

  • The program has still some troubles with #ifdef.
  • I did the code a long time ago (I just recently translated it quickly from french and fixed a bug), so please be forgiving on the code quality.

About

Simple tool to quickly show the definition of a function (or other stuff) in C/C++/Perl source files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages