]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - gnu/libexec/uucp/libuucp/spool.c
This is the Linux generic soundcard driver, version 1.0c. Supports
[FreeBSD/FreeBSD.git] / gnu / libexec / uucp / libuucp / spool.c
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 }