1: #ifndef lint
   2: static char sccsid[] = "@(#)gnamef.c	5.4 (Berkeley) 6/20/85";
   3: #endif
   4: 
   5: #include "uucp.h"
   6: #ifdef  NDIR
   7: #include "ndir.h"
   8: #else
   9: #include <sys/dir.h>
  10: #endif
  11: 
  12: /*LINTLIBRARY*/
  13: 
  14: /*
  15:  *	get next file name from directory
  16:  *
  17:  *	return codes:
  18:  *		0  -  end of directory read
  19:  *		1  -  returned name
  20:  */
  21: 
  22: gnamef(dirp, filename)
  23: register DIR *dirp;
  24: register char *filename;
  25: {
  26:     register struct direct *dentp;
  27: 
  28:     for (;;) {
  29:         if ((dentp = readdir(dirp)) == NULL) {
  30:             return 0;
  31:         }
  32:         if (dentp->d_ino != 0)
  33:             break;
  34:     }
  35: 
  36:     /* Truncate filename.  This may become a problem someday. */
  37:     strncpy(filename, dentp->d_name, NAMESIZE-1);
  38:     filename[NAMESIZE-1] = '\0';
  39:     DEBUG(99,"gnamef returns %s\n",filename);
  40:     return 1;
  41: }

Defined functions

Defined variables

sccsid defined in line 2; never used
Last modified: 1987-02-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2290
Valid CSS Valid XHTML 1.0 Strict