Guardian Procedure Calls Reference Manual

USESEGMENT Procedure (Superseded by SEGMENT_USE_ Procedure)
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameter
Condition Code Settings
Returned Value
Considerations
Example
Summary
NOTE: This procedure is supported for compatibility with previous software and should not be
used for new development.
The USESEGMENT procedure selects a particular extended data segment to be currently addressable
by the calling process.
For selectable segments, a call to USESEGMENT must follow a call to ALLOCATESEGMENT to
make the selectable extended data segment accessible. Although you can allocate multiple selectable
extended data segments, you can access only one at a time.
For shared flat segments, a call to USESEGMENT can follow a call to ALLOCATESEGMENT, but
calling USESEGMENT is unnecessary because all of the flat segments allocated by a process are
always accessible to the process.
Flat segments and selectable segments are supported on native processors that use D30 or later
versions of the HP NonStop operating system. Selectable segments are supported on all systems.
Syntax for C Programmers
You cannot call USESEGMENT directly from a C program, because it returns a value and also sets
the condition-code register. To access this procedure, you must write a "jacket" procedure in TAL
that is directly callable by your C program. For information on how to do this, see the discussion
of procedures that return a value and a condition code in the C/C++ Programmer's Guide. Note
that the SEGMENT_USE_ procedure, which should be used in new development, does not require
a "jacket" procedure in TAL to be called from a C program.
Syntax for TAL Programmers
old-segment-id := USESEGMENT [ ( segment-id ) ]; ! i
Parameter
segment-id
input
INT:value
if present, is the segment ID of the segment is to be used or -1 if no segment is used. If this
parameter is not supplied, the current in-use selectable segment remains unchanged and
old-segment-id returns the current in-use selectable segment ID. Note that segment-id
is returned even if segment-id is not valid, in which case the old-segment-id parameter
continues to remain the in-use segment.
1480 Guardian Procedure Calls (T-V)