![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 08:39 AM |
| How to identify which device from ssd29? | KhawHL | SUN Solaris | 10 | 05-13-2008 09:16 PM |
| identify this mobo | blowFish@ubuntu | What's on Your Mind? | 0 | 07-17-2007 10:06 PM |
| how to identify files I cannot access | wvdeijk | UNIX for Dummies Questions & Answers | 4 | 08-04-2006 02:18 AM |
| identify hardware | patrickb | Filesystems, Disks and Memory | 0 | 02-21-2006 07:29 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
identify function
Does anyone know a shell command that identifies the functions from a C file? Thank you
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
What are you trying to do - list functions in C source? Or in compiled binaries?
|
|
#3
|
|||
|
|||
|
source
Quote:
|
|
#4
|
|||
|
|||
|
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
|
|||
|
|||
|
ok, thank you, I was told that there is such a command... my mistake. And thanks again for the link.
|
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||
|
|||
|
That's exactly the kind of script I was trying to avoid. Hopefully, I'll find another way to do this. I encountered problems when differentiating between a declaration, a definition and a call of a function, as the regular expressions became very complex. That's when I was told that there already exists a command that does this (identifies each function)... just that I can't find it.
|
|||
| Google The UNIX and Linux Forums |
| Tags |
| linux, regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|