added qse_strspn() and qse_strcspn()

This commit is contained in:
2011-03-23 20:21:14 +00:00
parent e29dea930f
commit f83c2c133a
11 changed files with 240 additions and 143 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: mem.h 375 2010-11-30 11:35:28Z hyunghwan.chung $
* $Id: mem.h 407 2011-03-23 02:21:14Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
@ -31,12 +31,12 @@
/**
* The QSE_MMGR_GETDFL() macro returns the default memory manager.
*/
#define QSE_MMGR_GETDFL() (qse_mmgr)
#define QSE_MMGR_GETDFL() qse_getdflmmgr()
/**
* The QSE_MMGR_SETDFL() macro changes the default memory manager.
*/
#define QSE_MMGR_SETDFL(m) ((qse_mmgr)=(m))
#define QSE_MMGR_SETDFL(m) qse_setdflmmgr(m)
/**
* The QSE_MMGR_ALLOC() macro allocates a memory block of the @a size bytes
@ -187,6 +187,22 @@ void* qse_memrmem (
qse_size_t nl /**< number of bytes in the block */
);
/**
* The qse_getdflmmgr() function returns the default memory manager.
*/
qse_mmgr_t* qse_getdflmmgr (
void
);
/**
* The qse_setdflmmgr() function changes the default memory manager.
* If mmgr is #QSE_NULL, the memory manager is set to the builtin
* default.
*/
void qse_setdflmmgr (
qse_mmgr_t* mmgr
);
#ifdef __cplusplus
}
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: str.h 406 2011-03-21 14:03:01Z hyunghwan.chung $
* $Id: str.h 407 2011-03-23 02:21:14Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
@ -625,6 +625,34 @@ qse_char_t* qse_strxnend (
qse_size_t len2
);
qse_size_t qse_mbsspn (
const qse_mchar_t* str1,
const qse_mchar_t* str2
);
qse_size_t qse_wcsspn (
const qse_wchar_t* str1,
const qse_wchar_t* str2
);
qse_size_t qse_mbscspn (
const qse_mchar_t* str1,
const qse_mchar_t* str2
);
qse_size_t qse_wcscspn (
const qse_wchar_t* str1,
const qse_wchar_t* str2
);
#ifdef QSE_CHAR_IS_MCHAR
# define qse_strspn(str1,str2) qse_mbsspn(str1,str2)
# define qse_strcspn(str1,str2) qse_mbscspn(str1,str2)
#else
# define qse_strspn(str1,str2) qse_wcsspn(str1,str2)
# define qse_strcspn(str1,str2) qse_wcscspn(str1,str2)
#endif
/*
* string conversion
*/

View File

@ -14,14 +14,21 @@
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
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
/* OS/2 for other platforms than x86?
* If so, the endian should be defined selectively
/* OS/2 for other platforms than x86?
* If so, the endian should be defined selectively
*/
#define QSE_ENDIAN_LITTLE
/*
* You must define which character type to use as a default character here.
*
* #define QSE_CHAR_IS_WCHAR
* #define QSE_CHAR_IS_MCHAR
*/
#define QSE_ENDIAN_LITTLE
#if defined(__WATCOMC__)
# define QSE_SIZEOF_CHAR 1
@ -41,18 +48,12 @@
# define QSE_SIZEOF___INT32 4
# define QSE_SIZEOF___INT64 8
# define QSE_SIZEOF___INT128 0
#
# define QSE_SIZEOF_OFF64_T 0
# define QSE_SIZEOF_OFF_T 8
#
# define QSE_CHAR_IS_WCHAR
#else
# error Define the size of various data types.
#endif
#define QSE_SIZEOF_OFF64_T 0
#define QSE_SIZEOF_OFF_T 8
/*
* OS/2 does not have wchar_t(Unicode) friendly APIs unlike Windows.
* You must define which character type to use as a default character here.
*
* #define QSE_CHAR_IS_WCHAR
* #define QSE_CHAR_IS_MCHAR
*/
#define QSE_CHAR_IS_WCHAR