Jump to content

  • Log In with Google      Sign In   
  • Create Account

Recursive .h file search?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 mason   Members   -  Reputation: 128

Like
Likes
Like

Posted 17 September 1999 - 05:07 AM

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


Sponsor:

#2 FlyFire   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 September 1999 - 07:36 AM

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


#3 johnny   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 September 1999 - 05:07 AM

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






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS