1: #ifndef lint
2: static char sccsid[] = "@(#)prefix.c 5.1 (Berkeley) 7/2/83";
3: #endif
4:
5: /*******
6: * prefix(s1, s2) check s2 for prefix s1
7: * char *s1, *s2;
8: *
9: * return 0 - !=
10: * return 1 - ==
11: */
12:
13: prefix(s1, s2)
14: register char *s1, *s2;
15: {
16: register char c;
17:
18: while ((c = *s1++) == *s2++)
19: if (c == '\0')
20: return(1);
21: return(c == '\0');
22: }
23:
24: /*******
25: * wprefix(s1, s2) check s2 for prefix s1 with a wildcard character ?
26: * char *s1, *s2;
27: *
28: * return 0 - !=
29: * return 1 - ==
30: */
31:
32: wprefix(s1, s2)
33: register char *s1, *s2;
34: {
35: register char c;
36:
37: while ((c = *s1++) != '\0')
38: if (*s2 == '\0' || (c != *s2++ && c != '?'))
39: return(0);
40: return(1);
41: }
Defined functions
prefix
defined in line
13; used 15 times
Defined variables
sccsid
defined in line
2;
never used