From f93f4b87a492ba5dff2854813463ca6fc419b393 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sat, 26 Jan 2008 10:45:52 +0000 Subject: Added pj_strstr() and pj_stristr() in pjlib git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1757 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/include/pj/string.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'pjlib/include/pj') 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 @@ -471,6 +471,31 @@ PJ_INLINE(char*) pj_strchr( const pj_str_t *str, int chr) return (char*) memchr((char*)str->ptr, chr, str->slen); } +/** + * 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. * -- cgit v1.2.3