enhanced win32 utf8 console hack in sio

This commit is contained in:
2012-02-25 14:52:26 +00:00
parent b0bcf53b6f
commit ada60acf67
30 changed files with 296 additions and 233 deletions

View File

@ -210,15 +210,19 @@ void qse_fio_fini (
qse_fio_t* fio
);
qse_fio_errnum_t qse_fio_geterrnum (
const qse_fio_t* fio
);
/**
* The qse_fio_gethandle() function returns the native file handle.
*/
qse_fio_hnd_t qse_fio_gethandle (
qse_fio_t* fio
const qse_fio_t* fio
);
qse_ubi_t qse_fio_gethandleasubi (
qse_fio_t* fio
const qse_fio_t* fio
);
/**

View File

@ -121,11 +121,11 @@ typedef void (*qse_htb_freeer_t) (
* integer otherwise.
*/
typedef int (*qse_htb_comper_t) (
qse_htb_t* htb, /**< hash table */
const void* kptr1, /**< key pointer */
qse_size_t klen1, /**< key length */
const void* kptr2, /**< key pointer */
qse_size_t klen2 /**< key length */
const qse_htb_t* htb, /**< hash table */
const void* kptr1, /**< key pointer */
qse_size_t klen1, /**< key length */
const void* kptr2, /**< key pointer */
qse_size_t klen2 /**< key length */
);
/**
@ -154,9 +154,9 @@ typedef qse_size_t (*qse_htb_sizer_t) (
* The qse_htb_hasher_t type defines a key hash function
*/
typedef qse_size_t (*qse_htb_hasher_t) (
qse_htb_t* htb, /**< hash table */
const void* kptr, /**< key pointer */
qse_size_t klen /**< key length in bytes */
const qse_htb_t* htb, /**< hash table */
const void* kptr, /**< key pointer */
qse_size_t klen /**< key length in bytes */
);
/**
@ -361,7 +361,7 @@ void qse_htb_fini (
* The qse_htb_getmancbs() function gets manipulation callback function set.
*/
const qse_htb_mancbs_t* qse_htb_getmancbs (
qse_htb_t* htb /**< hash table */
const qse_htb_t* htb /**< hash table */
);
/**
@ -377,7 +377,7 @@ void qse_htb_setmancbs (
* The qse_htb_getsize() function gets the number of pairs in hash table.
*/
qse_size_t qse_htb_getsize (
qse_htb_t* htb
const qse_htb_t* htb
);
/**
@ -385,7 +385,7 @@ qse_size_t qse_htb_getsize (
* in a hash bucket.
*/
qse_size_t qse_htb_getcapa (
qse_htb_t* htb /**< hash table */
const qse_htb_t* htb /**< hash table */
);
/**
@ -396,9 +396,9 @@ qse_size_t qse_htb_getcapa (
* or #QSE_NULL if no match is found.
*/
qse_htb_pair_t* qse_htb_search (
qse_htb_t* htb, /**< hash table */
const void* kptr, /**< key pointer */
qse_size_t klen /**< key length */
const qse_htb_t* htb, /**< hash table */
const void* kptr, /**< key pointer */
qse_size_t klen /**< key length */
);
/**
@ -632,20 +632,20 @@ void qse_htb_freepair (
* The qse_htb_dflhash() function is a default hash function.
*/
qse_size_t qse_htb_dflhash (
qse_htb_t* htb,
const void* kptr,
qse_size_t klen
const qse_htb_t* htb,
const void* kptr,
qse_size_t klen
);
/**
* The qse_htb_dflcomp() function is default comparator.
*/
int qse_htb_dflcomp (
qse_htb_t* htb,
const void* kptr1,
qse_size_t klen1,
const void* kptr2,
qse_size_t klen2
const qse_htb_t* htb,
const void* kptr1,
qse_size_t klen1,
const void* kptr2,
qse_size_t klen2
);
#ifdef __cplusplus

View File

