CIF_OPEN(3)
NAME
Cif_Open, Cif_Close - Opens or closes a compiler information file (CIF)
SYNOPSIS
#define CIF_VERSION 2
#include <cif.h>
int Cif_Open (filename, opentype, rtypes, version)
char ∗filename;
char ∗opentype;
int ∗rtypes;
int version;
int Cif_Close (cifd, freemode)
int cifd;
int freemode;
IMPLEMENTATION
All Sun SPARC systems
DESCRIPTION
The Cif_Open routine opens the CIF specified by filename and assigns it the descriptor cifd. You must use the descriptor for all further references to the CIF. The Cif_Close routine closes the CIF that is associated with the descriptor cifd.
The Cif_Open routine accepts the following arguments:
filename Points to a character string that contains the name of the file.
opentype Specifies a character string that contains r.
rtypes Specifies the types of records to open. If the rtypes argument is NULL, all records of all types are returned. If rtypes is not NULL, it must be the address of a zero-terminated integer array of record type values. Cif_Getrecord returns only records with a type included in the rtypes array; all other records are skipped.
version Identifies the CIF version to open.
The Cif_Close routine accepts the following arguments:
cifd Specifies the CIF to close.
freemode Indicates that action is taken with any memory space associated with the CIF. The following actions may be taken:
CIF_MEM_KEEP retains space that is associated with the CIF for use with structures from other CIFs. CIF_MEM_FREE releases space that is associated with the CIF by using free().
CIF_VERSION defines the library version. The default is 1. The newest version is 2 and should be used with this routine.
See the Cif(3) man page for a discussion about CIF information, format, and versions.
RETURN VALUES
If the Cif_Open return value is positive, it is a valid CIF descriptor; otherwise, the open failed, and the return value indicates the status.
EXAMPLES
The following examples show how to use the Cif_Open and Cif_Close routines.
Example 1: The following example, when used in a program, opens the CIF called myprogram.T and assigns it the descriptor mycif. The records array limits the records that can be returned by Cif_Getrecord to records of types CIF_CIFHDR, CIF_ENTRY, CIF_UNIT, and CIF_ENDUNIT.
int records[] = { CIF_CIFHDR, CIF_ENTRY, CIF_UNIT, CIF_ENDUNIT, 0 };
int mycif; . . .
mycif = Cif_Open ("myprogram.T", "r", records, 1); . . . Example 2: The following example, when used in a program, closes the CIF that is associated with the descriptor mycif and releases the space that is associated with the CIF:
int mycif; . . .
(void) Cif_Close (mycif, CIF_MEM_FREE); . . .
SEE ALSO
Cif(3) for general information about CIFs
Cif_Duplicate(3), Cif_Errstring(3), Cif_Free(3), Cif_Getpos(3), Cif_Getrecord(3), Cif_Memmode(3), Cif_Msginsert(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-format specific 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: