STARBASE(3G)
NAME
starbase − Starbase Graphics Library description
DESCRIPTION
The Starbase Graphics Library consists of procedures used to generate graphics text and pictures. This library is based on the emerging American National Standards Institute’s Computer Graphics Interface standard (ANSI CGI). The Starbase Graphics Library provides a high-performance interface to HP graphics hardware and other selected graphics peripherals. These library routines can be used in C, Pascal and Fortran77 programs. In addition to the standard ANSI-CGI functions, Starbase provides asynchronous input functions, 3-dimensional transformations, and access to many device-dependent hardware features.
LINKING STARBASE PROGRAMS
It is extremely important that link files be specified in the following order:
driver(s),
libsb1.a,
libsb2.a .
Some drivers may require that additional libraries be linked with them. For instance, using libddhpgl.a requires that libdvio.a be linked as well. Also, some functions in the Starbase library require that the math library be linked in. Functions that require the math library are view_camera, ellipse, arc, and the shading functions. Specific requirements are described in The Starbase Device Drivers Manual.
For example: to compile and link the C program test.c for running on a terminal, hp98700 or hpgl plotter, use:
cc test.c -lddhpterm -ldd98700 -lhpgl -lsb1 -lsb2 -ldvio -lm -o test -O
LINKING STARBASE WINDOW PROGRAMS
HP Windows 9000
To link a Starbase program that may be directed to a window, the window library and possibly the byte driver must be included. The byte driver needs to be included for programs that draw to obscured graphics windows which are retained. Again, the order is important:
driver(s), [byte_driver], window_library, libsb1.a, libsb2.a
For example:
cc test.c -ldd98700 -lddbyte -lwindow -lsb1 -lsb2 -lm -o test -O
X - Windows
To link a Starbase program that may be directed to an X - Window, the X libraries and the libddXn.a driver must be included. Again, the order is important:
driver(s), X libraries, libsb1.a, libsb2.a
For example:
cc test.c -ldd98720 -lddXn.a -lX.a -lXr.a -lsb1.a -lsb2.a -lm -o test.c -O
INCLUDE FILE USAGE
The following templates show how include files should be used with the various language bindings:
C include Template
#include <starbase.c.h>
func()
{
/* function body */
}
main()
{
/* program body */
}
FORTRAN include Template
include ’/usr/include/starbase.f1.h’
program main
CPARAMETER statements
character NULL
parameter(NULL = char(0))
include ’/usr/include/starbase.f2.h’
CVARIABLE declarations
Cprogram body and/or subroutines and functions
end
Pascal include Template
program main(input,output);
$include ’/usr/include/starbase.p1.h’$
{ CONSTANTS }
{ TYPES }
{ VARIABLES }
$include ’/usr/include/starbase.p2.h’$
{ PROCEDURES AND FUNCTIONS }
begin
{program body}
end.
FILES
The following files make up the Starbase Graphics Library. Each is shown with a description of its function. These files are located in the /usr/lib directory.
libsb1.aStarbase Main Library
libsb2.aStarbase Stub Entry Points
libddbyte.aHP9000/Windows memory file
libwindow.aHP9000/Windows Library
and device drivers of the form libdd*.a
The following files are found in the /usr/include directory and should be used with the appropriate programming language.
starbase.c.hC program header file
starbase.f1.hFortran77 program header file
starbase.f2.hFortran77 program header file
starbase.p1.hPascal program header file
starbase.p2.hPascal program header file
SIGNALS
It is not recommended to use Starbase calls within a signal handler. There is state information that is needed within a procedure, if another Starbase procedure is called while another is processing information, this information can be lost or modified. If it is necessary to use Starbase calls, keep track of the current active Starbase file descriptor, and use a different file descriptor to the same device. Make sure this second file descriptor is not used outside the signal handler. At the end of the signal handler make a call to the current active device using a Starbase procedure that does not actually access the device, such as inquire_color_table with a count of 0. This should reset the device.
HARDWARE DEPENDENCIES
There are two versions of the Starbase library file, libsb1.a, on the series 300 releases. One has been compiled for the series 310 computer and will work for either the 310 or the 320 and is named /usr/lib/libsb1.10.a. The other has been compiled to utilize 68020 instructions and to use the 68881 math co-processor. This version is named /usr/lib/libsb1.20.a. The Starbase customize script, that is run whenever a system update is performed, links (ln) the appropriate version into the /usr/lib/libsb1.a file. If wishing to link a program that is to run on another system, it might be necessary to link with either libsb1.10.a or libsb1.20.a instead of libsb1.a in order to use the version best-suited for the target machine.
MKNOD SPECIAL FILES
HPGL Device Driver
The <sc> parameter is the select code of the HP_IB card or Serial Interface Card. The <LU> is the hardware Logical Unit number. The <AD> parameter is the HP_IB or Serial Interface Card address.
Series 300 Syntax
mknod /dev/hpgl c 21 0x<SC><AD>00
Series 800 Syntax
mknod /dev/hpgl c 21 0x<LU><AD> ... (for HPIB Card)
mknod /dev/hpgl c 1 0x<LU><AD> ... (for Serial interfaces)
HP_HIL Device Driver
The <LU> parameter is the Hardware Logical Unit Number and the <GI> parameter is the Graphics Interface Number and the <AD> parameter is the Address on the HIL serial loop.
Series 300
mknod /dev/hilx c 42 0x0000<AD>
Series 800
mknod /dev/hil<LU> c 42 0x00<LU><AD>
OR
mknod /dev/hil_<LU>.<AD> c 42 0x00<LU><AD>
HPTERM Device Driver
Use device file /dev/tty if you want the output to go to the terminal you are logged in on. See your System Administrator for details on using other terminals. Other terminals are usually designated as /dev/tty01, /dev/tty02, etc.
HP300h/HP300l Device Driver
Series 300 Syntax
mknod /dev/crt c 12 0x000000 ... (when alone)
mknod /dev/crt c 12 0x000100 ... (when also using hp98204b)
HP9836A Device Driver
Series 300
mknod /dev/crt c 12 0x000000
HP9837 Device Driver
mknod /dev/crt c 12 0x000000
HP98700 Device Driver
Series 300 Syntax
The <SC> parameter is the external select code of the HP98700 device.
mknod /dev/crt c 12 0x000000 ... (for console device)
mknod /dev/crt c 12 0x<SC>0200 ... (for external select code)
HP98550 Device Driver
Series 300 Syntax
mknod /dev/crt c 12 0x000000 ... (for old planes)
mknod /dev/ocrt c 12 0x000001 ... (for overlay planes)
mknod /dev/icrt c 12 0x000002 ... (for image planes)
HP98710 Device Driver
Series 300 Syntax
The <SC> parameter is the external select code of the HP98710 device
mknod /dev/crt c 12 0x000000 ... (for console device)
mknod /dev/crt c 12 0x<SC>0200 ... (for external select code)
HP98720 Device Driver
Series 300 Syntax
The <SC> parameter is the external select code of the HP98720 device
mknod /dev/crt c 12 0x000000 ... (for console device)
mknod /dev/crt c 12 0x<SC>0200 ... (for external select code)
Series 800 Syntax
The <LU> parameter is the hardware logical unit number of the HP98720 device
mknod /dev/crt c 14 0x00<LU>00
HP98721 Device Driver
Series 300 Syntax
The <SC> parameter is the external select code of the HP98721 device
mknod /dev/crt c 12 0x000000 ... (for console device)
mknod /dev/crt c 12 0x<SC>0200 ... (for external select code)
Series 800 Syntax
The <LU> parameter is the hardware logical unit number of the HP98720 device
mknod /dev/crt c 14 0x00<LU>00
HP Keyboard Device Driver
Use device file /dev/tty if you want the input to come from the terminal you are logged in on. See your System Administrator for details on using other terminals. Other terminals are usually designated as /dev/tty01, /dev/tty02, etc.
ENVIRONMENT VARIABLES
SB_DISPLAY_ADDR
Frame buffer displays and the shared-memory communication mechanisms use a range of addresses on the Series 300 machines. These addresses may conflict with extremely large code, heap, or stack space. This can be avoided by setting the environment variable SB_DISPLAY_ADDR to shift this range of addresses up or down.
If the Starbase Display Address environment variable (SB_DISPLAY_ADDR) is not set or is null, the default of 0xb00000 is used. This environment variable must be the same for all processes, so it is suggested that, if it is set, it be set in the Bourne file /etc/profile and the C Shell /etc/csh.login.
SEE ALSO
cc(1), fc(1), ld(1), pc(1),
Starbase Reference,
The Starbase Device Drivers Library,
Starbase Graphics Techniques.
Hewlett-Packard Company — May 11, 2021