.\"##
.\" $XConsortium: p238,v 5.2 94/04/17 20:57:11 rws Exp $
.\"##
.\"## 
$XMCOPY
.\"## Copyright (c) 1990, 1991 by Sun Microsystems, Inc. 
.\"## 
.\"##                         All Rights Reserved
.\"## 
.\"## Permission to use, copy, modify, and distribute this software and its 
.\"## documentation for any purpose and without fee is hereby granted, 
.\"## provided that the above copyright notice appear in all copies and that
.\"## both that copyright notice and this permission notice appear in 
.\"## supporting documentation, and that the name of Sun Microsystems,
.\"## not be used in advertising or publicity 
.\"## pertaining to distribution of the software without specific, written 
.\"## prior permission.  
.\"## 
.\"## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
.\"## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
.\"## EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
.\"## CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
.\"## USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\"## OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\"## PERFORMANCE OF THIS SOFTWARE.
.TH "OPEN ARCHIVE FILE" 3P "29 February 1991"
.SH NAME
OPEN ARCHIVE FILE \- open specified archive file
.IX "Archive Files" "OPEN ARCHIVE FILE"
.SH SYNOPSIS
.SS C Syntax
.ft B
.ta 1.25i 3i
.nf
void
popen_ar_file ( archive_id, archive_file )
Pint	archive_id;	\fIarchive identifier\fP
char	*archive_file;	\fIarchive file name\fP
.fi
.ft R
.SS Required PHIGS Operating States
(PHOP, *, *, *)
.SH DESCRIPTION
.SS Purpose
Use \s-2OPEN ARCHIVE FILE\s+2 to open an archive file and associate a
specified archive file identifier with the open archive file.  
.SS C Input Parameters
.IP \fIarchive_id\fP
An integer specifying the identifier to be associated with the open
archive file.  
.IP \fIarchive_file\fP
A character string giving the file name of the archive file.  The
application should not open this file;  \s-2PHIGS\s+2 will do this when it
needs to access the file.  
.IP
Neither the application nor the operator should attempt to interact with
this file after passing it to \s-2OPEN ARCHIVE FILE\s+2.  
.SS Execution
If the specified archive file does not exist, then a new file is 
created and remains empty until \s-2CLOSE ARCHIVE FILE\s+2 is
called.  At that time, any archived structures will be written to
the file.  
.LP
If the specified file exists and is a valid \s-2PEX-SI\s0 archive file,
the contents are read and available for retrieval.  If the named
file exists but is empty, it is treated as if it did not exist 
(in other words, it becomes a valid \s-2PEX-SI\s0 archive file and remains 
empty until it is closed, at which time any archived structures are written to it).  
.LP
The physical file is opened only by \s-2PHIGS\s+2 when reading from or writing
to it (in other words, during calls to \s-2OPEN ARCHIVE\s+2 and \s-2CLOSE
ARCHIVE\s+2).
.LP
The \s-2PHIGS\s+2 archive state is set to \fIarchive open\fP (\s-2AROP\s+2),
and the specified archive file identifier is added to the
\fIset of open archive files\fP maintained in the \s-2PHIGS\s+2 state list.  
.LP
\fBNote:\fP  It is recommended that the application leave an archive file open
until it is no longer needed, in order to avoid repeating the
overhead associated with the \s-2OPEN ARCHIVE FILE\s+2 operation.
.LP
One archive file format is supported: a private \fIbinary\fP format.
The binary format is supported for users who want compact archives over
standard conformance.  
.SH ERRORS
.IP 002
Ignoring function, function requires state 
(\s-2PHOP\s+2, \s-2*\s+2, \s-2*\s+2, \s-2*\s+2)
.IP 402
Ignoring function, archive file identifier already in use
.IP 400
Ignoring function, the archive file cannot be opened
.IP 401
Ignoring function, opening this archive file would exceed the maximum number
of simultaneously open archive files
.IP 403
Ignoring function, the archive file is not a \s-2PHIGS\s+2 archive file
.SH SEE ALSO
.nf
.IP
.ta 0.5i
.SM "ARCHIVE STRUCTURES (3P)"
.SM "CLOSE ARCHIVE FILE (3P)"
.SM "INQUIRE ARCHIVE FILES (3P)"
.SM "INQUIRE ARCHIVE STATE VALUE (3P)"
.SM "RETRIEVE STRUCTURE IDENTIFIERS (3P)"
.SM "RETRIEVE STRUCTURES (3P)"
.SM "DELETE ALL STRUCTURES FROM ARCHIVE (3P)"
.fi
