renamed qse_basenameasmbs() back to qse_mbsbasename()

renamed qse_basenameaswcs back to qse_wcsbasename()
added qse_get_log_priority_by_wcsname()
added qse_get_log_priority_by_mbsname()
added qse_get_log_facility_by_wcsname()
added qse_get_log_facility_by_mbsname()
added qse_wcsmbscmp(), qse_mbswcscmp()
added qse_wcsxmbscmp(), qse_mbsxwcscmp()
This commit is contained in:
2019-09-10 08:53:59 +00:00
parent f89efc150a
commit df8cff2451
15 changed files with 246 additions and 67 deletions

View File

@ -129,10 +129,10 @@ QSE_EXPORT int qse_ismbsdrivecurpath (
);
/**
* The qse_basenameasmbs() function returns the pointer to the file name
* The qse_mbsbasename() function returns the pointer to the file name
* segment in a multibyte path name.
*/
QSE_EXPORT const qse_mchar_t* qse_basenameasmbs (
QSE_EXPORT const qse_mchar_t* qse_mbsbasename (
const qse_mchar_t* path
);
@ -237,10 +237,10 @@ QSE_EXPORT int qse_iswcsdrivecurpath (
);
/**
* The qse_basenameaswcs() function returns the pointer to the file name
* The qse_wcsbasename() function returns the pointer to the file name
* segment in a wide-character path name.
*/
QSE_EXPORT const qse_wchar_t* qse_basenameaswcs (
QSE_EXPORT const qse_wchar_t* qse_wcsbasename (
const qse_wchar_t* path
);
@ -313,7 +313,7 @@ QSE_EXPORT qse_wchar_t* qse_mergewcspathdup (
# define qse_isdrivepath(p) qse_ismbsdrivepath(p)
# define qse_isdriveabspath(p) qse_ismbsdriveabspath(p)
# define qse_isdrivecurpath(p) qse_ismbsdrivecurpath(p)
# define qse_basename(path) qse_basenameasmbs(path)
# define qse_basename(path) qse_mbsbasename(path)
# define qse_pathcore(p) qse_mbspathcore(p)
# define qse_canonpath(p,c,f) qse_canonmbspath(p,c,f)
# define qse_mergepathdup(d,f,m) qse_mergembspathdup(d,f,m)
@ -323,7 +323,7 @@ QSE_EXPORT qse_wchar_t* qse_mergewcspathdup (
# define qse_isdrivepath(p) qse_iswcsdrivepath(p)
# define qse_isdriveabspath(p) qse_iswcsdriveabspath(p)
# define qse_isdrivecurpath(p) qse_iswcsdrivecurpath(p)
# define qse_basename(path) qse_basenameaswcs(path)
# define qse_basename(path) qse_wcsbasename(path)
# define qse_pathcore(p) qse_wcspathcore(p)
# define qse_canonpath(p,c,f) qse_canonwcspath(p,c,f)
# define qse_mergepathdup(d,f,m) qse_mergewcspathdup(d,f,m)

View File

@ -1418,6 +1418,31 @@ QSE_EXPORT int qse_wcszcasecmp (
# define qse_strzcasecmp qse_wcszcasecmp
#endif
/**
* The wcsmbscmp() function compares a wide-character string
* wit a byte string without considering charcter encoding.
* It compares each wide-character in s1 with each byte in s2.
*/
QSE_EXPORT int qse_wcsmbscmp (
const qse_wchar_t* s1,
const qse_mchar_t* s2
);
#define qse_mbswcscmp(s1, s2) (-qse_wcsmbscmp(s2, s1))
QSE_EXPORT int qse_wcsxmbscmp (
const qse_wchar_t* s1,
qse_size_t ln,
const qse_mchar_t* s2
);
QSE_EXPORT int qse_mbsxwcscmp (
const qse_mchar_t* s1,
qse_size_t ln,
const qse_wchar_t* s2
);
QSE_EXPORT qse_mchar_t* qse_mbsdup (
const qse_mchar_t* str,
qse_mmgr_t* mmgr

View File

@ -290,11 +290,22 @@ static QSE_INLINE void* qse_log_getxtn (qse_log_t* log) { return QSE_XTN(log); }
#define qse_log_getxtn(log) (QSE_XTN(log))
#endif
QSE_EXPORT void qse_log_setident (
qse_log_t* log,
const qse_char_t* ident
QSE_EXPORT void qse_log_setidentwithmbs (
qse_log_t* log,
const qse_mchar_t* ident
);
QSE_EXPORT void qse_log_setidentwithwcs (
qse_log_t* log,
const qse_wchar_t* ident
);
#if defined(QSE_CHAR_IS_MCHAR)
# define qse_log_setident qse_log_setidentwithmbs
#else
# define qse_log_setident qse_log_setidentwithwcs
#endif
/**
* \return 0 on success, -1 on failure
*/
@ -385,16 +396,34 @@ QSE_EXPORT qse_size_t qse_make_log_priority_name (
* \return an integer bitwised-ORed of priority bits if \a name is valid.
* 0 if \a name is invalid or empty.
*/
QSE_EXPORT int qse_get_log_priority_by_name (
const qse_char_t* name,
const qse_char_t* delim
QSE_EXPORT int qse_get_log_priority_by_mbsname (
const qse_mchar_t* name,
const qse_mchar_t* delim
);
QSE_EXPORT int qse_get_log_facility_by_name (
const qse_char_t* name,
QSE_EXPORT int qse_get_log_priority_by_wcsname (
const qse_wchar_t* name,
const qse_wchar_t* delim
);
QSE_EXPORT int qse_get_log_facility_by_mbsname (
const qse_mchar_t* name,
qse_log_facility_t* fcode
);
QSE_EXPORT int qse_get_log_facility_by_wcsname (
const qse_wchar_t* name,
qse_log_facility_t* fcode
);
#if defined(QSE_CHAR_IS_MCHAR)
# define qse_get_log_priority_by_name qse_get_log_priority_by_mbsname
# define qse_get_log_facility_by_name qse_get_log_facility_by_mbsname
#else
# define qse_get_log_priority_by_name qse_get_log_priority_by_wcsname
# define qse_get_log_facility_by_name qse_get_log_facility_by_wcsname
#endif
#ifdef __cplusplus
}
#endif