home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c160 / 1.ddi / SOURCE / H4FIRST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-22  |  490 b   |  25 lines

  1.  
  2. /* h4first.c   (c)Copyright Sequiter Software Inc., 1987-1990.  All rights reserved. */
  3.  
  4. #include "d4all.h"
  5. #include "h4memory.h"
  6.  
  7. int  h4first( char **ptr_ptr, int ref )
  8. {
  9.    MEMORY *memory ;
  10.    UNIT   *ref_ptr ;
  11.    
  12.    memory = (MEMORY *) (*ptr_ptr -sizeof(MEMORY)) ;
  13.  
  14.    if ( ref < 0 )  return -1 ;
  15.  
  16.    for(;;)
  17.    {
  18.       ref_ptr = (UNIT *) (*ptr_ptr + memory->len_unit* ref) ;
  19.       if ( ref_ptr->prev < 0 )   return ref ;
  20.  
  21.       ref =  ref_ptr->prev ;
  22.    }
  23. }
  24.  
  25.