execute_segment(3G)
NAME
execute_segment − add a segment execution element into the open segment
SYNOPSIS
C Syntax:
void execute_segment(fildes, segno)
int fildes, segno;
FORTRAN77 Syntax:
subroutine execute_segment(fildes, segno)
integer*4 fildes, segno
Pascal Syntax:
procedure execute_segment(fildes, segno:integer);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
segno Name of the executed segment. This can be any integer value.
Discussion
Execute_segment adds a segment reference element to the open segment. When the execute segment element is encountered during a traversal, a subset of the current Starbase state is saved (see push_state(3G)), the segment with name segno is traversed, the Starbase state is restored (see pop_state(3G)) and the traversal continues with the next element.
Execute_segment(3G) only differs from call_segment(3G) in the implicit state save and restore at traversal time.
The referenced segment, segno, does not need to exist prior to invocation of execute_segment. An empty segment will be created if necessary to satisfy the reference.
EXAMPLE
In the following C program segment, fildes is assumed to hold a file descriptor returned by a call to gopen(3G). Segment 2 is referenced from segment 1. The change to line_color_index in segment 2 will not affect the color of the polylines in segment 1, due to the implicit state save and restore.
open_segment(fildes,1,FALSE,FALSE); /* build segment 1 */
line_color_index(fildes, 1);/* set line color to index 1 */
polyline(fd, ...);/* polyline drawn in color 1 */
execute_segment(fildes, 2);/* invoke segment 2 here */
polyline(fd, ...);/* polyline drawn in color 1 */
close_segment(fildes);/* segment 1 is now closed */
open_segment(fildes,2,FALSE,FALSE); /* build segment 2 */
line_color_index(fildes,3);/* set line color index to 3 */
polyline(fd, ...);/* polyline drawn in color 3 */
close_segment(fildes);/* segment 2 is now closed */
ERRORS
1 Graphics device is not initialized for this operation.
24 Segment not open.
SEE ALSO
call_segment(3G), cond_execute_segment(3G), open_segment(3G),
push_state(3G), pop_state(3G).
Hewlett-Packard Company — HP-UX Release 9.10: April 1995