su 1.12.11devel
/build/buildd/sofia-sip-1.12.11+20110422/libsofia-sip-ua/su/sofia-sip/su_string.h
Go to the documentation of this file.
00001 /*
00002  * This file is part of the Sofia-SIP package
00003  *
00004  * Copyright (C) 2005 Nokia Corporation.
00005  *
00006  * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00021  * 02110-1301 USA
00022  *
00023  */
00024 
00025 #ifndef SOFIA_SIP_SU_STRING_H
00026 
00027 #define SOFIA_SIP_SU_STRING_H
00028 
00047 #ifndef SU_CONFIG_H
00048 #include <sofia-sip/su_config.h>
00049 #endif
00050 
00051 #include <string.h>
00052 
00053 SOFIA_BEGIN_DECLS
00054 
00055 su_inline int su_strcmp(char const *a, char const *b);
00056 su_inline int su_strncmp(char const *a, char const *b, size_t n);
00057 
00058 SOFIAPUBFUN char *su_strcasestr(const char *haystack, const char *needle);
00059 
00060 SOFIAPUBFUN int su_strcasecmp(char const *s1, char const *s2);
00061 SOFIAPUBFUN int su_strncasecmp(char const *s1, char const *s2, size_t n);
00062 
00063 SOFIAPUBFUN int su_strmatch(char const *str, char const *with);
00064 SOFIAPUBFUN int su_strnmatch(char const *str, char const *with, size_t n);
00065 
00066 SOFIAPUBFUN int su_casematch(char const *s1, char const *with);
00067 SOFIAPUBFUN int su_casenmatch(char const *s1, char const *with, size_t n);
00068 
00069 SOFIAPUBFUN size_t su_strnspn(char const *s, size_t size, char const *term);
00070 SOFIAPUBFUN size_t su_strncspn(char const *s, size_t ssize, char const *reject);
00071 
00072 SOFIAPUBFUN size_t su_memspn(const void *mem, size_t memlen,
00073                              const void *accept, size_t acceptlen);
00074 SOFIAPUBFUN size_t su_memcspn(const void *mem, size_t memlen,
00075                               const void *reject, size_t rejectlen);
00076 
00077 su_inline int su_strcmp(char const *a, char const *b)
00078 {
00079   return strcmp(a ? a : "", b ? b : "");
00080 }
00081 
00082 su_inline int su_strncmp(char const *a, char const *b, size_t n)
00083 {
00084   return strncmp(a ? a : "", b ? b : "", n);
00085 }
00086 
00087 SOFIA_END_DECLS
00088 
00089 #endif /* !SOFIA_SIP_SU_STRING_H */
 All Data Structures Files Functions Variables Typedefs Enumerator Defines

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