🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.shell
5 messages
5 total messages Started by Jinfu Chen Wed, 12 Sep 1990 17:39
Extract function names
#1019
Author: Jinfu Chen
Date: Wed, 12 Sep 1990 17:39
18 lines
1092 bytes
I'm looking for a tool to extract names of function call in C files. A
typical use of it is to build a cross-reference list for function calls. For
example, given source files of RN, I would like to find out which file the
ngdata_init() call is defined (and optionally) used.

Shell scripts (including perl) are welcome.





-- 
Jinfu Chen                  (602)898-5338 
Motorola, Inc.  SPS  Mesa, AZ
 ...uunet!motsps!digital!chen
chen@digital.sps.mot.com
CMS: RXFR30 at MESAVM
----------
Re: Extract function names
#1124
Author: Ken Lee
Date: Wed, 12 Sep 1990 21:24
11 lines
865 bytes
In article <4cc48e05.12c9a@digital.sps.mot.com>, chen@digital.sps.mot.com (Jinfu Chen) writes:
|> I'm looking for a tool to extract names of function call in C files. A
|> typical use of it is to build a cross-reference list for function calls.

Check out the ctags and cxref programs, available on most UNIX systems.

-- 
Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee
Re: Extract function names
#1055
Author: Daniel Edelson
Date: Thu, 13 Sep 1990 05:15
14 lines
1253 bytes
In article <4cc48e05.12c9a@digital.sps.mot.com> chen@digital.sps.mot.com (Jinfu Chen) writes:
>I'm looking for a tool to extract names of function call in C files. A
>typical use of it is to build a cross-reference list for function calls. For
>example, given source files of RN, I would like to find out which file the
>ngdata_init() call is defined (and optionally) used.
>-- 
>Jinfu Chen                  (602)898-5338 / chen@digital.sps.mot.com

The easiest way might be to first compile the files and then
use nm(1) to obtain the symbols defined in each module.

Daniel Edelson                             ``Do you think we 
daniel@cis.ucsc.edu, or                      should test it before
...!sun!practic!peren!daniel                we ship it?''
Re: Extract function names
#1121
Author: Jinfu Chen
Date: Fri, 14 Sep 1990 15:03
25 lines
1520 bytes
Thanks for all the replies and postings to my question. Suggestions include
using sed, grep, ctags, nm, and cxref. I find that cxref(1) comes with SYS V
is exactly what I need and works very well. Anyone still using
sed/grep/ctags/nm should give cxref a look.

My only problem with cxref is rather Apollo specific. On Apollos, cxref is
under Sys 5.3 environment but all my programs are developed under BSD 4.3
environment. Worst yet, cxref is stamped as sys5.3 for systype and runtype so
even explicitly calling the program still put me into sys5.3 environment. The
result is cxref (actually /usr/lib/xcpp) couldn't find BSD style include
files, or complain about incorret system calling syntax. I did try using
-I/bsd4.3/usr/include but still no luck.

I wonder if anyone in Apollo land could give me some help?




-- 
Jinfu Chen                  (602)898-5338 
Motorola, Inc.  SPS  Mesa, AZ
 ...uunet!motsps!digital!chen
chen@digital.sps.mot.com
CMS: RXFR30 at MESAVM
----------
Re: Extract function names
#1161
Author: Keith Cantrell
Date: Mon, 17 Sep 1990 18:52
51 lines
2285 bytes
In article <4cc48e05.12c9a@digital.sps.mot.com> chen@digital.sps.mot.com (Jinfu Chen) writes:
>I'm looking for a tool to extract names of function call in C files. A
>typical use of it is to build a cross-reference list for function calls. For
>example, given source files of RN, I would like to find out which file the
>ngdata_init() call is defined (and optionally) used.
>
>Shell scripts (including perl) are welcome.
>
>-- 
>Jinfu Chen                  (602)898-5338 
>Motorola, Inc.  SPS  Mesa, AZ
> ...uunet!motsps!digital!chen
>chen@digital.sps.mot.com
>CMS: RXFR30 at MESAVM
>----------

There was a program posted a while back (as in server years ago) call 'id'
that does an excellent job of exactly what you want.  It was written by
Greg McGary.  At the bottom of a README file I found the following:

-- Greg McGary
-- P.O. Box 286
-- Lincoln, MA  01773
--
-- 9/15/87
--
--     Until the end of 1987,
--     Consulting to Sun's East Coast Division:
--             gmcgary@ecd.sun.com
--             gmcgary@suneast.uu.net
--
--     After that, probably consulting in Europe...


so I am not sure what the current status of this program is.  This program
does have a copyright notice on it, so I don't just want to posted it
unless someone can convince me that I want get into any trouble :-).

Type at you later,

Keith Cantrell

-----------------------------------------------------------------------
Keith Cantrell                    Phones:  hm: 214-492-1088
Apollo Computer                            wk: 214-519-2399 @ DSC 
A Subsidiary of Hewlett-Packard
USMAIL:                          EMAIL:
2100 Sonata Ln                   kcantrel@digi.lonestar.org
Carrollton TX 75007                           or
                                  ...!uunet!digi!kcantrel
-----------------------------------------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads