LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-29-2008, 05:15 AM   #1
itchy8me
Member
 
Registered: Feb 2007
Location: Rotterdam
Distribution: debian 5
Posts: 33

Rep: Reputation: 15
Lightbulb making a graphical representation of include files in project.


hello,

I'm wondering wether there is a program/tool which can generate a graphical representation of all the include files in a c/c++ project. Thus a top down tree diagram. Anyone know of any such program/tool?

kind regards,
Wernher
 
Old 08-29-2008, 05:42 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
You could do:

Code:
tree -P '*.h'
 
Old 08-29-2008, 05:50 AM   #3
itchy8me
Member
 
Registered: Feb 2007
Location: Rotterdam
Distribution: debian 5
Posts: 33

Original Poster
Rep: Reputation: 15
strangely i don't have tree, the man pages says its a built in command. weird.
 
Old 08-29-2008, 06:12 AM   #4
itchy8me
Member
 
Registered: Feb 2007
Location: Rotterdam
Distribution: debian 5
Posts: 33

Original Poster
Rep: Reputation: 15
okasy found the provider for tree, however this was not what i was looking for. Doing $tree -P qucs/qucs/main.h, provides me with the following:
Code:
                                                                      
.                                                                               
|-- adms-2.2.8                                                                  
|   |-- admsCheck                                                               
|   |-- admsElement                                                             
|   |-- admsPreprocessor                                                        
|   |-- admsVeriloga                                                            
|   |-- admsXml                                                                 
|   |-- auxconf                                                                 
|   |-- images                                                                  
|   `-- scripts                                                                 
|-- adms-2.2.9                                                                  
|   |-- admsXml                                                                 
|   |-- auxconf                                                                 
|   |-- images                                                                  
|   `-- scripts                                                                 
|-- qucs                                                                        
|   |-- CVS                                                                     
|   |-- autom4te.cache                                                          
|   |-- contrib                                                                 
|   |   |-- CVS                                                                 
|   |   `-- vc                                                                  
|   |       `-- CVS                                                             
|   |-- debian                                                                  
|   |   `-- CVS                                                                 
|   |-- qucs                                                                    
|   |   |-- CVS                                                                 
|   |   |-- bitmaps                                                             
|   |   |   `-- CVS                                                             
|   |   |-- components                                                          
|   |   |   `-- CVS                                                             
|   |   |-- diagrams                                                            
|   |   |   `-- CVS                                                             
|   |   |-- dialogs                                                             
|   |   |   `-- CVS                                                             
|   |   |-- paintings                                                           
|   |   |   `-- CVS                                                             
|   |   `-- xmlutilities                                                        
|   |       `-- CVS                                                             
|   |-- qucs-attenuator                                                         
|   |   |-- CVS                                                                 
|   |   `-- bitmaps                                                             
|   |       `-- CVS                                                             
|   |-- qucs-edit                                                               
|   |   `-- CVS                                                                 
|   |-- qucs-filter                                                             
|   |   `-- CVS                                                                 
|   |-- qucs-help                                                               
|   |   |-- CVS                                                                 
|   |   `-- docs                                                                
|   |       |-- CVS                                                             
|   |       |-- cs                                                              
|   |       |   `-- CVS                                                         
|   |       |-- de                                                              
|   |       |   `-- CVS                                                         
|   |       |-- en                                                              
|   |       |   `-- CVS                                                         
|   |       |-- es                                                              
|   |       |   `-- CVS                                                         
|   |       |-- fr                                                              
|   |       |   `-- CVS                                                         
|   |       |-- ru                                                              
|   |       |   `-- CVS                                                         
|   |       `-- uk                                                              
|   |           `-- CVS                                                         
|   |-- qucs-lib                                                                
|   |   |-- CVS                                                                 
|   |   `-- library                                                             
|   |       `-- CVS                                                             
|   |-- qucs-tools                                                              
|   |   `-- CVS                                                                 
|   `-- qucs-transcalc                                                          
|       |-- CVS                                                                 
|       |-- bitmaps                                                             
|       |   `-- CVS                                                             
|       `-- examples                                                            
|           `-- CVS                                                             
|-- qucs-core                                                                   
|   |-- CVS                                                                     
|   |-- autom4te.cache                                                          
|   |-- contrib                                                                 
|   |   |-- CVS                                                                 
|   |   `-- vc                                                                  
|   |       `-- CVS                                                             
|   |-- doc                                                                     
|   |   `-- CVS                                                                 
|   |-- m4                                                                      
|   |   `-- CVS                                                                 
|   `-- src                                                                     
|       |-- CVS                                                                 
|       |-- components                                                          
|       |   |-- CVS                                                             
|       |   |-- devices                                                         
|       |   |   `-- CVS                                                         
|       |   |-- digital                                                         
|       |   |   `-- CVS                                                         
|       |   |-- microstrip                                                      
|       |   |   `-- CVS                                                         
|       |   `-- verilog                                                         
|       |       `-- CVS                                                         
|       |-- converter                                                           
|       |   `-- CVS                                                             
|       `-- math                                                                
|           `-- CVS                                                             
`-- qucs-doc                                                                    
    |-- CVS                                                                     
    |-- autom4te.cache                                                          
    |-- doxygen                                                                 
    |   `-- CVS                                                                 
    |-- report                                                                  
    |   |-- CVS                                                                 
    |   |-- EKV26                                                               
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   |-- StoQ_test1                                                          
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   |-- StoQ_test2                                                          
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   |-- StoQ_test3                                                          
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   |-- StoQ_test4                                                          
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   |-- StoQ_test5                                                          
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   |-- curtice                                                             
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   |-- log_amp                                                             
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   |-- mesfet                                                              
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   |-- mod_amp                                                             
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   |-- potentiometer                                                       
    |   |   |-- CVS                                                             
    |   |   `-- pics                                                            
    |   |       `-- CVS                                                         
    |   `-- verilog                                                             
    |       |-- CVS                                                             
    |       `-- pics                                                            
    |           `-- CVS                                                         
    |-- technical                                                               
    |   `-- CVS                                                                 
    `-- tutorial                                                                
        |-- CVS                                                                 
        |-- bjtbias                                                             
        |   |-- CVS                                                             
        |   `-- pics                                                            
        |       `-- CVS                                                         
        |-- coupler                                                             
        |   |-- CVS                                                             
        |   `-- pics                                                            
        |       `-- CVS                                                         
        |-- dcstatic                                                            
        |   |-- CVS                                                             
        |   `-- pics                                                            
        |       `-- CVS                                                         
        |-- digital                                                             
        |   |-- CVS                                                             
        |   `-- pics                                                            
        |       `-- CVS                                                         
        |-- equations                                                           
        |   |-- CVS                                                             
        |   `-- pics                                                            
        |       `-- CVS                                                         
        |-- ffmodels
        |   |-- CVS
        |   `-- pics
        |       `-- CVS
        |-- functions
        |   |-- CVS
        |   `-- pics
        |       `-- CVS
        |-- getstarted
        |   |-- CVS
        |   `-- pics
        |       `-- CVS
        |-- lna
        |   `-- CVS
        |-- modelbjt
        |   |-- CVS
        |   `-- pics
        |       `-- CVS
        |-- opamp
        |   |-- CVS
        |   `-- pics
        |       `-- CVS
        |-- poweramp
        |   |-- CVS
        |   `-- pics
        |       `-- CVS
        |-- spicetoqucs
        |   |-- CVS
        |   `-- pics
        |       `-- CVS
        `-- timer555
            |-- CVS
            `-- pics
                `-- CVS

