Oracle® Solaris Studio 12.4: C User's Guide

Exit Print View

Updated: March 2015
 
 

8.2.1 Step 1: Set Up the Environment

cscope is a screen-oriented tool that can only be used on terminals listed in the Terminal Information Utilities (terminfo) database. Be sure you have set the TERM environment variable to your terminal type so that cscope can verify that it is listed in the terminfo database. If you have not done so, assign a value to TERM and export it to the shell as follows:

In a Bourne shell, type:

$ TERM=term_name; export TERM

In a C shell, type:

% setenv TERM term_name

You may now want to assign a value to the EDITOR environment variable. By default, cscope invokes the vi editor. (The examples in this chapter illustrate vi usage.) If you prefer not to use vi, set the EDITOR environment variable to the editor of your choice and export EDITOR, as follows:

In a Bourne shell, type:

$ EDITOR=emacs; export EDITOR

In a C shell, type:

% setenv EDITOR emacs

You may have to write an interface between cscope and your editor. For details, see Command-Line Syntax for Editors.

If you want to use cscope only for browsing (without editing), you can set the VIEWER environment variable to pg and export VIEWER. cscope will then invoke pg instead of vi.

An environment variable called VPATH can be set to specify directories to be searched for source files. See View Paths.