Back to index

lightning-sunbird  0.9+nobinonly
Functions
strchr.c File Reference
#include "plstr.h"
#include <string.h>

Go to the source code of this file.

Functions

 PL_strchr (const char *s, char c)
 PL_strrchr (const char *s, char c)
 PL_strnchr (const char *s, char c, PRUint32 n)
 PL_strnrchr (const char *s, char c, PRUint32 n)

Function Documentation

PL_strchr ( const char *  s,
char  c 
)

Definition at line 42 of file strchr.c.

{
    if( (const char *)0 == s ) return (char *)0;

    return strchr(s, c);
}

Here is the call graph for this function:

PL_strnchr ( const char *  s,
char  c,
PRUint32  n 
)

Definition at line 58 of file strchr.c.

{
    if( (const char *)0 == s ) return (char *)0;

    for( ; n && *s; s++, n-- )
        if( *s == c )
            return (char *)s;

    if( ((char)0 == c) && (n > 0) && ((char)0 == *s) ) return (char *)s;

    return (char *)0;
}

Here is the caller graph for this function:

PL_strnrchr ( const char *  s,
char  c,
PRUint32  n 
)

Definition at line 72 of file strchr.c.

{
    const char *p;

    if( (const char *)0 == s ) return (char *)0;

    for( p = s; n && *p; p++, n-- )
        ;

    if( ((char)0 == c) && (n > 0) && ((char)0 == *p) ) return (char *)p;

    for( p--; p >= s; p-- )
        if( *p == c )
            return (char *)p;

    return (char *)0;
}

Here is the caller graph for this function:

PL_strrchr ( const char *  s,
char  c 
)

Definition at line 50 of file strchr.c.

{
    if( (const char *)0 == s ) return (char *)0;

    return strrchr(s, c);
}

Here is the caller graph for this function: