Loading...
Searching...
No Matches
su_string.h
Go to the documentation of this file.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef SOFIA_SIP_SU_STRING_H
#define SOFIA_SIP_SU_STRING_H
#ifndef SU_CONFIG_H
#include <sofia-sip/su_config.h>
#endif
#include <string.h>
SOFIA_BEGIN_DECLS
su_inline int su_strcmp(char const *a, char const *b);
su_inline int su_strncmp(char const *a, char const *b, size_t n);
SOFIAPUBFUN char *su_strcasestr(const char *haystack, const char *needle);
SOFIAPUBFUN int su_strcasecmp(char const *s1, char const *s2);
SOFIAPUBFUN int su_strncasecmp(char const *s1, char const *s2, size_t n);
SOFIAPUBFUN int su_strmatch(char const *str, char const *with);
SOFIAPUBFUN int su_strnmatch(char const *str, char const *with, size_t n);
SOFIAPUBFUN int su_casematch(char const *s1, char const *with);
SOFIAPUBFUN int su_casenmatch(char const *s1, char const *with, size_t n);
SOFIAPUBFUN size_t su_strnspn(char const *s, size_t size, char const *term);
SOFIAPUBFUN size_t su_strncspn(char const *s, size_t ssize, char const *reject);
SOFIAPUBFUN size_t su_memspn(const void *mem, size_t memlen,
const void *accept, size_t acceptlen);
SOFIAPUBFUN size_t su_memcspn(const void *mem, size_t memlen,
const void *reject, size_t rejectlen);
su_inline int su_strcmp(char const *a, char const *b)
{
return strcmp(a ? a : "", b ? b : "");
}
su_inline int su_strncmp(char const *a, char const *b, size_t n)
{
return strncmp(a ? a : "", b ? b : "", n);
}
SOFIA_END_DECLS
#endif /* !SOFIA_SIP_SU_STRING_H */
su_config.h
su library configuration
SOFIAPUBFUN
#define SOFIAPUBFUN
SOFIAPUBFUN declares an exported function.
Definition su_config.h:66
su_inline
#define su_inline
Define as suitable declarator static inline functions.
Definition su_configure.h:90
su_strncasecmp
int su_strncasecmp(char const *s1, char const *s2, size_t n)
ASCII-case-insensitive comparison.
Definition su_string.c:142
su_memcspn
size_t su_memcspn(const void *mem, size_t memlen, const void *reject, size_t rejectlen)
Search memory for bytes not in a given set.
Definition su_string.c:491
su_strncspn
size_t su_strncspn(char const *s, size_t ssize, char const *reject)
Search a string for a set of characters.
Definition su_string.c:391
su_casenmatch
int su_casenmatch(char const *s1, char const *with, size_t n)
ASCII-case-insensitive string match.
Definition su_string.c:279
su_casematch
int su_casematch(char const *s1, char const *with)
ASCII-case-insensitive string match.
Definition su_string.c:213
su_strcasecmp
int su_strcasecmp(char const *s1, char const *s2)
ASCII-case-insensitive comparison.
Definition su_string.c:101
su_strnmatch
int su_strnmatch(char const *str, char const *with, size_t n)
String prefix match.
Definition su_string.c:254
su_strmatch
int su_strmatch(char const *str, char const *with)
Check if two strings match.
Definition su_string.c:191
su_strcasestr
char * su_strcasestr(const char *haystack, const char *needle)
ASCII-case-insensitive substring search.
Definition su_string.c:46
su_strnspn
size_t su_strnspn(char const *s, size_t size, char const *term)
Search a string for a set of characters.
Definition su_string.c:333
su_memspn
size_t su_memspn(const void *mem, size_t memlen, const void *accept, size_t acceptlen)
Scan memory for a set of bytes.
Definition su_string.c:449

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.