C Standard Library Extensions  1.0.5
cxstrutils.h
00001 /* $Id: cxstrutils.h,v 1.5 2009/12/07 15:48:15 llundin Exp $
00002  *
00003  * This file is part of the ESO C Extension Library
00004  * Copyright (C) 2001-2006 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 /*
00022  * $Author: llundin $
00023  * $Date: 2009/12/07 15:48:15 $
00024  * $Revision: 1.5 $
00025  * $Name: cpl-5_3_0-BRANCH $
00026  */
00027 
00028 #ifndef CX_STRUTILS_H
00029 #define CX_STRUTILS_H
00030 
00031 #include <stdarg.h>
00032 #include <cxtypes.h>
00033 
00034 CX_BEGIN_DECLS
00035 
00036 /*
00037  * String comparison functions.
00038  */
00039 
00040 cxint cx_strcasecmp(const cxchar *, const cxchar *);
00041 cxint cx_strncasecmp(const cxchar *, const cxchar *, cxsize);
00042 cxint cx_strempty(const cxchar *, const cxchar *);
00043 
00044 
00045 /*
00046  * Utility functions modifing their string argument
00047  */
00048 
00049 cxchar *cx_strlower(cxchar *);
00050 cxchar *cx_strupper(cxchar *);
00051 
00052 cxchar *cx_strtrim(cxchar *);
00053 cxchar *cx_strrtrim(cxchar *);
00054 cxchar *cx_strstrip(cxchar *);
00055 
00056 
00057 /*
00058  * Utility functions which do not create a new string
00059  */
00060 
00061 cxchar *cx_strskip(const cxchar *, cxint (*)(cxint));
00062 
00063 
00064 /*
00065  * Utilities returning a newly allocated string.
00066  */
00067 
00068 cxchar *cx_strdup(const cxchar *);
00069 cxchar *cx_strndup(const cxchar *, cxsize);
00070 cxchar *cx_strvdupf(const cxchar *, va_list)
00071 #ifdef __GNUC__
00072     __attribute__((format (printf, 1, 0)))
00073 #endif
00074     ;
00075 
00076 cxchar *cx_stpcpy(cxchar *, const cxchar *);
00077 
00078 cxchar **cx_strsplit(const cxchar *, const cxchar *, cxint);
00079 void     cx_strfreev(cxchar **sarray);
00080 
00081 cxchar *cx_strjoinv(const cxchar *, cxchar **);
00082 
00083 CX_END_DECLS
00084 
00085 #endif /* CX_STRUTILS_H */