Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

errno(2)

,gclose(3g)

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. The file name is 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.
         This includes color map initialization and
         clearing the view surface.
 
  INIT - the device is initialized in a device dependent way.
 
  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. 
 
The named graphic device is opened unless one or more of the following are true:
 

A component of the path prefix is not a directory. [ENOTDIR]

A component of the path prefix denies search permission. 
[EACCES]

Mode permission is denied for the device specified. 

_NFILE file descriptors are currently open. [EMFILE]

The graphic device specified does not exist. [ENXIO]
(Graphics device driver is not loaded.) 

path points outside the process’s allocated address space. [EFAULT]

path is null. [ENOENT]

When a graphics device is opened, many defaults are set.  The file /starbase/defaults contains complete information on these defaults. 

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

errno(2),gclose(3g). 
 

Hewlett-Packard  —  last mod. May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026