CIF(3)
NAME
Cif − Introduction to the compiler information file (CIF) library routines
IMPLEMENTATION
All Sun SPARC systems
DESCRIPTION
CIFs are generated by the Sun SPARCompiler Fortran 90 compiler. They contain information about the Fortran source code. Depending on the options you select on the compiler command, a CIF can contain some or all of the following: Information about compiler options and the characteristics of the machine for which the source code was compiled Information about procedures Compiler messages Information about loops and statement types, and about procedures called in the source code Cross-reference information for each label, variable, procedure name, procedure argument, and symbolic constant in the source code
CIFs do not contain dynamic information, such as run-time trace information.
The compilers generate information that applies only to source code, as CIFs have language dependent structures as appropriate.
CIFs are designed to be used with programming tools. Using a set of library routines and the cif.h header file, you can write your own programs in the C programming language to retrieve information from the C or Fortran CIFs. Records are converted to a structure format before they are returned by the Cif_Getrecord(3) routine.
CIFs are initially ASCII, but when passed through cifconv(1) or when the Cif_Cifconv(3) routine is used, they are converted to sorted binary. The following are some of the benefits of a sorted binary CIF: Smaller Faster to read Additional selective queries: Cif_Filedir(3), Cif_Getunitdir(3), and Cif_Recgroup(3) Ordered
The cif.h file contains the following: Symbolic constants for all record types and the values contained in the record fields Structure declarations Library routine prototypes Symbolic constants for all CIF status values
Versions
CIFs that are written by F90 1.0 have CIF library version 2 format. To use any CIF reading tool with these new compilers, it is necessary to relink (or, optionally, recompile). There are two levels to using the new version 2 CIFs. If the tool’s functionality is satisfactory, relinking is all that is required. However, in order to take advantage of the new records that the new CIFs provide, the symbolic constant CIF_VERSION will need to be defined as 2 in the source file prior to the inclusion of cif.h, and then compiled (#define CIF_VERSION 2).
Since libcif 2.0 is a superset of libcif 1.0, it includes the logic to handle both version 1 and version 2 CIFs. The version 2 library recognizes a version 1 code even if a version 2 CIF is being read (generated by a new compiler) and will pass back only version 1 records. The version 1 library, however, will not handle version 2 CIFs. The library assumes that version 1 CIFs are used unless the symbolic constant CIF_VERSION has the value 2.
The CIF environment has three parts: the tool, the library, and the CIF generated by the compiler. The CIF is determined by the version of the compiler. The latest library is version 2. It also accepts version 1 CIFs. The tool determines which version is used by the value of the symbolic constant CIF_VERSION.
A summary of combinations of the three parts follows:
| Library to | |||
| CIF-version | which linked | Tool | Status |
| 1.0 | 1.0 | 1.0 | Okay |
| 1.0 | 1.0 | 2.0 | Won’t work |
| 1.0 | 2.0 | 1.0 | Okay |
| 1.0 | 2.0 | 2.0 | Okay |
| 2.0 | 1.0 | 1.0 | Won’t work |
| 2.0 | 1.0 | 2.0 | Won’t work |
| 2.0 | 2.0 | 1.0 | Okay |
| 2.0 | 2.0 | 2.0 | Okay |
Associated headers
cif.h
Associated functions
Binary format only functions
Cif_Getfiledir(3) Retrieves the file directory
Cif_Getunitdir(3) Retrieves the unit directory for the requested unit
Cif_Recgroup(3) Retrieves all the records of a particular type that belong to a single unit
Binary and ASCII format functions
Cif_Close(3) Closes a CIF
Cif_Duplicate(3) Duplicates a CIF structure
Cif_Errstring(3) Gets a string describing an error condition
Cif_Free(3) Frees all memory associated with a CIF structure
Cif_Getpos(3) Returns the current position of a CIF
Cif_Getrecord(3) Gets the next record
Cif_Memmode(3) Selects the memory management mode
Cif_Msginsert(3) Inserts message arguments into message text
Cif_Open(3) Opens a CIF
Cif_Release(3) Frees memory that is associated with a CIF
Cif_Setpos(3) Sets the current position of a CIF
ASCII to binary conversion
cifconv(1) CIF reformatter
SEE ALSO
Cif_Close(3), Cif_Duplicate(3), Cif_Errstring(3), Cif_Free(3), Cif_Getpos(3), Cif_Getrecord(3), Cif_Memmode(3), Cif_Msginsert(3), Cif_Open(3), Cif_Release(3), Cif_Setpos(3) for information about general CIF library routines
Cif_Getfiledir(3), Cif_Getunitdir(3), Cif_Recgroup(3) for information about binary CIF library routines
cifconv(1) for information about ASCII to binary format conversion in the
Compiler information file CIF Compiler information Compiler listings
SunOS 3.0.1 — Last change: