473,394 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

List of all functions in a C files

Hi All,

Is there way to list all functions in a C files? I've to rename all the
functions.

thanks,
Uday
Nov 15 '05 #1
15 9377
> Is there way to list all functions in a C files? I've to rename all
the functions.


I don't know what you are trying to do, but you may want to rethink your
strategy.

--
Martijn
http://www.sereneconcepts.nl
Nov 15 '05 #2
In article <Eo**************@news.oracle.com>, Uday <l0***@yahoo.com> wrote:
Hi All,

Is there way to list all functions in a C files? I've to rename all the
functions.


UNIX-ish answer: compile it and run elfdump or nm with the appropriate
options.

Windows answer: your "visual" thingy has a mode that lists function names

Or just read the files yourself and write down a list. if there is a
large number of functions to deal with (100+) then such a change should
probably planned with great care, far beyond simply renaming. Sounds
like someone gave you some busy-work.
--
7842++
Nov 15 '05 #3
Uday wrote:

Is there way to list all functions in a C files? I've to rename
all the functions.


Many. nm, cscope, xref all come to mind. However you have to make
corresponding changes in many files, including the .h ones. Once
you have a list id2id will come in handy. See:

<http://cbfalconer.home.att.net/download/id2id-20.zip>

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 15 '05 #4
CBFalconer wrote:
Uday wrote:

Is there way to list all functions in a C files? I've to rename
all the functions.


Many. nm, cscope, xref all come to mind.


What exactly would be the prescribed procedure for obtaining a list of
all functions in a source file using cscope?

Robert Gamble

Nov 15 '05 #5
In article <11**********************@o13g2000cwo.googlegroups .com>,
Robert Gamble <rg*******@gmail.com> wrote:
....
What exactly would be the prescribed procedure for obtaining a list of
all functions in a source file using cscope?


Probably start by reading the manual. After that, it's easy.

Nov 15 '05 #6
Kenny McCormack wrote:
In article <11**********************@o13g2000cwo.googlegroups .com>,
Robert Gamble <rg*******@gmail.com> wrote:
...
What exactly would be the prescribed procedure for obtaining a list of
all functions in a source file using cscope?


Probably start by reading the manual. After that, it's easy.


I thought cscope pnly had the following options:

Find this C symbol:
Find this global definition:
Find functions called by this function:
Find functions calling this function:
Find this text string:
Change this text string:
Find this egrep pattern:
Find this file:
Find files #including this file:

Not sure how can I get a list of functions in a file.

Nov 15 '05 #7
CBFalconer wrote:
Uday wrote:

Is there way to list all functions in a C files? I've to rename
all the functions.


Many. nm, cscope, xref all come to mind. However you have to make
corresponding changes in many files, including the .h ones. Once
you have a list id2id will come in handy. See:

<http://cbfalconer.home.att.net/download/id2id-20.zip>

Thanks a lot Chuck. I used *nm *to get the function names and then used
*id2id*.

But not sure how cscope helps here. I use cscope daily. It doesn't have
an option to list all function names in a C file. Let me know if I
missed something.
rgds,
Uday

Nov 15 '05 #8
Jaspreet wrote:
Kenny McCormack wrote:
In article <11**********************@o13g2000cwo.googlegroups .com>,
Robert Gamble <rg*******@gmail.com> wrote:
...
What exactly would be the prescribed procedure for obtaining a list of
all functions in a source file using cscope?


Probably start by reading the manual. After that, it's easy.


I thought cscope pnly had the following options:

Find this C symbol:
Find this global definition:
Find functions called by this function:
Find functions calling this function:
Find this text string:
Change this text string:
Find this egrep pattern:
Find this file:
Find files #including this file:

Not sure how can I get a list of functions in a file.


Apparently Kenny has a copy of the manual that contains information not
found at http://cscope.sourceforge.net/cscope_man_page.html. Maybe he
will be kind enough to enlighten us with the knowledge of where to
obtain said manual.

Robert Gamble

Nov 15 '05 #9
Robert Gamble wrote:
CBFalconer wrote:
Uday wrote:

Is there way to list all functions in a C files? I've to rename
all the functions.


Many. nm, cscope, xref all come to mind.


