From df28fde9ef16f2cf04ffef387ca77eb251433845 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 16 Nov 2011 15:18:46 +0000 Subject: [PATCH] added QSE_FIO_TEMPORARY. added qse_rand31() fixed a minor bug in handling QSE_FMTINTMAX_ZEROLEAD --- qse/include/qse/cmn/alg.h | 9 + qse/include/qse/cmn/fio.h | 21 +- qse/include/qse/cmn/fmt.h | 52 +++++ qse/include/qse/cmn/sio.h | 5 +- qse/lib/awk/tree.c | 56 ++++-- qse/lib/cmn/Makefile.am | 1 + qse/lib/cmn/Makefile.in | 28 +-- qse/lib/cmn/alg-rand.c | 23 +++ qse/lib/cmn/fio.c | 86 +++++++- qse/lib/cmn/fmt.c | 24 ++- qse/lib/fs/dir.c | 8 +- qse/samples/cmn/Makefile.am | 5 +- qse/samples/cmn/Makefile.in | 60 +++--- qse/samples/cmn/{fio.c => fio01.c} | 0 qse/samples/cmn/fio02.c | 93 +++++++++ qse/watcom/debug/os2/lib/cmn/qsecmn.tgt | 234 ++++++++++++---------- qse/watcom/qse.wpj | 10 +- qse/watcom/release/os2/lib/cmn/qsecmn.tgt | 232 +++++++++++---------- 18 files changed, 645 insertions(+), 302 deletions(-) create mode 100644 qse/lib/cmn/alg-rand.c rename qse/samples/cmn/{fio.c => fio01.c} (100%) create mode 100644 qse/samples/cmn/fio02.c diff --git a/qse/include/qse/cmn/alg.h b/qse/include/qse/cmn/alg.h index ecdee716..794943b6 100644 --- a/qse/include/qse/cmn/alg.h +++ b/qse/include/qse/cmn/alg.h @@ -113,4 +113,13 @@ void qse_qsort ( void* ctx ); + +/** + * The qse_rand31() function implements Park-Miller's minimal standard + * 32 bit pseudo-random number generator. + */ +qse_uint32_t qse_rand31 ( + qse_uint32_t seed +); + #endif diff --git a/qse/include/qse/cmn/fio.h b/qse/include/qse/cmn/fio.h index 803ef774..972a0535 100644 --- a/qse/include/qse/cmn/fio.h +++ b/qse/include/qse/cmn/fio.h @@ -39,8 +39,12 @@ enum qse_fio_open_flag_t /** treat the file name pointer as a handle pointer */ QSE_FIO_HANDLE = (1 << 3), + /** treate the file name pointer as a pointer to file name + * template to use when making a temporary file name */ + QSE_FIO_TEMPORARY = (1 << 4), + /** don't close an I/O handle in qse_fio_fini() and qse_fio_close() */ - QSE_FIO_NOCLOSE = (1 << 4), + QSE_FIO_NOCLOSE = (1 << 5), /* normal open flags */ QSE_FIO_READ = (1 << 8), @@ -58,10 +62,11 @@ enum qse_fio_open_flag_t /* 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), /* hints to OS. harmless(no effect) when used on unsupported platforms */ - QSE_FIO_RANDOM = (1 << 26), /* hint that access be random */ - QSE_FIO_SEQUENTIAL = (1 << 27) /* hint that access is sequential */ + QSE_FIO_RANDOM = (1 << 27), /* hint that access be random */ + QSE_FIO_SEQUENTIAL = (1 << 28) /* hint that access is sequential */ }; enum qse_fio_std_t @@ -150,6 +155,16 @@ QSE_DEFINE_COMMON_FUNCTIONS (fio) * The qse_fio_open() function opens a file. * To open a file, you should set the flags with at least one of * QSE_FIO_READ, QSE_FIO_WRITE, QSE_FIO_APPEND. + * + * If the #QSE_FIO_HANDLE flag is set, the @a path parameter is interpreted + * as a pointer to qse_fio_hnd_t. + * + * If the #QSE_FIO_TEMPORARY flag is set, the @a path parameter is + * interpreted as a path name template and an actual file name to open + * is internally generated using the template. The @a path parameter + * is filled with the last actual path name attempted when the function + * returns. So, you must not pass a constant string to the @a path + * parameter when #QSE_FIO_TEMPORARY is set. */ qse_fio_t* qse_fio_open ( qse_mmgr_t* mmgr, diff --git a/qse/include/qse/cmn/fmt.h b/qse/include/qse/cmn/fmt.h index 117e6284..5f089305 100644 --- a/qse/include/qse/cmn/fmt.h +++ b/qse/include/qse/cmn/fmt.h @@ -67,6 +67,16 @@ enum qse_fmtintmax_flag_t #define QSE_FMTINTMAX_FILLRIGHT QSE_FMTINTMAX_FILLRIGHT #define QSE_FMTINTMAX_FILLCENTER QSE_FMTINTMAX_FILLCENTER +#define QSE_FMTUINTMAX_NOTRUNC QSE_FMTINTMAX_NOTRUNC +#define QSE_FMTUINTMAX_NONULL QSE_FMTINTMAX_NONULL +#define QSE_FMTUINTMAX_NOZERO QSE_FMTINTMAX_NOZERO +#define QSE_FMTUINTMAX_ZEROLEAD QSE_FMTINTMAX_ZEROLEAD +#define QSE_FMTUINTMAX_UPPERCASE QSE_FMTINTMAX_UPPERCASE +#define QSE_FMTUINTMAX_PLUSSIGN QSE_FMTINTMAX_PLUSSIGN +#define QSE_FMTUINTMAX_EMPTYSIGN QSE_FMTINTMAX_EMPTYSIGN +#define QSE_FMTUINTMAX_FILLRIGHT QSE_FMTINTMAX_FILLRIGHT +#define QSE_FMTUINTMAX_FILLCENTER QSE_FMTINTMAX_FILLCENTER + #define QSE_FMTINTMAXTOMBS_NOTRUNC QSE_FMTINTMAX_NOTRUNC #define QSE_FMTINTMAXTOMBS_NONULL QSE_FMTINTMAX_NONULL #define QSE_FMTINTMAXTOMBS_NOZERO QSE_FMTINTMAX_NOZERO @@ -77,6 +87,16 @@ enum qse_fmtintmax_flag_t #define QSE_FMTINTMAXTOMBS_FILLRIGHT QSE_FMTINTMAX_FILLRIGHT #define QSE_FMTINTMAXTOMBS_FILLCENTER QSE_FMTINTMAX_FILLCENTER +#define QSE_FMTUINTMAXTOMBS_NOTRUNC QSE_FMTINTMAX_NOTRUNC +#define QSE_FMTUINTMAXTOMBS_NONULL QSE_FMTINTMAX_NONULL +#define QSE_FMTUINTMAXTOMBS_NOZERO QSE_FMTINTMAX_NOZERO +#define QSE_FMTUINTMAXTOMBS_ZEROLEAD QSE_FMTINTMAX_ZEROLEAD +#define QSE_FMTUINTMAXTOMBS_UPPERCASE QSE_FMTINTMAX_UPPERCASE +#define QSE_FMTUINTMAXTOMBS_PLUSSIGN QSE_FMTINTMAX_PLUSSIGN +#define QSE_FMTUINTMAXTOMBS_EMPTYSIGN QSE_FMTINTMAX_EMPTYSIGN +#define QSE_FMTUINTMAXTOMBS_FILLRIGHT QSE_FMTINTMAX_FILLRIGHT +#define QSE_FMTUINTMAXTOMBS_FILLCENTER QSE_FMTINTMAX_FILLCENTER + #define QSE_FMTINTMAXTOWCS_NOTRUNC QSE_FMTINTMAX_NOTRUNC #define QSE_FMTINTMAXTOWCS_NONULL QSE_FMTINTMAX_NONULL #define QSE_FMTINTMAXTOWCS_NOZERO QSE_FMTINTMAX_NOZERO @@ -87,6 +107,16 @@ enum qse_fmtintmax_flag_t #define QSE_FMTINTMAXTOWCS_FILLRIGHT QSE_FMTINTMAX_FILLRIGHT #define QSE_FMTINTMAXTOWCS_FILLCENTER QSE_FMTINTMAX_FILLCENTER +#define QSE_FMTUINTMAXTOWCS_NOTRUNC QSE_FMTINTMAX_NOTRUNC +#define QSE_FMTUINTMAXTOWCS_NONULL QSE_FMTINTMAX_NONULL +#define QSE_FMTUINTMAXTOWCS_NOZERO QSE_FMTINTMAX_NOZERO +#define QSE_FMTUINTMAXTOWCS_ZEROLEAD QSE_FMTINTMAX_ZEROLEAD +#define QSE_FMTUINTMAXTOWCS_UPPERCASE QSE_FMTINTMAX_UPPERCASE +#define QSE_FMTUINTMAXTOWCS_PLUSSIGN QSE_FMTINTMAX_PLUSSIGN +#define QSE_FMTUINTMAXTOWCS_EMPTYSIGN QSE_FMTINTMAX_EMPTYSIGN +#define QSE_FMTUINTMAXTOWCS_FILLRIGHT QSE_FMTINTMAX_FILLRIGHT +#define QSE_FMTUINTMAXTOWCS_FILLCENTER QSE_FMTINTMAX_FILLCENTER + #ifdef __cplusplus extern "C" { #endif @@ -111,6 +141,12 @@ extern "C" { * - If neither #QSE_FMTINTMAXTOMBS_FILLRIGHT nor #QSE_FMTINTMAXTOMBS_FILLCENTER * , slots before the formatting string are filled. * + * The @a precision parameter specified the minimum number of digits to + * produce from the @ value. If @a value produces fewer digits than + * @a precision, the actual digits are padded with '0' to meet the precision + * requirement. You can pass a negative number if you don't wish to specify + * precision. + * * The terminating null is not added if #QSE_FMTINTMAXTOMBS_NONULL is set; * The #QSE_FMTINTMAXTOMBS_UPPERCASE flag indicates that the function should * use the uppercase letter for a alphabetic digit; @@ -118,6 +154,11 @@ extern "C" { * The #QSE_FMTINTMAXTOMBS_PLUSSIGN flag and #QSE_FMTINTMAXTOMBS_EMPTYSIGN * ensures that the plus sign and a space is added for a positive integer * including 0 respectively. + * The #QSE_FMTINTMAXTOMBS_ZEROLEAD flag ensures that the numeric string + * begins with '0' before applying the prefix. + * You can set the #QSE_FMTINTMAXTOMBS_NOZERO flag if you want the value of + * 0 to produce nothing. If both #QSE_FMTINTMAXTOMBS_NOZERO and + * #QSE_FMTINTMAXTOMBS_ZEROLEAD are specified, '0' is still produced. * * If @a prefix is not #QSE_NULL, it is inserted before the digits. * @@ -159,6 +200,12 @@ int qse_fmtintmaxtombs ( * are filled. * - If neither #QSE_FMTINTMAXTOWCS_FILLRIGHT nor #QSE_FMTINTMAXTOWCS_FILLCENTER * , slots before the formatting string are filled. + * + * The @a precision parameter specified the minimum number of digits to + * produce from the @ value. If @a value produces fewer digits than + * @a precision, the actual digits are padded with '0' to meet the precision + * requirement. You can pass a negative number if don't wish to specify + * precision. * * The terminating null is not added if #QSE_FMTINTMAXTOWCS_NONULL is set; * The #QSE_FMTINTMAXTOWCS_UPPERCASE flag indicates that the function should @@ -167,6 +214,11 @@ int qse_fmtintmaxtombs ( * The #QSE_FMTINTMAXTOWCS_PLUSSIGN flag and #QSE_FMTINTMAXTOWCS_EMPTYSIGN * ensures that the plus sign and a space is added for a positive integer * including 0 respectively. + * The #QSE_FMTINTMAXTOWCS_ZEROLEAD flag ensures that the numeric string + * begins with 0 before applying the prefix. + * You can set the #QSE_FMTINTMAXTOWCS_NOZERO flag if you want the value of + * 0 to produce nothing. If both #QSE_FMTINTMAXTOWCS_NOZERO and + * #QSE_FMTINTMAXTOWCS_ZEROLEAD are specified, '0' is still produced. * * If @a prefix is not #QSE_NULL, it is inserted before the digits. * diff --git a/qse/include/qse/cmn/sio.h b/qse/include/qse/cmn/sio.h index f0201561..f05ee77d 100644 --- a/qse/include/qse/cmn/sio.h +++ b/qse/include/qse/cmn/sio.h @@ -33,8 +33,10 @@ enum qse_sio_open_flag_t { QSE_SIO_HANDLE = QSE_FIO_HANDLE, - QSE_SIO_NOCLOSE = QSE_FIO_NOCLOSE, + QSE_SIO_TEMPORARY = QSE_FIO_TEMPORARY, + QSE_SIO_IGNOREMBWCERR = QSE_FIO_IGNOREMBWCERR, + QSE_SIO_NOCLOSE = QSE_FIO_NOCLOSE, QSE_SIO_READ = QSE_FIO_READ, QSE_SIO_WRITE = QSE_FIO_WRITE, @@ -48,6 +50,7 @@ enum qse_sio_open_flag_t QSE_SIO_NOSHRD = QSE_FIO_NOSHRD, QSE_SIO_NOSHWR = QSE_FIO_NOSHWR, + QSE_SIO_NOSHDL = QSE_FIO_NOSHDL, QSE_SIO_RANDOM = QSE_FIO_RANDOM, QSE_SIO_SEQUENTIAL = QSE_FIO_SEQUENTIAL diff --git a/qse/lib/awk/tree.c b/qse/lib/awk/tree.c index 159bf4e6..cd6faca9 100644 --- a/qse/lib/awk/tree.c +++ b/qse/lib/awk/tree.c @@ -325,26 +325,42 @@ static int print_expr (qse_awk_t* awk, qse_awk_nde_t* nde) for (i = 0; i < len; i++) { /* TODO: maybe more de-escaping?? */ - if (ptr[i] == QSE_T('\n')) - PUT_SRCSTR (awk, QSE_T("\\n")); - else if (ptr[i] == QSE_T('\r')) - PUT_SRCSTR (awk, QSE_T("\\r")); - else if (ptr[i] == QSE_T('\f')) - PUT_SRCSTR (awk, QSE_T("\\f")); - else if (ptr[i] == QSE_T('\b')) - PUT_SRCSTR (awk, QSE_T("\\b")); - else if (ptr[i] == QSE_T('\v')) - PUT_SRCSTR (awk, QSE_T("\\v")); - else if (ptr[i] == QSE_T('\a')) - PUT_SRCSTR (awk, QSE_T("\\a")); - else if (ptr[i] == QSE_T('\0')) - PUT_SRCSTR (awk, QSE_T("\\0")); - else if (ptr[i] == QSE_T('\"')) - PUT_SRCSTR (awk, QSE_T("\\\"")); - else if (ptr[i] == QSE_T('\\')) - PUT_SRCSTR (awk, QSE_T("\\\\")); - else - PUT_SRCSTRX (awk, &ptr[i], 1); + switch (ptr[i]) + { + case QSE_T('\n'): + PUT_SRCSTR (awk, QSE_T("\\n")); + break; + case QSE_T('\r'): + PUT_SRCSTR (awk, QSE_T("\\r")); + break; + case QSE_T('\t'): + PUT_SRCSTR (awk, QSE_T("\\t")); + break; + case QSE_T('\f'): + PUT_SRCSTR (awk, QSE_T("\\f")); + break; + case QSE_T('\b'): + PUT_SRCSTR (awk, QSE_T("\\b")); + break; + case QSE_T('\v'): + PUT_SRCSTR (awk, QSE_T("\\v")); + break; + case QSE_T('\a'): + PUT_SRCSTR (awk, QSE_T("\\a")); + break; + case QSE_T('\0'): + PUT_SRCSTR (awk, QSE_T("\\0")); + break; + case QSE_T('\"'): + PUT_SRCSTR (awk, QSE_T("\\\"")); + break; + case QSE_T('\\'): + PUT_SRCSTR (awk, QSE_T("\\\\")); + break; + default: + PUT_SRCSTRX (awk, &ptr[i], 1); + break; + } } PUT_SRCSTR (awk, QSE_T("\"")); break; diff --git a/qse/lib/cmn/Makefile.am b/qse/lib/cmn/Makefile.am index c614b6da..1579f9d1 100644 --- a/qse/lib/cmn/Makefile.am +++ b/qse/lib/cmn/Makefile.am @@ -19,6 +19,7 @@ noinst_HEADERS = \ tre-stack.h libqsecmn_la_SOURCES = \ + alg-rand.c \ alg-search.c \ alg-sort.c \ assert.c \ diff --git a/qse/lib/cmn/Makefile.in b/qse/lib/cmn/Makefile.in index 8fc35211..d2326de2 100644 --- a/qse/lib/cmn/Makefile.in +++ b/qse/lib/cmn/Makefile.in @@ -75,19 +75,19 @@ am__base_list = \ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libqsecmn_la_DEPENDENCIES = -am_libqsecmn_la_OBJECTS = alg-search.lo alg-sort.lo assert.lo chr.lo \ - chr-cnv.lo dll.lo env.lo gdl.lo htb.lo lda.lo fio.lo fma.lo \ - fmt.lo main.lo mem.lo oht.lo opt.lo path-basename.lo \ - path-canon.lo pio.lo pma.lo rbt.lo rex.lo sio.lo sll.lo \ - stdio.lo str-beg.lo str-cat.lo str-chr.lo str-cnv.lo \ - str-cmp.lo str-cpy.lo str-del.lo str-dup.lo str-dynm.lo \ - str-dynw.lo str-end.lo str-excl.lo str-fcpy.lo str-fnmat.lo \ - str-incl.lo str-len.lo str-pac.lo str-pbrk.lo str-put.lo \ - str-rev.lo str-rot.lo str-set.lo str-spl.lo str-spn.lo \ - str-str.lo str-subst.lo str-tok.lo str-trm.lo str-word.lo \ - time.lo tio.lo tio-get.lo tio-put.lo tre.lo tre-ast.lo \ - tre-compile.lo tre-match-backtrack.lo tre-match-parallel.lo \ - tre-parse.lo tre-stack.lo utf8.lo xma.lo +am_libqsecmn_la_OBJECTS = alg-rand.lo alg-search.lo alg-sort.lo \ + assert.lo chr.lo chr-cnv.lo dll.lo env.lo gdl.lo htb.lo lda.lo \ + fio.lo fma.lo fmt.lo main.lo mem.lo oht.lo opt.lo \ + path-basename.lo path-canon.lo pio.lo pma.lo rbt.lo rex.lo \ + sio.lo sll.lo stdio.lo str-beg.lo str-cat.lo str-chr.lo \ + str-cnv.lo str-cmp.lo str-cpy.lo str-del.lo str-dup.lo \ + str-dynm.lo str-dynw.lo str-end.lo str-excl.lo str-fcpy.lo \ + str-fnmat.lo str-incl.lo str-len.lo str-pac.lo str-pbrk.lo \ + str-put.lo str-rev.lo str-rot.lo str-set.lo str-spl.lo \ + str-spn.lo str-str.lo str-subst.lo str-tok.lo str-trm.lo \ + str-word.lo time.lo tio.lo tio-get.lo tio-put.lo tre.lo \ + tre-ast.lo tre-compile.lo tre-match-backtrack.lo \ + tre-match-parallel.lo tre-parse.lo tre-stack.lo utf8.lo xma.lo libqsecmn_la_OBJECTS = $(am_libqsecmn_la_OBJECTS) libqsecmn_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -288,6 +288,7 @@ noinst_HEADERS = \ tre-stack.h libqsecmn_la_SOURCES = \ + alg-rand.c \ alg-search.c \ alg-sort.c \ assert.c \ @@ -441,6 +442,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mmgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StdMmgr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alg-rand.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alg-search.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alg-sort.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assert.Plo@am__quote@ diff --git a/qse/lib/cmn/alg-rand.c b/qse/lib/cmn/alg-rand.c new file mode 100644 index 00000000..1bf5ad38 --- /dev/null +++ b/qse/lib/cmn/alg-rand.c @@ -0,0 +1,23 @@ +#include + +/* Park-Miller "minimal standard" 31 bit + * pseudo-random number generator, implemented + * with David G. Carta's optimisation: with + * 32 bit math and wihtout division. + */ +qse_uint32_t qse_rand31 (qse_uint32_t seed) +{ + qse_uint32_t hi, lo; + + if (seed == 0) seed++; + + lo = 16807 * (seed & 0xFFFF); + hi = 16807 * (seed >> 16); + + lo += (hi & 0x7FFF) << 16; + lo += hi >> 15; + + if (lo > 0x7FFFFFFFul) lo -= 0x7FFFFFFFul; + + return lo; +} diff --git a/qse/lib/cmn/fio.c b/qse/lib/cmn/fio.c index ef92846a..ca8a09a0 100644 --- a/qse/lib/cmn/fio.c +++ b/qse/lib/cmn/fio.c @@ -20,6 +20,9 @@ #include #include +#include +#include +#include #include "mem.h" #if defined(_WIN32) @@ -90,15 +93,68 @@ int qse_fio_init ( { qse_fio_hnd_t handle; + qse_uint32_t temp_no; + qse_char_t* temp_ptr; + qse_size_t temp_tries; + if (mmgr == QSE_NULL) mmgr = QSE_MMGR_GETDFL(); QSE_MEMSET (fio, 0, QSE_SIZEOF(*fio)); fio->mmgr = mmgr; - /* store the flags for later use though only OS/2 needs + /* Store the flags for later use though only OS/2 needs * this at this moment */ fio->flags = flags; + if (flags & QSE_FIO_TEMPORARY) + { + qse_ntime_t now; + + QSE_ASSERTX ( + (flags & QSE_FIO_HANDLE) == 0, + "QSE_FIO_TEMPORARY and QSE_FIO_HANDLE are mutually exclusive" + ); + + temp_no = 0; + for (temp_ptr = path; *temp_ptr; temp_ptr++) + temp_no += *temp_ptr; + + /* The path name template must be at least 4 characters long + * excluding the terminating null. this function fails if not */ + if (temp_ptr - path < 4) return -1; + + qse_gettime (&now); + temp_no += (now & 0xFFFFFFFFlu); + + temp_tries = 0; + temp_ptr -= 4; + + retry_temporary: + temp_tries++; + + /* Fails after 5000 tries. 5000 randomly chosen */ + if (temp_tries > 5000) return -1; + + /* Generate the next random number to use to make a + * new path name */ + temp_no = qse_rand31 (temp_no); + + /* + * You must not pass a constant string for a path name + * when QSE_FIO_TEMPORARY is set, because it changes + * the path name with a random number generated + */ + qse_fmtuintmax ( + temp_ptr, + 4, + temp_no % 0x10000, + 16 | QSE_FMTUINTMAX_NOTRUNC | QSE_FMTUINTMAX_NONULL, + 4, + QSE_T('\0'), + QSE_NULL + ); + } + #if defined(_WIN32) if (flags & QSE_FIO_HANDLE) { @@ -107,7 +163,7 @@ int qse_fio_init ( else { DWORD desired_access = 0; - DWORD share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE; + DWORD share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; DWORD creation_disposition = 0; DWORD flag_and_attr = FILE_ATTRIBUTE_NORMAL; @@ -141,6 +197,8 @@ int qse_fio_init ( share_mode &= ~FILE_SHARE_READ; if (flags & QSE_FIO_NOSHWR) share_mode &= ~FILE_SHARE_WRITE; + if (flags & QSE_FIO_NOSHDL) + share_mode &= ~FILE_SHARE_DELETE; if (!(mode & QSE_FIO_WUSR)) flag_and_attr = FILE_ATTRIBUTE_READONLY; @@ -162,7 +220,11 @@ int qse_fio_init ( creation_disposition, flag_and_attr, 0 ); } - if (handle == INVALID_HANDLE_VALUE) return -1; + if (handle == INVALID_HANDLE_VALUE) + { + if (flags & QSE_FIO_TEMPORARY) goto retry_temporary; + return -1; + } /* some special check */ if (GetFileType(handle) == FILE_TYPE_UNKNOWN) @@ -258,7 +320,11 @@ int qse_fio_init ( 0L ); - if (ret != NO_ERROR) return -1; + if (ret != NO_ERROR) + { + if (flags & QSE_FIO_TEMPORARY) goto retry_temporary; + return -1; + } } #elif defined(__DOS__) @@ -308,7 +374,11 @@ int qse_fio_init ( oflags, permission ); - if (handle <= -1) return -1; + if (handle <= -1) + { + if (flags & QSE_FIO_TEMPORARY) goto retry_temporary; + return -1; + } } #else @@ -367,7 +437,11 @@ int qse_fio_init ( handle = QSE_OPEN (path_mb, desired_access, mode); } - if (handle == -1) return -1; + if (handle == -1) + { + if (flags & QSE_FIO_TEMPORARY) goto retry_temporary; + return -1; + } /* set some file access hints */ #if defined(POSIX_FADV_RANDOM) diff --git a/qse/lib/cmn/fmt.c b/qse/lib/cmn/fmt.c index 29454888..593242f1 100644 --- a/qse/lib/cmn/fmt.c +++ b/qse/lib/cmn/fmt.c @@ -60,14 +60,16 @@ static int fmt_unsigned_to_mbs ( } else { + qse_uintmax_t v = value; + /* store the resulting numeric string into 'tmp' first */ p = tmp; do { - *p++ = xbasestr[value % base]; - value /= base; + *p++ = xbasestr[v % base]; + v /= base; } - while (value > 0); + while (v > 0); /* reslen is the length of the resulting string without padding. */ reslen = (int)(p - tmp); @@ -87,8 +89,10 @@ static int fmt_unsigned_to_mbs ( else { preczero = 0; - if (base_and_flags & QSE_FMTINTMAXTOMBS_ZEROLEAD) + if ((base_and_flags & QSE_FMTINTMAXTOMBS_ZEROLEAD) && value != 0) { + /* if value is zero, 0 is emitted from it. + * so ZEROLEAD don't need to add another 0. */ preczero++; reslen++; } @@ -319,14 +323,16 @@ static int fmt_unsigned_to_wcs ( } else { + qse_uintmax_t v = value; + /* store the resulting numeric string into 'tmp' first */ p = tmp; do { - *p++ = xbasestr[value % base]; - value /= base; + *p++ = xbasestr[v % base]; + v /= base; } - while (value > 0); + while (v > 0); /* reslen is the length of the resulting string without padding. */ reslen = (int)(p - tmp); @@ -346,8 +352,10 @@ static int fmt_unsigned_to_wcs ( else { preczero = 0; - if (base_and_flags & QSE_FMTINTMAXTOWCS_ZEROLEAD) + if ((base_and_flags & QSE_FMTINTMAXTOWCS_ZEROLEAD) && value != 0) { + /* if value is zero, 0 is emitted from it. + * so ZEROLEAD don't need to add another 0. */ preczero++; reslen++; } diff --git a/qse/lib/fs/dir.c b/qse/lib/fs/dir.c index 257df5fb..052f0d11 100644 --- a/qse/lib/fs/dir.c +++ b/qse/lib/fs/dir.c @@ -724,11 +724,11 @@ qse_dir_ent_t* qse_dir_read (qse_dir_t* dir, int flags) QSE_SECNSEC_TO_MSEC(st.st_ctimespec.tv_sec,st.st_ctimespec.tv_nsec); #else #if defined(HAVE_STRUCT_STAT_ST_BIRTHTIME) - dir->ent.time.create = st.st_birthtime * QSE_MSEC_PER_SEC; + dir->ent.time.create = st.st_birthtime * QSE_MSECS_PER_SEC; #endif - dir->ent.time.access = st.st_atime * QSE_MSEC_PER_SEC; - dir->ent.time.modify = st.st_mtime * QSE_MSEC_PER_SEC; - dir->ent.time.change = st.st_ctime * QSE_MSEC_PER_SEC; + dir->ent.time.access = st.st_atime * QSE_MSECS_PER_SEC; + dir->ent.time.modify = st.st_mtime * QSE_MSECS_PER_SEC; + dir->ent.time.change = st.st_ctime * QSE_MSECS_PER_SEC; #endif dir->ent.flags |= QSE_DIR_ENT_TIME; } diff --git a/qse/samples/cmn/Makefile.am b/qse/samples/cmn/Makefile.am index 967b7aad..914d620d 100644 --- a/qse/samples/cmn/Makefile.am +++ b/qse/samples/cmn/Makefile.am @@ -6,7 +6,7 @@ AM_CPPFLAGS = \ -I$(includedir) -bin_PROGRAMS = xma fma pma chr str sll dll lda oht htb rbt fio pio sio time main main2 rex01 env path01 tre01 fmt01 fmt02 +bin_PROGRAMS = xma fma pma chr str sll dll lda oht htb rbt fio01 fio02 pio sio time main main2 rex01 env path01 tre01 fmt01 fmt02 LDFLAGS = -L../../lib/cmn LDADD = -lqsecmn @@ -22,7 +22,8 @@ lda_SOURCES = lda.c oht_SOURCES = oht.c htb_SOURCES = htb.c rbt_SOURCES = rbt.c -fio_SOURCES = fio.c +fio01_SOURCES = fio01.c +fio02_SOURCES = fio02.c pio_SOURCES = pio.c sio_SOURCES = sio.c time_SOURCES = time.c diff --git a/qse/samples/cmn/Makefile.in b/qse/samples/cmn/Makefile.in index 485dcb4e..a8c6c042 100644 --- a/qse/samples/cmn/Makefile.in +++ b/qse/samples/cmn/Makefile.in @@ -36,10 +36,10 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = xma$(EXEEXT) fma$(EXEEXT) pma$(EXEEXT) chr$(EXEEXT) \ str$(EXEEXT) sll$(EXEEXT) dll$(EXEEXT) lda$(EXEEXT) \ - oht$(EXEEXT) htb$(EXEEXT) rbt$(EXEEXT) fio$(EXEEXT) \ - pio$(EXEEXT) sio$(EXEEXT) time$(EXEEXT) main$(EXEEXT) \ - main2$(EXEEXT) rex01$(EXEEXT) env$(EXEEXT) path01$(EXEEXT) \ - tre01$(EXEEXT) fmt01$(EXEEXT) fmt02$(EXEEXT) + oht$(EXEEXT) htb$(EXEEXT) rbt$(EXEEXT) fio01$(EXEEXT) \ + fio02$(EXEEXT) pio$(EXEEXT) sio$(EXEEXT) time$(EXEEXT) \ + main$(EXEEXT) main2$(EXEEXT) rex01$(EXEEXT) env$(EXEEXT) \ + path01$(EXEEXT) tre01$(EXEEXT) fmt01$(EXEEXT) fmt02$(EXEEXT) subdir = samples/cmn DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -68,10 +68,14 @@ am_env_OBJECTS = env.$(OBJEXT) env_OBJECTS = $(am_env_OBJECTS) env_LDADD = $(LDADD) env_DEPENDENCIES = -am_fio_OBJECTS = fio.$(OBJEXT) -fio_OBJECTS = $(am_fio_OBJECTS) -fio_LDADD = $(LDADD) -fio_DEPENDENCIES = +am_fio01_OBJECTS = fio01.$(OBJEXT) +fio01_OBJECTS = $(am_fio01_OBJECTS) +fio01_LDADD = $(LDADD) +fio01_DEPENDENCIES = +am_fio02_OBJECTS = fio02.$(OBJEXT) +fio02_OBJECTS = $(am_fio02_OBJECTS) +fio02_LDADD = $(LDADD) +fio02_DEPENDENCIES = am_fma_OBJECTS = fma.$(OBJEXT) fma_OBJECTS = $(am_fma_OBJECTS) fma_LDADD = $(LDADD) @@ -161,19 +165,20 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(chr_SOURCES) $(dll_SOURCES) $(env_SOURCES) $(fio_SOURCES) \ - $(fma_SOURCES) $(fmt01_SOURCES) $(fmt02_SOURCES) \ - $(htb_SOURCES) $(lda_SOURCES) $(main_SOURCES) $(main2_SOURCES) \ - $(oht_SOURCES) $(path01_SOURCES) $(pio_SOURCES) $(pma_SOURCES) \ - $(rbt_SOURCES) $(rex01_SOURCES) $(sio_SOURCES) $(sll_SOURCES) \ - $(str_SOURCES) $(time_SOURCES) $(tre01_SOURCES) $(xma_SOURCES) +SOURCES = $(chr_SOURCES) $(dll_SOURCES) $(env_SOURCES) \ + $(fio01_SOURCES) $(fio02_SOURCES) $(fma_SOURCES) \ + $(fmt01_SOURCES) $(fmt02_SOURCES) $(htb_SOURCES) \ + $(lda_SOURCES) $(main_SOURCES) $(main2_SOURCES) $(oht_SOURCES) \ + $(path01_SOURCES) $(pio_SOURCES) $(pma_SOURCES) $(rbt_SOURCES) \ + $(rex01_SOURCES) $(sio_SOURCES) $(sll_SOURCES) $(str_SOURCES) \ + $(time_SOURCES) $(tre01_SOURCES) $(xma_SOURCES) DIST_SOURCES = $(chr_SOURCES) $(dll_SOURCES) $(env_SOURCES) \ - $(fio_SOURCES) $(fma_SOURCES) $(fmt01_SOURCES) \ - $(fmt02_SOURCES) $(htb_SOURCES) $(lda_SOURCES) $(main_SOURCES) \ - $(main2_SOURCES) $(oht_SOURCES) $(path01_SOURCES) \ - $(pio_SOURCES) $(pma_SOURCES) $(rbt_SOURCES) $(rex01_SOURCES) \ - $(sio_SOURCES) $(sll_SOURCES) $(str_SOURCES) $(time_SOURCES) \ - $(tre01_SOURCES) $(xma_SOURCES) + $(fio01_SOURCES) $(fio02_SOURCES) $(fma_SOURCES) \ + $(fmt01_SOURCES) $(fmt02_SOURCES) $(htb_SOURCES) \ + $(lda_SOURCES) $(main_SOURCES) $(main2_SOURCES) $(oht_SOURCES) \ + $(path01_SOURCES) $(pio_SOURCES) $(pma_SOURCES) $(rbt_SOURCES) \ + $(rex01_SOURCES) $(sio_SOURCES) $(sll_SOURCES) $(str_SOURCES) \ + $(time_SOURCES) $(tre01_SOURCES) $(xma_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -336,7 +341,8 @@ lda_SOURCES = lda.c oht_SOURCES = oht.c htb_SOURCES = htb.c rbt_SOURCES = rbt.c -fio_SOURCES = fio.c +fio01_SOURCES = fio01.c +fio02_SOURCES = fio02.c pio_SOURCES = pio.c sio_SOURCES = sio.c time_SOURCES = time.c @@ -434,9 +440,12 @@ dll$(EXEEXT): $(dll_OBJECTS) $(dll_DEPENDENCIES) env$(EXEEXT): $(env_OBJECTS) $(env_DEPENDENCIES) @rm -f env$(EXEEXT) $(LINK) $(env_OBJECTS) $(env_LDADD) $(LIBS) -fio$(EXEEXT): $(fio_OBJECTS) $(fio_DEPENDENCIES) - @rm -f fio$(EXEEXT) - $(LINK) $(fio_OBJECTS) $(fio_LDADD) $(LIBS) +fio01$(EXEEXT): $(fio01_OBJECTS) $(fio01_DEPENDENCIES) + @rm -f fio01$(EXEEXT) + $(LINK) $(fio01_OBJECTS) $(fio01_LDADD) $(LIBS) +fio02$(EXEEXT): $(fio02_OBJECTS) $(fio02_DEPENDENCIES) + @rm -f fio02$(EXEEXT) + $(LINK) $(fio02_OBJECTS) $(fio02_LDADD) $(LIBS) fma$(EXEEXT): $(fma_OBJECTS) $(fma_DEPENDENCIES) @rm -f fma$(EXEEXT) $(LINK) $(fma_OBJECTS) $(fma_LDADD) $(LIBS) @@ -504,7 +513,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fio01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fio02.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fma.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt01.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt02.Po@am__quote@ diff --git a/qse/samples/cmn/fio.c b/qse/samples/cmn/fio01.c similarity index 100% rename from qse/samples/cmn/fio.c rename to qse/samples/cmn/fio01.c diff --git a/qse/samples/cmn/fio02.c b/qse/samples/cmn/fio02.c new file mode 100644 index 00000000..617225c3 --- /dev/null +++ b/qse/samples/cmn/fio02.c @@ -0,0 +1,93 @@ +#include +#include + +#include +#include + +#define R(f) \ + do { \ + qse_printf (QSE_T("== %s ==\n"), QSE_T(#f)); \ + if (f() == -1) return -1; \ + } while (0) + +static int test1 (void) +{ + qse_fio_t* fio; + qse_ssize_t n; + char x[] = "fio test"; + char x2[] = "fio test2"; + qse_fio_off_t off; + char buf[1000]; + int i; + qse_char_t file[] = QSE_T("fio02-XXXX"); + + fio = qse_fio_open ( + QSE_NULL, + 0, + file, + QSE_FIO_CREATE | QSE_FIO_EXCLUSIVE | QSE_FIO_TEMPORARY | QSE_FIO_READ | QSE_FIO_WRITE, + QSE_FIO_RUSR|QSE_FIO_WUSR|QSE_FIO_RGRP|QSE_FIO_ROTH + ); + if (fio == QSE_NULL) + { + qse_printf (QSE_T("cannot open file - last file tried [%s]\n"), file); + return -1; + } + + qse_printf (QSE_T("file opened: [%s]\n"), file); + + for (i = 0; i < 2; i++) + { + n = qse_fio_write (fio, x, qse_mbslen(x)); + qse_printf (QSE_T("written %d bytes\n"), (int)n); + + off = qse_fio_seek (fio, 0, QSE_FIO_CURRENT); + if (off == (qse_fio_off_t)-1) + { + qse_printf (QSE_T("failed to get file offset\n")); + } + else + { + qse_printf (QSE_T("file offset at %ld\n"), (long)off); + } + + off = qse_fio_seek (fio, 0, QSE_FIO_BEGIN); + if (off == (qse_fio_off_t)-1) + { + qse_printf (QSE_T("failed to set file offset\n")); + } + else + { + qse_printf (QSE_T("moved file offset to %ld\n"), (long)off); + } + } + + + n = qse_fio_read (fio, buf, sizeof(buf)); + qse_printf (QSE_T("read %d bytes \n"), (int)n); + if (n > 0) + { + #ifdef QSE_CHAR_IS_MCHAR + qse_printf (QSE_T("buf => [%.*s]\n"), (int)n, buf); + #else + qse_printf (QSE_T("buf => [%.*S]\n"), (int)n, buf); + #endif + } + + qse_fio_close (fio); + + return 0; +} + +int main () +{ + setlocale (LC_ALL, ""); + + qse_printf (QSE_T("--------------------------------------------------------------------------------\n")); + qse_printf (QSE_T("Set the environment LANG to a Unicode locale such as UTF-8 if you see the illegal XXXXX errors. If you see such errors in Unicode locales, this program might be buggy. It is normal to see such messages in non-Unicode locales as it uses Unicode data\n")); + qse_printf (QSE_T("--------------------------------------------------------------------------------\n")); + + R (test1); + + return 0; +} diff --git a/qse/watcom/debug/os2/lib/cmn/qsecmn.tgt b/qse/watcom/debug/os2/lib/cmn/qsecmn.tgt index 421b07a2..2304e22d 100755 --- a/qse/watcom/debug/os2/lib/cmn/qsecmn.tgt +++ b/qse/watcom/debug/os2/lib/cmn/qsecmn.tgt @@ -42,7 +42,7 @@ WVList 0 10 WPickList -70 +71 11 MItem 3 @@ -91,8 +91,8 @@ WVList 0 22 MItem -35 -../../../../../lib/cmn/alg-search.c +33 +../../../../../lib/cmn/alg-rand.c 23 WString 4 @@ -109,8 +109,8 @@ WVList 0 26 MItem -33 -../../../../../lib/cmn/alg-sort.c +35 +../../../../../lib/cmn/alg-search.c 27 WString 4 @@ -127,8 +127,8 @@ WVList 0 30 MItem -31 -../../../../../lib/cmn/assert.c +33 +../../../../../lib/cmn/alg-sort.c 31 WString 4 @@ -145,8 +145,8 @@ WVList 0 34 MItem -32 -../../../../../lib/cmn/chr-cnv.c +31 +../../../../../lib/cmn/assert.c 35 WString 4 @@ -163,8 +163,8 @@ WVList 0 38 MItem -28 -../../../../../lib/cmn/chr.c +32 +../../../../../lib/cmn/chr-cnv.c 39 WString 4 @@ -182,7 +182,7 @@ WVList 42 MItem 28 -../../../../../lib/cmn/dll.c +../../../../../lib/cmn/chr.c 43 WString 4 @@ -200,7 +200,7 @@ WVList 46 MItem 28 -../../../../../lib/cmn/env.c +../../../../../lib/cmn/dll.c 47 WString 4 @@ -218,7 +218,7 @@ WVList 50 MItem 28 -../../../../../lib/cmn/fio.c +../../../../../lib/cmn/env.c 51 WString 4 @@ -236,7 +236,7 @@ WVList 54 MItem 28 -../../../../../lib/cmn/fma.c +../../../../../lib/cmn/fio.c 55 WString 4 @@ -254,7 +254,7 @@ WVList 58 MItem 28 -../../../../../lib/cmn/fmt.c +../../../../../lib/cmn/fma.c 59 WString 4 @@ -272,7 +272,7 @@ WVList 62 MItem 28 -../../../../../lib/cmn/gdl.c +../../../../../lib/cmn/fmt.c 63 WString 4 @@ -290,7 +290,7 @@ WVList 66 MItem 28 -../../../../../lib/cmn/htb.c +../../../../../lib/cmn/gdl.c 67 WString 4 @@ -308,7 +308,7 @@ WVList 70 MItem 28 -../../../../../lib/cmn/lda.c +../../../../../lib/cmn/htb.c 71 WString 4 @@ -325,8 +325,8 @@ WVList 0 74 MItem -29 -../../../../../lib/cmn/main.c +28 +../../../../../lib/cmn/lda.c 75 WString 4 @@ -343,8 +343,8 @@ WVList 0 78 MItem -28 -../../../../../lib/cmn/mem.c +29 +../../../../../lib/cmn/main.c 79 WString 4 @@ -362,7 +362,7 @@ WVList 82 MItem 28 -../../../../../lib/cmn/oht.c +../../../../../lib/cmn/mem.c 83 WString 4 @@ -380,7 +380,7 @@ WVList 86 MItem 28 -../../../../../lib/cmn/opt.c +../../../../../lib/cmn/oht.c 87 WString 4 @@ -397,8 +397,8 @@ WVList 0 90 MItem -38 -../../../../../lib/cmn/path-basename.c +28 +../../../../../lib/cmn/opt.c 91 WString 4 @@ -415,8 +415,8 @@ WVList 0 94 MItem -35 -../../../../../lib/cmn/path-canon.c +38 +../../../../../lib/cmn/path-basename.c 95 WString 4 @@ -433,8 +433,8 @@ WVList 0 98 MItem -28 -../../../../../lib/cmn/pio.c +35 +../../../../../lib/cmn/path-canon.c 99 WString 4 @@ -452,7 +452,7 @@ WVList 102 MItem 28 -../../../../../lib/cmn/pma.c +../../../../../lib/cmn/pio.c 103 WString 4 @@ -470,7 +470,7 @@ WVList 106 MItem 28 -../../../../../lib/cmn/rbt.c +../../../../../lib/cmn/pma.c 107 WString 4 @@ -488,7 +488,7 @@ WVList 110 MItem 28 -../../../../../lib/cmn/rex.c +../../../../../lib/cmn/rbt.c 111 WString 4 @@ -506,7 +506,7 @@ WVList 114 MItem 28 -../../../../../lib/cmn/sio.c +../../../../../lib/cmn/rex.c 115 WString 4 @@ -524,7 +524,7 @@ WVList 118 MItem 28 -../../../../../lib/cmn/sll.c +../../../../../lib/cmn/sio.c 119 WString 4 @@ -541,8 +541,8 @@ WVList 0 122 MItem -30 -../../../../../lib/cmn/stdio.c +28 +../../../../../lib/cmn/sll.c 123 WString 4 @@ -559,8 +559,8 @@ WVList 0 126 MItem -32 -../../../../../lib/cmn/str-beg.c +30 +../../../../../lib/cmn/stdio.c 127 WString 4 @@ -578,7 +578,7 @@ WVList 130 MItem 32 -../../../../../lib/cmn/str-cat.c +../../../../../lib/cmn/str-beg.c 131 WString 4 @@ -596,7 +596,7 @@ WVList 134 MItem 32 -../../../../../lib/cmn/str-chr.c +../../../../../lib/cmn/str-cat.c 135 WString 4 @@ -614,7 +614,7 @@ WVList 138 MItem 32 -../../../../../lib/cmn/str-cmp.c +../../../../../lib/cmn/str-chr.c 139 WString 4 @@ -632,7 +632,7 @@ WVList 142 MItem 32 -../../../../../lib/cmn/str-cnv.c +../../../../../lib/cmn/str-cmp.c 143 WString 4 @@ -650,7 +650,7 @@ WVList 146 MItem 32 -../../../../../lib/cmn/str-cpy.c +../../../../../lib/cmn/str-cnv.c 147 WString 4 @@ -668,7 +668,7 @@ WVList 150 MItem 32 -../../../../../lib/cmn/str-del.c +../../../../../lib/cmn/str-cpy.c 151 WString 4 @@ -686,7 +686,7 @@ WVList 154 MItem 32 -../../../../../lib/cmn/str-dup.c +../../../../../lib/cmn/str-del.c 155 WString 4 @@ -703,8 +703,8 @@ WVList 0 158 MItem -33 -../../../../../lib/cmn/str-dynm.c +32 +../../../../../lib/cmn/str-dup.c 159 WString 4 @@ -722,7 +722,7 @@ WVList 162 MItem 33 -../../../../../lib/cmn/str-dynw.c +../../../../../lib/cmn/str-dynm.c 163 WString 4 @@ -739,8 +739,8 @@ WVList 0 166 MItem -32 -../../../../../lib/cmn/str-end.c +33 +../../../../../lib/cmn/str-dynw.c 167 WString 4 @@ -757,8 +757,8 @@ WVList 0 170 MItem -33 -../../../../../lib/cmn/str-excl.c +32 +../../../../../lib/cmn/str-end.c 171 WString 4 @@ -776,7 +776,7 @@ WVList 174 MItem 33 -../../../../../lib/cmn/str-fcpy.c +../../../../../lib/cmn/str-excl.c 175 WString 4 @@ -794,7 +794,7 @@ WVList 178 MItem 33 -../../../../../lib/cmn/str-incl.c +../../../../../lib/cmn/str-fcpy.c 179 WString 4 @@ -811,8 +811,8 @@ WVList 0 182 MItem -32 -../../../../../lib/cmn/str-len.c +33 +../../../../../lib/cmn/str-incl.c 183 WString 4 @@ -830,7 +830,7 @@ WVList 186 MItem 32 -../../../../../lib/cmn/str-pac.c +../../../../../lib/cmn/str-len.c 187 WString 4 @@ -847,8 +847,8 @@ WVList 0 190 MItem -33 -../../../../../lib/cmn/str-pbrk.c +32 +../../../../../lib/cmn/str-pac.c 191 WString 4 @@ -865,8 +865,8 @@ WVList 0 194 MItem -32 -../../../../../lib/cmn/str-put.c +33 +../../../../../lib/cmn/str-pbrk.c 195 WString 4 @@ -884,7 +884,7 @@ WVList 198 MItem 32 -../../../../../lib/cmn/str-rev.c +../../../../../lib/cmn/str-put.c 199 WString 4 @@ -902,7 +902,7 @@ WVList 202 MItem 32 -../../../../../lib/cmn/str-rot.c +../../../../../lib/cmn/str-rev.c 203 WString 4 @@ -920,7 +920,7 @@ WVList 206 MItem 32 -../../../../../lib/cmn/str-set.c +../../../../../lib/cmn/str-rot.c 207 WString 4 @@ -938,7 +938,7 @@ WVList 210 MItem 32 -../../../../../lib/cmn/str-spl.c +../../../../../lib/cmn/str-set.c 211 WString 4 @@ -956,7 +956,7 @@ WVList 214 MItem 32 -../../../../../lib/cmn/str-spn.c +../../../../../lib/cmn/str-spl.c 215 WString 4 @@ -974,7 +974,7 @@ WVList 218 MItem 32 -../../../../../lib/cmn/str-str.c +../../../../../lib/cmn/str-spn.c 219 WString 4 @@ -991,8 +991,8 @@ WVList 0 222 MItem -34 -../../../../../lib/cmn/str-subst.c +32 +../../../../../lib/cmn/str-str.c 223 WString 4 @@ -1009,8 +1009,8 @@ WVList 0 226 MItem -32 -../../../../../lib/cmn/str-tok.c +34 +../../../../../lib/cmn/str-subst.c 227 WString 4 @@ -1028,7 +1028,7 @@ WVList 230 MItem 32 -../../../../../lib/cmn/str-trm.c +../../../../../lib/cmn/str-tok.c 231 WString 4 @@ -1045,8 +1045,8 @@ WVList 0 234 MItem -33 -../../../../../lib/cmn/str-word.c +32 +../../../../../lib/cmn/str-trm.c 235 WString 4 @@ -1063,8 +1063,8 @@ WVList 0 238 MItem -29 -../../../../../lib/cmn/time.c +33 +../../../../../lib/cmn/str-word.c 239 WString 4 @@ -1081,8 +1081,8 @@ WVList 0 242 MItem -32 -../../../../../lib/cmn/tio-get.c +29 +../../../../../lib/cmn/time.c 243 WString 4 @@ -1100,7 +1100,7 @@ WVList 246 MItem 32 -../../../../../lib/cmn/tio-put.c +../../../../../lib/cmn/tio-get.c 247 WString 4 @@ -1117,8 +1117,8 @@ WVList 0 250 MItem -28 -../../../../../lib/cmn/tio.c +32 +../../../../../lib/cmn/tio-put.c 251 WString 4 @@ -1135,8 +1135,8 @@ WVList 0 254 MItem -32 -../../../../../lib/cmn/tre-ast.c +28 +../../../../../lib/cmn/tio.c 255 WString 4 @@ -1153,8 +1153,8 @@ WVList 0 258 MItem -36 -../../../../../lib/cmn/tre-compile.c +32 +../../../../../lib/cmn/tre-ast.c 259 WString 4 @@ -1171,8 +1171,8 @@ WVList 0 262 MItem -44 -../../../../../lib/cmn/tre-match-backtrack.c +36 +../../../../../lib/cmn/tre-compile.c 263 WString 4 @@ -1189,8 +1189,8 @@ WVList 0 266 MItem -43 -../../../../../lib/cmn/tre-match-parallel.c +44 +../../../../../lib/cmn/tre-match-backtrack.c 267 WString 4 @@ -1207,8 +1207,8 @@ WVList 0 270 MItem -34 -../../../../../lib/cmn/tre-parse.c +43 +../../../../../lib/cmn/tre-match-parallel.c 271 WString 4 @@ -1226,7 +1226,7 @@ WVList 274 MItem 34 -../../../../../lib/cmn/tre-stack.c +../../../../../lib/cmn/tre-parse.c 275 WString 4 @@ -1243,8 +1243,8 @@ WVList 0 278 MItem -28 -../../../../../lib/cmn/tre.c +34 +../../../../../lib/cmn/tre-stack.c 279 WString 4 @@ -1262,7 +1262,7 @@ WVList 282 MItem 28 -../../../../../lib/cmn/xma.c +../../../../../lib/cmn/tre.c 283 WString 4 @@ -1279,26 +1279,26 @@ WVList 0 286 MItem -3 -*.h +28 +../../../../../lib/cmn/xma.c 287 WString -3 -NIL +4 +COBJ 288 WVList 0 289 WVList 0 --1 +11 1 1 0 290 MItem -28 -../../../../../lib/cmn/mem.h +3 +*.h 291 WString 3 @@ -1309,14 +1309,14 @@ WVList 293 WVList 0 -286 +-1 1 1 0 294 MItem -32 -../../../../../lib/cmn/syscall.h +28 +../../../../../lib/cmn/mem.h 295 WString 3 @@ -1327,7 +1327,25 @@ WVList 297 WVList 0 -286 +290 +1 +1 +0 +298 +MItem +32 +../../../../../lib/cmn/syscall.h +299 +WString +3 +NIL +300 +WVList +0 +301 +WVList +0 +290 1 1 0 diff --git a/qse/watcom/qse.wpj b/qse/watcom/qse.wpj index 3a58372e..6dc17b68 100755 --- a/qse/watcom/qse.wpj +++ b/qse/watcom/qse.wpj @@ -106,8 +106,8 @@ WRect WFileName 30 release/os2/lib/cmn/qsecmn.tgt -16 -13 +0 +0 27 VComponent 28 @@ -154,8 +154,8 @@ WRect WFileName 28 debug/os2/lib/cmn/qsecmn.tgt -16 -16 +0 +0 36 VComponent 37 @@ -380,4 +380,4 @@ WFileName debug/win32/lib/sed/qsesed.tgt 0 0 -33 +24 diff --git a/qse/watcom/release/os2/lib/cmn/qsecmn.tgt b/qse/watcom/release/os2/lib/cmn/qsecmn.tgt index ea10d575..198660b5 100755 --- a/qse/watcom/release/os2/lib/cmn/qsecmn.tgt +++ b/qse/watcom/release/os2/lib/cmn/qsecmn.tgt @@ -42,7 +42,7 @@ WVList 0 10 WPickList -69 +70 11 MItem 3 @@ -143,8 +143,8 @@ WVList 0 35 MItem -35 -../../../../../lib/cmn/alg-search.c +33 +../../../../../lib/cmn/alg-rand.c 36 WString 4 @@ -161,8 +161,8 @@ WVList 0 39 MItem -33 -../../../../../lib/cmn/alg-sort.c +35 +../../../../../lib/cmn/alg-search.c 40 WString 4 @@ -179,8 +179,8 @@ WVList 0 43 MItem -31 -../../../../../lib/cmn/assert.c +33 +../../../../../lib/cmn/alg-sort.c 44 WString 4 @@ -197,8 +197,8 @@ WVList 0 47 MItem -32 -../../../../../lib/cmn/chr-cnv.c +31 +../../../../../lib/cmn/assert.c 48 WString 4 @@ -215,8 +215,8 @@ WVList 0 51 MItem -28 -../../../../../lib/cmn/chr.c +32 +../../../../../lib/cmn/chr-cnv.c 52 WString 4 @@ -234,7 +234,7 @@ WVList 55 MItem 28 -../../../../../lib/cmn/dll.c +../../../../../lib/cmn/chr.c 56 WString 4 @@ -252,7 +252,7 @@ WVList 59 MItem 28 -../../../../../lib/cmn/fio.c +../../../../../lib/cmn/dll.c 60 WString 4 @@ -270,7 +270,7 @@ WVList 63 MItem 28 -../../../../../lib/cmn/fma.c +../../../../../lib/cmn/fio.c 64 WString 4 @@ -288,7 +288,7 @@ WVList 67 MItem 28 -../../../../../lib/cmn/fmt.c +../../../../../lib/cmn/fma.c 68 WString 4 @@ -306,7 +306,7 @@ WVList 71 MItem 28 -../../../../../lib/cmn/gdl.c +../../../../../lib/cmn/fmt.c 72 WString 4 @@ -324,7 +324,7 @@ WVList 75 MItem 28 -../../../../../lib/cmn/htb.c +../../../../../lib/cmn/gdl.c 76 WString 4 @@ -342,7 +342,7 @@ WVList 79 MItem 28 -../../../../../lib/cmn/lda.c +../../../../../lib/cmn/htb.c 80 WString 4 @@ -359,8 +359,8 @@ WVList 0 83 MItem -29 -../../../../../lib/cmn/main.c +28 +../../../../../lib/cmn/lda.c 84 WString 4 @@ -377,8 +377,8 @@ WVList 0 87 MItem -28 -../../../../../lib/cmn/mem.c +29 +../../../../../lib/cmn/main.c 88 WString 4 @@ -396,7 +396,7 @@ WVList 91 MItem 28 -../../../../../lib/cmn/oht.c +../../../../../lib/cmn/mem.c 92 WString 4 @@ -414,7 +414,7 @@ WVList 95 MItem 28 -../../../../../lib/cmn/opt.c +../../../../../lib/cmn/oht.c 96 WString 4 @@ -431,8 +431,8 @@ WVList 0 99 MItem -38 -../../../../../lib/cmn/path-basename.c +28 +../../../../../lib/cmn/opt.c 100 WString 4 @@ -449,8 +449,8 @@ WVList 0 103 MItem -35 -../../../../../lib/cmn/path-canon.c +38 +../../../../../lib/cmn/path-basename.c 104 WString 4 @@ -467,8 +467,8 @@ WVList 0 107 MItem -28 -../../../../../lib/cmn/pio.c +35 +../../../../../lib/cmn/path-canon.c 108 WString 4 @@ -486,7 +486,7 @@ WVList 111 MItem 28 -../../../../../lib/cmn/pma.c +../../../../../lib/cmn/pio.c 112 WString 4 @@ -504,7 +504,7 @@ WVList 115 MItem 28 -../../../../../lib/cmn/rbt.c +../../../../../lib/cmn/pma.c 116 WString 4 @@ -522,7 +522,7 @@ WVList 119 MItem 28 -../../../../../lib/cmn/rex.c +../../../../../lib/cmn/rbt.c 120 WString 4 @@ -540,7 +540,7 @@ WVList 123 MItem 28 -../../../../../lib/cmn/sio.c +../../../../../lib/cmn/rex.c 124 WString 4 @@ -558,7 +558,7 @@ WVList 127 MItem 28 -../../../../../lib/cmn/sll.c +../../../../../lib/cmn/sio.c 128 WString 4 @@ -575,8 +575,8 @@ WVList 0 131 MItem -30 -../../../../../lib/cmn/stdio.c +28 +../../../../../lib/cmn/sll.c 132 WString 4 @@ -593,8 +593,8 @@ WVList 0 135 MItem -32 -../../../../../lib/cmn/str-beg.c +30 +../../../../../lib/cmn/stdio.c 136 WString 4 @@ -612,7 +612,7 @@ WVList 139 MItem 32 -../../../../../lib/cmn/str-cat.c +../../../../../lib/cmn/str-beg.c 140 WString 4 @@ -630,7 +630,7 @@ WVList 143 MItem 32 -../../../../../lib/cmn/str-chr.c +../../../../../lib/cmn/str-cat.c 144 WString 4 @@ -648,7 +648,7 @@ WVList 147 MItem 32 -../../../../../lib/cmn/str-cmp.c +../../../../../lib/cmn/str-chr.c 148 WString 4 @@ -666,7 +666,7 @@ WVList 151 MItem 32 -../../../../../lib/cmn/str-cnv.c +../../../../../lib/cmn/str-cmp.c 152 WString 4 @@ -684,7 +684,7 @@ WVList 155 MItem 32 -../../../../../lib/cmn/str-cpy.c +../../../../../lib/cmn/str-cnv.c 156 WString 4 @@ -702,7 +702,7 @@ WVList 159 MItem 32 -../../../../../lib/cmn/str-del.c +../../../../../lib/cmn/str-cpy.c 160 WString 4 @@ -720,7 +720,7 @@ WVList 163 MItem 32 -../../../../../lib/cmn/str-dup.c +../../../../../lib/cmn/str-del.c 164 WString 4 @@ -737,8 +737,8 @@ WVList 0 167 MItem -33 -../../../../../lib/cmn/str-dynm.c +32 +../../../../../lib/cmn/str-dup.c 168 WString 4 @@ -756,7 +756,7 @@ WVList 171 MItem 33 -../../../../../lib/cmn/str-dynw.c +../../../../../lib/cmn/str-dynm.c 172 WString 4 @@ -773,8 +773,8 @@ WVList 0 175 MItem -32 -../../../../../lib/cmn/str-end.c +33 +../../../../../lib/cmn/str-dynw.c 176 WString 4 @@ -791,8 +791,8 @@ WVList 0 179 MItem -33 -../../../../../lib/cmn/str-excl.c +32 +../../../../../lib/cmn/str-end.c 180 WString 4 @@ -810,7 +810,7 @@ WVList 183 MItem 33 -../../../../../lib/cmn/str-fcpy.c +../../../../../lib/cmn/str-excl.c 184 WString 4 @@ -828,7 +828,7 @@ WVList 187 MItem 33 -../../../../../lib/cmn/str-incl.c +../../../../../lib/cmn/str-fcpy.c 188 WString 4 @@ -845,8 +845,8 @@ WVList 0 191 MItem -32 -../../../../../lib/cmn/str-len.c +33 +../../../../../lib/cmn/str-incl.c 192 WString 4 @@ -864,7 +864,7 @@ WVList 195 MItem 32 -../../../../../lib/cmn/str-pac.c +../../../../../lib/cmn/str-len.c 196 WString 4 @@ -881,8 +881,8 @@ WVList 0 199 MItem -33 -../../../../../lib/cmn/str-pbrk.c +32 +../../../../../lib/cmn/str-pac.c 200 WString 4 @@ -899,8 +899,8 @@ WVList 0 203 MItem -32 -../../../../../lib/cmn/str-put.c +33 +../../../../../lib/cmn/str-pbrk.c 204 WString 4 @@ -918,7 +918,7 @@ WVList 207 MItem 32 -../../../../../lib/cmn/str-rev.c +../../../../../lib/cmn/str-put.c 208 WString 4 @@ -936,7 +936,7 @@ WVList 211 MItem 32 -../../../../../lib/cmn/str-rot.c +../../../../../lib/cmn/str-rev.c 212 WString 4 @@ -954,7 +954,7 @@ WVList 215 MItem 32 -../../../../../lib/cmn/str-set.c +../../../../../lib/cmn/str-rot.c 216 WString 4 @@ -972,7 +972,7 @@ WVList 219 MItem 32 -../../../../../lib/cmn/str-spl.c +../../../../../lib/cmn/str-set.c 220 WString 4 @@ -990,7 +990,7 @@ WVList 223 MItem 32 -../../../../../lib/cmn/str-spn.c +../../../../../lib/cmn/str-spl.c 224 WString 4 @@ -1008,7 +1008,7 @@ WVList 227 MItem 32 -../../../../../lib/cmn/str-str.c +../../../../../lib/cmn/str-spn.c 228 WString 4 @@ -1025,8 +1025,8 @@ WVList 0 231 MItem -34 -../../../../../lib/cmn/str-subst.c +32 +../../../../../lib/cmn/str-str.c 232 WString 4 @@ -1043,8 +1043,8 @@ WVList 0 235 MItem -32 -../../../../../lib/cmn/str-tok.c +34 +../../../../../lib/cmn/str-subst.c 236 WString 4 @@ -1062,7 +1062,7 @@ WVList 239 MItem 32 -../../../../../lib/cmn/str-trm.c +../../../../../lib/cmn/str-tok.c 240 WString 4 @@ -1079,8 +1079,8 @@ WVList 0 243 MItem -33 -../../../../../lib/cmn/str-word.c +32 +../../../../../lib/cmn/str-trm.c 244 WString 4 @@ -1097,8 +1097,8 @@ WVList 0 247 MItem -29 -../../../../../lib/cmn/time.c +33 +../../../../../lib/cmn/str-word.c 248 WString 4 @@ -1115,8 +1115,8 @@ WVList 0 251 MItem -32 -../../../../../lib/cmn/tio-get.c +29 +../../../../../lib/cmn/time.c 252 WString 4 @@ -1134,7 +1134,7 @@ WVList 255 MItem 32 -../../../../../lib/cmn/tio-put.c +../../../../../lib/cmn/tio-get.c 256 WString 4 @@ -1151,8 +1151,8 @@ WVList 0 259 MItem -28 -../../../../../lib/cmn/tio.c +32 +../../../../../lib/cmn/tio-put.c 260 WString 4 @@ -1169,8 +1169,8 @@ WVList 0 263 MItem -32 -../../../../../lib/cmn/tre-ast.c +28 +../../../../../lib/cmn/tio.c 264 WString 4 @@ -1187,8 +1187,8 @@ WVList 0 267 MItem -36 -../../../../../lib/cmn/tre-compile.c +32 +../../../../../lib/cmn/tre-ast.c 268 WString 4 @@ -1205,8 +1205,8 @@ WVList 0 271 MItem -44 -../../../../../lib/cmn/tre-match-backtrack.c +36 +../../../../../lib/cmn/tre-compile.c 272 WString 4 @@ -1223,8 +1223,8 @@ WVList 0 275 MItem -43 -../../../../../lib/cmn/tre-match-parallel.c +44 +../../../../../lib/cmn/tre-match-backtrack.c 276 WString 4 @@ -1241,8 +1241,8 @@ WVList 0 279 MItem -34 -../../../../../lib/cmn/tre-parse.c +43 +../../../../../lib/cmn/tre-match-parallel.c 280 WString 4 @@ -1260,7 +1260,7 @@ WVList 283 MItem 34 -../../../../../lib/cmn/tre-stack.c +../../../../../lib/cmn/tre-parse.c 284 WString 4 @@ -1277,8 +1277,8 @@ WVList 0 287 MItem -28 -../../../../../lib/cmn/tre.c +34 +../../../../../lib/cmn/tre-stack.c 288 WString 4 @@ -1296,7 +1296,7 @@ WVList 291 MItem 28 -../../../../../lib/cmn/xma.c +../../../../../lib/cmn/tre.c 292 WString 4 @@ -1313,26 +1313,26 @@ WVList 0 295 MItem -3 -*.h +28 +../../../../../lib/cmn/xma.c 296 WString -3 -NIL +4 +COBJ 297 WVList 0 298 WVList 0 --1 +11 1 1 0 299 MItem -28 -../../../../../lib/cmn/mem.h +3 +*.h 300 WString 3 @@ -1343,14 +1343,14 @@ WVList 302 WVList 0 -295 +-1 1 1 0 303 MItem -32 -../../../../../lib/cmn/syscall.h +28 +../../../../../lib/cmn/mem.h 304 WString 3 @@ -1361,7 +1361,25 @@ WVList 306 WVList 0 -295 +299 +1 +1 +0 +307 +MItem +32 +../../../../../lib/cmn/syscall.h +308 +WString +3 +NIL +309 +WVList +0 +310 +WVList +0 +299 1 1 0