added QSE_SIO_NOAUTOFLUSH.

fixed a bug in qse_tio_writew()
changed how assert() prints messages.
This commit is contained in:
2011-12-12 14:46:22 +00:00
parent 0b4c66cbf5
commit 57683c9396
6 changed files with 107 additions and 68 deletions

View File

@ -60,13 +60,18 @@ enum qse_fio_open_flag_t
QSE_FIO_NOFOLLOW = (1 << 15),
/* for WIN32 only. harmless(no effect) when used on other platforms */
QSE_FIO_NOSHRD = (1 << 24),
QSE_FIO_NOSHWR = (1 << 25),
QSE_FIO_NOSHDL = (1 << 26),
QSE_FIO_NOSHRD = (1 << 20),
QSE_FIO_NOSHWR = (1 << 21),
QSE_FIO_NOSHDL = (1 << 22),
/* hints to OS. harmless(no effect) when used on unsupported platforms */
QSE_FIO_RANDOM = (1 << 27), /* hint that access be random */
QSE_FIO_SEQUENTIAL = (1 << 28) /* hint that access is sequential */
QSE_FIO_RANDOM = (1 << 23), /* hint that access be random */
QSE_FIO_SEQUENTIAL = (1 << 24) /* hint that access is sequential */
/* NOTE:
* NEVER (1 << 31) since QSE_SIO_NOAUTOFLUSH is defined to
* that value in sio.h FIO doesn't have any bufferring.
*/
};
enum qse_fio_std_t

View File

@ -53,7 +53,11 @@ enum qse_sio_open_flag_t
QSE_SIO_NOSHDL = QSE_FIO_NOSHDL,
QSE_SIO_RANDOM = QSE_FIO_RANDOM,
QSE_SIO_SEQUENTIAL = QSE_FIO_SEQUENTIAL
QSE_SIO_SEQUENTIAL = QSE_FIO_SEQUENTIAL,
/* Beware that this should not overlap with any QSE_FIO_XXXX.
* See NOTE in fio.h */
QSE_SIO_NOAUTOFLUSH = (1 << 31)
};
typedef qse_fio_off_t qse_sio_pos_t;
@ -62,7 +66,7 @@ typedef qse_fio_std_t qse_sio_std_t;
#define QSE_SIO_STDIN QSE_FIO_STDIN
#define QSE_SIO_STDOUT QSE_FIO_STDOUT
#define QSE_SIO_STDER QSE_FIO_STDERR
#define QSE_SIO_STDERR QSE_FIO_STDERR
/**
* The qse_sio_t type defines a simple text stream over a file. It also
@ -165,17 +169,37 @@ qse_ssize_t qse_sio_putc (
qse_char_t c
);
qse_ssize_t qse_sio_puts (
qse_sio_t* sio,
const qse_char_t* str
qse_ssize_t qse_sio_putms (
qse_sio_t* sio,
const qse_mchar_t* str
);
qse_ssize_t qse_sio_putsn (
qse_sio_t* sio,
const qse_char_t* str,
qse_size_t size
qse_ssize_t qse_sio_putws (
qse_sio_t* sio,
const qse_wchar_t* str
);
qse_ssize_t qse_sio_putmsn (
qse_sio_t* sio,
const qse_mchar_t* str,
qse_size_t size
);
qse_ssize_t qse_sio_putwsn (
qse_sio_t* sio,
const qse_wchar_t* str,
qse_size_t size
);
#if defined(QSE_CHAR_IS_MCHAR)
# define qse_sio_puts(sio,str) qse_sio_putms(sio,str)
# define qse_sio_putsn(sio,str,size) qse_sio_putmsn(sio,str,size)
#else
# define qse_sio_puts(sio,str) qse_sio_putws(sio,str)
# define qse_sio_putsn(sio,str,size) qse_sio_putwsn(sio,str,size)
#endif
/**
* The qse_sio_getpos() gets the current position in a stream.
* Note that it may not return the desired postion due to buffering.