

  PROCEDURE [INLINE] gfp$scan_all_fdes_in_image
    (    image_segment_number: ost$segment;
     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 image_segment_number <> 0 THEN
     state.control_p := #ADDRESS (1, image_segment_number, gfc$fde_control_table_base);
     index := UPPERBOUND (state.control_p^.in_use_words);
     WHILE (state.control_p^.in_use_words [index] = 0) DO
       index := index - 1;
     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_in_image;

*copyc gfc$constants
*copyc gft$file_descriptor_control
*copyc gft$file_desc_entry_p
*copyc gft$scan_all_fdes_state
*copyc i#real_memory_address
*copyc ost$heap
?? POP ??
