🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Recursive .h file search?

Started by
1 comment, last by mason 24 years, 9 months ago
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

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

Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!
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

This topic is closed to new replies.

Advertisement