interim commit while overhauling pio

- added qse_wcstombslen()
This commit is contained in:
2009-01-06 04:40:25 +00:00
parent b037bfcaf5
commit e606d9f9e1
23 changed files with 522 additions and 122 deletions

View File

@ -8,54 +8,32 @@
#include <qse/types.h>
#include <qse/macros.h>
#if 0
IN_FROM_NUL /* < /dev/null */
IN_DROP
IN_ACCEPT
IN_KEEP
OUT_TO_NUL /* > /dev/null */
OUT_DROP /* close it.. */
OUT_ACCEPT
OUT_KEEP /* dont do anything */
ERR_TO_NUL
ERR_DROP
ERR_ACCEPT
ERR_KEEP
#endif
enum qse_pio_open_flag_t
{
QSE_PIO_WRITEIN = (1 << 0),
QSE_PIO_READOUT = (1 << 1),
QSE_PIO_READERR = (1 << 2),
QSE_PIO_DROPIN = (1 << 3),
QSE_PIO_DROPOUT = (1 << 4),
QSE_PIO_DROPERR = (1 << 5),
QSE_PIO_ERRTOOUT = (1 << 6),
QSE_PIO_OUTTOERR = (1 << 7),
QSE_PIO_ERRTONUL = (1 << 8),
QSE_PIO_OUTTONUL = (1 << 9),
QSE_PIO_READ = (QSE_PIO_READOUT),
QSE_PIO_WRITE = (QSE_PIO_WRITEIN)
QSE_PIO_ERRTOOUT = (1 << 3),
QSE_PIO_OUTTOERR = (1 << 4),
QSE_PIO_INTONUL = (1 << 5),
QSE_PIO_ERRTONUL = (1 << 6),
QSE_PIO_OUTTONUL = (1 << 7),
QSE_PIO_DROPIN = (1 << 8),
QSE_PIO_DROPOUT = (1 << 9),
QSE_PIO_DROPERR = (1 << 10),
/* invoke the command through a default system shell */
QSE_PIO_SHELL = (1 << 11)
};
enum qse_pio_rw_flag_t
enum qse_pio_hid_t
{
QSE_PIO_IN = (1 << 0),
QSE_PIO_OUT = (1 << 1),
QSE_PIO_ERR = (1 << 2),
QSE_PIO_END = (1 << 8)
};
enum qse_pio_handle_id_t
{
QSE_PIO_HANDLE_IN = 0,
QSE_PIO_HANDLE_OUT = 1,
QSE_PIO_HANDLE_ERR = 2
QSE_PIO_ERR = (1 << 2)
};
#ifdef _WIN32
@ -83,7 +61,7 @@ struct qse_pio_t
extern "C" {
#endif
/****f* qse.pio/qse_pio_open
/****f* qse.cmn.pio/qse_pio_open
* NAME
* qse_pio_open - open a pipe to a child process
*
@ -97,7 +75,7 @@ qse_pio_t* qse_pio_open (
);
/******/
/****f* qse.pio/qse_pio_close
/****f* qse.cmn.pio/qse_pio_close
* NAME
* qse_pio_close - close a pipe
*
@ -119,7 +97,7 @@ void qse_pio_fini (
qse_pio_t* pio
);
/****f* qse.pio/qse_pio_wait
/****f* qse.cmn.pio/qse_pio_wait
* NAME
* qse_pio_wait - wait for a child process
*
@ -130,8 +108,19 @@ int qse_pio_wait (
);
/******/
/****f* qse.cmn.pio/qse_pio_gethandle
* NAME
* qse_pio_gethandle - get system handle
*
* SYNOPSIS
*/
qse_pio_hnd_t qse_pio_gethandle (
qse_pio_t* pio,
int hid
);
/******/
/****f* qse.pio/qse_pio_read
/****f* qse.cmn.pio/qse_pio_read
* NAME
* qse_pio_read - read data
*
@ -141,11 +130,11 @@ qse_ssize_t qse_pio_read (
qse_pio_t* pio,
void* buf,
qse_size_t size,
int flags
int hid
);
/******/
/****f* qse.pio/qse_pio_write
/****f* qse.cmn.pio/qse_pio_write
* NAME
* qse_pio_write - write data
*
@ -159,11 +148,11 @@ qse_ssize_t qse_pio_write (
qse_pio_t* pio,
const void* data,
qse_size_t size,
int flags
int hid
);
/******/
/****f* qse.pio/qse_pio_end
/****f* qse.cmn.pio/qse_pio_end
* NAME
* qse_pio_end
*
@ -171,7 +160,7 @@ qse_ssize_t qse_pio_write (
*/
void qse_pio_end (
qse_pio_t* pio,
int flags
int hid
);
/******/

View File

@ -408,6 +408,28 @@ qse_size_t qse_mbsntowcsn (
);
/******/
/****f* qse.cmn.str/qse_wcstombslen
* NAME
* qse_wcstombslen - get the length
*
* DESCRIPTION
* The qse_wcstombslen() function scans a null-terminated wide character
* string to get the total number of multibyte characters that it can be
* converted to. The resulting number of characters is stored into memory
* pointed to by mbslen.
*
* RETURN
* The qse_wcstombslen() function returns the number of wide characters
* handled.
*
* SYNOPSIS
*/
qse_size_t qse_wcstombslen (
const qse_wchar_t* wcs,
qse_size_t* mbslen
);
/******/
/****f* qse.cmn.str/qse_wcstombs
* NAME
* qse_wcstombs - convert a wide character string to a multibyte string.