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
*/