OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
Recovering From Errors
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
6-7
Using the GPI_STATUS_ Procedure
printfd (" Error class: ", error_class);
printfd (" Primary code: ", primary_code);
printfd (" Secondary code: ", secondary_code);
printfd (" Qualifier code: ", error_qualifier);
printfd (" Error source: ", error_source);
printf (" Info - buffer:");
----------------------------------------------------------------------------
---------------------- Test Information Buffer -----------------------------
----------------------------------------------------------------------------
IF ( total_info_len > 0 ) THEN
BEGIN
printfd (" Total info buffer size: ", total_info_len);
----------------------------------------------------------------------------
---------------------- Report Information Buffer ---------------------------
----------------------------------------------------------------------------
-- access info buffer memory only if a buffer was provided
IF (actual_info_len > 0 ) THEN
BEGIN
@buffer_ptr := @buffer;
DO
BEGIN
CALL print_info_buffer (buffer_ptr,structure_size);
actual_info_len := actual_info_len - structure_size;
IF ( actual_info_len > 0 ) THEN
BEGIN
-- Add calculation for second buffer
@buffer_ptr := @buffer_ptr + $UDBL(structure_size);
END -- then
END
UNTIL ( actual_info_len <= 0 );
END;
IF ( total_info_len > ZGPI_MAX_STATUS_BUF_LEN ) THEN
BEGIN
printf (" The size of the info buffer is too small");
printf (" to get all of the information. ");
END -- then
END -- then
ELSE
BEGIN
printf (" No Info - buffer present");
END; -- else
END -- then
ELSE
BEGIN
printfd (" GPI_STATUS_ failed! Error: ", local_rc );
END; -- else
END; -- End show_gpi_status
------------------ Listing for print macros follows ----------------------
-- Simply print the string parameter 'x' to the screen
DEFINE printf( x ) =
BEGIN
outline ':=' x -> @outptr;
outlen := $INT(@outptr - @outline);
CALL WRITEX ( output_fn
, outline
, outlen
);
END #;
-- Print one integer 'y' at the end of the string 'x'