home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / prog_c / flex.lzh / FLEX / FLEX2 / GNU.LIB.SRC / READDIR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-16  |  445 b   |  23 lines

  1. /*
  2.  * BSD/Unix expansion library for Amiga.
  3.  *
  4.  * readdir() -- system independent directory code
  5.  */
  6.  
  7. #include "dir.h"
  8.  
  9. struct direct *
  10. readdir(my_dir)
  11.    DIR *my_dir;
  12. {
  13.     static struct direct    result ;
  14.  
  15.     if (!ExNext(my_dir->d_lock, &(my_dir->d_info)))
  16.         return NULL ;
  17.  
  18.     result.d_reclen = result.d_ino = 1;    /* Not NULL! */
  19.     (void) strcpy(result.d_name, my_dir -> d_info.fib_FileName);
  20.     result.d_namlen = strlen(result.d_name);
  21.     return &result ;
  22. }
  23.