Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ print_eleme(3G) — HP-UX ANSI C A.10.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

inq_content(3G)

inq_ele_type(3G)

print_element(3G)

NAME

print_element − print a display list element

SYNOPSIS

C Syntax:

void print_element ( fildes, abbreviate_arrays )
int fildes, abbreviate_arrays;

FORTRAN77 Syntax:

subroutine print_element ( fildes, abbreviate_arrays )
integer*4 fildes, abbreviate_arrays

Pascal Syntax:

procedure print_element ( fildes, abbreviate_arrays:integer );

DESCRIPTION

Input Parameters

fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened. 

abbreviate_arrays
Controls whether to print the contents of an array parameter. If TRUE (1), only a string "{}" is printed to indicate that the corresponding parameter is an array.  If FALSE (0), array contents are printed in their entirety. 

Discussion

Print_element prints to standard output the function name and the parameters of the current element of the currently open segment of the specified graphics device.  It is intended as an aid in debugging display lists. 

The fildes parameter is printed as the string "fd" representing the integer file descriptor returned by gopen when an I/O path to a graphics device is opened.  The parameter list is enclosed in parentheses.  The output line is 80 columns wide.  The integer field width is 11, and floating point numbers have a total field width of 15 and a precision of 10.  Byte array parameters (as found in application_data, block_write, dcblock_write and gescape) are printed out as groups of 8 hexadecimal digits.

If the current element is element 0, none of the above applies.  Only the string "ELEMENT 0" is printed to standard output. 

EXAMPLE

Assume that fd holds a gopen’ed file descriptor, clist is an array of reals initialized with the following values:

clist[0] = 0.0; clist[1] = 0.0;
clist[2] = 0.5; clist[3] = 1.0;
clist[4] = 1.0; clist[5] = -3.14159;
clist[6] = 0.0; clist[7] = 0.0;

and the current element of the currently open segment of fd is a polygon created with the call

polygon2d(fd, clist, 4, FALSE);

 
If the programmer wishes to print out the element with arrays abbreviated, the call

 print_element(fd, TRUE);
 

would print the following to standard output:

 polygon2d( fd, {}, 4, 0)
 

If the programmer wishes to print out the element with full arrays, the call

 print_element(fd, FALSE);

would print the following to standard output:

 polygon2d( fd, { 0, 0, 0.5, 1, 1, -3.14159012, 0, 0}, 4, 0)
 

Other examples of the use of the print_element function, including utilities to print an entire display list, can be found in the directory <starbase>/examples/dl (the actual path name of the directory given in angle brackets depends on the file system structure; see the Graphics Administration Guide for details). 

ERRORS

1 Graphics device is not initialized for this operation. 

24 Segment not open. 

SEE ALSO

inq_content(3G), inq_ele_type(3G). 

Hewlett-Packard Company  —  HP-UX Release 10.0

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