Mercurial > hg > Applications > mh
annotate sbr/strindex.c @ 3:f89a9a79e124
utf-8
author | kono |
---|---|
date | Wed, 20 Apr 2005 00:25:01 +0900 |
parents | bce86c4163a3 |
children | 441a2190cfae |
rev | line source |
---|---|
0 | 1 /* strindex.c - "unsigned" lexical index */ |
2 #ifndef lint | |
3 static char ident[] = "@(#)$Id$"; | |
4 #endif /* lint */ | |
5 | |
6 | |
7 int stringdex (p1, p2) | |
8 register char *p1, | |
9 *p2; | |
10 { | |
11 register char *p; | |
12 | |
13 if (p1 == 0 || p2 == 0) return(-1); /* XXX */ | |
14 | |
15 for (p = p2; *p; p++) | |
16 if (uprf (p, p1)) | |
17 return (p - p2); | |
18 | |
19 return (-1); | |
20 } |