+static int skipvfs;
+
+badtype(type, typelist)
+ int type;
+ int *typelist;
+{
+ if (typelist == 0)
+ return(0);
+ while (*typelist) {
+ if (type == *typelist)
+ return(skipvfs);
+ typelist++;
+ }
+ return(!skipvfs);
+}
+
+int *
+maketypelist(fslist)
+ char *fslist;
+{
+ register char *nextcp;
+ register int *av, i;
+ char *malloc();
+
+ if (fslist == NULL)
+ return(NULL);
+ if (fslist[0] == 'n' && fslist[1] == 'o') {
+ fslist += 2;
+ skipvfs = 1;
+ } else
+ skipvfs = 0;
+ for (i = 0, nextcp = fslist; *nextcp; nextcp++)
+ if (*nextcp == ',')
+ i++;
+ av = (int *)malloc((i+2) * sizeof(int));
+ if (av == NULL)
+ return(NULL);
+ for (i = 0; fslist; fslist = nextcp) {
+ if (nextcp = index(fslist, ','))
+ *nextcp++ = '\0';
+ if (strcmp(fslist, "ufs") == 0)
+ av[i++] = MOUNT_UFS;
+ else if (strcmp(fslist, "nfs") == 0)
+ av[i++] = MOUNT_NFS;
+ else if (strcmp(fslist, "mfs") == 0)
+ av[i++] = MOUNT_MFS;
+ else if (strcmp(fslist, "pc") == 0)
+ av[i++] = MOUNT_PC;
+ }
+ av[i++] = 0;
+ return(av);
+}
+
+#ifdef NFS
+namematch(hp, nfshost)
+ struct hostent *hp;
+ char *nfshost;
+{
+ register char *cp;
+ register char **np;
+
+ if (hp == NULL || nfshost == NULL)
+ return(1);
+ if (strcasecmp(nfshost, hp->h_name) == 0)
+ return(1);
+ if (cp = index(hp->h_name, '.')) {
+ *cp = '\0';
+ if (strcasecmp(nfshost, hp->h_name) == 0)
+ return(1);
+ }
+ for (np = hp->h_aliases; *np; np++) {
+ if (strcasecmp(nfshost, *np) == 0)
+ return(1);
+ if (cp = index(*np, '.')) {
+ *cp = '\0';
+ if (strcasecmp(nfshost, *np) == 0)
+ return(1);
+ }
+ }
+ return(0);
+}
+