home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / uucp / Uucp.framework / uucp.subproj / spool.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-09  |  802 b   |  31 lines

  1. /* spool.c
  2.    See whether a filename is legal for the spool directory.  */
  3.  
  4. #include "uucp.h"
  5.  
  6. #include <ctype.h>
  7.  
  8. #include "uudefs.h"
  9.  
  10. /* See whether a file is a spool file.  Spool file names are specially
  11.    crafted to hand around to other UUCP packages.  They always begin
  12.    with 'C', 'D' or 'X', and the second character is always a period.
  13.    The remaining characters may be any printable characters, since
  14.    they may include a grade set by another system.  */
  15.  
  16. boolean
  17. fspool_file (zfile)
  18.      const char *zfile;
  19. {
  20.   const char *z;
  21.  
  22.   if (*zfile != 'C' && *zfile != 'D' && *zfile != 'X')
  23.     return FALSE;
  24.   if (zfile[1] != '.')
  25.     return FALSE;
  26.   for (z = zfile + 2; *z != '\0'; z++)
  27.     if (*z == '/' || ! isprint (BUCHAR (*z)) || isspace (BUCHAR (*z)))
  28.       return FALSE;
  29.   return TRUE;
  30. }
  31.