What exactly would be the prescribed procedure for obtaining a
list of all functions in a source file using cscope?


Cscope does seem to be a problem. It also has some funny ideas
about what constitutes a function.

However the xref I include in the hashlib package (DOS executable
only, source is lost) marks all function names with a terminal ().
So you can easily pick out the list with simple things such as
"grep () <xrefoutput.xrf>". However it won't discriminate between
static declarations in different files. It considers functional
macros to be functions and has similar failings to cscope. To
illustrate:

#include <iso646.h>

int main(void) {
while (not(something)) continue;
....

and cscope and xref both think not is a function.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 15 '05 #10
Uday wrote:

Part 1.1 Type: Plain Text (text/plain)
Encoding: 7bit


Security risk html/mime ignored and destroyed. Usenet is a pure
text medium.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 15 '05 #11


CBFalconer wrote:
Uday wrote:
Part 1.1 Type: Plain Text (text/plain)
Encoding: 7bit

Security risk html/mime ignored and destroyed. Usenet is a pure
text medium.


"Usenet is a pure text medium?" Surely you're
joking, Mr. Fey-- er, Falconer.

http://ars.userfriendly.org/cartoons/?id=20050720

--
Er*********@sun.com

Nov 15 '05 #12
Hi if you are try to rename all functions in a c files, you take the
risk of your project not run in other operationals system...

Nov 15 '05 #13
On 2005-07-22 05:27, LucasRescue wrote:
Hi if you are try to rename all functions in a c files, you take the
risk of your project not run in other operationals system...


Not necessarily.

Nov 15 '05 #14
In article <20050724194328.U39760@gothmog>,
Giorgos Keramidas <ke******@ceid.upatras.gr> wrote:
On 2005-07-22 05:27, LucasRescue wrote:
Hi if you are try to rename all functions in a c files, you take the
risk of your project not run in other operationals system...


Not necessarily.


Please go to m-w.com and lookup the word "risk".

Nov 15 '05 #15
ga*****@yin.interaccess.com (Kenny McCormack) wrote:
In article <20050724194328.U39760@gothmog>,
Giorgos Keramidas <ke******@ceid.upatras.gr> wrote:
On 2005-07-22 05:27, LucasRescue wrote:
Hi if you are try to rename all functions in a c files, you take the
risk of your project not run in other operationals system...


Not necessarily.


Please go to m-w.com and lookup the word "risk".


Yes, and? If you write a C program, any C program, you take the risk of
it not running under other implementations, because some do declare
identifiers they should not declare. If it's a proper C implementation,
these non-Standard identifiers can be turned off. Renaming all functions
in _your_ C files, if done correctly, does not increase this risk.

Richard
Nov 15 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Harold Crump | last post by:
Greetings, I need to get a list of all files in a particular virtual directory on a web site, such as - http://www.myServer.com/FileStore I tried using the directory functions, but this...
19
by: Ross A. Finlayson | last post by:
Hi, I hope you can help me understand the varargs facility. Say I am programming in ISO C including stdarg.h and I declare a function as so: void log_printf(const char* logfilename, const...
3
by: Bryan | last post by:
This is for a utility that I am writing to update all of our Excel reports. I currently have a form with a couple list boxes and browse buttons. One browse button allows the user to add the XLS...
9
by: TheOne | last post by:
Would anyone please point me to a list of reentrant C library functions? I want to know which C library functions are safe to use inside a signal handler across all platforms. Does GNU C library...
10
by: not_a_commie | last post by:
Here is a list of features I've wanted in .NET as pulled from my lab notebook. If some of them are already there, maybe somebody could point them out to me. If you have an opinion positive or...
4
by: none | last post by:
Hi, I am wondering if anyone has some insight into a way to get the names of the functions that are defined in a C header file. What I am trying to do is develop tests for a large amount of C...
8
by: dmp | last post by:
What are Linked list? Please somebody show some ready made programs of linked list
0
by: Atos | last post by:
SINGLE-LINKED LIST Let's start with the simplest kind of linked list : the single-linked list which only has one link per node. That node except from the data it contains, which might be...
36
by: pereges | last post by:
Hi, I am wondering which of the two data structures (link list or array) would be better in my situation. I have to create a list of rays for my ray tracing program. the data structure of ray...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.