home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Education
/
collectionofeducationcarat1997.iso
/
COMPUSCI
/
CSCOP.ZIP
/
CSCOPE.DOC
< prev
next >
Wrap
Text File
|
1993-10-31
|
39KB
|
1,495 lines
c-scope
C program
analysis tool
User's Manual
JAYAR Systems
253 College Street
Suite 263
Toronto, Ontario
Canada M5T 1R5
(416) 751-5678
LICENSE
The license for the Shareware evaluation (trial use) version of
c-scope is contained in the file LICENSE.DOC. This file has been included
for your convenience as an appendix to this manual.
WARRANTY
The Shareware evaluation (trial use) version of c-scope is provided
AS IS. JAYAR Systems MAKES NO WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED,
INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY AND/OR
FITNESS FOR A PARTICULAR PURPOSE.
SUPPORT POLICY
JAYAR Systems provides free support for this product. We will answer
questions and fix serious bugs. If you have any questions about or problems
with using this product, give us a call at the number on the front cover of
this manual. Or, if you are not in a rush, send us a letter.
We would also appreciate hearing from you if you have any comments or
suggestions for improvements.
_______
____|__ | (R)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
c-scope Copyright (C) 1991-93 JAYAR Systems
All Rights Reserved
CONTENTS
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 What c-scope does . . . . . . . . . . . . . . . . . . . . . . . 2
3 Using c-scope . . . . . . . . . . . . . . . . . . . . . . . . . 8
1 Installing c-scope . . . . . . . . . . . . . . . . . . . . . 8
2 Running c-scope . . . . . . . . . . . . . . . . . . . . . . 8
3 Ignoring functions . . . . . . . . . . . . . . . . . . . . . 9
4 Function declarations . . . . . . . . . . . . . . . . . . . 9
4 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1 Non-standard function types . . . . . . . . . . . . . . . . 11
2 Preprocessor . . . . . . . . . . . . . . . . . . . . . . . . 11
3 Function pointers . . . . . . . . . . . . . . . . . . . . . 11
A Error messages . . . . . . . . . . . . . . . . . . . . . . . . 13
B License . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
C Trial Use License: . . . . . . . . . . . . . . . . . . . . . . 16
D Limited Distribution License: . . . . . . . . . . . . . . . . . 17
E Definition of Shareware . . . . . . . . . . . . . . . . . . . . 19
F How to Register . . . . . . . . . . . . . . . . . . . . . . . . 20
iii
1 Introduction
c-scope is an analysis tool for C programs. It shows you what functions are
contained in a program and which functions they reference. This information
is provided in several easy-to-use formats. In addition, the registered
version of c-scope computes and reports a number of software complexity
metrics for each function.
The program to be analyzed may be contained in one file, or spread
across many files, as is typical with C programs.
It is possible with c-scope to get detailed information on all of the
inter-function references, or just on those that you are interested in.
The analysis provided by c-scope is ideal for understanding or
documenting the structure and operation of a large C program, whether it is
a program you wrote or one that you inherited.
Using c-scope is simple and is described in the following sections of
the manual. Section 2 describes c-scope's capabilities by working through a
short example. Section 8 shows you how to use c-scope. And Section 3.4
provides a few notes on using c-scope.
1
What c-scope does 2
2 What c-scope does
The easiest way to explain what c-scope does is to work through an example.
For illustration purposes we will use the following simple example program
(the RPN desk calculator program, borrowed from K & R) and analyze it with
c-scope. The program consists of five functions, in three files.
File DCALC.C in Figure 1 contains the main program, main(), file
STACK.C in Figure 2 contains the functions push(), pop() and clear() and
file GETOP.C in Figure 3 contains function getop().
When c-scope analyzes a program it produces four reports which are
printed on stdout:
o A Function Location report. For each function defined in your program
(i.e., has source code), c-scope lists the function (functions are
listed alphabetically), the name of the file the function is contained
in, and the line number in the file where the function is defined; for
our example program:
FUNCTION LOCATION
Function File Line No.
-------------------- -------------------- --------
clear STACK.C 34
getop GETOP.C 6
main DCALC.C 7
pop STACK.C 22
push STACK.C 10
o A File Contents report. This is similar to the Function Location
report, but for each file the functions defined in it are listed. File
names are printed in the order determined by the contents of the file
SOURCE.DAT (discussed later in Section 8):
FILE CONTENTS
File Function
-------------------- --------------------
GETOP.C getop
DCALC.C main
STACK.C push
pop
clear
What c-scope does 3
o A Function References report. For each function defined in the program
(i.e., whose source code is available), an alphabetical list of the
functions called by that function are listed. c-scope recognizes a
function call if it occurs in the body of the function or in an
initialization statement. Functions which do not reference any other
functions are listed as referencing function void (