File Utility Program (FUP) Management Programming Manual

FUP Commands and Responses
File Utility Program (FUP) Management Programming Manual523322-001
3-7
CHECKSUM Command
Figure 3-1. TAL Example of a CHECKSUM Procedure (page 1 of 3)
!----------------------------------------------------------
! Procedure CHECKSUM is a high-level procedure that
! demonstrates the use of the programmatic FUP interface
! with file-name templates. RESPONSE-TYPE is set to the
! default value, and MAXRESP is set to -1.
!
! FUP returns a response record for each file and returns
! as many response records as will fit in the buffer.
! FUP will not return any more response records after it
! encounters an error.
!
! This procedure assumes that the FUP process has already
! been started. If FUP returns an error, the procedure
! prints an error message and returns.
! This procedure returns 0 if it processes the complete
! file set or an error number if an error prevented the
! entire file set from being processed.
!----------------------------------------------------------
INT PROC CHECKSUM (file, partonly, numberdone);
! Parameter declarations
INT .file; ! File(s) to checksum
INT partonly; ! Checksum only specified partition
INT(32) .numberdone; ! Number of files checksummed
BEGIN
! Global variables used
! STRUCT .EXT buffer (ZFUP^DDL^MSG^BUFFER^DEF);
! STRUCT .EXT save^buffer (ZFUP^DDL^MSG^BUFFER^DEF);
! INT fup^file^number;
! Local definitions
INT error, ! Error variable
spi^error, ! SPI error variable
done, ! Use to process all files
token^val, ! Token values