OSI/AS Programming Manual
Example 2: Presentation Layer and ACSE
Sample Programs
E–68 056783 Tandem Computers Incorporated
--
-- user_data is large enough to hold all of the data.
-- Real applications might call this procedure several
-- times using next_position and more_data.
--
start_position := 0D; -- start at the beginning
error := APS_DATA_GETPARAM_( cepi
, $UDBL( $LEN( user_data ) )
, user_data
, more_data
, next_position
, start_position
);
IF ( error <> ZAPS^ERR^OK ) AND
( error <> ZAPS^ERR^NO^DATA ) THEN
CALL display_aps_error( error_data_getparam_proc );
END; -- proc retrieve_user_data
? PAGE
------------------------------------------------------------
--
-- Wait for APS completion by first checking that the
-- initial status was OK, and then calling MFM_AWAITIOX_.
--
------------------------------------------------------------
PROC wait_for_aps_completion( error_proc );
INT error_proc; -- i : aps proc label
BEGIN
LITERAL timelimit = -1D; -- wait indefinitely
INT filenum;
IF ( status <> ZAPS^VAL^STATUS^OK ) THEN
CALL display_aps_status( error_proc )
ELSE
BEGIN
--
-- The initial status was OK, so we'll wait here.
-- Note that on completion, the tag will be set to
-- what it was when we called the corresponding APS
-- procedure. This example doesn't take advantage
-- of this fact.
-- Real applications might set the tag to the
-- address of a control block for remapping
-- at completion time.
--
filenum := -1; -- Wait for any completion.
CALL MFM_AWAITIOX_( status
, filenum
, ! buffer-addr !
, ! count-transferred !
, tag
, timelimit
, ! segment-id !
);