Search for patterns in source code
I am using Visual Studio 6.0 and code is in C/C++. Commercial software with over 2000 source files scattered all over. Trying to get a handle on doing some estimates on various tasks.
Is there a way in VS6.0 that allows one to do "Find In Files..." with some complex search criteria?
For example, I would like to search for lines in files that contains the string "alloc" or "malloc" or "calloc" or "realloc" which does NOT contain the string "sizeof". Is there a way to do this?
I also would like to have a line count (how many lines are there in all these files when the search pattern matches), and a file count (how many files do these lines occured in).
If they can be configures to ignore lines that preceeds with "//" or in the middle of a /*...*/ block or even inside of a #if 0 ... #endif even better.
This is just one example, I need to do dozens of different searches to make an assessment on how bad the code is and decide whether we hack/patch or refactor or whatever.
Also we use CVS source code control which creates a admin directory with duplicate code that will double the count, is there a way to "include subfolder" but not to include subfolders of a specific name?