CIF_MEMMODE(3)
NAME
Cif_Memmode - Selects the memory management mode for a compiler information file (CIF)
SYNOPSIS
#define CIF_VERSION 2
#include <cif.h>
int Cif_Memmode (cifd, mode)
int cifd;
int mode;
IMPLEMENTATION
All Sun SPARC systems
DESCRIPTION
The Cif_Memmode routine establishes the memory management mode that processes the structures that the Cif_Getrecord(3) routine returns.
The Cif_Memmode routine accepts the following arguments:
cifd Specifies CIF descriptor returned by the Cif_Open(3) routine.
mode Specifies memory managment mode.
You can specify one of the following three modes for mode:
CIF_MEM_INDIV Each structure is returned by using newly allocated space. You must free the space when it is no longer needed. You can use the Cif_Free(3) routine to free individual structures.
CIF_MEM_FIXED Each call to Cif_Getrecord uses the same memory area. The next call to Cif_Getrecord overwrites the contents of the memory area. This is the default mode.
CIF_MEM_MANAGED
Structures are allocated from memory that the library routines manage. Structures are accumulated as they are encountered and can be released by using the Cif_Release(3) routine.
Cif_Memmode must be called after the Cif_Open(3) routine, but before the first call to Cif_Getrecord, for any particular CIF. Each open CIF can use a different mode.
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
A positive return value indicates successful completion. A negative return value indicates that an error occurred.
EXAMPLES
The following example, when used in a program, sets the memory management mode for the CIF that is identified by the descriptor mycif to CIF_MEM_INDIV. The descriptor is assigned by the Cif_Open routine. int mycif; . . . (void) Cif_Memmode (mycif, CIF_MEM_INDIV); . . .
SEE ALSO
Cif(3) for general information about CIFs
Cif_Close(3), Cif_Duplicate(3), Cif_Errstring(3), Cif_Free(3), Cif_Getpos(3), Cif_Getrecord(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-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: