]> pd.if.org Git - pdclib/blob - functions/string/strlen.c
Merged PDPCLIB and Therx code.
[pdclib] / functions / string / strlen.c
1 // ----------------------------------------------------------------------------
2 // $Id$
3 // ----------------------------------------------------------------------------
4 // Public Domain C Library - http://pdclib.sourceforge.net
5 // This code is Public Domain. Use, modify, and redistribute at will.
6 // ----------------------------------------------------------------------------
7
8 size_t strlen( const char * s ) { /* TODO */ };
9
10 /* Therx code
11 {
12     const char * start = s1;
13     while (*s1)
14     {
15         s1++;
16     }
17     return s1 - start;
18 }
19 */
20
21 /* PDPC code - unreviewed
22 {
23     const char *p;
24     
25     p = s;
26     while (*p != '\0') p++;
27     return ((size_t)(p - s));
28 }
29 */