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 windows being used for window-dumb applications and windows being used for window-smart applications (e.g., "X11 local:0.0 5800009"). This routine does not support tty devices (e.g., terminals and plotters).
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 accessible to the application.
• Otherwise, return the alternate driver (accelerated or unaccelerated, as appropriate), if that driver is accessible to the application.
• Otherwise, if the application is running in an X11 window, return the sox11 driver name if it is accessible to the application.
• Otherwise, return NULL.
Examples
For all of the following examples, the device file "<screen>/window" (the actual path names of the directories given in angle brackets in this section depend on the file system structure; see the Graphics Administration Guide for details) is considered to be an X11 window displayed on <dev>/crt, and "flag" is pointing to the accelerated flag.
The following examples assume that the user is linking the application with only archive Starbase libraries.
If the user linked the application with the libddgcrx.a and libddsox11.a device drivers, the call inquire_device_driver("<screen>/window", driver, 10, &flag) would return "sox11" in driver, with a return value of 2.
If the user linked the application with only the libddcgm.a device driver, the call inquire_device_driver ("<screen>/window", driver, 10, &flag) would return 0.
RETURN VALUE
If the requested driver name could be found, this routine will return a 1. If an alternative driver name had to be used instead, this routine will return a 2. If no suitable driver can be found, this routine will return a 0.
DEFAULTS
The default value for flags is ACCELERATED.
SEE ALSO
Starbase Reference: gopen(3G). Starbase Graphics Techniques.
Hewlett-Packard Company — November 03, 1994