added unicode trait and case functions.
fixed some code for os2
This commit is contained in:
@ -42,6 +42,7 @@ pkginclude_HEADERS = \
|
||||
time.h \
|
||||
tio.h \
|
||||
tre.h \
|
||||
uni.h \
|
||||
uri.h \
|
||||
utf8.h \
|
||||
xma.h
|
||||
|
@ -56,8 +56,8 @@ am__pkginclude_HEADERS_DIST = alg.h chr.h cp949.h cp950.h dir.h dll.h \
|
||||
env.h fio.h fma.h fmt.h fs.h gdl.h glob.h htb.h hton.h ipad.h \
|
||||
lda.h main.h map.h mbwc.h mem.h mux.h nwad.h nwif.h nwio.h \
|
||||
oht.h opt.h path.h pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h \
|
||||
stdio.h str.h task.h time.h tio.h tre.h uri.h utf8.h xma.h \
|
||||
Mmgr.hpp StdMmgr.hpp Mmged.hpp
|
||||
stdio.h str.h task.h time.h tio.h tre.h uni.h uri.h utf8.h \
|
||||
xma.h Mmgr.hpp StdMmgr.hpp Mmged.hpp
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
@ -266,8 +266,8 @@ pkginclude_HEADERS = alg.h chr.h cp949.h cp950.h dir.h dll.h env.h \
|
||||
fio.h fma.h fmt.h fs.h gdl.h glob.h htb.h hton.h ipad.h lda.h \
|
||||
main.h map.h mbwc.h mem.h mux.h nwad.h nwif.h nwio.h oht.h \
|
||||
opt.h path.h pio.h pma.h rbt.h rex.h sio.h sll.h slmb.h \
|
||||
stdio.h str.h task.h time.h tio.h tre.h uri.h utf8.h xma.h \
|
||||
$(am__append_1)
|
||||
stdio.h str.h task.h time.h tio.h tre.h uni.h uri.h utf8.h \
|
||||
xma.h $(am__append_1)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
56
qse/include/qse/cmn/uni.h
Normal file
56
qse/include/qse/cmn/uni.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
Copyright 2006-2012 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
|
||||
QSE is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
QSE is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
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
|
||||
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _QSE_CMN_UNI_H_
|
||||
#define _QSE_CMN_UNI_H_
|
||||
|
||||
|
||||
/** @file
|
||||
* This file provides functions, types, macros for unicode handling.
|
||||
*/
|
||||
|
||||
#include <qse/types.h>
|
||||
#include <qse/macros.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
QSE_EXPORT int qse_isunitype (qse_wcint_t c, int type);
|
||||
QSE_EXPORT int qse_isuniupper (qse_wcint_t c);
|
||||
QSE_EXPORT int qse_isunilower (qse_wcint_t c);
|
||||
QSE_EXPORT int qse_isunialpha (qse_wcint_t c);
|
||||
QSE_EXPORT int qse_isunidigit (qse_wcint_t c);
|
||||
QSE_EXPORT int qse_isunixdigit (qse_wcint_t c);
|
||||
QSE_EXPORT int qse_isunialnum (qse_wcint_t c);
|
||||
QSE_EXPORT int qse_isunispace (qse_wcint_t c);
|
||||
QSE_EXPORT int qse_isuniprint (qse_wcint_t c);
|
||||
QSE_EXPORT int qse_isunigraph (qse_wcint_t c);
|
||||
QSE_EXPORT int qse_isunicntrl (qse_wcint_t c);
|
||||
QSE_EXPORT int qse_isunipunct (qse_wcint_t c);
|
||||
QSE_EXPORT qse_wcint_t qse_touniupper (qse_wcint_t c);
|
||||
QSE_EXPORT qse_wcint_t qse_tounilower (qse_wcint_t c);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -36,56 +36,64 @@
|
||||
# define QSE_SIZEOF_INT 4
|
||||
# define QSE_SIZEOF_LONG 4
|
||||
# define QSE_SIZEOF_LONG_LONG 8
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF_VOID_P 4
|
||||
# define QSE_SIZEOF_FLOAT 4
|
||||
# define QSE_SIZEOF_DOUBLE 8
|
||||
# define QSE_SIZEOF_LONG_DOUBLE 8
|
||||
# define QSE_SIZEOF_WCHAR_T 2
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF___INT8 1
|
||||
# define QSE_SIZEOF___INT16 2
|
||||
# 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 4
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF_MBSTATE_T QSE_SIZEOF_LONG
|
||||
# define QSE_MBLEN_MAX 8
|
||||
#
|
||||
# define QSE_CHAR_IS_WCHAR
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#elif defined(__WATCOMC__) && !defined(__386__)
|
||||
# define QSE_SIZEOF_CHAR 1
|
||||
# define QSE_SIZEOF_SHORT 2
|
||||
# define QSE_SIZEOF_INT 2
|
||||
# define QSE_SIZEOF_LONG 4
|
||||
# define QSE_SIZEOF_LONG_LONG 8
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF_VOID_P 4
|
||||
# define QSE_SIZEOF_FLOAT 4
|
||||
# define QSE_SIZEOF_DOUBLE 8
|
||||
# define QSE_SIZEOF_LONG_DOUBLE 8
|
||||
# define QSE_SIZEOF_WCHAR_T 2
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF___INT8 1
|
||||
# define QSE_SIZEOF___INT16 2
|
||||
# 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 4
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF_MBSTATE_T QSE_SIZEOF_LONG
|
||||
# define QSE_MBLEN_MAX 8
|
||||
#
|
||||
# define QSE_CHAR_IS_WCHAR
|
||||
#
|
||||
# /* these two have only to be large enough */
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#else
|
||||
# error Define the size of various data types.
|
||||
#endif
|
||||
|
@ -50,7 +50,7 @@ _M_X64 x64 platform
|
||||
# define QSE_SIZEOF_INT 4
|
||||
# define QSE_SIZEOF_LONG 4
|
||||
# define QSE_SIZEOF_LONG_LONG 8
|
||||
#
|
||||
|
||||
# if defined(_WIN64)
|
||||
# define QSE_SIZEOF_VOID_P 8
|
||||
# else
|
||||
@ -60,27 +60,33 @@ _M_X64 x64 platform
|
||||
# define QSE_SIZEOF_DOUBLE 8
|
||||
# define QSE_SIZEOF_LONG_DOUBLE 8
|
||||
# define QSE_SIZEOF_WCHAR_T 2
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF___INT8 1
|
||||
# define QSE_SIZEOF___INT16 2
|
||||
# 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_SIZEOF_MBSTATE_T QSE_SIZEOF_LONG
|
||||
# define QSE_MBLEN_MAX 16
|
||||
#
|
||||
# define QSE_CHAR_IS_WCHAR
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#elif defined(__GNUC__) || defined(__DMC__) || defined(__POCC__)
|
||||
# define QSE_SIZEOF_CHAR 1
|
||||
# define QSE_SIZEOF_SHORT 2
|
||||
# define QSE_SIZEOF_INT 4
|
||||
# define QSE_SIZEOF_LONG 4
|
||||
# define QSE_SIZEOF_LONG_LONG 8
|
||||
#
|
||||
|
||||
# if defined(_WIN64)
|
||||
# define QSE_SIZEOF_VOID_P 8
|
||||
# else
|
||||
@ -90,20 +96,26 @@ _M_X64 x64 platform
|
||||
# define QSE_SIZEOF_DOUBLE 8
|
||||
# define QSE_SIZEOF_LONG_DOUBLE 16
|
||||
# define QSE_SIZEOF_WCHAR_T 2
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF___INT8 0
|
||||
# define QSE_SIZEOF___INT16 0
|
||||
# define QSE_SIZEOF___INT32 0
|
||||
# define QSE_SIZEOF___INT64 0
|
||||
# define QSE_SIZEOF___INT128 0
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF_OFF64_T 0
|
||||
# define QSE_SIZEOF_OFF_T 8
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF_MBSTATE_T QSE_SIZEOF_LONG
|
||||
# define QSE_MBLEN_MAX 16
|
||||
#
|
||||
# define QSE_CHAR_IS_WCHAR
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# define QSE_SIZEOF_CHAR 1
|
||||
# define QSE_SIZEOF_SHORT 2
|
||||
@ -114,7 +126,7 @@ _M_X64 x64 platform
|
||||
# else
|
||||
# define QSE_SIZEOF_LONG_LONG 0
|
||||
# endif
|
||||
#
|
||||
|
||||
# if defined(_WIN64)
|
||||
# define QSE_SIZEOF_VOID_P 8
|
||||
# else
|
||||
@ -124,24 +136,25 @@ _M_X64 x64 platform
|
||||
# define QSE_SIZEOF_DOUBLE 8
|
||||
# define QSE_SIZEOF_LONG_DOUBLE 8
|
||||
# define QSE_SIZEOF_WCHAR_T 2
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF___INT8 1
|
||||
# define QSE_SIZEOF___INT16 2
|
||||
# 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_SIZEOF_MBSTATE_T QSE_SIZEOF_LONG
|
||||
# define QSE_MBLEN_MAX 8
|
||||
#
|
||||
# define QSE_CHAR_IS_WCHAR
|
||||
#
|
||||
# /* these two have only to be large enough */
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
#else
|
||||
# error Define the size of various data types.
|
||||
#endif
|
||||
|
@ -36,35 +36,66 @@
|
||||
# define QSE_SIZEOF_INT 4
|
||||
# define QSE_SIZEOF_LONG 4
|
||||
# define QSE_SIZEOF_LONG_LONG 8
|
||||
#
|
||||
# define QSE_SIZEOF_VOID_P 4
|
||||
# define QSE_SIZEOF_FLOAT 4
|
||||
# define QSE_SIZEOF_DOUBLE 8
|
||||
# define QSE_SIZEOF_LONG_DOUBLE 8
|
||||
# define QSE_SIZEOF_WCHAR_T 2
|
||||
#
|
||||
|
||||
# define QSE_SIZEOF___INT8 1
|
||||
# define QSE_SIZEOF___INT16 2
|
||||
# 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
|
||||
#
|
||||
|
||||
/* I don't know the exact mbstate size.
|
||||
* but this should be large enough */
|
||||
# define QSE_SIZEOF_MBSTATE_T QSE_SIZEOF_LONG
|
||||
/* TODO: check the exact value */
|
||||
# define QSE_MBLEN_MAX 8
|
||||
#
|
||||
# define QSE_CHAR_IS_WCHAR
|
||||
#
|
||||
# /* these two have only to be large enough */
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# define QSE_SIZEOF_CHAR 1
|
||||
# define QSE_SIZEOF_SHORT 2
|
||||
# define QSE_SIZEOF_INT 4
|
||||
# define QSE_SIZEOF_LONG 4
|
||||
# define QSE_SIZEOF_LONG_LONG 0
|
||||
# define QSE_SIZEOF_VOID_P 4
|
||||
# define QSE_SIZEOF_FLOAT 4
|
||||
# define QSE_SIZEOF_DOUBLE 8
|
||||
# define QSE_SIZEOF_LONG_DOUBLE 8
|
||||
# define QSE_SIZEOF_WCHAR_T 2
|
||||
|
||||
# define QSE_SIZEOF___INT8 0
|
||||
# define QSE_SIZEOF___INT16 0
|
||||
# define QSE_SIZEOF___INT32 0
|
||||
# define QSE_SIZEOF___INT64 0
|
||||
# define QSE_SIZEOF___INT128 0
|
||||
|
||||
# define QSE_SIZEOF_OFF64_T 0
|
||||
# define QSE_SIZEOF_OFF_T 4
|
||||
|
||||
# define QSE_SIZEOF_MBSTATE_T QSE_SIZEOF_LONG
|
||||
# define QSE_MBLEN_MAX 8
|
||||
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define QSE_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
# define QSE_CHAR_IS_WCHAR 1
|
||||
# define QSE_ENABLE_BUNDLED_UNICODE 1
|
||||
|
||||
#else
|
||||
# error Define the size of various data types.
|
||||
#endif
|
||||
|
||||
#include "conf-inf.h"
|
||||
#include <qse/conf-inf.h>
|
||||
|
@ -616,6 +616,9 @@
|
||||
/* char is wchar */
|
||||
#undef QSE_CHAR_IS_WCHAR
|
||||
|
||||
/* use the bundled unicode routines */
|
||||
#undef QSE_ENABLE_BUNDLED_UNICODE
|
||||
|
||||
/* enable qse_sed_setexectracer() */
|
||||
#undef QSE_ENABLE_SEDTRACER
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
# pragma pack(1)
|
||||
#elif defined(__HP_aCC) || defined(__HP_cc)
|
||||
# pragma PACK 1
|
||||
#elif defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
#elif defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0500))
|
||||
# pragma pack(push,1)
|
||||
#elif defined(__DECC)
|
||||
# pragma pack(push,1)
|
||||
|
@ -22,7 +22,7 @@
|
||||
# pragma pack(2)
|
||||
#elif defined(__HP_aCC) || defined(__HP_cc)
|
||||
# pragma PACK 2
|
||||
#elif defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
#elif defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0500))
|
||||
# pragma pack(push,2)
|
||||
#elif defined(__DECC)
|
||||
# pragma pack(push,2)
|
||||
|
@ -22,7 +22,7 @@
|
||||
# pragma pack()
|
||||
#elif defined(__HP_aCC) || defined(__HP_cc)
|
||||
# pragma PACK
|
||||
#elif defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
#elif defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0500))
|
||||
# pragma pack(pop)
|
||||
#elif defined(__DECC)
|
||||
# pragma pack(pop)
|
||||
|
Reference in New Issue
Block a user