GOPEN(3G)
NAME
gopen − open an I/O path to a graphics device, create the environment for that device, and optionally perform device initialization.
SYNOPSIS
C SYNTAX
int gopen (path,kind,driver,mode);
char *path,*driver;
int kind,mode;
FORTRAN77 SYNTAX
integer*4 function gopen(path,kind,driver,mode)
character*(*) path,driver
integer*4 kind,mode
PASCAL SYNTAX
function gopen(path:string255;kind:integer;
driver:string255;mode:integer):integer;
HP-UX COMPATIBILITY
Level: HP-UX/STANDARD
Origin HP
DESCRIPTION
INPUT PARAMETERS
path
is the device file name for the device to be opened. This file is usually found in the /dev directory.
kind
is one of the constants
INDEV (device is to be used for input only),
OUTDEV (device if to be used for output only), or
OUTINDEV (device is to be used for input and output.)
driver
is the character representation of the hardware device type. See the Starbase Device Drivers Library for details.
mode
is a word of flags specifying control at open time. The following flags can be OR-ed together:
SPOOLED - the output is spooled to a file.
Do not inquire from the device
RESET_DEVICE - the device is completely initialized.
INIT - the device is initialized in a device dependent way.
This includes color map initialization and
clearing the view surface.
THREE_D - all transformations that occur are three dimensional.
This includes point, line, and polygon transformations as
well as matrix concatenations.
For example:
fildes=gopen("/dev/hpib",OUTDEV,"hp97060",SPOOLED|INIT);
DISCUSSION
This function returns a non-negative integer upon a successful device opening. This integer is called the file descriptor and is referred to by the name fildes in this manual.
The file descriptor remains open across exec system calls. See fcntl(2) .
No process may have more than _NFILE file descriptors open simultaneously. _NFILE is an HP-UX system variable which defines the number of open processes allowed at any one time. The value assigned to this variable is found in /usr/include/stdio.h. Only one raster output device may be open by a single process simultaneously, though that device may be opened more then once. When a graphics device is opened, many defaults are set. The file /usr/lib/starbase/defaults contains complete information on these defaults.
The device file name PATH is created by the mknod command. For information about creation of the device file, refer to the Starbase Device Drivers Library manual under the chapter which describes the device of interest.
RETURN VALUE
Upon successful completion, a non-negative integer, namely a file descriptor, is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
SEE ALSO
Starbase Device Drivers Library,errno(2),gclose(3g).
Hewlett-Packard Company — May 11, 2021