diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-01-26 10:45:52 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-01-26 10:45:52 +0000 |
commit | f93f4b87a492ba5dff2854813463ca6fc419b393 (patch) | |
tree | bf9679e2bcdd699acbf7b3c285f49e8ecc54281d /pjlib/include | |
parent | c0fdb7a7f1e264d0983e765873cfa6e26decc6c8 (diff) |
Added pj_strstr() and pj_stristr() in pjlib
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1757 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include')
-rw-r--r-- | pjlib/include/pj/string.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pjlib/include/pj/string.h b/pjlib/include/pj/string.h index 8124539f..945af2da 100644 --- a/pjlib/include/pj/string.h +++ b/pjlib/include/pj/string.h @@ -472,6 +472,31 @@ PJ_INLINE(char*) pj_strchr( const pj_str_t *str, int chr) } /** + * Find the occurence of a substring substr in string str. + * + * @param str The string to search. + * @param substr The string to search fo. + * + * @return the pointer to the position of substr in str, or NULL. Note + * that if str is not NULL terminated, the returned pointer + * is pointing to non-NULL terminated string. + */ +PJ_DECL(char*) pj_strstr(const pj_str_t *str, const pj_str_t *substr); + +/** + * Performs substring lookup like pj_strstr() but ignores the case of + * both strings. + * + * @param str The string to search. + * @param substr The string to search fo. + * + * @return the pointer to the position of substr in str, or NULL. Note + * that if str is not NULL terminated, the returned pointer + * is pointing to non-NULL terminated string. + */ +PJ_DECL(char*) pj_stristr(const pj_str_t *str, const pj_str_t *substr); + +/** * Remove (trim) leading whitespaces from the string. * * @param str The string. |