------------------------------------------------------------------ -- -- NAME: CGI_INQ_SEGMENT_INFORMATION - BODY -- DISCREPANCY REPORTS: ------------------------------------------------------------------ -- file: cgi_inq_seg_info_b.ada -- level: 1a,2a with CGI_SEGMENT_STORAGE; with SEGMENT_STATE_LIST_TYPES; with GKS_ERRORS; with GKS_TYPES; use GKS_TYPES; package body CGI_INQ_SEGMENT_INFORMATION is -- This package allows inquiries to be made about information -- pertaining to segments or their associated workstations. procedure INQ_SET_OF_ASSOCIATED_WS (INSTR : in out CGI_INQ_SET_OF_ASSOCIATED_WS) is -- The set of associated workstations for the specified segment is -- returned as the inquired information. -- -- The following components of the record INSTR are used in this -- procedure: -- SEGMENT_TO_INQ_SET_OF_ASSOCIATED_WS - The name of the segment whose -- associated workstations are -- returned -- SET_OF_ASSOCIATED_WS_INQ - The workstations identifiers associated -- with the specified segment -- ERROR_INDICATOR - The error indicator used to log errors. -- -- The following errors may be detected by this routine: -- SEGMENT_DOES_NOT_EXIST - Specified segment does not exist function "="(A,B : SEGMENT_STATE_LIST_TYPES.SEG_STATE_LIST_PTR) return BOOLEAN renames SEGMENT_STATE_LIST_TYPES."="; CURRENT_SEG : SEGMENT_STATE_LIST_TYPES.SEG_STATE_LIST_PTR; -- Segment pointer used locally for accessing a segment state list begin CURRENT_SEG := SEGMENT_STATE_LIST_TYPES.GET_SEGMENT_STATE_LIST (CGI_SEGMENT_STORAGE.WS_MANAGER_SEG_LIST, INSTR.SEGMENT_TO_INQ_SET_OF_ASSOCIATED_WS); -- ERROR_NUMBER is set if the specified segment -- does not exist in WS_MANAGER_SEG_LIST in the CGI_ -- SEGMENT_STORAGE. if CURRENT_SEG = NULL then INSTR.ERROR_INDICATOR := GKS_ERRORS.SEGMENT_DOES_NOT_EXIST; else INSTR.SET_OF_ASSOCIATED_WS_INQ := CURRENT_SEG.ASSOCIATED_WS; end if; end INQ_SET_OF_ASSOCIATED_WS; procedure INQ_SEGMENT_ATTRIBUTES (INSTR : in out CGI_INQ_SEGMENT_ATTRIBUTES) is -- The segment attributes for the SEGMENT_TO_INQ_ATTRIBUTES -- are returned as the inquired information. -- -- The following components of the record INSTR are used in this -- procedure: -- SEGMENT_TO_INQ_ATTRIBUTES - The name of the segment whose -- attributes are to be returned -- DYM_SEGMENT_TRANSFORMATION_INQ - The current transformation matrix -- of the specified segment -- VISIBILITY_INQ - The current segment visibility of the specified -- segment -- HIGHLIGHTING_INQ - The current segment highlighting of the -- specified segment -- PRIORITY_INQ - The current segment priority of the specified -- segment -- DETECTABILITY_INQ - The current segment detectability of the -- specified segment -- ERROR_INDICATOR - The error indicator used to log errors. -- -- The following error may be detected by this routine: -- SEGMENT_DOES_NOT_EXIST - Specified segment does not exist function "="(A,B : SEGMENT_STATE_LIST_TYPES.SEG_STATE_LIST_PTR) return BOOLEAN renames SEGMENT_STATE_LIST_TYPES."="; CURRENT_SEG : SEGMENT_STATE_LIST_TYPES.SEG_STATE_LIST_PTR; -- Segment pointer used locally for accessing a segment state list begin CURRENT_SEG := SEGMENT_STATE_LIST_TYPES.GET_SEGMENT_STATE_LIST (CGI_SEGMENT_STORAGE.WS_MANAGER_SEG_LIST, INSTR.SEGMENT_TO_INQ_ATTRIBUTES); -- ERROR_NUMBER is set if the specified segment SEGMENT_ -- TO_INQ_ATTRIBUTES does not exist in WS_MANAGER_SEG_LIST in the -- CGI_SEGMENT_STORAGE. if CURRENT_SEG = NULL then INSTR.ERROR_INDICATOR := GKS_ERRORS.SEGMENT_DOES_NOT_EXIST; else -- The attributes inquired are retrieved from the segment state -- list for SEGMENT_TO_INQ_ATTRIBUTES. INSTR.DYM_SEGMENT_TRANSFORMATION_INQ := CURRENT_SEG. SEG_TRANSFORMATION; INSTR.VISIBILITY_INQ := CURRENT_SEG.SEG_VISIBILITY; INSTR.HIGHLIGHTING_INQ := CURRENT_SEG.SEG_HIGHLIGHTING; INSTR.PRIORITY_INQ := CURRENT_SEG.SEG_PRIORITY; INSTR.DETECTABILITY_INQ := CURRENT_SEG.SEG_DETECTABILITY; end if; end INQ_SEGMENT_ATTRIBUTES; procedure INQ_NAME_OF_OPEN_SEGMENT (INSTR : in out CGI_INQ_NAME_OF_OPEN_SEGMENT) is -- The name of the open segment is -- returned as the inquired information. -- -- The following components of the record INSTR are used in this -- procedure: -- OPEN_SEGMENT_TO_INQ_NAME_OF - The name of the currently opened -- segment returned. -- -- No errors are detected by this routine. begin INSTR.OPEN_SEGMENT_TO_INQ_NAME_OF := CGI_SEGMENT_STORAGE.OPEN_SEGMENT_PTR.SEG_NAME; end INQ_NAME_OF_OPEN_SEGMENT; procedure INQ_SET_OF_SEGMENT_NAMES_IN_USE (INSTR : in out CGI_INQ_SET_OF_SEGMENT_NAMES_IN_USE) is -- The set of segment names currently in use in GKS is -- returned as the inquired information. -- -- The following components of the record INSTR are used in this -- procedure: -- SET_OF_SEGMENT_NAMES_IN_USE_INQ - The name of the currently opened -- segment returned. -- -- No errors are detected by this routine. function "="(A,B : SEGMENT_STATE_LIST_TYPES.SEG_STATE_LIST_PTR) return BOOLEAN renames SEGMENT_STATE_LIST_TYPES."="; CURRENT_SEG : SEGMENT_STATE_LIST_TYPES.SEG_STATE_LIST_PTR; -- Segment pointer used locally for accessing a segment state list begin INSTR.SET_OF_SEGMENT_NAMES_IN_USE_INQ := SEGMENT_NAMES.NULL_LIST; -- Check for at least one segment in list if CGI_SEGMENT_STORAGE.WS_MANAGER_SEG_LIST.LOW_PRIORITY_SEG /= NULL then -- Traverse link list begining with lowest priority segment CURRENT_SEG := CGI_SEGMENT_STORAGE.WS_MANAGER_SEG_LIST. LOW_PRIORITY_SEG; -- loop through linked list of segments to get segment names loop -- add current segment name to list of segment names SEGMENT_NAMES.ADD_TO_LIST(CURRENT_SEG.SEG_NAME, INSTR.SET_OF_SEGMENT_NAMES_IN_USE_INQ); -- set pointer to next segment in list CURRENT_SEG := CURRENT_SEG.HIGHER_PRIORITY_SEG; -- next pointer is null at end of list exit when CURRENT_SEG = NULL; end loop; end if; end INQ_SET_OF_SEGMENT_NAMES_IN_USE; end CGI_INQ_SEGMENT_INFORMATION;