blob: 4b99b623842aea835e8eabc2371b026f6b253c7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#if 0
#include <string.h>
#include "_assert.h"
/** count matching characters **/
char * strpbrk(const char *s1, const char *s2)
{
size_t i;
ASSERT_NONNULL(s1);
ASSERT_NONNULL(s2);
for (i = 0; i < strlen (s1); i++) {
if (strchr(s2, s1[i]) != NULL) {
return (char*)s1 + i;
}
}
return NULL;
}
/***
locates the first occurence in ARGUMENT(s1) of any character in ARGUMENT(s2).
***/
/*
RETURN_FAILURE(CONSTANT(NULL));
RETURN_SUCCESS(a pointer to the located character);
STDC(1)
*/
#endif
|