First some background.
I work in projects where there are several hundreds of .c and .h files divided in dozens of directories. Therefore it is very difficult to find a specific .h file. I used to use Windows search function. But it is very complex and slow to use. And if there are multiple files with the same name, it is difficult to decide which one is the correct one.
That is why I developed SEARC_INC.VDM.
Now I only need to put the cursor on the line that contains the #include directive and hit Ctrl-F12 to call the macro, and the correct include file is immediately opened!
Search_inc.vdm searches for the include file from directories listed in a file include.lst. (You can probably copy the list directly from your compiler command file or makefile.)
If the filename is enclosed in arrow braces <>, only directories listed in include.lst are searched. If the filename is enclosed in "", source file's directory is first searched, then dirs listed in include.lst.
If you list the include directories in the same order as in your compiler settings, Vedit will find exactly the same file as what compiler would use, even if there are multiple files with the same name.
If the file is not found using the search algorithm above, a dialog box opens. This allows you to edit the filename and then re-run the search. Or, you can select [Browse] to manually search for the file using file open dialog box.
Put include.lst file in the root of your projects directory tree, and it will be found where ever you are in the directory tree.
Since Vedit does not have a setting for "project home directory", I had to create a special search algorithm. The macro searches for include.lst file first from the directory of the currently edited file. If not found, it is then searched from parent directories (upwards in the directory tree) until the file is found or root is reached.
I have now included the macro in my C-TOOLS package ctools22.zip which I just updated on my web page:
http://koti.mbnet.fi/pkl/vedit/c_tools.htm
For more detailed description of the macro, see the file c_tools.txt, included in the .zip file.
Note: many other macros in the package have been updated, too. (I had actually upgraded some of the macros long time ago, but had not updated my web page until now.)
--
Pauli
|
|