summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-07-18 20:01:23 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-07-18 20:01:23 +0000
commit4f81bc9756e6910d8e9d027d242d60632ea6e885 (patch)
tree47ad189a9f9e824afeb8693f4c7dd926e0eb0028
parentc37c0fbe62e1e135de4c14fc027024d43ad80022 (diff)
Formerly subr.c.~7~
-rw-r--r--ufs/subr.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/ufs/subr.c b/ufs/subr.c
index 5833dfef..6c7ea5f2 100644
--- a/ufs/subr.c
+++ b/ufs/subr.c
@@ -226,6 +226,40 @@ ffs_setblock(fs, cp, h)
cp[h >> 3] |= (0x01 << (h & 0x7));
return;
default:
- panic("ffs_setblock");
+ assert (0);
}
}
+
+/* Taken from 4.4 BSD sys/libkern/skpc.c:
+ @(#)skpc.c 8.1 (Berkeley) 6/10/93
+*/
+int
+skpc(mask0, size, cp0)
+ int mask0;
+ int size;
+ char *cp0;
+{
+ register u_char *cp, *end, mask;
+
+ mask = mask0;
+ cp = (u_char *)cp0;
+ for (end = &cp[size]; cp < end && *cp == mask; ++cp);
+ return (end - cp);
+}
+
+/* Taken from 4.4 BSD sys/libkern/scanc.c:
+ @(#)scanc.c 8.1 (Berkeley) 6/10/93
+*/
+int
+scanc(size, cp, table, mask0)
+ u_int size;
+ register u_char *cp, table[];
+ int mask0;
+{
+ register u_char *end;
+ register u_char mask;
+
+ mask = mask0;
+ for (end = &cp[size]; cp < end && (table[*cp] & mask) == 0; ++cp);
+ return (end - cp);
+}