The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passing global variable to a function which is called by another function sars Shell Programming and Scripting 4 06-30-2008 11:39 AM
How to identify which device from ssd29? KhawHL SUN Solaris 10 05-14-2008 12:16 AM
identify this mobo blowFish@ubuntu What's on Your Mind? 0 07-18-2007 01:06 AM
how to identify files I cannot access wvdeijk UNIX for Dummies Questions & Answers 4 08-04-2006 05:18 AM
identify hardware patrickb Filesystems, Disks and Memory 0 02-21-2006 10:29 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-04-2006
xinfinity xinfinity is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 5
identify function

Does anyone know a shell command that identifies the functions from a C file? Thank you
  #2 (permalink)  
Old 04-04-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
What are you trying to do - list functions in C source? Or in compiled binaries?
  #3 (permalink)  
Old 04-04-2006
xinfinity xinfinity is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 5
source

Quote:
Originally Posted by jim mcnamara
What are you trying to do - list functions in C source? Or in compiled binaries?
I want to get all the names of the functions from a C source file, by using a shell command.
  #4 (permalink)  
Old 04-04-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
There isn't a shell command that does that.

You need special software to parse the code. You can use splint to get information like that. Download it here:

http://www.splint.org/download.html
  #5 (permalink)  
Old 04-04-2006
xinfinity xinfinity is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 5
ok, thank you, I was told that there is such a command... my mistake. And thanks again for the link.
  #6 (permalink)  
Old 04-04-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
You could write a very complex shell script to find all occurrences of2words that come just before an open parenthesis, then do a unique sort on those words. Then you have to find a way to remove all of the external functions.

However, coders do funny things with declarations that really confuse a script. Generally, you need to write a lexer (lex & yacc) to parse source code correctly.
Closed Thread

Bookmarks

Tags
linux, regex, regular expressions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0