Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6557 | serge | 1 | /* |
2 | FUNCTION |
||
3 | < |
||
4 | |||
5 | INDEX |
||
6 | strchrnul |
||
7 | |||
8 | ANSI_SYNOPSIS |
||
9 | #include |
||
10 | char * strchrnul(const char *<[string]>, int <[c]>); |
||
11 | |||
12 | TRAD_SYNOPSIS |
||
13 | #include |
||
14 | char * strchrnul(<[string]>, <[c]>); |
||
15 | const char *<[string]>; |
||
16 | int <[c]>; |
||
17 | |||
18 | DESCRIPTION |
||
19 | This function finds the first occurence of <[c]> (converted to |
||
20 | a char) in the string pointed to by <[string]> (including the |
||
21 | terminating null character). |
||
22 | |||
23 | RETURNS |
||
24 | Returns a pointer to the located character, or a pointer |
||
25 | to the concluding null byte if <[c]> does not occur in <[string]>. |
||
26 | |||
27 | PORTABILITY |
||
28 | < |
||
29 | |||
30 | < |
||
31 | strchr() and strlen() from elsewhere in this library. |
||
32 | |||
33 | QUICKREF |
||
34 | strchrnul |
||
35 | */ |
||
36 | |||
37 | #include |
||
38 | |||
39 | char * |
||
40 | _DEFUN (strchrnul, (s1, i), |
||
41 | _CONST char *s1 _AND |
||
42 | int i) |
||
43 | { |
||
44 | char *s = strchr(s1, i); |
||
45 | |||
46 | return s ? s : (char *)s1 + strlen(s1); |
||
47 | } |