Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ xref(1) — DG/UX 5.4R3.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cxref(1)

cc(1)



xref(1)                        DG/UX 5.4R3.00                        xref(1)


NAME
       xref - generate cross reference table from C, Fortran and Pascal
       sources

SYNOPSIS
       xref [-e] [-l<c|f|p>] [-p] [-u] [-wnum] [-Dname[=string]] [-Idir]
       [-U] [-X82] [ filename ] ...

   where:
       filename

              Is a source file.  By default xref uses the filename's
              extension to determine the language of the source, (.c for C ,
              .f for Fortran, and .p for Pascal).  All sources for a given
              invocation of xref must be of the same language.  The language
              of the source file can be set explicitly by the -l option.  If
              the first filename argument does not have a recognized
              extension or if the source is to be read from standard input,
              the -l option must be used to set the language.

              For C sources, xref invokes the cxref(1) command.  Therefore
              xref imposes the same restrictions:  A filename is required,
              source cannot be read from standard input, and all files must
              have a .c extension.  cxref(1) also creates a temporary .cx
              file in the current directory. The user must have write
              permission to the current directory and no .cx file can exist
              for a specified .c file input.

DESCRIPTION
       The xref command reads source files and generates a cross reference
       table for the identifiers found.  xref will read source from standard
       input or from files listed as arguments on the command line. A cross
       reference table is written to standard output listing identifiers in
       alphabetical order.  Each table entry gives the filenames and line
       numbers where the identifier was found.

       For the C language, defined preprocessor macro names are included in
       the cross reference table.  By default predefined macro names are
       omitted from the table.  The -p option will restore them.  DG/UX
       header files define many long preprocessor macros to handle
       administration of include files.  In order to minimize their presence
       in the table, identifiers beginning with an underscore '_' are
       omitted from the table by default.  The -u option will restore them.
       The -D and -U options can be used to define and undefine macro names
       in the same way as they are used by cc.

       For the Fortran language, xref recognizes Green Hills extensions,
       intrinsic functions and system routines and omits them from the cross
       reference table.  The -e option can be used to disable extensions,
       treating those keywords as normal identifiers instead.  Green Hills
       treats debug lines, (lines beginning with [XxDd]), as comments unless
       the -X82 switch is used.  xref recognizes the -X82 switch and treats
       debug lines as normal code when it is used.




Licensed material--property of copyright holder(s)                         1




xref(1)                        DG/UX 5.4R3.00                        xref(1)


       For the Pascal language, xref recognizes Green Hills predefined words
       and extensions, omitting them from the cross reference table. The -p
       option may be used to disable predefines and the -e option may be
       used to disable extensions.  Identifiers to be omited from the table
       are treated as case insensitive.  Identifiers that remain in the
       table are treated as case sensitive.

       Column spacing is based on the lengths of  the longest identifier,
       filename and line number in the output.  The overall width of the
       table can be controlled by the -wnum option, by default 80.  The
       minimum width of the table is the sum of the longest identifier,
       filename, and line number.  Values specified for num less than the
       minimum are treated as being the minimum.

       Options are:

       -e     Disable Green Hills Fortran and Pascal extensions (ignored for
              C source).

       -l<c|f|p>
              Specify the language of the source files as C, Fortran or
              Pascal respectively.

       -p     Disable Green Hills predefined words and exclusion of
              predefined macros in C (ignored for Fortran source).

       -u     Disable exclusion of identifiers beginning with an underscore
              in C (ignored for Fortran and Pascal sources).

       -wnum  Set width of cross reference table to num columns.

       [-Dname[=string]]
              Define macro name for C sources (ignored for Fortran and
              Pascal sources).

       [-Idir]
              Search for #include files in the directory dir.  If more than
              one -I option is specified search directories in the order
              they appear on the command line.

       [-U]   Undefine macro name for C sources (ignored for Fortran and
              Pascal sources).

       [-X82] Treat Fortran debug lines as code instead of comments (ignored
              for C and Pascal sources).

EXAMPLES
       xref -I/pdd/pascalincludes file1.p file2.p

       xref -lc -w60 file.c >file.xrf

DIAGNOSTICS
       xref does not verify that a Fortran or Pascal source is compilable.




Licensed material--property of copyright holder(s)                         2




xref(1)                        DG/UX 5.4R3.00                        xref(1)


       An error will be reported for mismatched Pascal closing comment
       symbols('*)', '}').

SEE ALSO
       cxref(1), cc(1).

NOTES
       Fortran identifiers split over a continuation line are treated as two
       separate identifiers.

       Fortran keywords used as arrays are not reported as identifiers.

       Fortran intrinsic function keywords are not reported as identifiers
       when used in the parameter list of an intrinsic function regardless
       of whether they are a valid keyword for that particular intrinsic
       function.

       Fortran data type reserved words used as the left operand in
       multiplications are not reported as identifiers.






































Licensed material--property of copyright holder(s)                         3


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026