From 7dd9e67cd8b05ef737efd7bdad3f7a42eff4b7d5 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 29 Nov 2012 14:03:59 +0000 Subject: [PATCH] added qse_awk_rtx_isnilval(). enhanced the qse_awk_sio_t core functions so that the implementaion can set the stream name added export specifiers to some functions --- qse/cmd/awk/awk.c | 4 +- qse/include/qse/awk/Awk.hpp | 24 +- qse/include/qse/awk/awk.h | 58 ++-- qse/include/qse/cmn/alg.h | 17 +- qse/include/qse/cmn/chr.h | 16 +- qse/include/qse/cmn/cp949.h | 8 +- qse/include/qse/cmn/cp950.h | 8 +- qse/include/qse/cmn/dir.h | 12 +- qse/include/qse/cmn/env.h | 38 +-- qse/include/qse/cmn/fio.h | 45 +-- qse/include/qse/cmn/mem.h | 6 - qse/include/qse/cmn/xma.h | 30 +- qse/include/qse/macros.h | 4 + qse/lib/awk/StdAwk.cpp | 16 +- qse/lib/awk/awk.c | 2 + qse/lib/awk/parse.c | 4 +- qse/lib/awk/std.c | 38 ++- qse/lib/awk/val.c | 5 + qse/lib/awk/val.h | 16 ++ qse/lib/cmn/env.c | 12 +- qse/lib/cmn/fio.c | 12 +- qse/lib/cmn/xma.c | 12 +- qse/regress/awk/regress.out | 32 +-- qse/regress/awk/regress.out.xma | 32 +-- qse/samples/awk/awk07.cpp | 11 +- qse/samples/awk/awk08.cpp | 15 +- qse/samples/awk/awk10.c | 2 +- qse/watcom/debug/dos32/lib/awk/qseawk.tgt | 240 +++++++++------- qse/watcom/debug/dos32/mod/awk/awk-dir.tgt | 84 +++--- qse/watcom/debug/dos32/mod/awk/awk-str.tgt | 72 ++--- qse/watcom/debug/dos32/mod/awk/awk-sys.tgt | 90 +++--- qse/watcom/debug/os2/lib/awk/qseawk.tgt | 314 ++++++++++++--------- qse/watcom/debug/os2/mod/awk/awk-dir.tgt | 84 +++--- qse/watcom/debug/os2/mod/awk/awk-str.tgt | 72 ++--- qse/watcom/debug/os2/mod/awk/awk-sys.tgt | 84 +++--- qse/watcom/qse.wpj | 162 +++++------ 36 files changed, 889 insertions(+), 792 deletions(-) diff --git a/qse/cmd/awk/awk.c b/qse/cmd/awk/awk.c index 9a2f8a4c..a4817f00 100644 --- a/qse/cmd/awk/awk.c +++ b/qse/cmd/awk/awk.c @@ -322,7 +322,7 @@ static void dprint_return (qse_awk_rtx_t* rtx, qse_awk_val_t* ret) qse_size_t len; qse_char_t* str; - if (ret == qse_awk_val_nil) + if (qse_awk_rtx_isnilval (rtx, ret)) { dprint (QSE_T("[RETURN] - ***nil***\n")); } @@ -807,6 +807,7 @@ static int comparg (int argc, qse_char_t* argv[], struct arg_t* arg) isfl++; } +#if 0 else if (isfl >= 2) { /* if more than one -f has been specified, attempt to convert @@ -842,6 +843,7 @@ static int comparg (int argc, qse_char_t* argv[], struct arg_t* arg) qse_str_fini (&script); } } +#endif for (i = 0; i < isfl ; i++) isf[isfl].cmgr = arg->script_cmgr; diff --git a/qse/include/qse/awk/Awk.hpp b/qse/include/qse/awk/Awk.hpp index 48697320..9837b64b 100644 --- a/qse/include/qse/awk/Awk.hpp +++ b/qse/include/qse/awk/Awk.hpp @@ -205,32 +205,44 @@ public: public: Mode getMode() const { - return mode; + return this->mode; + } + + int getFlags () const + { + return arg->flags; } const char_t* getName() const { - return arg->name; + return this->arg->name; + } + + // since it doesn't copy the contents, + // it should point to something that outlives this object. + void setName (const char_t* name) + { + this->arg->name = name; } void* getHandle () const { - return arg->handle; + return this->arg->handle; } void setHandle (void* handle) { - arg->handle = handle; + this->arg->handle = handle; } operator Awk* () const { - return awk; + return this->awk; } operator awk_t* () const { - return awk->awk; + return this->awk->awk; } protected: diff --git a/qse/include/qse/awk/awk.h b/qse/include/qse/awk/awk.h index 6d543cf6..16b1ea96 100644 --- a/qse/include/qse/awk/awk.h +++ b/qse/include/qse/awk/awk.h @@ -499,11 +499,39 @@ struct qse_awk_sio_lxc_t }; typedef struct qse_awk_sio_lxc_t qse_awk_sio_lxc_t; +enum qse_awk_sio_arg_flag_t +{ + QSE_AWK_SIO_INCLUDED = (1 << 0) +}; + typedef struct qse_awk_sio_arg_t qse_awk_sio_arg_t; struct qse_awk_sio_arg_t { - const qse_char_t* name; /**< [IN] name of I/O object */ - void* handle; /**< [OUT] I/O handle set by a handler */ + /** + * [IN] bitwise-ORed of #qse_awk_sio_arg_flag_t. + * The field is set with #QSE_AWK_SIO_INCLUDED if an included file + * is handled. + */ + int flags; + + /** + * [IN/OUT] name of I/O object. + * if #QSE_AWK_SIO_INCLUDED is not set, the name is set to #QSE_NULL. + * the source stream handler(#qse_awk_sio_impl_t) can change this field + * to give useful information back to the parser. + * + * if #QSE_AWK_SIO_INCLUDED is set in the flags field, + * the name field is set to the name of the included file. + */ + const qse_char_t* name; + + /** + * [OUT] I/O handle set by a handler. + * The source stream handler can set this field when it opens a stream. + * All subsequent operations on the stream see this field as set + * during opening. + */ + void* handle; /*-- from here down, internal use only --*/ struct @@ -1378,21 +1406,6 @@ typedef struct qse_awk_nrflt_t qse_awk_nrflt_t; extern "C" { #endif -/** represents a nil value */ -QSE_EXPORT extern qse_awk_val_t* qse_awk_val_nil; - -/** represents an empty string */ -QSE_EXPORT extern qse_awk_val_t* qse_awk_val_zls; - -/** represents a numeric value -1 */ -QSE_EXPORT extern qse_awk_val_t* qse_awk_val_negone; - -/** represents a numeric value 0 */ -QSE_EXPORT extern qse_awk_val_t* qse_awk_val_zero; - -/** represents a numeric value 1 */ -QSE_EXPORT extern qse_awk_val_t* qse_awk_val_one; - /** * The qse_awk_open() function creates a new qse_awk_t object. The object * created can be passed to other qse_awk_xxx() functions and is valid until @@ -2190,7 +2203,16 @@ QSE_EXPORT int qse_awk_rtx_setrec ( ); /** - * The qse_awk_rtx_makenilval() function create a nil value. + * The qse_awk_rtx_isnilval(0 function determines if a value + * is a nil value. + */ +QSE_EXPORT int qse_awk_rtx_isnilval ( + qse_awk_rtx_t* rtx, + qse_awk_val_t* val +); + +/** + * The qse_awk_rtx_makenilval() function creates a nil value. * It always returns the pointer to the statically allocated * nil value. So it never fails. */ diff --git a/qse/include/qse/cmn/alg.h b/qse/include/qse/cmn/alg.h index addc7cce..43079944 100644 --- a/qse/include/qse/cmn/alg.h +++ b/qse/include/qse/cmn/alg.h @@ -90,7 +90,7 @@ extern "C" { * } * @endcode */ -void* qse_bsearch ( +QSE_EXPORT void* qse_bsearch ( const void* key, const void* base, qse_size_t nmemb, @@ -102,7 +102,7 @@ void* qse_bsearch ( /** * The qse_lsearch() function performs linear search over an array. */ -void* qse_lsearch ( +QSE_EXPORT void* qse_lsearch ( const void* key, const void* base, qse_size_t nmemb, @@ -115,7 +115,7 @@ void* qse_lsearch ( /** * The qse_qsort() function performs quick-sorting over an array. */ -void qse_qsort ( +QSE_EXPORT void qse_qsort ( void* base, qse_size_t nmemb, qse_size_t size, @@ -128,7 +128,7 @@ void qse_qsort ( * The qse_rand31() function implements Park-Miller's minimal standard * 32 bit pseudo-random number generator. */ -qse_uint32_t qse_rand31 ( +QSE_EXPORT qse_uint32_t qse_rand31 ( qse_uint32_t seed ); @@ -138,7 +138,7 @@ qse_uint32_t qse_rand31 ( * The qse_randxs32() function implements the xorshift random number generator * by George Marsaglia. */ -qse_uint32_t qse_randxs32 ( +QSE_EXPORT qse_uint32_t qse_randxs32 ( qse_uint32_t seed ); #endif @@ -148,7 +148,7 @@ qse_uint32_t qse_randxs32 ( * The qse_randxs64() function implements the xorshift random number generator * by George Marsaglia. */ -qse_uint64_t qse_randxs64 ( +QSE_EXPORT qse_uint64_t qse_randxs64 ( qse_uint64_t seed ); #endif @@ -169,8 +169,7 @@ qse_uint64_t qse_randxs64 ( # error Unsupported #endif - -qse_size_t qse_enbase64 ( +QSE_EXPORT qse_size_t qse_enbase64 ( const void* in, qse_size_t isz, qse_mchar_t* out, @@ -178,7 +177,7 @@ qse_size_t qse_enbase64 ( qse_size_t* xsz ); -qse_size_t qse_debase64 ( +QSE_EXPORT qse_size_t qse_debase64 ( const qse_mchar_t* in, qse_size_t isz, void* out, diff --git a/qse/include/qse/cmn/chr.h b/qse/include/qse/cmn/chr.h index e4aa2ba8..45579a43 100644 --- a/qse/include/qse/cmn/chr.h +++ b/qse/include/qse/cmn/chr.h @@ -166,43 +166,43 @@ typedef qse_ctype_t qse_wctype_t; extern "C" { #endif -int qse_ismctype ( +QSE_EXPORT int qse_ismctype ( qse_mcint_t c, qse_mctype_t type ); -int qse_iswctype ( +QSE_EXPORT int qse_iswctype ( qse_wcint_t c, qse_wctype_t type ); -qse_mcint_t qse_tomctype ( +QSE_EXPORT qse_mcint_t qse_tomctype ( qse_mcint_t c, qse_mctype_t type ); -qse_wcint_t qse_towctype ( +QSE_EXPORT qse_wcint_t qse_towctype ( qse_wcint_t c, qse_wctype_t type ); -int qse_mbstoctype ( +QSE_EXPORT int qse_mbstoctype ( const qse_mchar_t* name, qse_mctype_t* id ); -int qse_mbsntoctype ( +QSE_EXPORT int qse_mbsntoctype ( const qse_mchar_t* name, qse_size_t len, qse_mctype_t* id ); -int qse_wcstoctype ( +QSE_EXPORT int qse_wcstoctype ( const qse_wchar_t* name, qse_wctype_t* id ); -int qse_wcsntoctype ( +QSE_EXPORT int qse_wcsntoctype ( const qse_wchar_t* name, qse_size_t len, qse_wctype_t* id diff --git a/qse/include/qse/cmn/cp949.h b/qse/include/qse/cmn/cp949.h index 39a5c8a4..4d579d2f 100644 --- a/qse/include/qse/cmn/cp949.h +++ b/qse/include/qse/cmn/cp949.h @@ -52,7 +52,7 @@ extern "C" { * This function doesn't check invalid unicode code points and performs * conversion compuationally. */ -qse_size_t qse_uctocp949 ( +QSE_EXPORT qse_size_t qse_uctocp949 ( qse_wchar_t uc, qse_mchar_t* cp949, qse_size_t size @@ -66,7 +66,7 @@ qse_size_t qse_uctocp949 ( * not complete. * - An integer between 1 and size inclusive is returned in all other cases. */ -qse_size_t qse_cp949touc ( +QSE_EXPORT qse_size_t qse_cp949touc ( const qse_mchar_t* cp949, qse_size_t size, qse_wchar_t* uc @@ -82,7 +82,7 @@ qse_size_t qse_cp949touc ( * not complete. * - An integer between 1 and size inclusive is returned in all other cases. */ -qse_size_t qse_cp949len ( +QSE_EXPORT qse_size_t qse_cp949len ( const qse_mchar_t* cp949, qse_size_t size ); @@ -92,7 +92,7 @@ qse_size_t qse_cp949len ( * to form a single unicode character. Use #QSE_CP949LEN_MAX if you need a * compile-time constant. */ -qse_size_t qse_cp949lenmax ( +QSE_EXPORT qse_size_t qse_cp949lenmax ( void ); diff --git a/qse/include/qse/cmn/cp950.h b/qse/include/qse/cmn/cp950.h index 4a2f41da..6ea64df2 100644 --- a/qse/include/qse/cmn/cp950.h +++ b/qse/include/qse/cmn/cp950.h @@ -52,7 +52,7 @@ extern "C" { * This function doesn't check invalid unicode code points and performs * conversion compuationally. */ -qse_size_t qse_uctocp950 ( +QSE_EXPORT qse_size_t qse_uctocp950 ( qse_wchar_t uc, qse_mchar_t* cp950, qse_size_t size @@ -66,7 +66,7 @@ qse_size_t qse_uctocp950 ( * not complete. * - An integer between 1 and size inclusive is returned in all other cases. */ -qse_size_t qse_cp950touc ( +QSE_EXPORT qse_size_t qse_cp950touc ( const qse_mchar_t* cp950, qse_size_t size, qse_wchar_t* uc @@ -82,7 +82,7 @@ qse_size_t qse_cp950touc ( * not complete. * - An integer between 1 and size inclusive is returned in all other cases. */ -qse_size_t qse_cp950len ( +QSE_EXPORT qse_size_t qse_cp950len ( const qse_mchar_t* cp950, qse_size_t size ); @@ -92,7 +92,7 @@ qse_size_t qse_cp950len ( * to form a single unicode character. Use #QSE_CP950LEN_MAX if you need a * compile-time constant. */ -qse_size_t qse_cp950lenmax ( +QSE_EXPORT qse_size_t qse_cp950lenmax ( void ); diff --git a/qse/include/qse/cmn/dir.h b/qse/include/qse/cmn/dir.h index 8826cbbc..ab2c52bd 100644 --- a/qse/include/qse/cmn/dir.h +++ b/qse/include/qse/cmn/dir.h @@ -72,31 +72,31 @@ struct qse_dir_ent_t extern "C" { #endif -qse_dir_t* qse_dir_open ( +QSE_EXPORT qse_dir_t* qse_dir_open ( qse_mmgr_t* mmgr, qse_size_t xtnsize, const qse_char_t* path, int flags ); -void qse_dir_close ( +QSE_EXPORT void qse_dir_close ( qse_dir_t* dir ); -qse_mmgr_t* qse_dir_getmmgr ( +QSE_EXPORT qse_mmgr_t* qse_dir_getmmgr ( qse_dir_t* dir ); -void* qse_dir_getxtn ( +QSE_EXPORT void* qse_dir_getxtn ( qse_dir_t* dir ); -int qse_dir_reset ( +QSE_EXPORT int qse_dir_reset ( qse_dir_t* dir, const qse_char_t* path ); -int qse_dir_read ( +QSE_EXPORT int qse_dir_read ( qse_dir_t* dir, qse_dir_ent_t* ent ); diff --git a/qse/include/qse/cmn/env.h b/qse/include/qse/cmn/env.h index 70ffa711..a43e440b 100644 --- a/qse/include/qse/cmn/env.h +++ b/qse/include/qse/cmn/env.h @@ -50,7 +50,7 @@ typedef struct qse_env_t qse_env_t; struct qse_env_t { - QSE_DEFINE_COMMON_FIELDS(env) + qse_mmgr_t* mmgr; struct { @@ -72,37 +72,43 @@ struct qse_env_t extern "C" { #endif -QSE_DEFINE_COMMON_FUNCTIONS(env) - -qse_env_t* qse_env_open ( +QSE_EXPORT qse_env_t* qse_env_open ( qse_mmgr_t* mmgr, qse_size_t xtnsize, int fromcurenv ); -void qse_env_close ( +QSE_EXPORT void qse_env_close ( qse_env_t* env ); -int qse_env_init ( +QSE_EXPORT int qse_env_init ( qse_env_t* env, qse_mmgr_t* mmgr, int fromcurenv ); -void qse_env_fini ( +QSE_EXPORT void qse_env_fini ( qse_env_t* env ); -void qse_env_clear ( +QSE_EXPORT qse_mmgr_t* qse_env_getmmgr ( qse_env_t* env ); -const qse_env_char_t* qse_env_getstr ( +QSE_EXPORT void* qse_env_getxtn ( qse_env_t* env ); -qse_env_char_t** qse_env_getarr ( +QSE_EXPORT void qse_env_clear ( + qse_env_t* env +); + +QSE_EXPORT const qse_env_char_t* qse_env_getstr ( + qse_env_t* env +); + +QSE_EXPORT qse_env_char_t** qse_env_getarr ( qse_env_t* env ); @@ -113,36 +119,36 @@ qse_env_char_t** qse_env_getarr ( * * @return 0 on success, -1 on failure */ -int qse_env_insertwcs ( +QSE_EXPORT int qse_env_insertwcs ( qse_env_t* env, const qse_wchar_t* name, const qse_wchar_t* value ); -int qse_env_insertwcsa ( +QSE_EXPORT int qse_env_insertwcsa ( qse_env_t* env, const qse_wchar_t* name, const qse_wchar_t* value[] ); -int qse_env_insertmbs ( +QSE_EXPORT int qse_env_insertmbs ( qse_env_t* env, const qse_mchar_t* name, const qse_mchar_t* value ); -int qse_env_insertmbsa ( +QSE_EXPORT int qse_env_insertmbsa ( qse_env_t* env, const qse_mchar_t* name, const qse_mchar_t* value[] ); -int qse_env_deletewcs ( +QSE_EXPORT int qse_env_deletewcs ( qse_env_t* env, const qse_wchar_t* name ); -int qse_env_deletembs ( +QSE_EXPORT int qse_env_deletembs ( qse_env_t* env, const qse_mchar_t* name ); diff --git a/qse/include/qse/cmn/fio.h b/qse/include/qse/cmn/fio.h index ac6946b1..9fd2ac0b 100644 --- a/qse/include/qse/cmn/fio.h +++ b/qse/include/qse/cmn/fio.h @@ -141,7 +141,7 @@ typedef struct qse_fio_lck_t qse_fio_lck_t; struct qse_fio_t { - QSE_DEFINE_COMMON_FIELDS (fio) + qse_mmgr_t* mmgr; qse_fio_errnum_t errnum; qse_fio_hnd_t handle; int status; @@ -161,8 +161,6 @@ struct qse_fio_lck_t extern "C" { #endif -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 @@ -178,7 +176,7 @@ QSE_DEFINE_COMMON_FUNCTIONS (fio) * 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_EXPORT qse_fio_t* qse_fio_open ( qse_mmgr_t* mmgr, qse_size_t ext, const qse_char_t* path, @@ -189,14 +187,14 @@ qse_fio_t* qse_fio_open ( /** * The qse_fio_close() function closes a file. */ -void qse_fio_close ( +QSE_EXPORT void qse_fio_close ( qse_fio_t* fio ); /** * The qse_fio_close() function opens a file into @a fio. */ -int qse_fio_init ( +QSE_EXPORT int qse_fio_init ( qse_fio_t* fio, qse_mmgr_t* mmgr, const qse_char_t* path, @@ -208,29 +206,37 @@ int qse_fio_init ( * The qse_fio_close() function finalizes a file by closing the handle * stored in @a fio. */ -void qse_fio_fini ( +QSE_EXPORT void qse_fio_fini ( qse_fio_t* fio ); -qse_fio_errnum_t qse_fio_geterrnum ( +QSE_EXPORT qse_mmgr_t* qse_fio_getmmgr ( + qse_fio_t* fio +); + +QSE_EXPORT void* qse_fio_getxtn ( + qse_fio_t* fio +); + +QSE_EXPORT 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_EXPORT qse_fio_hnd_t qse_fio_gethandle ( const qse_fio_t* fio ); -qse_ubi_t qse_fio_gethandleasubi ( +QSE_EXPORT qse_ubi_t qse_fio_gethandleasubi ( const qse_fio_t* fio ); /** * The qse_fio_seek() function changes the current file position. */ -qse_fio_off_t qse_fio_seek ( +QSE_EXPORT qse_fio_off_t qse_fio_seek ( qse_fio_t* fio, qse_fio_off_t offset, qse_fio_ori_t origin @@ -239,7 +245,7 @@ qse_fio_off_t qse_fio_seek ( /** * The qse_fio_truncate() function truncates a file to @a size. */ -int qse_fio_truncate ( +QSE_EXPORT int qse_fio_truncate ( qse_fio_t* fio, qse_fio_off_t size ); @@ -247,7 +253,7 @@ int qse_fio_truncate ( /** * The qse_fio_read() function reads data. */ -qse_ssize_t qse_fio_read ( +QSE_EXPORT qse_ssize_t qse_fio_read ( qse_fio_t* fio, void* buf, qse_size_t size @@ -256,7 +262,7 @@ qse_ssize_t qse_fio_read ( /** * The qse_fio_write() function writes data. */ -qse_ssize_t qse_fio_write ( +QSE_EXPORT qse_ssize_t qse_fio_write ( qse_fio_t* fio, const void* data, qse_size_t size @@ -271,7 +277,7 @@ qse_ssize_t qse_fio_write ( * - The file size is 0. * - The file is opened without #QSE_FIO_READ. */ -int qse_fio_chmod ( +QSE_EXPORT int qse_fio_chmod ( qse_fio_t* fio, int mode ); @@ -281,26 +287,25 @@ int qse_fio_chmod ( * It is useful in determining the media error, without which qse_fio_close() * may succeed despite such an error. */ -int qse_fio_sync ( +QSE_EXPORT int qse_fio_sync ( qse_fio_t* fio ); /* TODO: qse_fio_lock, qse_fio_unlock */ -int qse_fio_lock ( +QSE_EXPORT int qse_fio_lock ( qse_fio_t* fio, qse_fio_lck_t* lck, int flags ); -int qse_fio_unlock ( +QSE_EXPORT int qse_fio_unlock ( qse_fio_t* fio, qse_fio_lck_t* lck, int flags ); - -int qse_getstdfiohandle ( +QSE_EXPORT int qse_getstdfiohandle ( qse_fio_std_t std, qse_fio_hnd_t* hnd ); diff --git a/qse/include/qse/cmn/mem.h b/qse/include/qse/cmn/mem.h index e270dc7f..1e6c11d8 100644 --- a/qse/include/qse/cmn/mem.h +++ b/qse/include/qse/cmn/mem.h @@ -59,12 +59,6 @@ extern "C" { #endif -/** - * The qse_mmgr global variable holds a pointer to the default memory - * manager. Use QSE_MMGR_GETDFL() and QSE_MMGR_SETDFL() to manipulate it. - */ -extern qse_mmgr_t* qse_mmgr; - /** * The qse_memcpy() functions copies @a n bytes from the source memory block * @a src to the destinaion memory block @a dst. The memory blocks must not diff --git a/qse/include/qse/cmn/xma.h b/qse/include/qse/cmn/xma.h index d0dc5793..746e3e23 100644 --- a/qse/include/qse/cmn/xma.h +++ b/qse/include/qse/cmn/xma.h @@ -81,7 +81,7 @@ typedef struct qse_xma_blk_t qse_xma_blk_t; struct qse_xma_t { - QSE_DEFINE_COMMON_FIELDS (xma) + qse_mmgr_t* mmgr; /** pointer to the first memory block */ qse_xma_blk_t* head; @@ -118,8 +118,6 @@ typedef int (*qse_xma_dumper_t) ( extern "C" { #endif -QSE_DEFINE_COMMON_FUNCTIONS (xma) - /** * The qse_xma_open() function creates a memory allocator. It obtains a memory * zone of the @a zonesize bytes with the memory manager @a mmgr. It also makes @@ -128,7 +126,7 @@ QSE_DEFINE_COMMON_FUNCTIONS (xma) * * @return pointer to a memory allocator on success, #QSE_NULL on failure */ -qse_xma_t* qse_xma_open ( +QSE_EXPORT qse_xma_t* qse_xma_open ( qse_mmgr_t* mmgr, /**< memory manager */ qse_size_t xtnsize, /**< extension size in bytes */ qse_size_t zonesize /**< zone size in bytes */ @@ -140,10 +138,18 @@ qse_xma_t* qse_xma_open ( * the zone. Call this function to destroy a memory allocator created with * qse_xma_open(). */ -void qse_xma_close ( +QSE_EXPORT void qse_xma_close ( qse_xma_t* xma /**< memory allocator */ ); +QSE_EXPORT qse_mmgr_t* qse_xma_getmmgr ( + qse_xma_t* xma +); + +QSE_EXPORT void* qse_xma_getxtn ( + qse_xma_t* xma +); + /** * The qse_xma_init() initializes a memory allocator. If you have the qse_xma_t * structure statically declared or already allocated, you may pass the pointer @@ -152,7 +158,7 @@ void qse_xma_close ( * it does not accept the extension size, thus not creating an extention area. * @return 0 on success, -1 on failure */ -int qse_xma_init ( +QSE_EXPORT int qse_xma_init ( qse_xma_t* xma, /**< memory allocator */ qse_mmgr_t* mmgr, /**< memory manager */ qse_size_t zonesize /**< zone size in bytes */ @@ -162,7 +168,7 @@ int qse_xma_init ( * The qse_xma_fini() function finalizes a memory allocator. Call this * function to finalize a memory allocator initialized with qse_xma_init(). */ -void qse_xma_fini ( +QSE_EXPORT void qse_xma_fini ( qse_xma_t* xma /**< memory allocator */ ); @@ -170,12 +176,12 @@ void qse_xma_fini ( * The qse_xma_alloc() function allocates @a size bytes. * @return pointer to a memory block on success, #QSE_NULL on failure */ -void* qse_xma_alloc ( +QSE_EXPORT void* qse_xma_alloc ( qse_xma_t* xma, /**< memory allocator */ qse_size_t size /**< size in bytes */ ); -void* qse_xma_calloc ( +QSE_EXPORT void* qse_xma_calloc ( qse_xma_t* xma, qse_size_t size ); @@ -184,7 +190,7 @@ void* qse_xma_calloc ( * The qse_xma_alloc() function resizes the memory block @a b to @a size bytes. * @return pointer to a resized memory block on success, #QSE_NULL on failure */ -void* qse_xma_realloc ( +QSE_EXPORT void* qse_xma_realloc ( qse_xma_t* xma, /**< memory allocator */ void* b, /**< memory block */ qse_size_t size /**< new size in bytes */ @@ -193,7 +199,7 @@ void* qse_xma_realloc ( /** * The qse_xma_alloc() function frees the memory block @a b. */ -void qse_xma_free ( +QSE_EXPORT void qse_xma_free ( qse_xma_t* xma, /**< memory allocator */ void* b /**< memory block */ ); @@ -203,7 +209,7 @@ void qse_xma_free ( * with the output function @a dumper provided. The debug build shows * more statistical counters. */ -void qse_xma_dump ( +QSE_EXPORT void qse_xma_dump ( qse_xma_t* xma, /**< memory allocator */ qse_xma_dumper_t dumper, /**< output function */ void* ctx /**< first parameter to output function */ diff --git a/qse/include/qse/macros.h b/qse/include/qse/macros.h index f0b9b0d1..2201bb46 100644 --- a/qse/include/qse/macros.h +++ b/qse/include/qse/macros.h @@ -69,6 +69,10 @@ # define QSE_EXPORT __attribute__((visibility("default"))) # define QSE_PRIVATE __attribute__((visibility("hidden"))) /*# define QSE_PRIVATE __attribute__((visibility("internal")))*/ +#elif defined(__WATCOMC__) +# define QSE_IMPORT __declspec(dllimport) +# define QSE_EXPORT __declspec(dllexport) +# define QSE_PRIVATE #else # define QSE_IMPORT # define QSE_EXPORT diff --git a/qse/lib/awk/StdAwk.cpp b/qse/lib/awk/StdAwk.cpp index 943515b9..e32ac42f 100644 --- a/qse/lib/awk/StdAwk.cpp +++ b/qse/lib/awk/StdAwk.cpp @@ -1512,9 +1512,8 @@ void* StdAwk::modsym (void* handle, const qse_char_t* name) int StdAwk::SourceFile::open (Data& io) { qse_sio_t* sio; - const char_t* ioname = io.getName(); - if (ioname == QSE_NULL) + if (!(io.getFlags() & QSE_AWK_SIO_INCLUDED)) { // open the main source file. @@ -1552,14 +1551,20 @@ int StdAwk::SourceFile::open (Data& io) dir.len = base - this->name; } } + + io.setName (this->name); } else { // open an included file - const char_t* file = ioname; + const char_t* ioname, * file; char_t fbuf[64]; char_t* dbuf = QSE_NULL; + ioname = io.getName(); + QSE_ASSERT (ioname != QSE_NULL); + + file = ioname; if (dir.len > 0 && ioname[0] != QSE_T('/')) { size_t tmplen, totlen; @@ -1622,9 +1627,8 @@ StdAwk::ssize_t StdAwk::SourceFile::write (Data& io, const char_t* buf, size_t l int StdAwk::SourceString::open (Data& io) { qse_sio_t* sio; - const char_t* ioname = io.getName(); - if (ioname == QSE_NULL) + if (!(io.getFlags() & QSE_AWK_SIO_INCLUDED)) { // open the main source file. // SourceString does not support writing. @@ -1633,6 +1637,8 @@ int StdAwk::SourceString::open (Data& io) } else { + const char_t* ioname = io.getName(); + // open an included file sio = qse_sio_open ( ((Awk*)io)->getMmgr(), diff --git a/qse/lib/awk/awk.c b/qse/lib/awk/awk.c index a2488c03..e2252c78 100644 --- a/qse/lib/awk/awk.c +++ b/qse/lib/awk/awk.c @@ -404,6 +404,8 @@ int qse_awk_clear (qse_awk_t* awk) awk->sio.last.file = QSE_NULL; awk->sio.nungots = 0; + awk->sio.arg.flags = 0; + awk->sio.arg.name = QSE_NULL; awk->sio.arg.line = 1; awk->sio.arg.colm = 1; awk->sio.arg.b.pos = 0; diff --git a/qse/lib/awk/parse.c b/qse/lib/awk/parse.c index 16e33c9e..e959d70d 100644 --- a/qse/lib/awk/parse.c +++ b/qse/lib/awk/parse.c @@ -741,6 +741,7 @@ static int begin_include (qse_awk_t* awk) goto oops; } + arg->flags = QSE_AWK_SIO_INCLUDED; arg->name = QSE_HTB_KPTR(pair); CLRERR (awk); @@ -765,7 +766,8 @@ static int begin_include (qse_awk_t* awk) if (get_char (awk) <= -1 || get_token (awk) <= -1) { end_include (awk); - /* since i've called end_include(), i don't go to oops */ + /* i don't jump to oops since i've called + * end_include() where awk->sio.inp/arg is freed. */ return -1; } diff --git a/qse/lib/awk/std.c b/qse/lib/awk/std.c index 7fdde828..e7ef75d5 100644 --- a/qse/lib/awk/std.c +++ b/qse/lib/awk/std.c @@ -716,23 +716,37 @@ static int open_parsestd (qse_awk_t* awk, xtn_t* xtn, qse_size_t index) static qse_ssize_t sf_in_open ( qse_awk_t* awk, qse_awk_sio_arg_t* arg, xtn_t* xtn) { - if (arg == QSE_NULL || arg->name == QSE_NULL) + if (arg == QSE_NULL || !(arg->flags & QSE_AWK_SIO_INCLUDED)) { /* handle normal source input streams specified * to qse_awk_parsestd() */ qse_ssize_t x; x = open_parsestd (awk, xtn, 0); - if (x >= 0) xtn->s.in.xindex = 0; /* update the current stream index */ + if (x >= 0) + { + xtn->s.in.xindex = 0; /* update the current stream index */ + /* perform some manipulation about the top-level input information */ + if (xtn->s.in.x[0].type == QSE_AWK_PARSESTD_FILE) + awk->sio.arg.name = xtn->s.in.x[0].u.file.path; + else + awk->sio.arg.name = QSE_NULL; + awk->sio.arg.line = 1; + awk->sio.arg.colm = 1; + } + return x; } else { /* handle the included source file - @include */ - const qse_char_t* file = arg->name; + const qse_char_t* file; qse_char_t fbuf[64]; qse_char_t* dbuf = QSE_NULL; + QSE_ASSERT (arg->name != QSE_NULL); + + file = arg->name; if (xtn->s.in.u.file.dir.len > 0 && arg->name[0] != QSE_T('/')) { qse_size_t tmplen, totlen; @@ -778,7 +792,7 @@ static qse_ssize_t sf_in_open ( static qse_ssize_t sf_in_close ( qse_awk_t* awk, qse_awk_sio_arg_t* arg, xtn_t* xtn) { - if (arg == QSE_NULL || arg->name == QSE_NULL) + if (arg == QSE_NULL || !(arg->flags & QSE_AWK_SIO_INCLUDED)) { switch (xtn->s.in.x[xtn->s.in.xindex].type) { @@ -810,7 +824,7 @@ static qse_ssize_t sf_in_read ( qse_char_t* data, qse_size_t size, xtn_t* xtn) { - if (arg == QSE_NULL || arg->name == QSE_NULL) + if (arg == QSE_NULL || !(arg->flags & QSE_AWK_SIO_INCLUDED)) { qse_ssize_t n; @@ -864,6 +878,15 @@ static qse_ssize_t sf_in_read ( { /* if successful, close the current stream */ xtn->s.in.xindex = next; /* update the next to the current */ + + /* perform some manipulation about the top-level input information */ + if (xtn->s.in.x[next].type == QSE_AWK_PARSESTD_FILE) + awk->sio.arg.name = xtn->s.in.x[next].u.file.path; + else + awk->sio.arg.name = QSE_NULL; + awk->sio.arg.line = 1; + awk->sio.arg.colm = 1; + goto again; } } @@ -876,7 +899,9 @@ static qse_ssize_t sf_in_read ( /* handle the included source file - @include */ qse_ssize_t n; + QSE_ASSERT (arg->name != QSE_NULL); QSE_ASSERT (arg->handle != QSE_NULL); + n = qse_sio_getstrn (arg->handle, data, size); if (n <= -1) { @@ -2519,8 +2544,7 @@ done: return ret; } -qse_cmgr_t* qse_awk_rtx_getcmgrstd ( - qse_awk_rtx_t* rtx, const qse_char_t* ioname) +qse_cmgr_t* qse_awk_rtx_getcmgrstd (qse_awk_rtx_t* rtx, const qse_char_t* ioname) { #if defined(QSE_CHAR_IS_WCHAR) rxtn_t* rxtn; diff --git a/qse/lib/awk/val.c b/qse/lib/awk/val.c index ce9bb14b..78b6117c 100644 --- a/qse/lib/awk/val.c +++ b/qse/lib/awk/val.c @@ -63,6 +63,11 @@ qse_awk_val_t* qse_awk_val_negone = (qse_awk_val_t*)&awk_int[0]; qse_awk_val_t* qse_awk_val_zero = (qse_awk_val_t*)&awk_int[1]; qse_awk_val_t* qse_awk_val_one = (qse_awk_val_t*)&awk_int[2]; +int qse_awk_rtx_isnilval (qse_awk_rtx_t* rtx, qse_awk_val_t* val) +{ + return val->type == QSE_AWK_VAL_NIL; +} + qse_awk_val_t* qse_awk_rtx_makenilval (qse_awk_rtx_t* rtx) { return (qse_awk_val_t*)&awk_nil; diff --git a/qse/lib/awk/val.h b/qse/lib/awk/val.h index 800ead78..0a62f853 100644 --- a/qse/lib/awk/val.h +++ b/qse/lib/awk/val.h @@ -54,6 +54,22 @@ struct qse_awk_val_rchunk_t extern "C" { #endif +/* represents a nil value */ +extern qse_awk_val_t* qse_awk_val_nil; + +/* represents an empty string */ +extern qse_awk_val_t* qse_awk_val_zls; + +/* represents a numeric value -1 */ +extern qse_awk_val_t* qse_awk_val_negone; + +/* represents a numeric value 0 */ +extern qse_awk_val_t* qse_awk_val_zero; + +/* represents a numeric value 1 */ +extern qse_awk_val_t* qse_awk_val_one; + + void qse_awk_rtx_freeval ( qse_awk_rtx_t* rtx, qse_awk_val_t* val, diff --git a/qse/lib/cmn/env.c b/qse/lib/cmn/env.c index a6f5800a..e8f67186 100644 --- a/qse/lib/cmn/env.c +++ b/qse/lib/cmn/env.c @@ -31,8 +31,6 @@ #define STRSIZE 4096 #define ARRSIZE 128 -QSE_IMPLEMENT_COMMON_FUNCTIONS(env) - static int load_curenv (qse_env_t* env); static int insert_sys_wcs (qse_env_t* env, const qse_wchar_t* name); static int insert_sys_mbs (qse_env_t* env, const qse_mchar_t* name); @@ -75,6 +73,16 @@ void qse_env_fini (qse_env_t* env) if (env->str.ptr) QSE_MMGR_FREE (env->mmgr, env->str.ptr); } +qse_mmgr_t* qse_env_getmmgr (qse_env_t* env) +{ + return env->mmgr; +} + +void* qse_env_getxtn (qse_env_t* env) +{ + return QSE_XTN (env); +} + void qse_env_clear (qse_env_t* env) { if (env->str.ptr) diff --git a/qse/lib/cmn/fio.c b/qse/lib/cmn/fio.c index fe193a90..730aa53a 100644 --- a/qse/lib/cmn/fio.c +++ b/qse/lib/cmn/fio.c @@ -53,8 +53,6 @@ enum STATUS_NOCLOSE = (1 << 1) }; -QSE_IMPLEMENT_COMMON_FUNCTIONS (fio) - #if defined(_WIN32) static qse_fio_errnum_t syserr_to_errnum (DWORD e) { @@ -888,6 +886,16 @@ void qse_fio_fini (qse_fio_t* fio) } } +qse_mmgr_t* qse_fio_getmmgr (qse_fio_t* fio) +{ + return fio->mmgr; +} + +void* qse_fio_getxtn (qse_fio_t* fio) +{ + return QSE_XTN (fio); +} + qse_fio_errnum_t qse_fio_geterrnum (const qse_fio_t* fio) { return fio->errnum; diff --git a/qse/lib/cmn/xma.c b/qse/lib/cmn/xma.c index 9403859c..11fa1cbe 100644 --- a/qse/lib/cmn/xma.c +++ b/qse/lib/cmn/xma.c @@ -54,8 +54,6 @@ struct qse_xma_blk_t } b; }; -QSE_IMPLEMENT_COMMON_FUNCTIONS (xma) - static QSE_INLINE_ALWAYS qse_size_t szlog2 (qse_size_t n) { /* @@ -183,6 +181,16 @@ void qse_xma_fini (qse_xma_t* xma) QSE_MMGR_FREE (xma->mmgr, xma->head); } +qse_mmgr_t* qse_xma_getmmgr (qse_xma_t* xma) +{ + return xma->mmgr; +} + +void* qse_xma_getxtn (qse_xma_t* xma) +{ + return QSE_XTN (xma); +} + static QSE_INLINE void attach_to_freelist (qse_xma_t* xma, qse_xma_blk_t* b) { /* diff --git a/qse/regress/awk/regress.out b/qse/regress/awk/regress.out index 47c1627b..500f126a 100644 --- a/qse/regress/awk/regress.out +++ b/qse/regress/awk/regress.out @@ -937,7 +937,7 @@ my hello my hello my hello my hello -ERROR: CODE 16 LINE 6 COLUMN 1 - block nested too deeply +ERROR: CODE 16 LINE 6 COLUMN 1 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-002.awk - block nested too deeply -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-003.awk &1 -------------------------------------------------------------------------------- @@ -956,7 +956,7 @@ BEGIN { -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-004.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 43 LINE 3 COLUMN 9 - function 'a' redefined +ERROR: CODE 43 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-004.awk - function 'a' redefined -------------------------------------------------------------------------------- [CMD] qseawk --implicit=off --newline=on -d- -f lang-005.awk &1 -------------------------------------------------------------------------------- @@ -984,7 +984,7 @@ BEGIN { -------------------------------------------------------------------------------- [CMD] qseawk --implicit=off --newline=on -d- -f lang-006.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 44 LINE 5 COLUMN 10 - global variable 'a' redefined +ERROR: CODE 44 LINE 5 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-006.awk - global variable 'a' redefined -------------------------------------------------------------------------------- [CMD] qseawk --implicit=on --newline=on -d- -f lang-007.awk &1 -------------------------------------------------------------------------------- @@ -1352,7 +1352,7 @@ BEGIN { printf ("%s\n",10.34); } -ERROR: CODE 104 LINE 3 COLUMN 2 - recursion detected in format conversion +ERROR: CODE 104 LINE 3 COLUMN 2 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-013.awk - recursion detected in format conversion -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-014.awk &1 -------------------------------------------------------------------------------- @@ -1367,7 +1367,7 @@ BEGIN { -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-015.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 16 LINE 3 COLUMN 50 - block nested too deeply +ERROR: CODE 16 LINE 3 COLUMN 50 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-015.awk - block nested too deeply -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-016.awk &1 -------------------------------------------------------------------------------- @@ -1481,27 +1481,27 @@ END { -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-018.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 48 LINE 1 COLUMN 9 - duplicate global variable 'ARGV' +ERROR: CODE 48 LINE 1 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-018.awk - duplicate global variable 'ARGV' -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-019.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 50 LINE 1 COLUMN 15 - '+' not a valid parameter name +ERROR: CODE 50 LINE 1 COLUMN 15 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-019.awk - '+' not a valid parameter name -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-020.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 51 LINE 1 COLUMN 9 - '+' not a valid variable name +ERROR: CODE 51 LINE 1 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-020.awk - '+' not a valid variable name -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-021.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 51 LINE 3 COLUMN 9 - '+' not a valid variable name +ERROR: CODE 51 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-021.awk - '+' not a valid variable name -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-022.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 24 LINE 2 COLUMN 9 - left parenthesis expected in place of '=' +ERROR: CODE 24 LINE 2 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-022.awk - left parenthesis expected in place of '=' -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-023.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 29 LINE 5 COLUMN 20 - colon expected in place of ';' +ERROR: CODE 29 LINE 5 COLUMN 20 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-023.awk - colon expected in place of ';' -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-024.awk &1 -------------------------------------------------------------------------------- @@ -1533,7 +1533,7 @@ BEGIN { delete iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix; } -ERROR: CODE 80 LINE 3 COLUMN 9 - 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix' not deletable +ERROR: CODE 80 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-025.awk - 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix' not deletable -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-026.awk &1 -------------------------------------------------------------------------------- @@ -1549,15 +1549,15 @@ abc -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-027.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 18 LINE 2 COLUMN 1 - invalid character '' +ERROR: CODE 18 LINE 2 COLUMN 1 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-027.awk - invalid character '' -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-028.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 42 LINE 2 COLUMN 10 - intrinsic function 'substr' redefined +ERROR: CODE 42 LINE 2 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-028.awk - intrinsic function 'substr' redefined -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-029.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 43 LINE 9 COLUMN 10 - function 'abc' redefined +ERROR: CODE 43 LINE 9 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-029.awk - function 'abc' redefined -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-030.awk &1 -------------------------------------------------------------------------------- @@ -2456,7 +2456,7 @@ BEGIN { -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -d- -f lang-049.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 60 LINE 2 COLUMN 9 - no argument provided +ERROR: CODE 60 LINE 2 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-049.awk - no argument provided -------------------------------------------------------------------------------- [CMD] qseawk --newline=on -F: -f columnate.awk passwd.dat &1 -------------------------------------------------------------------------------- diff --git a/qse/regress/awk/regress.out.xma b/qse/regress/awk/regress.out.xma index f3a2653e..e0019ecf 100644 --- a/qse/regress/awk/regress.out.xma +++ b/qse/regress/awk/regress.out.xma @@ -937,7 +937,7 @@ my hello my hello my hello my hello -ERROR: CODE 16 LINE 6 COLUMN 1 - block nested too deeply +ERROR: CODE 16 LINE 6 COLUMN 1 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-002.awk - block nested too deeply -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-003.awk &1 -------------------------------------------------------------------------------- @@ -956,7 +956,7 @@ BEGIN { -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-004.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 43 LINE 3 COLUMN 9 - function 'a' redefined +ERROR: CODE 43 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-004.awk - function 'a' redefined -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --implicit=off --newline=on -d- -f lang-005.awk &1 -------------------------------------------------------------------------------- @@ -984,7 +984,7 @@ BEGIN { -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --implicit=off --newline=on -d- -f lang-006.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 44 LINE 5 COLUMN 10 - global variable 'a' redefined +ERROR: CODE 44 LINE 5 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-006.awk - global variable 'a' redefined -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --implicit=on --newline=on -d- -f lang-007.awk &1 -------------------------------------------------------------------------------- @@ -1352,7 +1352,7 @@ BEGIN { printf ("%s\n",10.34); } -ERROR: CODE 104 LINE 3 COLUMN 2 - recursion detected in format conversion +ERROR: CODE 104 LINE 3 COLUMN 2 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-013.awk - recursion detected in format conversion -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-014.awk &1 -------------------------------------------------------------------------------- @@ -1367,7 +1367,7 @@ BEGIN { -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-015.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 16 LINE 3 COLUMN 50 - block nested too deeply +ERROR: CODE 16 LINE 3 COLUMN 50 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-015.awk - block nested too deeply -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-016.awk &1 -------------------------------------------------------------------------------- @@ -1481,27 +1481,27 @@ END { -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-018.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 48 LINE 1 COLUMN 9 - duplicate global variable 'ARGV' +ERROR: CODE 48 LINE 1 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-018.awk - duplicate global variable 'ARGV' -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-019.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 50 LINE 1 COLUMN 15 - '+' not a valid parameter name +ERROR: CODE 50 LINE 1 COLUMN 15 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-019.awk - '+' not a valid parameter name -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-020.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 51 LINE 1 COLUMN 9 - '+' not a valid variable name +ERROR: CODE 51 LINE 1 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-020.awk - '+' not a valid variable name -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-021.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 51 LINE 3 COLUMN 9 - '+' not a valid variable name +ERROR: CODE 51 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-021.awk - '+' not a valid variable name -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-022.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 24 LINE 2 COLUMN 9 - left parenthesis expected in place of '=' +ERROR: CODE 24 LINE 2 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-022.awk - left parenthesis expected in place of '=' -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-023.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 29 LINE 5 COLUMN 20 - colon expected in place of ';' +ERROR: CODE 29 LINE 5 COLUMN 20 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-023.awk - colon expected in place of ';' -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-024.awk &1 -------------------------------------------------------------------------------- @@ -1533,7 +1533,7 @@ BEGIN { delete iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix; } -ERROR: CODE 80 LINE 3 COLUMN 9 - 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix' not deletable +ERROR: CODE 80 LINE 3 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-025.awk - 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix' not deletable -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-026.awk &1 -------------------------------------------------------------------------------- @@ -1549,15 +1549,15 @@ abc -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-027.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 18 LINE 2 COLUMN 1 - invalid character '' +ERROR: CODE 18 LINE 2 COLUMN 1 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-027.awk - invalid character '' -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-028.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 42 LINE 2 COLUMN 10 - intrinsic function 'substr' redefined +ERROR: CODE 42 LINE 2 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-028.awk - intrinsic function 'substr' redefined -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-029.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 43 LINE 9 COLUMN 10 - function 'abc' redefined +ERROR: CODE 43 LINE 9 COLUMN 10 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-029.awk - function 'abc' redefined -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-030.awk &1 -------------------------------------------------------------------------------- @@ -2456,7 +2456,7 @@ BEGIN { -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -d- -f lang-049.awk &1 -------------------------------------------------------------------------------- -ERROR: CODE 60 LINE 2 COLUMN 9 - no argument provided +ERROR: CODE 60 LINE 2 COLUMN 9 FILE /home/hyung-hwan/nfs.exports/workspace/qse/x86_64/linux-wchar-debug-shared/../../src/regress/awk/lang-049.awk - no argument provided -------------------------------------------------------------------------------- [CMD] qseawk -m 500000 --newline=on -F: -f columnate.awk passwd.dat &1 -------------------------------------------------------------------------------- diff --git a/qse/samples/awk/awk07.cpp b/qse/samples/awk/awk07.cpp index 789cdffb..db7093c6 100644 --- a/qse/samples/awk/awk07.cpp +++ b/qse/samples/awk/awk07.cpp @@ -45,12 +45,12 @@ static int run_awk (QSE::StdAwk& awk) QSE::StdAwk::SourceString in (QSE_T( "function pa (x) {\n" - " reset ret;\n" + " @reset ret;\n" " for (i in x) { print i, \"=>\", x[i]; ret += x[i]; }\n" " return ret + FOO++;\n" "}\n" "function pb (x) {\n" - " reset ret;\n" + " @reset ret;\n" " for (i in x) { ret[-i] = -x[i]; }\n" " return ret;\n" "}" @@ -135,11 +135,8 @@ static int awk_main (int argc, qse_char_t* argv[]) int ret = awk.open(); - // allow returning a map from a function and enable 'reset' - awk.setTrait ( - awk.getTrait() | - QSE_AWK_MAPTOVAR | - QSE_AWK_EXTRAKWS); + // allow returning a map from a function + awk.setTrait (awk.getTrait() | QSE_AWK_FLEXMAP); if (ret >= 0) ret = run_awk (awk); if (ret <= -1) diff --git a/qse/samples/awk/awk08.cpp b/qse/samples/awk/awk08.cpp index 48ed6318..13768dea 100644 --- a/qse/samples/awk/awk08.cpp +++ b/qse/samples/awk/awk08.cpp @@ -188,11 +188,14 @@ static void print_error (MyAwk& awk) { MyAwk::loc_t loc = awk.getErrorLocation(); - print_error ( - QSE_T("LINE [%u] %s\n"), - (unsigned)loc.line, - awk.getErrorMessage() - ); + if (loc.file) + { + print_error (QSE_T("line %u at %s - %s\n"), (unsigned)loc.line, loc.file, awk.getErrorMessage()); + } + else + { + print_error (QSE_T("line %u - %s\n"), (unsigned)loc.line, awk.getErrorMessage()); + } } #ifdef _WIN32 @@ -358,7 +361,7 @@ static int awk_main_2 (MyAwk& awk, int argc, qse_char_t* argv[]) cmdline_t cmdline; int n; - awk.setTrait (awk.getTrait() | QSE_AWK_EXTRAKWS | QSE_AWK_MAPTOVAR | QSE_AWK_RWPIPE); + awk.setTrait (awk.getTrait() | QSE_AWK_EXTRAKWS | QSE_AWK_FLEXMAP | QSE_AWK_RWPIPE); // ARGV[0] if (awk.addArgument (QSE_T("awk08")) <= -1) diff --git a/qse/samples/awk/awk10.c b/qse/samples/awk/awk10.c index 88b66faa..c418b96e 100644 --- a/qse/samples/awk/awk10.c +++ b/qse/samples/awk/awk10.c @@ -58,7 +58,7 @@ int main () /* don't allow BEGIN, END, pattern-action blocks */ opt &= ~QSE_AWK_PABLOCK; /* can assign a map to a variable */ - opt |= QSE_AWK_MAPTOVAR; + opt |= QSE_AWK_FLEXMAP; qse_awk_setopt (awk, QSE_AWK_TRAIT, &opt); psin.type = QSE_AWK_PARSESTD_STR; diff --git a/qse/watcom/debug/dos32/lib/awk/qseawk.tgt b/qse/watcom/debug/dos32/lib/awk/qseawk.tgt index d2b57856..8be10143 100755 --- a/qse/watcom/debug/dos32/lib/awk/qseawk.tgt +++ b/qse/watcom/debug/dos32/lib/awk/qseawk.tgt @@ -32,107 +32,103 @@ WString LIB 8 WVList -0 +2 9 +MVState +10 +WString +5 +WLINK +11 +WString +28 +?????Library directories(;): +1 +12 +WString +13 +../../lib/cmn +0 +13 +MVState +14 +WString +5 +WLINK +15 +WString +18 +?????Libraries(,): +1 +16 +WString +6 +qsecmn +0 +17 WVList 0 -1 1 1 0 -10 +18 WPickList 22 -11 +19 MItem 3 *.c -12 +20 WString 4 COBJ -13 +21 WVList 2 -14 +22 MVState -15 +23 WString 3 WCC -16 +24 WString 25 d????Include directories: 1 -17 +25 WString 37 "$(%watcom)/h;../../../../../include" 0 -18 +26 MVState -19 +27 WString 3 WCC -20 +28 WString 23 ?????Macro definitions: 1 -21 +29 WString 78 QSE_BUILD_DEBUG QSE_AWK_DEFAULT_MODPREFIX="awk-" QSE_AWK_DEFAULT_MODPOSTFIX="" 0 -22 -WVList -0 --1 -1 -1 -0 -23 -MItem -28 -../../../../../lib/awk/awk.c -24 -WString -4 -COBJ -25 -WVList -0 -26 -WVList -0 -11 -1 -1 -0 -27 -MItem -28 -../../../../../lib/awk/err.c -28 -WString -4 -COBJ -29 -WVList -0 30 WVList 0 -11 +-1 1 1 0 31 MItem 28 -../../../../../lib/awk/fnc.c +../../../../../lib/awk/awk.c 32 WString 4 @@ -143,14 +139,14 @@ WVList 34 WVList 0 -11 +19 1 1 0 35 MItem -29 -../../../../../lib/awk/misc.c +28 +../../../../../lib/awk/err.c 36 WString 4 @@ -161,14 +157,14 @@ WVList 38 WVList 0 -11 +19 1 1 0 39 MItem -30 -../../../../../lib/awk/parse.c +28 +../../../../../lib/awk/fnc.c 40 WString 4 @@ -179,14 +175,14 @@ WVList 42 WVList 0 -11 +19 1 1 0 43 MItem -28 -../../../../../lib/awk/rec.c +29 +../../../../../lib/awk/misc.c 44 WString 4 @@ -197,14 +193,14 @@ WVList 46 WVList 0 -11 +19 1 1 0 47 MItem -28 -../../../../../lib/awk/rio.c +30 +../../../../../lib/awk/parse.c 48 WString 4 @@ -215,14 +211,14 @@ WVList 50 WVList 0 -11 +19 1 1 0 51 MItem 28 -../../../../../lib/awk/run.c +../../../../../lib/awk/rec.c 52 WString 4 @@ -233,14 +229,14 @@ WVList 54 WVList 0 -11 +19 1 1 0 55 MItem 28 -../../../../../lib/awk/std.c +../../../../../lib/awk/rio.c 56 WString 4 @@ -251,14 +247,14 @@ WVList 58 WVList 0 -11 +19 1 1 0 59 MItem -29 -../../../../../lib/awk/tree.c +28 +../../../../../lib/awk/run.c 60 WString 4 @@ -269,14 +265,14 @@ WVList 62 WVList 0 -11 +19 1 1 0 63 MItem 28 -../../../../../lib/awk/val.c +../../../../../lib/awk/std.c 64 WString 4 @@ -287,50 +283,50 @@ WVList 66 WVList 0 -11 +19 1 1 0 67 MItem -3 -*.h +29 +../../../../../lib/awk/tree.c 68 WString -3 -NIL +4 +COBJ 69 WVList 0 70 WVList 0 --1 +19 1 1 0 71 MItem 28 -../../../../../lib/awk/awk.h +../../../../../lib/awk/val.c 72 WString -3 -NIL +4 +COBJ 73 WVList 0 74 WVList 0 -67 +19 1 1 0 75 MItem -28 -../../../../../lib/awk/err.h +3 +*.h 76 WString 3 @@ -341,14 +337,14 @@ WVList 78 WVList 0 -67 +-1 1 1 0 79 MItem 28 -../../../../../lib/awk/fnc.h +../../../../../lib/awk/awk.h 80 WString 3 @@ -359,14 +355,14 @@ WVList 82 WVList 0 -67 +75 1 1 0 83 MItem -29 -../../../../../lib/awk/misc.h +28 +../../../../../lib/awk/err.h 84 WString 3 @@ -377,14 +373,14 @@ WVList 86 WVList 0 -67 +75 1 1 0 87 MItem -30 -../../../../../lib/awk/parse.h +28 +../../../../../lib/awk/fnc.h 88 WString 3 @@ -395,14 +391,14 @@ WVList 90 WVList 0 -67 +75 1 1 0 91 MItem -28 -../../../../../lib/awk/rio.h +29 +../../../../../lib/awk/misc.h 92 WString 3 @@ -413,14 +409,14 @@ WVList 94 WVList 0 -67 +75 1 1 0 95 MItem -28 -../../../../../lib/awk/run.h +30 +../../../../../lib/awk/parse.h 96 WString 3 @@ -431,14 +427,14 @@ WVList 98 WVList 0 -67 +75 1 1 0 99 MItem -29 -../../../../../lib/awk/tree.h +28 +../../../../../lib/awk/rio.h 100 WString 3 @@ -449,14 +445,14 @@ WVList 102 WVList 0 -67 +75 1 1 0 103 MItem 28 -../../../../../lib/awk/val.h +../../../../../lib/awk/run.h 104 WString 3 @@ -467,7 +463,43 @@ WVList 106 WVList 0 -67 +75 +1 +1 +0 +107 +MItem +29 +../../../../../lib/awk/tree.h +108 +WString +3 +NIL +109 +WVList +0 +110 +WVList +0 +75 +1 +1 +0 +111 +MItem +28 +../../../../../lib/awk/val.h +112 +WString +3 +NIL +113 +WVList +0 +114 +WVList +0 +75 1 1 0 diff --git a/qse/watcom/debug/dos32/mod/awk/awk-dir.tgt b/qse/watcom/debug/dos32/mod/awk/awk-dir.tgt index 8dd3256b..07a950ad 100755 --- a/qse/watcom/debug/dos32/mod/awk/awk-dir.tgt +++ b/qse/watcom/debug/dos32/mod/awk/awk-dir.tgt @@ -32,7 +32,7 @@ WString CWDLL 8 WVList -4 +3 9 MVState 10 @@ -66,54 +66,54 @@ WString qsecmn qseawk 0 17 -MVState +MCState 18 WString 5 WLINK 19 WString -21 -dx???Export names(,): -1 -20 -WString -5 -load_ -0 -21 -MCState -22 -WString -5 -WLINK -23 -WString 24 ?????Eliminate dead code 1 1 -24 +20 WVList 0 -1 1 1 0 -25 +21 WPickList 2 -26 +22 MItem 3 *.c -27 +23 WString 4 COBJ -28 +24 WVList 3 +25 +MVState +26 +WString +3 +WCC +27 +WString +25 +d????Include directories: +1 +28 +WString +37 +"$(%watcom)/h;../../../../../include" +0 29 MVState 30 @@ -122,64 +122,48 @@ WString WCC 31 WString -25 -d????Include directories: +23 +?????Macro definitions: 1 32 WString -37 -"$(%watcom)/h;../../../../../include" +15 +QSE_BUILD_DEBUG 0 33 -MVState +MCState 34 WString 3 WCC 35 WString -23 -?????Macro definitions: -1 -36 -WString -15 -QSE_BUILD_DEBUG -0 -37 -MCState -38 -WString -3 -WCC -39 -WString 33 ?????Disable stack depth checking 1 1 -40 +36 WVList 0 -1 1 1 0 -41 +37 MItem 28 ../../../../../mod/awk/dir.c -42 +38 WString 4 COBJ -43 +39 WVList 0 -44 +40 WVList 0 -26 +22 1 1 0 diff --git a/qse/watcom/debug/dos32/mod/awk/awk-str.tgt b/qse/watcom/debug/dos32/mod/awk/awk-str.tgt index 48c9082b..162bead1 100755 --- a/qse/watcom/debug/dos32/mod/awk/awk-str.tgt +++ b/qse/watcom/debug/dos32/mod/awk/awk-str.tgt @@ -32,7 +32,7 @@ WString CWDLL 8 WVList -3 +2 9 MVState 10 @@ -66,42 +66,42 @@ WString qsecmn qseawk 0 17 -MVState -18 -WString -5 -WLINK -19 -WString -21 -dx???Export names(,): -1 -20 -WString -5 -load_ -0 -21 WVList 0 -1 1 1 0 -22 +18 WPickList 2 -23 +19 MItem 3 *.c -24 +20 WString 4 COBJ -25 +21 WVList 2 +22 +MVState +23 +WString +3 +WCC +24 +WString +25 +d????Include directories: +1 +25 +WString +37 +"$(%watcom)/h;../../../../../include" +0 26 MVState 27 @@ -110,52 +110,36 @@ WString WCC 28 WString -25 -d????Include directories: -1 -29 -WString -37 -"$(%watcom)/h;../../../../../include" -0 -30 -MVState -31 -WString -3 -WCC -32 -WString 23 ?????Macro definitions: 1 -33 +29 WString 15 QSE_BUILD_DEBUG 0 -34 +30 WVList 0 -1 1 1 0 -35 +31 MItem 28 ../../../../../mod/awk/str.c -36 +32 WString 4 COBJ -37 +33 WVList 0 -38 +34 WVList 0 -23 +19 1 1 0 diff --git a/qse/watcom/debug/dos32/mod/awk/awk-sys.tgt b/qse/watcom/debug/dos32/mod/awk/awk-sys.tgt index b5839f06..797d87fe 100755 --- a/qse/watcom/debug/dos32/mod/awk/awk-sys.tgt +++ b/qse/watcom/debug/dos32/mod/awk/awk-sys.tgt @@ -32,7 +32,7 @@ WString CWDLL 8 WVList -4 +3 9 MVState 10 @@ -66,63 +66,63 @@ WString qsecmn qseawk 0 17 -MVState +MCState 18 WString 5 WLINK 19 WString -21 -dx???Export names(,): -1 -20 -WString -5 -load_ -0 -21 -MCState -22 -WString -5 -WLINK -23 -WString 24 ?????Eliminate dead code 1 1 -24 +20 WVList 1 -25 +21 ActionStates -26 +22 WString 5 &Make -27 +23 WVList 0 -1 1 1 0 -28 +24 WPickList 2 -29 +25 MItem 3 *.c -30 +26 WString 4 COBJ -31 +27 WVList 3 +28 +MVState +29 +WString +3 +WCC +30 +WString +25 +d????Include directories: +1 +31 +WString +37 +"$(%watcom)/h;../../../../../include" +0 32 MVState 33 @@ -131,64 +131,48 @@ WString WCC 34 WString -25 -d????Include directories: +23 +?????Macro definitions: 1 35 WString -37 -"$(%watcom)/h;../../../../../include" +15 +QSE_BUILD_DEBUG 0 36 -MVState +MCState 37 WString 3 WCC 38 WString -23 -?????Macro definitions: -1 -39 -WString -15 -QSE_BUILD_DEBUG -0 -40 -MCState -41 -WString -3 -WCC -42 -WString 33 ?????Disable stack depth checking 1 1 -43 +39 WVList 0 -1 1 1 0 -44 +40 MItem 28 ../../../../../mod/awk/sys.c -45 +41 WString 4 COBJ -46 +42 WVList 0 -47 +43 WVList 0 -29 +25 1 1 0 diff --git a/qse/watcom/debug/os2/lib/awk/qseawk.tgt b/qse/watcom/debug/os2/lib/awk/qseawk.tgt index b183fa8f..4dd95fd3 100755 --- a/qse/watcom/debug/os2/lib/awk/qseawk.tgt +++ b/qse/watcom/debug/os2/lib/awk/qseawk.tgt @@ -7,12 +7,12 @@ MComponent 0 2 WString -3 -LIB +4 +ODLL 3 WString 5 -o_2so +o_2do 1 0 1 @@ -25,135 +25,131 @@ MCommand 6 MItem 10 -qseawk.lib +qseawk.dll 7 WString -3 -LIB +4 +ODLL 8 WVList -0 +2 9 +MVState +10 +WString +5 +WLINK +11 +WString +28 +?????Library directories(;): +1 +12 +WString +13 +../../lib/cmn +0 +13 +MVState +14 +WString +5 +WLINK +15 +WString +18 +?????Libraries(,): +1 +16 +WString +6 +qsecmn +0 +17 WVList 0 -1 1 1 0 -10 +18 WPickList 23 -11 +19 MItem 3 *.c -12 +20 WString 4 COBJ -13 +21 WVList 3 -14 -MVState -15 -WString -3 -WCC -16 -WString -25 -o?2??Include directories: -1 -17 -WString -54 -"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include" -0 -18 -MVState -19 -WString -3 -WCC -20 -WString -23 -?????Macro definitions: -1 -21 -WString -78 -QSE_BUILD_DEBUG QSE_AWK_DEFAULT_MODPREFIX="awk-" QSE_AWK_DEFAULT_MODPOSTFIX="" -0 22 -MCState +MVState 23 WString 3 WCC 24 WString +25 +o?2??Include directories: +1 +25 +WString +54 +"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include" +0 +26 +MVState +27 +WString +3 +WCC +28 +WString +23 +?????Macro definitions: +1 +29 +WString +78 +QSE_BUILD_DEBUG QSE_AWK_DEFAULT_MODPREFIX="awk-" QSE_AWK_DEFAULT_MODPOSTFIX="" +0 +30 +MCState +31 +WString +3 +WCC +32 +WString 29 ?????Emit Browser information 1 1 -25 +33 WVList 1 -26 +34 ActionStates -27 +35 WString 5 &Make -28 +36 WVList 0 -1 1 1 0 -29 -MItem -28 -../../../../../lib/awk/awk.c -30 -WString -4 -COBJ -31 -WVList -0 -32 -WVList -0 -11 -1 -1 -0 -33 -MItem -28 -../../../../../lib/awk/err.c -34 -WString -4 -COBJ -35 -WVList -0 -36 -WVList -0 -11 -1 -1 -0 37 MItem 28 -../../../../../lib/awk/fnc.c +../../../../../lib/awk/awk.c 38 WString 4 @@ -164,14 +160,14 @@ WVList 40 WVList 0 -11 +19 1 1 0 41 MItem -29 -../../../../../lib/awk/misc.c +28 +../../../../../lib/awk/err.c 42 WString 4 @@ -182,14 +178,14 @@ WVList 44 WVList 0 -11 +19 1 1 0 45 MItem -30 -../../../../../lib/awk/parse.c +28 +../../../../../lib/awk/fnc.c 46 WString 4 @@ -200,14 +196,14 @@ WVList 48 WVList 0 -11 +19 1 1 0 49 MItem -28 -../../../../../lib/awk/rec.c +29 +../../../../../lib/awk/misc.c 50 WString 4 @@ -218,14 +214,14 @@ WVList 52 WVList 0 -11 +19 1 1 0 53 MItem -28 -../../../../../lib/awk/rio.c +30 +../../../../../lib/awk/parse.c 54 WString 4 @@ -236,14 +232,14 @@ WVList 56 WVList 0 -11 +19 1 1 0 57 MItem 28 -../../../../../lib/awk/run.c +../../../../../lib/awk/rec.c 58 WString 4 @@ -254,14 +250,14 @@ WVList 60 WVList 0 -11 +19 1 1 0 61 MItem 28 -../../../../../lib/awk/std.c +../../../../../lib/awk/rio.c 62 WString 4 @@ -272,14 +268,14 @@ WVList 64 WVList 0 -11 +19 1 1 0 65 MItem -29 -../../../../../lib/awk/tree.c +28 +../../../../../lib/awk/run.c 66 WString 4 @@ -290,14 +286,14 @@ WVList 68 WVList 0 -11 +19 1 1 0 69 MItem 28 -../../../../../lib/awk/val.c +../../../../../lib/awk/std.c 70 WString 4 @@ -308,14 +304,14 @@ WVList 72 WVList 0 -11 +19 1 1 0 73 MItem 29 -../../../../../lib/cmn/hton.c +../../../../../lib/awk/tree.c 74 WString 4 @@ -326,50 +322,50 @@ WVList 76 WVList 0 -11 +19 1 1 0 77 MItem -3 -*.h +28 +../../../../../lib/awk/val.c 78 WString -3 -NIL +4 +COBJ 79 WVList 0 80 WVList 0 --1 +19 1 1 0 81 MItem -28 -../../../../../lib/awk/awk.h +29 +../../../../../lib/cmn/hton.c 82 WString -3 -NIL +4 +COBJ 83 WVList 0 84 WVList 0 -77 +19 1 1 0 85 MItem -28 -../../../../../lib/awk/err.h +3 +*.h 86 WString 3 @@ -380,14 +376,14 @@ WVList 88 WVList 0 -77 +-1 1 1 0 89 MItem 28 -../../../../../lib/awk/fnc.h +../../../../../lib/awk/awk.h 90 WString 3 @@ -398,14 +394,14 @@ WVList 92 WVList 0 -77 +85 1 1 0 93 MItem -29 -../../../../../lib/awk/misc.h +28 +../../../../../lib/awk/err.h 94 WString 3 @@ -416,14 +412,14 @@ WVList 96 WVList 0 -77 +85 1 1 0 97 MItem -30 -../../../../../lib/awk/parse.h +28 +../../../../../lib/awk/fnc.h 98 WString 3 @@ -434,14 +430,14 @@ WVList 100 WVList 0 -77 +85 1 1 0 101 MItem -28 -../../../../../lib/awk/rio.h +29 +../../../../../lib/awk/misc.h 102 WString 3 @@ -452,14 +448,14 @@ WVList 104 WVList 0 -77 +85 1 1 0 105 MItem -28 -../../../../../lib/awk/run.h +30 +../../../../../lib/awk/parse.h 106 WString 3 @@ -470,14 +466,14 @@ WVList 108 WVList 0 -77 +85 1 1 0 109 MItem -29 -../../../../../lib/awk/tree.h +28 +../../../../../lib/awk/rio.h 110 WString 3 @@ -488,14 +484,14 @@ WVList 112 WVList 0 -77 +85 1 1 0 113 MItem 28 -../../../../../lib/awk/val.h +../../../../../lib/awk/run.h 114 WString 3 @@ -506,7 +502,43 @@ WVList 116 WVList 0 -77 +85 +1 +1 +0 +117 +MItem +29 +../../../../../lib/awk/tree.h +118 +WString +3 +NIL +119 +WVList +0 +120 +WVList +0 +85 +1 +1 +0 +121 +MItem +28 +../../../../../lib/awk/val.h +122 +WString +3 +NIL +123 +WVList +0 +124 +WVList +0 +85 1 1 0 diff --git a/qse/watcom/debug/os2/mod/awk/awk-dir.tgt b/qse/watcom/debug/os2/mod/awk/awk-dir.tgt index 4b989dd1..ef6e286b 100755 --- a/qse/watcom/debug/os2/mod/awk/awk-dir.tgt +++ b/qse/watcom/debug/os2/mod/awk/awk-dir.tgt @@ -32,7 +32,7 @@ WString ODLL 8 WVList -4 +3 9 MVState 10 @@ -66,54 +66,54 @@ WString qsecmn qseawk 0 17 -MVState +MCState 18 WString 5 WLINK 19 WString -21 -o????Export names(,): -1 -20 -WString -5 -load_ -0 -21 -MCState -22 -WString -5 -WLINK -23 -WString 24 ?????Eliminate dead code 1 1 -24 +20 WVList 0 -1 1 1 0 -25 +21 WPickList 2 -26 +22 MItem 3 *.c -27 +23 WString 4 COBJ -28 +24 WVList 3 +25 +MVState +26 +WString +3 +WCC +27 +WString +25 +o?2??Include directories: +1 +28 +WString +54 +"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include" +0 29 MVState 30 @@ -122,64 +122,48 @@ WString WCC 31 WString -25 -o?2??Include directories: +23 +?????Macro definitions: 1 32 WString -54 -"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include" +15 +QSE_BUILD_DEBUG 0 33 -MVState +MCState 34 WString 3 WCC 35 WString -23 -?????Macro definitions: -1 -36 -WString -15 -QSE_BUILD_DEBUG -0 -37 -MCState -38 -WString -3 -WCC -39 -WString 33 ?????Disable stack depth checking 1 1 -40 +36 WVList 0 -1 1 1 0 -41 +37 MItem 28 ../../../../../mod/awk/dir.c -42 +38 WString 4 COBJ -43 +39 WVList 0 -44 +40 WVList 0 -26 +22 1 1 0 diff --git a/qse/watcom/debug/os2/mod/awk/awk-str.tgt b/qse/watcom/debug/os2/mod/awk/awk-str.tgt index 1b4f2fe2..52547228 100755 --- a/qse/watcom/debug/os2/mod/awk/awk-str.tgt +++ b/qse/watcom/debug/os2/mod/awk/awk-str.tgt @@ -32,7 +32,7 @@ WString ODLL 8 WVList -3 +2 9 MVState 10 @@ -66,42 +66,42 @@ WString qsecmn qseawk 0 17 -MVState -18 -WString -5 -WLINK -19 -WString -21 -o????Export names(,): -1 -20 -WString -5 -load_ -0 -21 WVList 0 -1 1 1 0 -22 +18 WPickList 2 -23 +19 MItem 3 *.c -24 +20 WString 4 COBJ -25 +21 WVList 2 +22 +MVState +23 +WString +3 +WCC +24 +WString +25 +o?2??Include directories: +1 +25 +WString +54 +"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include" +0 26 MVState 27 @@ -110,52 +110,36 @@ WString WCC 28 WString -25 -o?2??Include directories: -1 -29 -WString -54 -"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include" -0 -30 -MVState -31 -WString -3 -WCC -32 -WString 23 ?????Macro definitions: 1 -33 +29 WString 15 QSE_BUILD_DEBUG 0 -34 +30 WVList 0 -1 1 1 0 -35 +31 MItem 28 ../../../../../mod/awk/str.c -36 +32 WString 4 COBJ -37 +33 WVList 0 -38 +34 WVList 0 -23 +19 1 1 0 diff --git a/qse/watcom/debug/os2/mod/awk/awk-sys.tgt b/qse/watcom/debug/os2/mod/awk/awk-sys.tgt index 033758a8..9a8d0bed 100755 --- a/qse/watcom/debug/os2/mod/awk/awk-sys.tgt +++ b/qse/watcom/debug/os2/mod/awk/awk-sys.tgt @@ -32,7 +32,7 @@ WString ODLL 8 WVList -4 +3 9 MVState 10 @@ -66,54 +66,54 @@ WString qsecmn qseawk 0 17 -MVState +MCState 18 WString 5 WLINK 19 WString -21 -o????Export names(,): -1 -20 -WString -5 -load_ -0 -21 -MCState -22 -WString -5 -WLINK -23 -WString 24 ?????Eliminate dead code 1 1 -24 +20 WVList 0 -1 1 1 0 -25 +21 WPickList 2 -26 +22 MItem 3 *.c -27 +23 WString 4 COBJ -28 +24 WVList 3 +25 +MVState +26 +WString +3 +WCC +27 +WString +25 +o?2??Include directories: +1 +28 +WString +54 +"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include" +0 29 MVState 30 @@ -122,64 +122,48 @@ WString WCC 31 WString -25 -o?2??Include directories: +23 +?????Macro definitions: 1 32 WString -54 -"$(%watcom)/h;$(%watcom)/h/os2;../../../../../include" +15 +QSE_BUILD_DEBUG 0 33 -MVState +MCState 34 WString 3 WCC 35 WString -23 -?????Macro definitions: -1 -36 -WString -15 -QSE_BUILD_DEBUG -0 -37 -MCState -38 -WString -3 -WCC -39 -WString 33 ?????Disable stack depth checking 1 1 -40 +36 WVList 0 -1 1 1 0 -41 +37 MItem 28 ../../../../../mod/awk/sys.c -42 +38 WString 4 COBJ -43 +39 WVList 0 -44 +40 WVList 0 -26 +22 1 1 0 diff --git a/qse/watcom/qse.wpj b/qse/watcom/qse.wpj index 0b2e1617..c66aa6b7 100755 --- a/qse/watcom/qse.wpj +++ b/qse/watcom/qse.wpj @@ -4,10 +4,10 @@ projectIdent VpeMain 1 WRect -124 -282 -9318 -9674 +117 +273 +9311 +9664 2 MProject 3 @@ -100,10 +100,10 @@ WVList VComponent 26 WRect -1067 -2516 -5697 -4232 +1060 +2506 +5690 +4222 1 0 27 @@ -116,10 +116,10 @@ release/os2/lib/cmn/qsecmn.tgt VComponent 29 WRect -87 -1238 -5697 -4232 +80 +1228 +5690 +4222 1 0 30 @@ -132,10 +132,10 @@ release/os2/lib/sed/qsesed.tgt VComponent 32 WRect -2099 -1394 -5697 -4232 +2091 +1384 +5690 +4222 1 0 33 @@ -148,10 +148,10 @@ release/os2/cmd/sed/qsesed.tgt VComponent 35 WRect -2823 -341 -5697 -4232 +2816 +331 +5690 +4222 1 0 36 @@ -164,10 +164,10 @@ debug/os2/lib/cmn/qsecmn.tgt VComponent 38 WRect -1045 -2350 -5697 -4232 +1038 +2340 +5690 +4222 1 0 39 @@ -180,11 +180,11 @@ debug/os2/lib/sed/qsesed.tgt VComponent 41 WRect -416 -312 -5697 -4232 -1 +409 +302 +5690 +4222 +0 0 42 WFileName @@ -196,10 +196,10 @@ debug/os2/lib/awk/qseawk.tgt VComponent 44 WRect -329 -399 -5697 -4232 +321 +390 +5690 +4222 1 0 45 @@ -212,10 +212,10 @@ debug/os2/cmd/awk/qseawk.tgt VComponent 47 WRect -2669 --360 -5697 -4232 +2662 +0 +5690 +4222 1 0 48 @@ -228,26 +228,26 @@ debug/dos32/lib/cmn/qsecmn.tgt VComponent 50 WRect -1616 -955 -5697 -4232 -1 +2925 +1277 +5690 +4222 +0 0 51 WFileName 30 debug/dos32/lib/awk/qseawk.tgt 0 -4 +0 52 VComponent 53 WRect 0 -195 -5697 -4232 +185 +5690 +4222 1 0 54 @@ -262,8 +262,8 @@ VComponent WRect 0 0 -5697 -4232 +5690 +4222 1 0 57 @@ -276,10 +276,10 @@ debug/dos32/lib/sed/qsesed.tgt VComponent 59 WRect -577 -555 -5697 -4232 +570 +546 +5690 +4222 1 0 60 @@ -294,8 +294,8 @@ VComponent WRect 0 0 -5697 -4232 +5690 +4222 1 0 63 @@ -308,10 +308,10 @@ debug/os2/cmd/sed/qsesed.tgt VComponent 65 WRect -2603 -1072 -5697 -4232 +2596 +1063 +5690 +4222 1 0 66 @@ -319,15 +319,15 @@ WFileName 31 debug/dos32/mod/awk/awk-sys.tgt 0 -1 +0 67 VComponent 68 WRect -1133 -224 -5697 -4232 +1126 +214 +5690 +4222 1 0 69 @@ -340,10 +340,10 @@ debug/os2/mod/awk/awk-sys.tgt VComponent 71 WRect -468 -3062 -5697 -4252 +460 +3052 +5690 +4242 1 0 72 @@ -351,15 +351,15 @@ WFileName 29 debug/os2/mod/awk/awk-dir.tgt 0 -1 +0 73 VComponent 74 WRect -577 -565 -5697 -4252 +570 +555 +5690 +4242 1 0 75 @@ -372,10 +372,10 @@ debug/dos32/mod/awk/awk-dir.tgt VComponent 77 WRect -212 204 -5712 -4330 +195 +5705 +4320 1 0 78 @@ -388,10 +388,10 @@ debug/dos32/mod/awk/awk-str.tgt VComponent 80 WRect -424 -1394 -5712 -4330 +416 +1384 +5705 +4320 1 0 81 @@ -399,5 +399,5 @@ WFileName 29 debug/os2/mod/awk/awk-str.tgt 0 -1 -34 +0 +49