OSI/FTAM Programming Guide
NonStop FTAM Programming
HP NonStop OSI/FTAM Programming Guide—528612-001
3-14
Data-Value Parameter
!---------------------------------------------------------------------!
! This procedure takes the data-value parameter returned by a call !
! to FTM_DATA_IND_ and processes each data element in the buffer. !
!---------------------------------------------------------------------!
proc process_data(data_value);
string .ext data_value; ! the data_value parameter returned by the
! FTM_DATA_IND_ procedure call
begin
int .ext data_hdr(zaps^ddl^data^hdr^def);
int .ext elem_hdr(zaps^ddl^data^element^hdr^def);
string .ext data; ! pointer to the current chunk of data
int(32) data_len; ! the length of the current data chunk
int i;
@data_hdr := @data_value;
@elem_hdr := @data_hdr + $udbl($len(zaps^ddl^data^hdr^def));
@data := @elem_hdr + $udbl($len(zaps^ddl^data^element^hdr^def));
data_len := elem_hdr.zlen;
for i := 1 to data_hdr.znum^elements do
begin
--> PROCESS DATA HERE <--
! Calculate the address of the next element header. Note that
! if the data following the current element header has an odd
! length, it will be followed by a pad byte so that the
! next element header structure is word aligned.
@elem_hdr := @elem_hdr +
$udbl($len(zaps^ddl^data^element^hdr^def)) +
elem_hdr.zlen +
$udbl(elem_hdr.zlen '\' 2);
@data := @elem_hdr +
$udbl($len(zaps^ddl^data^element^hdr^def));
data_len := elem_hdr.zlen;
i := i + 1;
end;
end;