Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gopen(3G)

inquire_device_driver(3G)

NAME

inquire_device_driver − return the name of the Starbase driver to use for a given device file. 

SYNOPSIS

C Syntax:

int inquire_device_driver(path,driver,length,flag);
char *path, *driver; int length, *flag;

FORTRAN77 Syntax:

subroutine inquire_device_driver(path,driver,flag);
character*(*) path;
character*(*) driver;
integer*4 flag;

Pascal Syntax:

procedure inquire_device_driver(path:string255;
var driver:string255;length:integer;var flag:integer);

DESCRIPTION

Input Parameters

path Device file name for the device to be used. 

length Number of bytes allocated for the driver name string. 

flag Pointer to word(s) containing flags indicating which driver to return. The flags are bitwise masks, and only those bit positions have meaning. This is a pointer instead of just an integer, thereby allowing more than 32 flags if needed. It can have the following values:

ACCELERATED Request the accelerated driver. 

UNACCELERATED Request the unaccelerated driver. 

Output Parameters

driver Starbase driver name that works with the device file. 

Discussion

inquire_device_driver can be used to determine which starbase driver to use for a given piece of hardware. This routine supports raster devices (eg /dev/crt), a window being used for window dumb applications (eg /dev/screen/window), and a window being used for window smart applications (eg "X11 unix:0.0 5800009"). This routine does not support tty devices (eg terminals and plotters) or windows being used for Windows/9000 applications. 
 
If the user is using shared libraries, then inquire_device_driver will return an appropriate driver. An appropriate driver is one that best matches the input parameters. If the user is using archive libraries, then inquire_device_driver will return an appropriate driver based on what libraries are linked in with the application. 
 
The following procedure is used to determine what to return for an application using archive libraries. See the examples section for more detail.

• Return the appropriate driver name, if that driver is accessable to the application. 

• Otherwise, return the alternate driver (accelerated or unaccelerated, as appropriate), if that driver is accessable to the application. 

• Otherwise, if the application is running in an X11 window, return the sox11 driver name if it is accessable to the application. 

• Otherwise, return NULL. 

Examples

For all of the following examples, the device file "/dev/crt" is considered to be set to a hp98704 device and flag is pointing to the ACCELERATED flag.  Also, the device file "/dev/screen/meow" is considered to be an X11 window running on /dev/crt. 
 
If the user linked the application with shared libraries, then the call inquire_device_driver("/dev/crt", driver, 10, &flag), would return "hp98705" in driver, with a return value of 1.
 
The following examples assume that the user is linking the application with only archive starbase libraries.
 
If the user linked the application with only the libdd98704.a device driver, then the call inquire_device_driver("/dev/crt", driver, 10, &flag) would return "hp98704" in driver, with a return value of 2. The call inquire_device_driver("/dev/screen/meow", driver, 10, &flag) would also return "hp98704" in driver, with a return value of 2.
 
If the user linked the application with the libdda1096.a and libddsox11.a device drivers, then the call inquire_device_driver("/dev/screen/meow", driver, 10, &flag) would return "sox11" in driver, with a return value of 2.
 
If the user linked the application with only the libdda1096.a device driver, then the call inquire_device_driver("/dev/screen/meow", driver, 10, &flag) would return 0. The call inquire_device_driver("/dev/crt", driver, 10, &flag) would also return 0.
 

RETURN VALUE

If the requested driver name could be found, then this routine will return a 1.  If an alternative driver name had to be used instead, then this routine will return a 2. If no suitable driver can be found, then this routine will return a 0. 
 

DEFAULTS

The default value for flags is ACCELERATED. 
 

SEE ALSO

gopen(3G), Starbase Graphics Techniques. 

Hewlett-Packard Company  —  HP-UX Release 9.03: April 1994

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