OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
Recovering From Errors
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
6-14
Information Buffer
---------------------------------------------------------------------------
-- Function Name: print_info_buffer --
-- --
-- Arguments: buffer_in IN --
-- buffer_size OUT --
-- --
-- Description: This function prints the info_buffer, which is --
-- RETURNed by the GPI_STATUS_ function call. It --
-- shows more detailed information about the error. --
---------------------------------------------------------------------------
PROC print_info_buffer ( buffer_in,
buffer_size);
STRING .EXT buffer_in;
INT .buffer_size;
BEGIN
INT counter; -- Counter for the loop
-- This redefinition allows us to use one pointer to access all the different
-- info buffer structures.
STRING .EXT struct_1_ptr (ZGPI_INFO_1_DEF),
.EXT struct_2_ptr (ZGPI_INFO_2_DEF) = struct_1_ptr,
.EXT struct_3_ptr (ZGPI_INFO_3_DEF) = struct_1_ptr,
.EXT struct_4_ptr (ZGPI_INFO_4_DEF) = struct_1_ptr,
.EXT struct_5_ptr (ZGPI_INFO_5_DEF) = struct_1_ptr;
INT number; -- Temporary storage for character 8 bit extraction
-- Put pointer into a typed pointer to get struct type out
@struct_1_ptr := @buffer_in;
IF (struct_1_ptr.z_struct_type = ZGPI_ST_ERROR_ATTR) THEN
BEGIN
buffer_size := $LEN ( ZGPI_INFO_1_DEF);
printf (" Structure type: Error attribute ");
printfld (" Object identifier: ",
struct_1_ptr.z_data.z_obj_id);
printfd (" Object class: ",
struct_1_ptr.z_data.z_obj_class);
printfd (" Object Type : ",
struct_1_ptr.z_data.z_obj_type);
printf (" Attribute descriptor");
printfd (" Attribute type: ",
struct_1_ptr.z_data.z_attr_dscr.type);
printfd (" Attribute syntax: ",
struct_1_ptr.z_data.z_attr_dscr.syntax);
printf (" Attribute value: ");
-- Print the bytes in hex, because some of the characters might not
-- be printable.
outline ':='" String value: " -> @outptr;
CALL print_hex (struct_1_ptr.z_data.z_attr_string_value,
16,outptr);
@outptr := @outptr[16];
CALL WRITEX ( output_fn
, outline
, $INT(@outptr - @outline)
);
printf (" ");
END
ELSE IF (struct_1_ptr.z_struct_type = ZGPI_ST_DANGLING_OBJ) THEN
BEGIN