[INHERIT('sys$library:starlet', 'sys$library:pascal$lib_routines')] PROGRAM Use_Getquiw(OUTPUT); TYPE Item_List_Cell = RECORD CASE INTEGER OF 1: ( { Normal Cell } Buffer_Length : [WORD] 0..65535; Item_Code : [WORD] 0..65535; Buffer_Addr : UNSIGNED; Return_Addr : UNSIGNED ); 2:( { Terminator } Terminator : UNSIGNED ); END; Item_List_Template(Count:INTEGER) = ARRAY [1..Count] OF Item_List_Cell; VAR Item_List : Item_List_Template(3); Job_Item_List : Item_List_Template(3); Queue_Name : [VOLATILE] VARYING [32] OF CHAR; Result_Queue_Name : [VOLATILE] VARYING [32] OF CHAR; Result_Job_Name : [VOLATILE] VARYING [32] OF CHAR; Status : INTEGER; Search_Flags : SEARCH_FLAGS$TYPE; { from STARLET.PEN } Job_IOSB, IOSB : RECORD JBC_Status : INTEGER; Reserved : INTEGER; END; BEGIN { Define the queue to search } Queue_Name := '*'; { Search queues matching the name } Item_List[1].Buffer_Length := LENGTH(Queue_Name); Item_List[1].Item_Code := QUI$_Search_Name; Item_List[1].Buffer_Addr := IADDRESS(Queue_Name.Body); Item_List[1].Return_Addr := 0; { Place resulting name in Result_Queue_Name } Item_List[2].Buffer_Length := SIZE(Result_Queue_Name.Body); Item_List[2].Item_Code := QUI$_Queue_Name; Item_List[2].Buffer_Addr := IADDRESS(Result_Queue_Name.Body); Item_List[2].Return_Addr := IADDRESS(Result_Queue_Name.Length); { Terminate the item list } Item_List[3].Terminator := 0; { For each queue, ask for all jobs } Search_Flags := ZERO; Search_Flags.QUI$V_Search_All_Jobs := TRUE; { Place job name in Result_Job_Name } Job_Item_List[1].Buffer_Length := SIZE(Result_Job_Name.Body); Job_Item_List[1].Item_Code := QUI$_Job_Name; Job_Item_List[1].Buffer_Addr := IADDRESS(Result_Job_Name.Body); Job_Item_List[1].Return_Addr := IADDRESS(Result_Job_Name.Length); { Provide search flags } Job_Item_List[2].Buffer_Length := SIZE(Search_Flags); Job_Item_List[2].Item_Code := QUI$_Search_Flags; Job_Item_List[2].Buffer_Addr := IADDRESS(Search_Flags); Job_Item_List[2].Return_Addr := 0; { Terminate the item list } Job_Item_List[3].terminator := 0; { Loop over all the queue names } REPEAT Status := $getquiw( Func := QUI$_Display_Queue, IOSB := IOSB, ItmLst := Item_List); IF IOSB.JBC_Status <> JBC$_NOMOREQUE THEN BEGIN WRITELN(Result_Queue_Name); { For each queue, loop over all the jobs } REPEAT $getquiw( Func := QUI$_Display_Job, IOSB := Job_IOSB, Itmlst := Job_Item_List); IF (Job_IOSB.JBC_Status <> JBC$_NOMOREJOB) AND (Job_IOSB.JBC_Status <> JBC$_NOSUCHJOB) THEN WRITELN(' ',Job_IOSB.JBC_Status,Result_Job_Name); UNTIL (Job_IOSB.JBC_Status = JBC$_NOMOREJOB) OR (Job_IOSB.JBC_Status = JBC$_NOSUCHJOB); END; UNTIL IOSB.JBC_Status = JBC$_NOMOREQUE; END.