Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

mason

Recursive .h file search?

This topic is 7032 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've done such prog for one guy for money (it takes about a hour to me to write it)
on Borland C++
That's it, it takes first .c file as parameter and recursive scans for each included file and then stores ASCII graphics tree into out file.
You can easy modify it for your needs.

If you interested, send me an e-mail and i'll send it's sources.

mailto:mit@pc2o205a.pnpi.spb.ru

------------------
FlyFire/CodeX
http://codexorg.webjump.com

Share this post


Link to post
Share on other sites
Advertisement
OK, I need a tool, and before I write it, I wanted to make sure there's not one out there already.

Here's the situation: I've got a symbol, say, const char *currentversion = "1.00." It's defined in version.h.

Now I've got myprog.cpp:

#include "myheader.h"
#include "myotherheader.h"
#include "yetanotherheader.h"
#include "onemoreheader.h"
#include "oklastoneipromise.h"

one of these header files eventually #includes version.h, tho maybe not directly (maybe myheader.h includes commonheader.h which includes version.h).

I need a tool that takes as input "currentversion" and spits out something like:

"currentversion" found in myprog.cpp/myheader.h/commonheader.h/version.h.

Browse info won't help me here. It'll take me directly to "currentversion" but it won't tell me how it got there, which is what I'm more interested in.

In other words... I'm looking for a "Find In Files" tool that recursively uses the "include tree."

As a last resort, I'm considering writing my own (doesn't seem like it'd be that hard to write as a DevStudio macro), but I'd rather just d/l it.

Has anyone heard of such a tool?

Mason McCuskey
Spin Studios
www.spin-studios.com

Share this post


Link to post
Share on other sites
I was wondering... do you want this program to help you avoid multiple definitions of varialbes? Or just to see the layout of your program? If you want to avoid mutliple definitions, use the standard:

#ifndef X_H
#define X_H

// header file stuff in here

#end if

Where X is the name of your .h file, such as MAIN_H for main.h This will only include your header file once in a compile of the program, no matter how often you #include it in other .c/.cpp files. If you already knew that... just ignore

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!