@ -1,4 +1,3 @@
/*
* $Id$
*
@ -25,7 +24,7 @@
#include <qse/types.h>
#include <qse/macros.h>
typedef struct qse_ipad_t qse_ipad_t;
typedef struct qse_ipad_t qse_ipad_t;
typedef struct qse_ipad4_t qse_ipad4_t;
typedef struct qse_ipad6_t qse_ipad6_t;
@ -44,14 +43,14 @@ struct qse_ipad_t
{
enum
{
QSE_IPAD_IP4,
QSE_IPAD_IP6
QSE_IPAD_V4,
QSE_IPAD_V6
} type;
union
{
qse_ipad4_t ip4;
qse_ipad4_t ip6;
qse_ipad4_t v4;
qse_ipad6_t v6;
} u;
};
@ -59,6 +58,38 @@ struct qse_ipad_t
extern "C" {
#endif
int qse_mbstoipad4 (
const qse_mchar_t* mbs,
qse_ipad4_t* ipad
);
int qse_mbsntoipad4 (
const qse_mchar_t* mbs,
qse_size_t len
);
int qse_ipad4tombs (
const qse_ipad4_t* ipad,
qse_mchar_t* mbs,
qse_size_t len
);
int qse_wcstoipad4 (
const qse_wchar_t* wcs,
qse_ipad4_t* ipad
);
int qse_wcstoipad4 (
const qse_wchar_t* wcs,
qse_ipad4_t* ipad
);
int qse_ipad4towcs (
const qse_ipad4_t* ipad,
qse_wchar_t* wcs,
qse_size_t len
);
#ifdef __cplusplus
}
#endif

View File

@ -263,12 +263,21 @@ void qse_pio_fini (
qse_pio_t* pio /**< pio object */
);
/**
* The qse_pio_geterrnum() function returns the number of the last error
* occurred.
* @return error number
*/
qse_pio_errnum_t qse_pio_geterrnum (
const qse_pio_t* pio /**< pio object */
);
/**
* The qse_pio_getoption() function gets the current option.
* @return option number OR'ed of #qse_pio_option_t enumerators
*/
int qse_pio_getoption (
qse_pio_t* pio /**< pio object */
const qse_pio_t* pio /**< pio object */
);
/**
@ -280,15 +289,6 @@ void qse_pio_setoption (
enumerators */
);
/**
* The qse_pio_geterrnum() function returns the number of the last error
* occurred.
* @return error number
*/
qse_pio_errnum_t qse_pio_geterrnum (
qse_pio_t* pio /**< pio object */
);
/**
* The qse_pio_getcmgr() function returns the current character manager.
* It returns #QSE_NULL is @a pio is not opened with #QSE_PIO_TEXT.
@ -313,8 +313,8 @@ void qse_pio_setcmgr (
* @return pipe handle
*/
qse_pio_hnd_t qse_pio_gethandle (
qse_pio_t* pio, /**< pio object */
qse_pio_hid_t hid /**< handle ID */
const qse_pio_t* pio, /**< pio object */
qse_pio_hid_t hid /**< handle ID */
);
/**
@ -323,8 +323,8 @@ qse_pio_hnd_t qse_pio_gethandle (
* @return pipe handle
*/
qse_ubi_t qse_pio_gethandleasubi (
qse_pio_t* pio, /**< pio object */
qse_pio_hid_t hid /**< handle ID */
const qse_pio_t* pio, /**< pio object */
qse_pio_hid_t hid /**< handle ID */
);
/**
@ -332,7 +332,7 @@ qse_ubi_t qse_pio_gethandleasubi (
* @return process handle
*/
qse_pio_pid_t qse_pio_getchild (
qse_pio_t* pio /**< pio object */
const qse_pio_t* pio /**< pio object */
);
/**

View File

@ -116,11 +116,11 @@ typedef void (*qse_rbt_freeer_t) (
* key is greater than the second key, -1 otherwise.
*/
typedef int (*qse_rbt_comper_t) (
qse_rbt_t* rbt, /**< red-black tree */
const void* kptr1, /**< key pointer */
qse_size_t klen1, /**< key length */
const void* kptr2, /**< key pointer */
qse_size_t klen2 /**< key length */
const qse_rbt_t* rbt, /**< red-black tree */
const void* kptr1, /**< key pointer */
qse_size_t klen1, /**< key length */
const void* kptr2, /**< key pointer */
qse_size_t klen2 /**< key length */
);
/**
@ -319,7 +319,7 @@ void qse_rbt_fini (
* The qse_rbt_getmancbs() function gets manipulation callback function set.
*/
const qse_rbt_mancbs_t* qse_rbt_getmancbs (
qse_rbt_t* rbt /**< red-black tree */
const qse_rbt_t* rbt /**< red-black tree */
);
/**
@ -335,7 +335,7 @@ void qse_rbt_setmancbs (
* The qse_rbt_getsize() function gets the number of pairs in red-black tree.
*/
qse_size_t qse_rbt_getsize (
qse_rbt_t* rbt /**< red-black tree */
const qse_rbt_t* rbt /**< red-black tree */
);
/**
@ -346,9 +346,9 @@ qse_size_t qse_rbt_getsize (
* or QSE_NULL if no match is found.
*/
qse_rbt_pair_t* qse_rbt_search (
qse_rbt_t* rbt, /**< red-black tree */
const void* kptr, /**< key pointer */
qse_size_t klen /**< the size of the key */
const qse_rbt_t* rbt, /**< red-black tree */
const void* kptr, /**< key pointer */
qse_size_t klen /**< the size of the key */
);
/**
@ -574,11 +574,11 @@ void qse_rbt_freepair (
* The qse_rbt_dflcomp() function defines the default key comparator.
*/
int qse_rbt_dflcomp (
qse_rbt_t* rbt,
const void* kptr1,
qse_size_t klen1,
const void* kptr2,
qse_size_t klen2
const qse_rbt_t* rbt,
const void* kptr1,
qse_size_t klen1,
const void* kptr2,
qse_size_t klen2
);
#ifdef __cplusplus

View File

@ -238,7 +238,7 @@ qse_rex_node_t* qse_rex_yield (
* The qse_rex_getoption() function returns the current options.
*/
int qse_rex_getoption (
qse_rex_t* rex /**< regular expression processor */
const qse_rex_t* rex /**< regular expression processor */
);
/**
@ -250,11 +250,11 @@ void qse_rex_setoption (
);
qse_rex_errnum_t qse_rex_geterrnum (
qse_rex_t* rex
const qse_rex_t* rex
);
const qse_char_t* qse_rex_geterrmsg (
qse_rex_t* rex
const qse_rex_t* rex
);
qse_rex_node_t* qse_rex_comp (

View File

@ -197,7 +197,7 @@ void qse_sio_fini (
);
qse_sio_errnum_t qse_sio_geterrnum (
qse_sio_t* sio
const qse_sio_t* sio
);
qse_cmgr_t* qse_sio_getcmgr (
@ -210,11 +210,11 @@ void qse_sio_setcmgr (
);
qse_sio_hnd_t qse_sio_gethandle (
qse_sio_t* sio
const qse_sio_t* sio
);
qse_ubi_t qse_sio_gethandleasubi (
qse_sio_t* sio
const qse_sio_t* sio
);
qse_ssize_t qse_sio_flush (

View File

@ -169,7 +169,7 @@ int qse_tio_fini (
* The qse_tio_geterrnum() function returns the current error code.
*/
qse_tio_errnum_t qse_tio_geterrnum (
qse_tio_t* tio
const qse_tio_t* tio
);
/**