  PROCEDURE [INLINE] gfp$scan_all_fdes
    (    residence: gft$table_residence;
     VAR state: gft$scan_all_fdes_state;
     VAR fde_p: gft$file_desc_entry_p);

?? PUSH (LISTEXT := ON) ??
   VAR
     index: integer,
     rma: integer,
     seg: integer;

   IF residence <> gfc$tr_null_residence THEN
     IF residence = gfc$tr_system THEN
       seg := osc$segnum_mainframe_wired;
     ELSE
       seg := osc$segnum_job_fixed_heap;
     IFEND;
     state.control_p := #ADDRESS (1, seg, gfc$fde_control_table_base);
     index := UPPERBOUND (state.control_p^.in_use_words);
     #real_memory_address (#LOC (state.control_p^.in_use_words [index]), rma);
     WHILE (rma < 0) OR (state.control_p^.in_use_words [index] = 0) DO
       index := index - 1;
       #real_memory_address (#LOC (state.control_p^.in_use_words [index]), rma);
     WHILEND;
     state.current_index := index * 64 + 64;
   IFEND;

   index := state.current_index;
   REPEAT
     index := index - 1;
   UNTIL  (index < 0) OR state.control_p^.in_use_bits [index];
   IF index < 0 THEN
     fde_p := NIL;
   ELSE
     seg := #SEGMENT (state.control_p);
     fde_p := #ADDRESS (1, seg, gfc$fde_size * index + gfc$fde_table_base);
     state.current_index := index;
   IFEND;
 PROCEND gfp$scan_all_fdes;

*copyc gfc$constants
*copyc gft$file_descriptor_control
*copyc gft$file_desc_entry_p
*copyc gft$table_residence
*copyc gft$scan_all_fdes_state
*copyc ost$heap
?? POP ??