215 directories, 0 files
which is the tree structure of my directory.

Is there a program/tool like this but then to display the tree diagram of includes in a C/C++ project?

kind regards,
Wernher

Last edited by itchy8me; 08-29-2008 at 06:15 AM.
 
Old 08-29-2008, 08:50 AM   #5
makyo
Member
 
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 735

Rep: Reputation: 76
Hi.

There appears to be something on-point at http://www.cpan.org/scripts/nutshell/ch6/inctree ... cheers, makyo
 
Old 08-29-2008, 09:08 AM   #6
itchy8me
Member
 
Registered: Feb 2007
Location: Rotterdam
Distribution: debian 5
Posts: 33

Original Poster
Rep: Reputation: 15
thanks a bunch, a little raw and ungraphical, but hey it'll suffice
 
Old 08-29-2008, 10:30 AM   #7
itchy8me
Member
 
Registered: Feb 2007
Location: Rotterdam
Distribution: debian 5
Posts: 33

Original Poster
Rep: Reputation: 15
refining my searches on google through a lead by makyo, i have come across the program calltree, http://linux.softpedia.com/progDownl...nload-971.html, which also refers to the cflow command. Doing a "info cflow" in shell i find the info papers on the command but the binary is not installed on my system. searched my package manager for it and google but cannot find the tars or a package that provides it. Anybody know what software package would provide cflow?

kind regards,
Wernher
 
Old 08-29-2008, 10:34 AM   #8
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
The tree thing sort of works if you invoke it with the correct arguments - listing files which match the pattern "*.h" or whatever. However, I cannot find a way to suppress the printing of directories which do not contain any headers.

If all you want is a list, find is the best tool. I was hoping that tree would accept a list of files to list on stdin or as command line arguments, but alas it does not.
 
Old 08-29-2008, 10:45 AM   #9
makyo
Member
 
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 735

Rep: Reputation: 76
Hi.

Quote:
Description: Analyze control flow in C source files
GNU cflow analyzes a collection of C source files and prints a graph, charting
control flow within the program.
.
Homepage: http://www.gnu.org/software/cflow/
Tag: devel::lang:c, interface::commandline, role:rogram, scope::utility, suite::gnu, use::browsing, works-with::software:source

-- excerpt from GNU/Debian lenny apt-cache show cflow
The page at gnu.org exists, but I stopped there because cflow is in my repository.

It was also the top hit with Google ... cheers, makyo

Last edited by makyo; 08-29-2008 at 10:47 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphical representation of VBR audio? kahlil88 Linux - General 0 12-07-2006 09:17 AM
Graphical representation of man page relations marsm Linux - General 2 11-27-2006 07:59 AM
Kdevekop: include a Project as a Subproject ? bastl Programming 1 09-09-2005 12:09 PM
make file to include libxml into your project alix123 Programming 3 12-10-2004 05:17 AM
Folding@Home Graphical representation of work? Thymox Linux - Software 2 12-03-2002 03:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration