From 36b20b41698b523069b156350830a870432159d3 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 8 Jul 2014 14:30:42 +0000 Subject: [PATCH] renamed qse_xstr_t to qse_cstr_t --- qse/cmd/awk/awk.c | 6 +-- qse/cmd/http/httpd.c | 2 +- qse/cmd/sed/sed.c | 4 +- qse/cmd/xli/xli.c | 2 +- qse/include/qse/Types.hpp | 2 +- qse/include/qse/awk/Awk.hpp | 14 +++---- qse/include/qse/awk/StdAwk.hpp | 2 +- qse/include/qse/awk/awk.h | 42 +++++++++---------- qse/include/qse/awk/stdawk.h | 2 +- qse/include/qse/cmn/glob.h | 2 +- qse/include/qse/cmn/htb.h | 4 +- qse/include/qse/cmn/mbwc.h | 4 +- qse/include/qse/cmn/rbt.h | 4 +- qse/include/qse/cmn/rex.h | 12 +++--- qse/include/qse/cmn/str.h | 70 +++++++++++++++---------------- qse/include/qse/cmn/uri.h | 32 +++++++------- qse/include/qse/http/htrd.h | 2 +- qse/include/qse/http/htre.h | 4 +- qse/include/qse/http/http.h | 4 +- qse/include/qse/http/stdhttpd.h | 2 +- qse/include/qse/sed/Sed.hpp | 2 +- qse/include/qse/sed/sed.h | 18 ++++---- qse/include/qse/sed/stdsed.h | 8 ++-- qse/include/qse/types.h | 16 +++---- qse/include/qse/xli/stdxli.h | 2 +- qse/include/qse/xli/xli.h | 10 ++--- qse/lib/awk/Awk.cpp | 14 +++---- qse/lib/awk/StdAwk.cpp | 12 +++--- qse/lib/awk/awk.c | 6 +-- qse/lib/awk/awk.h | 16 +++---- qse/lib/awk/err.c | 8 ++-- qse/lib/awk/fnc.c | 26 ++++++------ qse/lib/awk/fnc.h | 2 +- qse/lib/awk/misc.c | 28 ++++++------- qse/lib/awk/misc.h | 20 ++++----- qse/lib/awk/mod-dir.c | 2 +- qse/lib/awk/mod-math.c | 2 +- qse/lib/awk/mod-mpi.c | 2 +- qse/lib/awk/mod-sed.c | 8 ++-- qse/lib/awk/mod-str.c | 8 ++-- qse/lib/awk/mod-sys.c | 2 +- qse/lib/awk/mod-uci.c | 6 +-- qse/lib/awk/parse.c | 74 ++++++++++++++++----------------- qse/lib/awk/parse.h | 2 +- qse/lib/awk/rec.c | 8 ++-- qse/lib/awk/rio.c | 6 +-- qse/lib/awk/run.c | 20 ++++----- qse/lib/awk/std.c | 20 ++++----- qse/lib/awk/tree.c | 6 +-- qse/lib/awk/tree.h | 6 +-- qse/lib/awk/val.c | 30 ++++++------- qse/lib/cmn/fs.c | 2 +- qse/lib/cmn/glob.c | 2 +- qse/lib/cmn/mbwc-str.c | 2 +- qse/lib/cmn/mbwc.c | 2 +- qse/lib/cmn/nwad.c | 4 +- qse/lib/cmn/rex.c | 12 +++--- qse/lib/cmn/str-dup.c | 8 ++-- qse/lib/cmn/str-dyn.c | 8 ++-- qse/lib/cmn/str-dyn.h | 4 +- qse/lib/cmn/str-fcpy.c | 8 ++-- qse/lib/cmn/str-fcpy.h | 4 +- qse/lib/cmn/str-subst.c | 8 ++-- qse/lib/cmn/str-subst.h | 8 ++-- qse/lib/cmn/str-tok.c | 12 +++--- qse/lib/http/htrd.c | 8 ++-- qse/lib/http/htre.c | 4 +- qse/lib/http/http.c | 2 +- qse/lib/http/httpd-cgi.c | 10 ++--- qse/lib/http/httpd-dir.c | 16 +++---- qse/lib/http/httpd-file.c | 4 +- qse/lib/http/httpd-std.c | 2 +- qse/lib/sed/Sed.cpp | 2 +- qse/lib/sed/StdSed.cpp | 8 ++-- qse/lib/sed/err.c | 4 +- qse/lib/sed/sed.c | 34 +++++++-------- qse/lib/sed/sed.h | 4 +- qse/lib/sed/std.c | 24 +++++------ qse/lib/xli/err.c | 4 +- qse/lib/xli/read.c | 26 ++++++------ qse/lib/xli/std.c | 16 +++---- qse/lib/xli/xli.c | 28 ++++++------- qse/samples/awk/awk07.c | 4 +- qse/samples/cmn/htb.c | 4 +- qse/samples/cmn/rbt.c | 4 +- qse/samples/cmn/rex01.c | 4 +- qse/samples/cmn/str01.c | 4 +- qse/samples/sed/sed03.c | 2 +- 88 files changed, 454 insertions(+), 454 deletions(-) diff --git a/qse/cmd/awk/awk.c b/qse/cmd/awk/awk.c index df6fa310..47ad5e86 100644 --- a/qse/cmd/awk/awk.c +++ b/qse/cmd/awk/awk.c @@ -101,7 +101,7 @@ struct arg_t struct gvmv_t { int idx; - qse_xstr_t str; + qse_cstr_t str; }; static void dprint (const qse_char_t* fmt, ...) @@ -434,7 +434,7 @@ static void print_usage (qse_sio_t* out, const qse_char_t* argv0) /* ---------------------------------------------------------------------- */ -static int collect_into_xarg (const qse_xstr_t* path, void* ctx) +static int collect_into_xarg (const qse_cstr_t* path, void* ctx) { xarg_t* xarg = (xarg_t*)ctx; @@ -477,7 +477,7 @@ static void purge_xarg (xarg_t* xarg) static int expand_wildcard (int argc, qse_char_t* argv[], int glob, xarg_t* xarg) { int i; - qse_xstr_t tmp; + qse_cstr_t tmp; for (i = 0; i < argc; i++) { diff --git a/qse/cmd/http/httpd.c b/qse/cmd/http/httpd.c index 2d12aebf..b53bf392 100644 --- a/qse/cmd/http/httpd.c +++ b/qse/cmd/http/httpd.c @@ -146,7 +146,7 @@ struct access_t typedef struct loccfg_t loccfg_t; struct loccfg_t { - qse_mxstr_t locname; + qse_mcstr_t locname; qse_mchar_t* xcfg[XCFG_MAX]; int root_is_nwad; diff --git a/qse/cmd/sed/sed.c b/qse/cmd/sed/sed.c index 3d20086d..eaccd45d 100644 --- a/qse/cmd/sed/sed.c +++ b/qse/cmd/sed/sed.c @@ -603,7 +603,7 @@ struct xarg_t typedef struct xarg_t xarg_t; -static int collect_into_xarg (const qse_xstr_t* path, void* ctx) +static int collect_into_xarg (const qse_cstr_t* path, void* ctx) { xarg_t* xarg = (xarg_t*)ctx; @@ -644,7 +644,7 @@ static void purge_xarg (xarg_t* xarg) static int expand_wildcards (int argc, qse_char_t* argv[], int glob, xarg_t* xarg) { int i; - qse_xstr_t tmp; + qse_cstr_t tmp; for (i = 0; i < argc; i++) { diff --git a/qse/cmd/xli/xli.c b/qse/cmd/xli/xli.c index 116d060b..e76f121c 100644 --- a/qse/cmd/xli/xli.c +++ b/qse/cmd/xli/xli.c @@ -516,7 +516,7 @@ for (i = 0; i < QSE_COUNTOF(defs); i++) qse_xli_definepair (xli, defs[i].name, & } { - static const qse_xstr_t strs[] = + static const qse_cstr_t strs[] = { { QSE_T("hello"), 5 }, { QSE_T("xli"), 3 }, diff --git a/qse/include/qse/Types.hpp b/qse/include/qse/Types.hpp index 7acb6cc6..c454ddba 100644 --- a/qse/include/qse/Types.hpp +++ b/qse/include/qse/Types.hpp @@ -71,7 +71,7 @@ public: typedef qse_flt_t flt_t; /** redefines a structure of a character pointer and length */ - typedef qse_xstr_t xstr_t; + typedef qse_cstr_t cstr_t; }; ///////////////////////////////// diff --git a/qse/include/qse/awk/Awk.hpp b/qse/include/qse/awk/Awk.hpp index 0ea433db..f112bb18 100644 --- a/qse/include/qse/awk/Awk.hpp +++ b/qse/include/qse/awk/Awk.hpp @@ -146,7 +146,7 @@ public: /// void setError ( errnum_t code, ///< error code - const xstr_t* args = QSE_NULL, ///< message formatting + const cstr_t* args = QSE_NULL, ///< message formatting /// argument array const loc_t* loc = QSE_NULL ///< error location ); @@ -525,7 +525,7 @@ public: /// /// The Index class encapsulates an index of an arrayed value. /// - class QSE_EXPORT Index: protected qse_xstr_t + class QSE_EXPORT Index: protected qse_cstr_t { public: friend class Value; @@ -544,13 +544,13 @@ public: this->len = len; } - void set (const qse_xstr_t* x) + void set (const qse_cstr_t* x) { this->ptr = x->ptr; this->len = x->len; } - Index& operator= (const qse_xstr_t* x) + Index& operator= (const qse_cstr_t* x) { this->set (x); return *this; @@ -821,7 +821,7 @@ public: mutable struct { - qse_xstr_t str; + qse_cstr_t str; } cached; public: @@ -858,7 +858,7 @@ public: void setError ( errnum_t code, - const xstr_t* args = QSE_NULL, + const cstr_t* args = QSE_NULL, const loc_t* loc = QSE_NULL ); @@ -1335,7 +1335,7 @@ protected: int add (awk_t* awk, const char_t* arg, size_t len); void clear (awk_t* awk); - qse_xstr_t* ptr; + qse_cstr_t* ptr; size_t len; size_t capa; }; diff --git a/qse/include/qse/awk/StdAwk.hpp b/qse/include/qse/awk/StdAwk.hpp index 24f31cc9..9f32ab95 100644 --- a/qse/include/qse/awk/StdAwk.hpp +++ b/qse/include/qse/awk/StdAwk.hpp @@ -59,7 +59,7 @@ public: protected: const char_t* name; - qse_xstr_t dir; + qse_cstr_t dir; qse_cmgr_t* cmgr; }; diff --git a/qse/include/qse/awk/awk.h b/qse/include/qse/awk/awk.h index f3603e4a..23dde2f8 100644 --- a/qse/include/qse/awk/awk.h +++ b/qse/include/qse/awk/awk.h @@ -193,7 +193,7 @@ typedef struct qse_awk_val_flt_t qse_awk_val_flt_t; struct qse_awk_val_str_t { QSE_AWK_VAL_HDR; - qse_xstr_t val; + qse_cstr_t val; }; typedef struct qse_awk_val_str_t qse_awk_val_str_t; @@ -204,7 +204,7 @@ typedef struct qse_awk_val_str_t qse_awk_val_str_t; struct qse_awk_val_rex_t { QSE_AWK_VAL_HDR; - qse_xstr_t str; + qse_cstr_t str; void* code[2]; }; typedef struct qse_awk_val_rex_t qse_awk_val_rex_t; @@ -271,7 +271,7 @@ typedef struct qse_awk_val_map_itr_t qse_awk_val_map_itr_t; * of a map value. */ #define QSE_AWK_VAL_MAP_ITR_KEY(itr) \ - ((const qse_xstr_t*)QSE_HTB_KPTL((itr)->pair)) + ((const qse_cstr_t*)QSE_HTB_KPTL((itr)->pair)) /** * The #QSE_AWK_VAL_MAP_ITR_VAL macro get the pointer to the value part @@ -308,7 +308,7 @@ typedef enum qse_awk_val_map_data_type_t qse_awk_val_map_data_type_t; */ struct qse_awk_val_map_data_t { - qse_xstr_t key; + qse_cstr_t key; qse_awk_val_map_data_type_t type; void* vptr; }; @@ -403,7 +403,7 @@ struct qse_awk_nde_t */ struct qse_awk_fun_t { - qse_xstr_t name; + qse_cstr_t name; qse_size_t nargs; qse_awk_nde_t* body; }; @@ -810,7 +810,7 @@ typedef struct qse_awk_mod_sym_t qse_awk_mod_sym_t; struct qse_awk_fnc_info_t { - qse_xstr_t name; + qse_cstr_t name; /** #QSE_NULL if the function is not registered from module */ qse_awk_mod_t* mod; @@ -1411,9 +1411,9 @@ struct qse_awk_rtx_valtostr_out_t union { - qse_xstr_t cpl; - qse_xstr_t cplcpy; - qse_xstr_t cpldup; /* need to free cpldup.ptr */ + qse_cstr_t cpl; + qse_cstr_t cplcpy; + qse_cstr_t cpldup; /* need to free cpldup.ptr */ qse_str_t* strp; qse_str_t* strpcat; } u; @@ -1600,7 +1600,7 @@ QSE_EXPORT void qse_awk_geterrinf ( QSE_EXPORT void qse_awk_seterrnum ( qse_awk_t* awk, /**< awk */ qse_awk_errnum_t errnum, /**< error number */ - const qse_xstr_t* errarg /**< argument array for formatting + const qse_cstr_t* errarg /**< argument array for formatting * an error message */ ); @@ -1630,7 +1630,7 @@ QSE_EXPORT void qse_awk_geterror ( QSE_EXPORT void qse_awk_seterror ( qse_awk_t* awk, /**< awk */ qse_awk_errnum_t errnum, /**< error number */ - const qse_xstr_t* errarg, /**< argument array for formatting + const qse_cstr_t* errarg, /**< argument array for formatting * an error message */ const qse_awk_loc_t* errloc /**< error location */ ); @@ -1851,7 +1851,7 @@ QSE_EXPORT qse_char_t* qse_awk_strxdup ( */ QSE_EXPORT qse_char_t* qse_awk_cstrdup ( qse_awk_t* awk, /**< awk */ - const qse_xstr_t* str /**< string */ + const qse_cstr_t* str /**< string */ ); /** @@ -2078,7 +2078,7 @@ QSE_EXPORT qse_awk_val_t* qse_awk_rtx_getarg ( * pointer to the internal value of SUBSEP. It's a specialized * version of qse_awk_rtx_getgbl (rtx, QSE_AWK_GBL_SUBSEP). */ -QSE_EXPORT const qse_xstr_t* qse_awk_rtx_getsubsep ( +QSE_EXPORT const qse_cstr_t* qse_awk_rtx_getsubsep ( qse_awk_rtx_t* rtx /**< runtime context */ ); @@ -2223,7 +2223,7 @@ QSE_EXPORT void qse_awk_rtx_geterror ( QSE_EXPORT void qse_awk_rtx_seterrnum ( qse_awk_rtx_t* rtx, /**< runtime context */ qse_awk_errnum_t errnum, /**< error number */ - const qse_xstr_t* errarg /**< arguments to format error message */ + const qse_cstr_t* errarg /**< arguments to format error message */ ); /** @@ -2240,7 +2240,7 @@ QSE_EXPORT void qse_awk_rtx_seterrinf ( QSE_EXPORT void qse_awk_rtx_seterror ( qse_awk_rtx_t* rtx, /**< runtime context */ qse_awk_errnum_t errnum, /**< error number */ - const qse_xstr_t* errarg, /**< argument array for formatting + const qse_cstr_t* errarg, /**< argument array for formatting * an error message */ const qse_awk_loc_t* errloc /**< error line */ ); @@ -2261,7 +2261,7 @@ QSE_EXPORT int qse_awk_rtx_clrrec ( QSE_EXPORT int qse_awk_rtx_setrec ( qse_awk_rtx_t* rtx, /**< runtime context */ qse_size_t idx, /**< 0 for $0, N for $N */ - const qse_xstr_t* str /**< string */ + const qse_cstr_t* str /**< string */ ); /** @@ -2336,17 +2336,17 @@ QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithwcs ( */ QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithxstr ( qse_awk_rtx_t* rtx, - const qse_xstr_t* str + const qse_cstr_t* str ); QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithmxstr ( qse_awk_rtx_t* rtx, - const qse_mxstr_t* mxstr + const qse_mcstr_t* mxstr ); QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithwxstr ( qse_awk_rtx_t* rtx, - const qse_wxstr_t* wxstr + const qse_wcstr_t* wxstr ); /** @@ -2392,7 +2392,7 @@ QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makenstrvalwithstr ( */ QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makenstrvalwithxstr ( qse_awk_rtx_t* rtx, - const qse_xstr_t* str + const qse_cstr_t* str ); /** @@ -2401,7 +2401,7 @@ QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makenstrvalwithxstr ( */ QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makerexval ( qse_awk_rtx_t* rtx, - const qse_xstr_t* str, + const qse_cstr_t* str, void* code[2] ); diff --git a/qse/include/qse/awk/stdawk.h b/qse/include/qse/awk/stdawk.h index 4a06d9e2..4cc9c99d 100644 --- a/qse/include/qse/awk/stdawk.h +++ b/qse/include/qse/awk/stdawk.h @@ -79,7 +79,7 @@ struct qse_awk_parsestd_t * ptr field with qse_awk_freemem() once you're done with it to * avoid memory leaks. */ - qse_xstr_t str; + qse_cstr_t str; } u; }; diff --git a/qse/include/qse/cmn/glob.h b/qse/include/qse/cmn/glob.h index 329b8941..67f81af3 100644 --- a/qse/include/qse/cmn/glob.h +++ b/qse/include/qse/cmn/glob.h @@ -30,7 +30,7 @@ */ typedef int (*qse_glob_cbimpl_t) ( - const qse_xstr_t* path, + const qse_cstr_t* path, void* cbctx ); diff --git a/qse/include/qse/cmn/htb.h b/qse/include/qse/cmn/htb.h index 4ea1b163..49af8114 100644 --- a/qse/include/qse/cmn/htb.h +++ b/qse/include/qse/cmn/htb.h @@ -488,7 +488,7 @@ QSE_EXPORT qse_htb_pair_t* qse_htb_update ( * qse_htb_t* htb, qse_htb_pair_t* pair, * void* kptr, qse_size_t klen, void* ctx) * { - * qse_xstr_t* v = (qse_xstr_t*)ctx; + * qse_cstr_t* v = (qse_cstr_t*)ctx; * if (pair == QSE_NULL) * { * // no existing key for the key @@ -540,7 +540,7 @@ QSE_EXPORT qse_htb_pair_t* qse_htb_update ( * * for (i = 0; i < QSE_COUNTOF(vals); i++) * { - * qse_xstr_t ctx; + * qse_cstr_t ctx; * ctx.ptr = vals[i]; ctx.len = qse_strlen(vals[i]); * qse_htb_cbsert (s1, * keys[i%QSE_COUNTOF(keys)], qse_strlen(keys[i%QSE_COUNTOF(keys)]), diff --git a/qse/include/qse/cmn/mbwc.h b/qse/include/qse/cmn/mbwc.h index e5e5ece5..52e03f10 100644 --- a/qse/include/qse/cmn/mbwc.h +++ b/qse/include/qse/cmn/mbwc.h @@ -240,7 +240,7 @@ QSE_EXPORT qse_mchar_t* qse_wcsatombsdupwithcmgr ( QSE_EXPORT qse_mchar_t* qse_wcsnatombsdupwithcmgr ( - const qse_wxstr_t wcs[], + const qse_wcstr_t wcs[], qse_size_t* mbslen, qse_mmgr_t* mmgr, qse_cmgr_t* cmgr @@ -454,7 +454,7 @@ QSE_EXPORT qse_mchar_t* qse_wcsatombsdup ( ); QSE_EXPORT qse_mchar_t* qse_wcsnatombsdup ( - const qse_wxstr_t wcs[], + const qse_wcstr_t wcs[], qse_size_t* mbslen, qse_mmgr_t* mmgr ); diff --git a/qse/include/qse/cmn/rbt.h b/qse/include/qse/cmn/rbt.h index 77903dd4..01e90564 100644 --- a/qse/include/qse/cmn/rbt.h +++ b/qse/include/qse/cmn/rbt.h @@ -438,7 +438,7 @@ QSE_EXPORT qse_rbt_pair_t* qse_rbt_update ( * qse_rbt_t* rbt, qse_rbt_pair_t* pair, * void* kptr, qse_size_t klen, void* ctx) * { - * qse_xstr_t* v = (qse_xstr_t*)ctx; + * qse_cstr_t* v = (qse_cstr_t*)ctx; * if (pair == QSE_NULL) * { * // no existing key for the key @@ -490,7 +490,7 @@ QSE_EXPORT qse_rbt_pair_t* qse_rbt_update ( * * for (i = 0; i < QSE_COUNTOF(vals); i++) * { - * qse_xstr_t ctx; + * qse_cstr_t ctx; * ctx.ptr = vals[i]; ctx.len = qse_strlen(vals[i]); * qse_rbt_cbsert (s1, * keys[i%QSE_COUNTOF(keys)], qse_strlen(keys[i%QSE_COUNTOF(keys)]), diff --git a/qse/include/qse/cmn/rex.h b/qse/include/qse/cmn/rex.h index 7180e71d..a555d808 100644 --- a/qse/include/qse/cmn/rex.h +++ b/qse/include/qse/cmn/rex.h @@ -276,9 +276,9 @@ QSE_EXPORT qse_rex_node_t* qse_rex_comp ( QSE_EXPORT int qse_rex_exec ( qse_rex_t* rex, - const qse_xstr_t* str, - const qse_xstr_t* substr, - qse_xstr_t* matstr + const qse_cstr_t* str, + const qse_cstr_t* substr, + qse_cstr_t* matstr ); @@ -296,9 +296,9 @@ QSE_EXPORT int qse_matchrex ( qse_size_t depth, void* code, int option, - const qse_xstr_t* str, - const qse_xstr_t* substr, - qse_xstr_t* match, + const qse_cstr_t* str, + const qse_cstr_t* substr, + qse_cstr_t* match, qse_rex_errnum_t* errnum ); diff --git a/qse/include/qse/cmn/str.h b/qse/include/qse/cmn/str.h index a7de428c..f46e122b 100644 --- a/qse/include/qse/cmn/str.h +++ b/qse/include/qse/cmn/str.h @@ -28,7 +28,7 @@ /** \file * This file provides various functions, types, macros for string manipulation. * - * The #qse_xstr_t type and the #qse_xstr_t defined in help you + * The #qse_cstr_t type and the #qse_cstr_t defined in help you * deal with a string pointer and length in a structure. */ @@ -76,7 +76,7 @@ typedef qse_size_t (*qse_wcs_sizer_t) ( ); #if defined(QSE_CHAR_IS_MCHAR) -# define QSE_STR_XSTR(s) ((qse_xstr_t*)QSE_MBS_XSTR(s)) +# define QSE_STR_XSTR(s) ((qse_cstr_t*)QSE_MBS_XSTR(s)) # define QSE_STR_LEN(s) QSE_MBS_LEN(s) # define QSE_STR_PTR(s) QSE_MBS_PTR(s) # define QSE_STR_CPTR(s,idx) QSE_MBS_CPTR(s,idx) @@ -86,7 +86,7 @@ typedef qse_size_t (*qse_wcs_sizer_t) ( # define qse_str_t qse_mbs_t # define qse_str_sizer_t qse_mbs_sizer_t #else -# define QSE_STR_XSTR(s) ((qse_xstr_t*)QSE_WCS_XSTR(s)) +# define QSE_STR_XSTR(s) ((qse_cstr_t*)QSE_WCS_XSTR(s)) # define QSE_STR_LEN(s) QSE_WCS_LEN(s) # define QSE_STR_PTR(s) QSE_WCS_PTR(s) # define QSE_STR_CPTR(s,idx) QSE_WCS_CPTR(s,idx) @@ -105,7 +105,7 @@ struct qse_mbs_t { qse_mmgr_t* mmgr; qse_mbs_sizer_t sizer; /**< buffer resizer function */ - qse_mxstr_t val; /**< buffer/string pointer and lengh */ + qse_mcstr_t val; /**< buffer/string pointer and lengh */ qse_size_t capa; /**< buffer capacity */ }; @@ -116,7 +116,7 @@ struct qse_wcs_t { qse_mmgr_t* mmgr; qse_wcs_sizer_t sizer; /**< buffer resizer function */ - qse_wxstr_t val; /**< buffer/string pointer and lengh */ + qse_wcstr_t val; /**< buffer/string pointer and lengh */ qse_size_t capa; /**< buffer capacity */ }; @@ -131,7 +131,7 @@ struct qse_wcs_t typedef qse_mchar_t* (*qse_mbssubst_t) ( qse_mchar_t* buf, qse_size_t bsz, - const qse_mxstr_t* ident, + const qse_mcstr_t* ident, void* ctx ); @@ -142,7 +142,7 @@ typedef qse_mchar_t* (*qse_mbssubst_t) ( typedef qse_wchar_t* (*qse_wcssubst_t) ( qse_wchar_t* buf, qse_size_t bsz, - const qse_wxstr_t* ident, + const qse_wcstr_t* ident, void* ctx ); @@ -585,25 +585,25 @@ QSE_EXPORT qse_size_t qse_wcsfcpy ( /** * The qse_mbsfncpy() function formats a string by position. * It differs from qse_mbsfcpy() in that \a str is an array of the - * #qse_mxstr_t type. + * #qse_mcstr_t type. * \sa qse_mbsfcpy, qse_mbsxfcpy, qse_mbsxfncpy */ QSE_EXPORT qse_size_t qse_mbsfncpy ( qse_mchar_t* buf, const qse_mchar_t* fmt, - const qse_mxstr_t str[] + const qse_mcstr_t str[] ); /** * The qse_wcsfncpy() function formats a string by position. * It differs from qse_wcsfcpy() in that \a str is an array of the - * #qse_wxstr_t type. + * #qse_wcstr_t type. * \sa qse_wcsfcpy, qse_wcsxfcpy, qse_wcsxfncpy */ QSE_EXPORT qse_size_t qse_wcsfncpy ( qse_wchar_t* buf, const qse_wchar_t* fmt, - const qse_wxstr_t str[] + const qse_wcstr_t str[] ); /** @@ -645,27 +645,27 @@ QSE_EXPORT qse_size_t qse_wcsxfcpy ( /** * The qse_mbsxfncpy() function formats a string by position. * It differs from qse_strfcpy() in that \a buf is length-bounded of \a bsz - * characters and \a str is an array of the #qse_mxstr_t type. + * characters and \a str is an array of the #qse_mcstr_t type. * \sa qse_mbsfcpy, qse_mbsfncpy, qse_mbsxfcpy */ QSE_EXPORT qse_size_t qse_mbsxfncpy ( qse_mchar_t* buf, qse_size_t bsz, const qse_mchar_t* fmt, - const qse_mxstr_t str[] + const qse_mcstr_t str[] ); /** * The qse_wcsxfncpy() function formats a string by position. * It differs from qse_strfcpy() in that \a buf is length-bounded of \a bsz - * characters and \a str is an array of the #qse_wxstr_t type. + * characters and \a str is an array of the #qse_wcstr_t type. * \sa qse_wcsfcpy, qse_wcsfncpy, qse_wcsxfcpy */ QSE_EXPORT qse_size_t qse_wcsxfncpy ( qse_wchar_t* buf, qse_size_t bsz, const qse_wchar_t* fmt, - const qse_wxstr_t str[] + const qse_wcstr_t str[] ); #if defined(QSE_CHAR_IS_MCHAR) @@ -781,7 +781,7 @@ QSE_EXPORT qse_size_t qse_wcsxvfmt ( * \a bsz by substituting new values for ${} segments within it. The actual * substitution is made by invoking the callback function \a subst. * \code - * qse_mchar_t* subst (qse_mchar_t* buf, qse_size_t bsz, const qse_mxstr_t* ident, void* ctx) + * qse_mchar_t* subst (qse_mchar_t* buf, qse_size_t bsz, const qse_mcstr_t* ident, void* ctx) * { * if (qse_mbsxcmp (ident->ptr, ident->len, QSE_MT("USER")) == 0) * return buf + qse_mbsxput (buf, bsz, QSE_MT("sam")); @@ -803,7 +803,7 @@ QSE_EXPORT qse_size_t qse_wcsxvfmt ( * if the buffer points to #QSE_MBSSUBST_NOBUF as shown belown. * * \code - * qse_mchar_t* subst (qse_mchar_t* buf, qse_size_t bsz, const qse_mxstr_t* ident, void* ctx) + * qse_mchar_t* subst (qse_mchar_t* buf, qse_size_t bsz, const qse_mcstr_t* ident, void* ctx) * { * if (qse_mcsxcmp (ident->ptr, ident->len, QSE_MT("USER")) == 0) * return buf + (buf == QSE_MBSSUBST_NOBUF? 3: qse_mcsxput (buf, bsz, QSE_MT("sam"))); @@ -823,7 +823,7 @@ QSE_EXPORT qse_size_t qse_wcsxvfmt ( * recursively. * * \code - * qse_mchar_t* subst (qse_mchar_t* buf, qse_size_t bsz, const qse_mxstr_t* ident, void* ctx) + * qse_mchar_t* subst (qse_mchar_t* buf, qse_size_t bsz, const qse_mcstr_t* ident, void* ctx) * { * if (qse_mbsxcmp (ident->ptr, ident->len, QSE_MT("USER")) == 0) * return QSE_NULL; @@ -855,7 +855,7 @@ QSE_EXPORT qse_size_t qse_mbsxnsubst ( * \a bsz by substituting new values for ${} segments within it. The actual * substitution is made by invoking the callback function \a subst. * \code - * qse_wchar_t* subst (qse_wchar_t* buf, qse_size_t bsz, const qse_wxstr_t* ident, void* ctx) + * qse_wchar_t* subst (qse_wchar_t* buf, qse_size_t bsz, const qse_wcstr_t* ident, void* ctx) * { * if (qse_wcsxcmp (ident->ptr, ident->len, QSE_WT("USER")) == 0) * return buf + qse_wcsxput (buf, bsz, QSE_WT("sam")); @@ -876,7 +876,7 @@ QSE_EXPORT qse_size_t qse_mbsxnsubst ( * above can be extended to return the buffer pointer without actual copying * * \code - * qse_mchar_t* subst (qse_mchar_t* buf, qse_size_t bsz, const qse_wxstr_t* ident, void* ctx) + * qse_mchar_t* subst (qse_mchar_t* buf, qse_size_t bsz, const qse_wcstr_t* ident, void* ctx) * { * if (qse_wcsxcmp (ident->ptr, ident->len, QSE_WT("USER")) == 0) * return buf + (buf == QSE_WCSSUBST_NOBUF? 3: qse_wcsxput (buf, bsz, QSE_WT("sam"))); @@ -896,7 +896,7 @@ QSE_EXPORT qse_size_t qse_mbsxnsubst ( * recursively. * * \code - * qse_mchar_t* subst (qse_mchar_t* buf, qse_size_t bsz, const qse_wxstr_t* ident, void* ctx) + * qse_mchar_t* subst (qse_mchar_t* buf, qse_size_t bsz, const qse_wcstr_t* ident, void* ctx) * { * if (qse_wcsxcmp (ident->ptr, ident->len, QSE_WT("USER")) == 0) * return QSE_NULL; @@ -1288,23 +1288,23 @@ QSE_EXPORT qse_wchar_t* qse_wcsadup ( #endif QSE_EXPORT qse_mchar_t* qse_mcstrdup ( - const qse_mxstr_t* str, + const qse_mcstr_t* str, qse_mmgr_t* mmgr ); QSE_EXPORT qse_mchar_t* qse_mcstradup ( - const qse_mxstr_t str[], + const qse_mcstr_t str[], qse_size_t* len, qse_mmgr_t* mmgr ); QSE_EXPORT qse_wchar_t* qse_wcstrdup ( - const qse_wxstr_t* str, + const qse_wcstr_t* str, qse_mmgr_t* mmgr ); QSE_EXPORT qse_wchar_t* qse_wcstradup ( - const qse_wxstr_t str[], + const qse_wcstr_t str[], qse_size_t* len, qse_mmgr_t* mmgr ); @@ -2284,14 +2284,14 @@ QSE_EXPORT int qse_wcsspltrn ( QSE_EXPORT qse_mchar_t* qse_mbstok ( const qse_mchar_t* s, const qse_mchar_t* delim, - qse_mxstr_t* tok + qse_mcstr_t* tok ); QSE_EXPORT qse_mchar_t* qse_mbsxtok ( const qse_mchar_t* s, qse_size_t len, const qse_mchar_t* delim, - qse_mxstr_t* tok + qse_mcstr_t* tok ); QSE_EXPORT qse_mchar_t* qse_mbsxntok ( @@ -2299,20 +2299,20 @@ QSE_EXPORT qse_mchar_t* qse_mbsxntok ( qse_size_t len, const qse_mchar_t* delim, qse_size_t delim_len, - qse_mxstr_t* tok + qse_mcstr_t* tok ); QSE_EXPORT qse_wchar_t* qse_wcstok ( const qse_wchar_t* s, const qse_wchar_t* delim, - qse_wxstr_t* tok + qse_wcstr_t* tok ); QSE_EXPORT qse_wchar_t* qse_wcsxtok ( const qse_wchar_t* s, qse_size_t len, const qse_wchar_t* delim, - qse_wxstr_t* tok + qse_wcstr_t* tok ); QSE_EXPORT qse_wchar_t* qse_wcsxntok ( @@ -2320,7 +2320,7 @@ QSE_EXPORT qse_wchar_t* qse_wcsxntok ( qse_size_t len, const qse_wchar_t* delim, qse_size_t delim_len, - qse_wxstr_t* tok + qse_wcstr_t* tok ); #if defined(QSE_CHAR_IS_MCHAR) @@ -2613,13 +2613,13 @@ QSE_EXPORT void* qse_mbs_getxtn ( /** * The qse_mbs_yield() function assigns the buffer to an variable of the - * #qse_mxstr_t type and recreate a new buffer of the \a new_capa capacity. + * #qse_mcstr_t type and recreate a new buffer of the \a new_capa capacity. * The function fails if it fails to allocate a new buffer. * \return 0 on success, and -1 on failure. */ QSE_EXPORT int qse_mbs_yield ( qse_mbs_t* str, /**< string */ - qse_mxstr_t* buf, /**< buffer pointer */ + qse_mcstr_t* buf, /**< buffer pointer */ qse_size_t newcapa /**< new capacity */ ); @@ -2810,13 +2810,13 @@ QSE_EXPORT void* qse_wcs_getxtn ( /** * The qse_wcs_yield() function assigns the buffer to an variable of the - * #qse_wxstr_t type and recreate a new buffer of the \a new_capa capacity. + * #qse_wcstr_t type and recreate a new buffer of the \a new_capa capacity. * The function fails if it fails to allocate a new buffer. * \return 0 on success, and -1 on failure. */ QSE_EXPORT int qse_wcs_yield ( qse_wcs_t* str, /**< string */ - qse_wxstr_t* buf, /**< buffer pointer */ + qse_wcstr_t* buf, /**< buffer pointer */ qse_size_t new_capa /**< new capacity */ ); diff --git a/qse/include/qse/cmn/uri.h b/qse/include/qse/cmn/uri.h index ff692b85..5e8d42c9 100644 --- a/qse/include/qse/cmn/uri.h +++ b/qse/include/qse/cmn/uri.h @@ -29,32 +29,32 @@ typedef struct qse_wuri_t qse_wuri_t; struct qse_muri_t { - qse_mxstr_t scheme; + qse_mcstr_t scheme; struct { - qse_mxstr_t user; - qse_mxstr_t pass; + qse_mcstr_t user; + qse_mcstr_t pass; } auth; - qse_mxstr_t host; - qse_mxstr_t port; - qse_mxstr_t path; - qse_mxstr_t query; - qse_mxstr_t frag; + qse_mcstr_t host; + qse_mcstr_t port; + qse_mcstr_t path; + qse_mcstr_t query; + qse_mcstr_t frag; }; struct qse_wuri_t { - qse_wxstr_t scheme; + qse_wcstr_t scheme; struct { - qse_wxstr_t user; - qse_wxstr_t pass; + qse_wcstr_t user; + qse_wcstr_t pass; } auth; - qse_wxstr_t host; - qse_wxstr_t port; - qse_wxstr_t path; - qse_wxstr_t query; - qse_wxstr_t frag; + qse_wcstr_t host; + qse_wcstr_t port; + qse_wcstr_t path; + qse_wcstr_t query; + qse_wcstr_t frag; }; enum qse_mbstouri_flag_t diff --git a/qse/include/qse/http/htrd.h b/qse/include/qse/http/htrd.h index 278b2fad..d86cd871 100644 --- a/qse/include/qse/http/htrd.h +++ b/qse/include/qse/http/htrd.h @@ -186,7 +186,7 @@ QSE_EXPORT int qse_htrd_halt ( QSE_EXPORT int qse_htrd_scanqparam ( qse_htrd_t* http, - const qse_mxstr_t* cstr + const qse_mcstr_t* cstr ); #ifdef __cplusplus diff --git a/qse/include/qse/http/htre.h b/qse/include/qse/http/htre.h index 8ef1d77e..2edb7f72 100644 --- a/qse/include/qse/http/htre.h +++ b/qse/include/qse/http/htre.h @@ -169,13 +169,13 @@ QSE_EXPORT void qse_htre_clear ( QSE_EXPORT int qse_htre_setstrfromcstr ( qse_htre_t* re, qse_mbs_t* str, - const qse_mxstr_t* cstr + const qse_mcstr_t* cstr ); QSE_EXPORT int qse_htre_setstrfromxstr ( qse_htre_t* re, qse_mbs_t* str, - const qse_mxstr_t* xstr + const qse_mcstr_t* xstr ); QSE_EXPORT const qse_htre_hdrval_t* qse_htre_getheaderval ( diff --git a/qse/include/qse/http/http.h b/qse/include/qse/http/http.h index d5c5b6cd..2b817cdf 100644 --- a/qse/include/qse/http/http.h +++ b/qse/include/qse/http/http.h @@ -35,7 +35,7 @@ typedef qse_mbs_t qse_htob_t; /* octet string */ -typedef qse_mxstr_t qse_htos_t; +typedef qse_mcstr_t qse_htos_t; /** * The qse_http_version_t type defines http version. @@ -176,7 +176,7 @@ QSE_EXPORT qse_http_method_t qse_mbstohttpmethod ( ); QSE_EXPORT qse_http_method_t qse_mcstrtohttpmethod ( - const qse_mxstr_t* name + const qse_mcstr_t* name ); QSE_EXPORT int qse_parsehttprange ( diff --git a/qse/include/qse/http/stdhttpd.h b/qse/include/qse/http/stdhttpd.h index 768e9612..ca7324ef 100644 --- a/qse/include/qse/http/stdhttpd.h +++ b/qse/include/qse/http/stdhttpd.h @@ -76,7 +76,7 @@ struct qse_httpd_serverstd_realm_t typedef struct qse_httpd_serverstd_auth_t qse_httpd_serverstd_auth_t; struct qse_httpd_serverstd_auth_t { - qse_mxstr_t key; + qse_mcstr_t key; int authok; }; diff --git a/qse/include/qse/sed/Sed.hpp b/qse/include/qse/sed/Sed.hpp index b9a93b6c..3ff04a4d 100644 --- a/qse/include/qse/sed/Sed.hpp +++ b/qse/include/qse/sed/Sed.hpp @@ -246,7 +246,7 @@ public: /// void setError ( errnum_t num, ///< error number - const xstr_t* args = QSE_NULL, ///< string array for formatting + const cstr_t* args = QSE_NULL, ///< string array for formatting /// an error message const loc_t* loc = QSE_NULL ///< error location ); diff --git a/qse/include/qse/sed/sed.h b/qse/include/qse/sed/sed.h index 15b6f369..efe796f2 100644 --- a/qse/include/qse/sed/sed.h +++ b/qse/include/qse/sed/sed.h @@ -154,19 +154,19 @@ struct qse_sed_cmd_t union { /* text for the a, i, c commands */ - qse_xstr_t text; + qse_cstr_t text; /* file name for r, w, R, W */ - qse_xstr_t file; + qse_cstr_t file; /* data for the s command */ struct { void* rex; /* regular expression */ - qse_xstr_t rpl; /* replacement */ + qse_cstr_t rpl; /* replacement */ /* flags */ - qse_xstr_t file; /* file name for w */ + qse_cstr_t file; /* file name for w */ unsigned short occ; unsigned short g: 1; /* global */ unsigned short p: 1; /* print */ @@ -175,12 +175,12 @@ struct qse_sed_cmd_t } subst; /* translation set for the y command */ - qse_xstr_t transet; + qse_cstr_t transet; /* branch target for b and t */ struct { - qse_xstr_t label; + qse_cstr_t label; qse_sed_cmd_t* target; } branch; @@ -561,7 +561,7 @@ QSE_EXPORT void qse_sed_geterror ( QSE_EXPORT void qse_sed_seterrnum ( qse_sed_t* sed, /**< stream editor */ qse_sed_errnum_t errnum, /**< error number */ - const qse_xstr_t* errarg /**< argument for formatting error message */ + const qse_cstr_t* errarg /**< argument for formatting error message */ ); /** @@ -583,7 +583,7 @@ QSE_EXPORT void qse_sed_seterrmsg ( QSE_EXPORT void qse_sed_seterror ( qse_sed_t* sed, /**< stream editor */ qse_sed_errnum_t errnum, /**< error number */ - const qse_xstr_t* errarg, /**< array of arguments for formatting + const qse_cstr_t* errarg, /**< array of arguments for formatting * an error message */ const qse_sed_loc_t* errloc /**< error location */ ); @@ -722,7 +722,7 @@ QSE_EXPORT void qse_sed_freemem ( QSE_EXPORT void qse_sed_getspace ( qse_sed_t* sed, qse_sed_space_t space, - qse_xstr_t* str + qse_cstr_t* str ); #ifdef __cplusplus diff --git a/qse/include/qse/sed/stdsed.h b/qse/include/qse/sed/stdsed.h index 0553a109..80c415b0 100644 --- a/qse/include/qse/sed/stdsed.h +++ b/qse/include/qse/sed/stdsed.h @@ -82,7 +82,7 @@ struct qse_sed_iostd_t * the ptr field with qse_sed_freemem() once you're done with it * to avoid memory leaks. */ - qse_xstr_t str; + qse_cstr_t str; /** pre-opened sio stream */ qse_sio_t* sio; @@ -176,7 +176,7 @@ QSE_EXPORT int qse_sed_compstdstr ( */ QSE_EXPORT int qse_sed_compstdxstr ( qse_sed_t* sed, - const qse_xstr_t* script + const qse_cstr_t* script ); /** @@ -229,8 +229,8 @@ QSE_EXPORT int qse_sed_execstdfile ( */ QSE_EXPORT int qse_sed_execstdxstr ( qse_sed_t* sed, - const qse_xstr_t* instr, - qse_xstr_t* outstr, + const qse_cstr_t* instr, + qse_cstr_t* outstr, qse_cmgr_t* cmgr ); diff --git a/qse/include/qse/types.h b/qse/include/qse/types.h index d5d483a3..4ac0f7d4 100644 --- a/qse/include/qse/types.h +++ b/qse/include/qse/types.h @@ -617,31 +617,31 @@ struct qse_link_t }; /** - * The qse_mxstr_t type defines a structure combining a pointer to a character + * The qse_mcstr_t type defines a structure combining a pointer to a character * string and the number of characters. */ -struct qse_mxstr_t +struct qse_mcstr_t { qse_mchar_t* ptr; /**< pointer to a character string */ qse_size_t len; /**< the number of characters */ }; -typedef struct qse_mxstr_t qse_mxstr_t; +typedef struct qse_mcstr_t qse_mcstr_t; /** - * The qse_wxstr_t type defines a structure combining a pointer to a character + * The qse_wcstr_t type defines a structure combining a pointer to a character * string and the number of characters. */ -struct qse_wxstr_t +struct qse_wcstr_t { qse_wchar_t* ptr; /**< pointer to a character string */ qse_size_t len; /**< the number of characters */ }; -typedef struct qse_wxstr_t qse_wxstr_t; +typedef struct qse_wcstr_t qse_wcstr_t; #if defined(QSE_CHAR_IS_MCHAR) - typedef qse_mxstr_t qse_xstr_t; + typedef qse_mcstr_t qse_cstr_t; #else - typedef qse_wxstr_t qse_xstr_t; + typedef qse_wcstr_t qse_cstr_t; #endif /** diff --git a/qse/include/qse/xli/stdxli.h b/qse/include/qse/xli/stdxli.h index 3b17d699..3c0508f6 100644 --- a/qse/include/qse/xli/stdxli.h +++ b/qse/include/qse/xli/stdxli.h @@ -80,7 +80,7 @@ struct qse_xli_iostd_t * ptr field with qse_xli_freemem() once you're done with it to * avoid memory leaks. */ - qse_xstr_t str; + qse_cstr_t str; } u; }; diff --git a/qse/include/qse/xli/xli.h b/qse/include/qse/xli/xli.h index 42ca634e..cc93c089 100644 --- a/qse/include/qse/xli/xli.h +++ b/qse/include/qse/xli/xli.h @@ -490,7 +490,7 @@ QSE_EXPORT void qse_xli_geterror ( QSE_EXPORT void qse_xli_seterrnum ( qse_xli_t* xli, /**< stream editor */ qse_xli_errnum_t errnum, /**< error number */ - const qse_xstr_t* errarg /**< argument for formatting error message */ + const qse_cstr_t* errarg /**< argument for formatting error message */ ); /** @@ -512,7 +512,7 @@ QSE_EXPORT void qse_xli_seterrmsg ( QSE_EXPORT void qse_xli_seterror ( qse_xli_t* xli, /**< stream editor */ qse_xli_errnum_t errnum, /**< error number */ - const qse_xstr_t* errarg, /**< array of arguments for formatting + const qse_cstr_t* errarg, /**< array of arguments for formatting * an error message */ const qse_xli_loc_t* errloc /**< error location */ ); @@ -558,7 +558,7 @@ QSE_EXPORT qse_xli_pair_t* qse_xli_insertpairwithstr ( const qse_char_t* key, const qse_char_t* alias, const qse_char_t* keytag, - const qse_xstr_t* value, + const qse_cstr_t* value, const qse_char_t* strtag ); @@ -569,7 +569,7 @@ QSE_EXPORT qse_xli_pair_t* qse_xli_insertpairwithstrs ( const qse_char_t* key, const qse_char_t* alias, const qse_char_t* keytag, - const qse_xstr_t value[], + const qse_cstr_t value[], qse_size_t count ); @@ -614,7 +614,7 @@ QSE_EXPORT qse_xli_str_t* qse_xli_addsegtostr ( qse_xli_t* xli, qse_xli_str_t* str, const qse_char_t* tag, - const qse_xstr_t* value + const qse_cstr_t* value ); /** diff --git a/qse/lib/awk/Awk.cpp b/qse/lib/awk/Awk.cpp index fbaab9b2..1e710e9e 100644 --- a/qse/lib/awk/Awk.cpp +++ b/qse/lib/awk/Awk.cpp @@ -594,7 +594,7 @@ int Awk::Value::setStr (Run* r, const char_t* str, size_t len, bool numeric) { val_t* tmp; - xstr_t cstr; + cstr_t cstr; cstr.ptr = (char_t*)str; cstr.len = len; @@ -757,7 +757,7 @@ int Awk::Value::setIndexedStr ( { val_t* tmp; - xstr_t cstr; + cstr_t cstr; cstr.ptr = (char_t*)str; cstr.len = len; @@ -928,7 +928,7 @@ const Awk::char_t* Awk::Run::getErrorMessage () const return qse_awk_rtx_geterrmsg (this->rtx); } -void Awk::Run::setError (errnum_t code, const xstr_t* args, const loc_t* loc) +void Awk::Run::setError (errnum_t code, const cstr_t* args, const loc_t* loc) { QSE_ASSERT (this->rtx != QSE_NULL); qse_awk_rtx_seterror (this->rtx, code, args, loc); @@ -1049,7 +1049,7 @@ const Awk::char_t* Awk::getErrorMessage () const return this->errinf.msg; } -void Awk::setError (errnum_t code, const xstr_t* args, const loc_t* loc) +void Awk::setError (errnum_t code, const cstr_t* args, const loc_t* loc) { if (awk != QSE_NULL) { @@ -1497,12 +1497,12 @@ int Awk::xstrs_t::add (awk_t* awk, const char_t* arg, size_t len) { if (this->len >= this->capa) { - qse_xstr_t* ptr; + qse_cstr_t* ptr; size_t capa = this->capa; capa += 64; - ptr = (qse_xstr_t*) qse_awk_reallocmem ( - awk, this->ptr, QSE_SIZEOF(qse_xstr_t)*(capa+1)); + ptr = (qse_cstr_t*) qse_awk_reallocmem ( + awk, this->ptr, QSE_SIZEOF(qse_cstr_t)*(capa+1)); if (ptr == QSE_NULL) return -1; this->ptr = ptr; diff --git a/qse/lib/awk/StdAwk.cpp b/qse/lib/awk/StdAwk.cpp index 57900cce..4a515a96 100644 --- a/qse/lib/awk/StdAwk.cpp +++ b/qse/lib/awk/StdAwk.cpp @@ -81,7 +81,7 @@ static qse_sio_t* open_sio (Awk* awk, StdAwk::Run* run, const qse_char_t* file, sio = qse_sio_open ((run? ((Awk*)*run)->getMmgr(): awk->getMmgr()), 0, file, flags); if (sio == QSE_NULL) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (StdAwk::char_t*)file; ea.len = qse_strlen (file); if (run) run->setError (QSE_AWK_EOPEN, &ea); @@ -104,7 +104,7 @@ static qse_sio_t* open_sio_std (Awk* awk, StdAwk::Run* run, qse_sio_std_t std, i sio = qse_sio_openstd ((run? ((Awk*)*run)->getMmgr(): awk->getMmgr()), 0, std, flags); if (sio == QSE_NULL) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (StdAwk::char_t*)std_names[std]; ea.len = qse_strlen (std_names[std]); if (run) run->setError (QSE_AWK_EOPEN, &ea); @@ -862,7 +862,7 @@ int StdAwk::open_console_in (Console& io) qse_char_t ibuf[128]; qse_size_t ibuflen; qse_awk_val_t* v; - qse_xstr_t as; + qse_cstr_t as; nextfile: file = this->runarg.ptr[this->runarg_index].ptr; @@ -898,7 +898,7 @@ int StdAwk::open_console_in (Console& io) if (qse_strlen(file) != this->runarg.ptr[this->runarg_index].len) { - xstr_t arg; + cstr_t arg; arg.ptr = (char_t*)file; arg.len = qse_strlen (arg.ptr); ((Run*)io)->setError (QSE_AWK_EIONMNL, &arg); @@ -947,7 +947,7 @@ int StdAwk::open_console_in (Console& io) if (qse_strlen(as.ptr) < as.len) { /* the name contains one or more '\0' */ - xstr_t arg; + cstr_t arg; arg.ptr = as.ptr; arg.len = qse_strlen (as.ptr); ((Run*)io)->setError (QSE_AWK_EIONMNL, &arg); @@ -1031,7 +1031,7 @@ int StdAwk::open_console_out (Console& io) if (qse_strlen(file) != this->ofile.ptr[this->ofile_index].len) { - xstr_t arg; + cstr_t arg; arg.ptr = (char_t*)file; arg.len = qse_strlen (arg.ptr); ((Run*)io)->setError (QSE_AWK_EIONMNL, &arg); diff --git a/qse/lib/awk/awk.c b/qse/lib/awk/awk.c index 5168e788..afd545be 100644 --- a/qse/lib/awk/awk.c +++ b/qse/lib/awk/awk.c @@ -391,7 +391,7 @@ void qse_awk_setprm (qse_awk_t* awk, const qse_awk_prm_t* prm) awk->prm = *prm; } -static int dup_str_opt (qse_awk_t* awk, const void* value, qse_xstr_t* tmp) +static int dup_str_opt (qse_awk_t* awk, const void* value, qse_cstr_t* tmp) { if (value) { @@ -423,7 +423,7 @@ int qse_awk_setopt (qse_awk_t* awk, qse_awk_opt_t id, const void* value) case QSE_AWK_MODPREFIX: case QSE_AWK_MODPOSTFIX: { - qse_xstr_t tmp; + qse_cstr_t tmp; int idx; if (dup_str_opt (awk, value, &tmp) <= -1) return -1; @@ -438,7 +438,7 @@ int qse_awk_setopt (qse_awk_t* awk, qse_awk_opt_t id, const void* value) case QSE_AWK_INCLUDEDIRS: { - qse_xstr_t tmp; + qse_cstr_t tmp; if (dup_str_opt (awk, value, &tmp) <= -1) return -1; if (awk->opt.incldirs.ptr) QSE_MMGR_FREE (awk->mmgr, awk->opt.incldirs.ptr); diff --git a/qse/lib/awk/awk.h b/qse/lib/awk/awk.h index 35c4f961..d130dc58 100644 --- a/qse/lib/awk/awk.h +++ b/qse/lib/awk/awk.h @@ -88,7 +88,7 @@ struct qse_awk_tree_t { qse_size_t ngbls; /* total number of globals */ qse_size_t ngbls_base; /* number of intrinsic globals */ - qse_xstr_t cur_fun; + qse_cstr_t cur_fun; qse_htb_t* funs; /* awk function map */ qse_awk_nde_t* begin; @@ -123,8 +123,8 @@ struct qse_awk_t struct { int trait; - qse_xstr_t mod[2]; - qse_xstr_t incldirs; + qse_cstr_t mod[2]; + qse_cstr_t incldirs; union { @@ -314,11 +314,11 @@ struct qse_awk_rtx_t qse_awk_int_t nr; qse_awk_int_t fnr; - qse_xstr_t convfmt; - qse_xstr_t ofmt; - qse_xstr_t ofs; - qse_xstr_t ors; - qse_xstr_t subsep; + qse_cstr_t convfmt; + qse_cstr_t ofmt; + qse_cstr_t ofs; + qse_cstr_t ors; + qse_cstr_t subsep; } gbl; /* rio chain */ diff --git a/qse/lib/awk/err.c b/qse/lib/awk/err.c index 5d242da7..9b0cac6f 100644 --- a/qse/lib/awk/err.c +++ b/qse/lib/awk/err.c @@ -214,7 +214,7 @@ void qse_awk_geterror ( } void qse_awk_seterrnum ( - qse_awk_t* awk, qse_awk_errnum_t errnum, const qse_xstr_t* errarg) + qse_awk_t* awk, qse_awk_errnum_t errnum, const qse_cstr_t* errarg) { qse_awk_seterror (awk, errnum, errarg, QSE_NULL); } @@ -225,7 +225,7 @@ void qse_awk_seterrinf (qse_awk_t* awk, const qse_awk_errinf_t* errinf) } void qse_awk_seterror ( - qse_awk_t* awk, qse_awk_errnum_t errnum, const qse_xstr_t* errarg, + qse_awk_t* awk, qse_awk_errnum_t errnum, const qse_cstr_t* errarg, const qse_awk_loc_t* errloc) { const qse_char_t* errfmt; @@ -283,7 +283,7 @@ void qse_awk_rtx_geterror ( } void qse_awk_rtx_seterrnum ( - qse_awk_rtx_t* rtx, qse_awk_errnum_t errnum, const qse_xstr_t* errarg) + qse_awk_rtx_t* rtx, qse_awk_errnum_t errnum, const qse_cstr_t* errarg) { qse_awk_rtx_seterror (rtx, errnum, errarg, 0); } @@ -294,7 +294,7 @@ void qse_awk_rtx_seterrinf (qse_awk_rtx_t* rtx, const qse_awk_errinf_t* errinf) } void qse_awk_rtx_seterror ( - qse_awk_rtx_t* rtx, qse_awk_errnum_t errnum, const qse_xstr_t* errarg, + qse_awk_rtx_t* rtx, qse_awk_errnum_t errnum, const qse_cstr_t* errarg, const qse_awk_loc_t* errloc) { const qse_char_t* errfmt; diff --git a/qse/lib/awk/fnc.c b/qse/lib/awk/fnc.c index 9820e1af..8c8bc4c3 100644 --- a/qse/lib/awk/fnc.c +++ b/qse/lib/awk/fnc.c @@ -80,7 +80,7 @@ qse_awk_fnc_t* qse_awk_addfnc (qse_awk_t* awk, const qse_char_t* name, const qse qse_awk_fnc_t* fnc; qse_size_t fnc_size; qse_size_t speclen; - qse_xstr_t ncs; + qse_cstr_t ncs; ncs.ptr = (qse_char_t*)name; ncs.len = qse_strlen (name); @@ -134,7 +134,7 @@ qse_awk_fnc_t* qse_awk_addfnc (qse_awk_t* awk, const qse_char_t* name, const qse int qse_awk_delfnc (qse_awk_t* awk, const qse_char_t* name) { - qse_xstr_t ncs; + qse_cstr_t ncs; ncs.ptr = (qse_char_t*)name; ncs.len = qse_strlen (name); @@ -153,7 +153,7 @@ void qse_awk_clrfnc (qse_awk_t* awk) qse_htb_clear (awk->fnc.user); } -qse_awk_fnc_t* qse_awk_findfnc (qse_awk_t* awk, const qse_xstr_t* name) +qse_awk_fnc_t* qse_awk_findfnc (qse_awk_t* awk, const qse_cstr_t* name) { qse_htb_pair_t* pair; int i; @@ -598,14 +598,14 @@ int qse_awk_fnc_split (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) qse_size_t nargs; qse_awk_val_t* a0, * a1, * a2, * t1, * t2; - qse_xstr_t str, fs; + qse_cstr_t str, fs; qse_char_t* str_free = QSE_NULL, * fs_free = QSE_NULL; const qse_char_t* p; qse_size_t str_left, org_len; void* fs_rex = QSE_NULL; void* fs_rex_free = QSE_NULL; - qse_xstr_t tok; + qse_cstr_t tok; qse_awk_int_t nflds; qse_awk_errnum_t errnum; @@ -799,7 +799,7 @@ int qse_awk_fnc_tolower (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) qse_size_t nargs; qse_size_t i; qse_awk_val_t* a0, * r; - qse_xstr_t str; + qse_cstr_t str; nargs = qse_awk_rtx_getnargs (rtx); QSE_ASSERT (nargs == 1); @@ -828,7 +828,7 @@ int qse_awk_fnc_toupper (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) qse_size_t nargs; qse_size_t i; qse_awk_val_t* a0, * r; - qse_xstr_t str; + qse_cstr_t str; nargs = qse_awk_rtx_getnargs (rtx); QSE_ASSERT (nargs == 1); @@ -857,7 +857,7 @@ static int __substitute (qse_awk_rtx_t* run, qse_awk_int_t max_count) qse_size_t nargs; qse_awk_val_t* a0, * a1, * a2, * v; - qse_xstr_t s0, s1, s2; + qse_cstr_t s0, s1, s2; const qse_char_t* s2_end; qse_char_t* s0_free = QSE_NULL; @@ -870,7 +870,7 @@ static int __substitute (qse_awk_rtx_t* run, qse_awk_int_t max_count) qse_str_t new; int new_inited = 0; - qse_xstr_t mat, pmat, cur; + qse_cstr_t mat, pmat, cur; qse_awk_int_t sub_count; @@ -1131,7 +1131,7 @@ int qse_awk_fnc_match (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) qse_size_t len0; qse_awk_int_t idx, start = 1; int n; - qse_xstr_t mat; + qse_cstr_t mat; nargs = qse_awk_rtx_getnargs (rtx); QSE_ASSERT (nargs >= 2 && nargs <= 3); @@ -1173,7 +1173,7 @@ int qse_awk_fnc_match (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) if (start > len0 || start <= 0) n = 0; else { - qse_xstr_t tmp; + qse_cstr_t tmp; /*TODO: must use str0,len0? */ tmp.ptr = str0 + start - 1; @@ -1229,8 +1229,8 @@ int qse_awk_fnc_sprintf (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) qse_awk_val_t* a0; qse_str_t out, fbu; int out_inited = 0, fbu_inited = 0; - qse_xstr_t cs0; - qse_xstr_t x; + qse_cstr_t cs0; + qse_cstr_t x; nargs = qse_awk_rtx_getnargs (rtx); QSE_ASSERT (nargs > 0); diff --git a/qse/lib/awk/fnc.h b/qse/lib/awk/fnc.h index cfbd32c0..4e875e4c 100644 --- a/qse/lib/awk/fnc.h +++ b/qse/lib/awk/fnc.h @@ -42,7 +42,7 @@ struct qse_awk_fnc_t extern "C" { #endif -qse_awk_fnc_t* qse_awk_findfnc (qse_awk_t* awk, const qse_xstr_t* name); +qse_awk_fnc_t* qse_awk_findfnc (qse_awk_t* awk, const qse_cstr_t* name); int qse_awk_fnc_index (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi); int qse_awk_fnc_rindex (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi); diff --git a/qse/lib/awk/misc.c b/qse/lib/awk/misc.c index 851c2b05..cf3f446b 100644 --- a/qse/lib/awk/misc.c +++ b/qse/lib/awk/misc.c @@ -69,7 +69,7 @@ qse_char_t* qse_awk_strxdup (qse_awk_t* awk, const qse_char_t* s, qse_size_t l) return ptr; } -qse_char_t* qse_awk_cstrdup (qse_awk_t* awk, const qse_xstr_t* s) +qse_char_t* qse_awk_cstrdup (qse_awk_t* awk, const qse_cstr_t* s) { qse_char_t* ptr = qse_cstrdup (s, awk->mmgr); if (ptr == QSE_NULL) qse_awk_seterrnum (awk, QSE_AWK_ENOMEM, QSE_NULL); @@ -661,7 +661,7 @@ qse_size_t qse_awk_inttostr ( qse_char_t* qse_awk_rtx_strtok ( qse_awk_rtx_t* rtx, const qse_char_t* s, - const qse_char_t* delim, qse_xstr_t* tok) + const qse_char_t* delim, qse_cstr_t* tok) { return qse_awk_rtx_strxntok ( rtx, s, qse_strlen(s), delim, qse_strlen(delim), tok); @@ -669,7 +669,7 @@ qse_char_t* qse_awk_rtx_strtok ( qse_char_t* qse_awk_rtx_strxtok ( qse_awk_rtx_t* rtx, const qse_char_t* s, qse_size_t len, - const qse_char_t* delim, qse_xstr_t* tok) + const qse_char_t* delim, qse_cstr_t* tok) { return qse_awk_rtx_strxntok ( rtx, s, len, delim, qse_strlen(delim), tok); @@ -678,7 +678,7 @@ qse_char_t* qse_awk_rtx_strxtok ( qse_char_t* qse_awk_rtx_strntok ( qse_awk_rtx_t* rtx, const qse_char_t* s, const qse_char_t* delim, qse_size_t delim_len, - qse_xstr_t* tok) + qse_cstr_t* tok) { return qse_awk_rtx_strxntok ( rtx, s, qse_strlen(s), delim, delim_len, tok); @@ -686,7 +686,7 @@ qse_char_t* qse_awk_rtx_strntok ( qse_char_t* qse_awk_rtx_strxntok ( qse_awk_rtx_t* rtx, const qse_char_t* s, qse_size_t len, - const qse_char_t* delim, qse_size_t delim_len, qse_xstr_t* tok) + const qse_char_t* delim, qse_size_t delim_len, qse_cstr_t* tok) { const qse_char_t* p = s, *d; const qse_char_t* end = s + len; @@ -880,12 +880,12 @@ qse_char_t* qse_awk_rtx_strxntokbyrex ( qse_awk_rtx_t* rtx, const qse_char_t* str, qse_size_t len, const qse_char_t* substr, qse_size_t sublen, - void* rex, qse_xstr_t* tok, + void* rex, qse_cstr_t* tok, qse_awk_errnum_t* errnum) { int n; qse_size_t i; - qse_xstr_t match, s, cursub, realsub; + qse_cstr_t match, s, cursub, realsub; s.ptr = (qse_char_t*)str; s.len = len; @@ -989,7 +989,7 @@ exit_loop: qse_char_t* qse_awk_rtx_strxnfld ( qse_awk_rtx_t* rtx, qse_char_t* str, qse_size_t len, qse_char_t fs, qse_char_t ec, qse_char_t lq, qse_char_t rq, - qse_xstr_t* tok) + qse_cstr_t* tok) { qse_char_t* p = str; qse_char_t* end = str + len; @@ -1190,8 +1190,8 @@ int qse_awk_buildrex ( static int matchtre ( qse_awk_t* awk, qse_tre_t* tre, int opt, - const qse_xstr_t* str, qse_xstr_t* mat, - qse_xstr_t submat[9], qse_awk_errnum_t* errnum) + const qse_cstr_t* str, qse_cstr_t* mat, + qse_cstr_t submat[9], qse_awk_errnum_t* errnum) { int n; qse_tre_match_t match[10] = { { 0, 0 }, }; @@ -1239,8 +1239,8 @@ static int matchtre ( int qse_awk_matchrex ( qse_awk_t* awk, void* code, int icase, - const qse_xstr_t* str, const qse_xstr_t* substr, - qse_xstr_t* match, qse_awk_errnum_t* errnum) + const qse_cstr_t* str, const qse_cstr_t* substr, + qse_cstr_t* match, qse_awk_errnum_t* errnum) { #if defined(USE_REX) int x; @@ -1287,7 +1287,7 @@ void qse_awk_freerex (qse_awk_t* awk, void* code, void* icode) int qse_awk_rtx_matchrex ( qse_awk_rtx_t* rtx, qse_awk_val_t* val, - const qse_xstr_t* str, const qse_xstr_t* substr, qse_xstr_t* match) + const qse_cstr_t* str, const qse_cstr_t* substr, qse_cstr_t* match) { void* code; int icase, x; @@ -1305,7 +1305,7 @@ int qse_awk_rtx_matchrex ( else { /* convert to a string and build a regular expression */ - qse_xstr_t tmp; + qse_cstr_t tmp; tmp.ptr = qse_awk_rtx_getvalstr (rtx, val, &tmp.len); if (tmp.ptr == QSE_NULL) return -1; diff --git a/qse/lib/awk/misc.h b/qse/lib/awk/misc.h index fa5cc3cc..033aa451 100644 --- a/qse/lib/awk/misc.h +++ b/qse/lib/awk/misc.h @@ -27,19 +27,19 @@ extern "C" { qse_char_t* qse_awk_rtx_strtok ( qse_awk_rtx_t* rtx, const qse_char_t* s, - const qse_char_t* delim, qse_xstr_t* tok); + const qse_char_t* delim, qse_cstr_t* tok); qse_char_t* qse_awk_rtx_strxtok ( qse_awk_rtx_t* rtx, const qse_char_t* s, qse_size_t len, - const qse_char_t* delim, qse_xstr_t* tok); + const qse_char_t* delim, qse_cstr_t* tok); qse_char_t* qse_awk_rtx_strntok ( qse_awk_rtx_t* rtx, const qse_char_t* s, - const qse_char_t* delim, qse_size_t delim_len, qse_xstr_t* tok); + const qse_char_t* delim, qse_size_t delim_len, qse_cstr_t* tok); qse_char_t* qse_awk_rtx_strxntok ( qse_awk_rtx_t* rtx, const qse_char_t* s, qse_size_t len, - const qse_char_t* delim, qse_size_t delim_len, qse_xstr_t* tok); + const qse_char_t* delim, qse_size_t delim_len, qse_cstr_t* tok); qse_char_t* qse_awk_rtx_strxntokbyrex ( qse_awk_rtx_t* rtx, @@ -48,7 +48,7 @@ qse_char_t* qse_awk_rtx_strxntokbyrex ( const qse_char_t* substr, qse_size_t sublen, void* rex, - qse_xstr_t* tok, + qse_cstr_t* tok, qse_awk_errnum_t* errnum ); @@ -60,7 +60,7 @@ qse_char_t* qse_awk_rtx_strxnfld ( qse_char_t lq, qse_char_t rq, qse_char_t ec, - qse_xstr_t* tok + qse_cstr_t* tok ); int qse_awk_buildrex ( @@ -74,16 +74,16 @@ int qse_awk_buildrex ( int qse_awk_matchrex ( qse_awk_t* awk, void* code, int icase, - const qse_xstr_t* str, const qse_xstr_t* substr, - qse_xstr_t* match, qse_awk_errnum_t* errnum + const qse_cstr_t* str, const qse_cstr_t* substr, + qse_cstr_t* match, qse_awk_errnum_t* errnum ); void qse_awk_freerex (qse_awk_t* awk, void* code, void* icode); int qse_awk_rtx_matchrex ( qse_awk_rtx_t* rtx, qse_awk_val_t* val, - const qse_xstr_t* str, const qse_xstr_t* substr, - qse_xstr_t* match + const qse_cstr_t* str, const qse_cstr_t* substr, + qse_cstr_t* match ); #ifdef __cplusplus diff --git a/qse/lib/awk/mod-dir.c b/qse/lib/awk/mod-dir.c index c8795b1f..23cd8928 100644 --- a/qse/lib/awk/mod-dir.c +++ b/qse/lib/awk/mod-dir.c @@ -551,7 +551,7 @@ static inttab_t inttab[] = static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym) { - qse_xstr_t ea; + qse_cstr_t ea; int left, right, mid, n; left = 0; right = QSE_COUNTOF(fnctab) - 1; diff --git a/qse/lib/awk/mod-math.c b/qse/lib/awk/mod-math.c index 6a5b5cfd..0ba40b25 100644 --- a/qse/lib/awk/mod-math.c +++ b/qse/lib/awk/mod-math.c @@ -488,7 +488,7 @@ static fnctab_t fnctab[] = static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym) { - qse_xstr_t ea; + qse_cstr_t ea; int left, right, mid, n; left = 0; right = QSE_COUNTOF(fnctab) - 1; diff --git a/qse/lib/awk/mod-mpi.c b/qse/lib/awk/mod-mpi.c index ee3643c8..3179b7ff 100644 --- a/qse/lib/awk/mod-mpi.c +++ b/qse/lib/awk/mod-mpi.c @@ -193,7 +193,7 @@ static inttab_t inttab[] = static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym) { - qse_xstr_t ea; + qse_cstr_t ea; int left, right, mid, n; left = 0; right = QSE_COUNTOF(fnctab) - 1; diff --git a/qse/lib/awk/mod-sed.c b/qse/lib/awk/mod-sed.c index 3df3511f..a8a3a56e 100644 --- a/qse/lib/awk/mod-sed.c +++ b/qse/lib/awk/mod-sed.c @@ -83,7 +83,7 @@ static int fnc_file_to_file (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) qse_sed_t* sed = QSE_NULL; qse_awk_val_t* retv; qse_awk_val_t* a[3]; - qse_xstr_t xstr[3]; + qse_cstr_t xstr[3]; int i = 0, ret = 0; /* result = sed::file_to_file ("s/ABC/123/g", input_file, output_file [, option_string]) */ @@ -140,8 +140,8 @@ static int fnc_str_to_str (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) qse_sed_t* sed = QSE_NULL; qse_awk_val_t* retv; qse_awk_val_t* a[2], * tmp; - qse_xstr_t xstr[2]; - qse_xstr_t outstr; + qse_cstr_t xstr[2]; + qse_cstr_t outstr; int i = 0, ret = 0, n; sed = qse_sed_openstdwithmmgr (qse_awk_rtx_getmmgr(rtx), 0); @@ -225,7 +225,7 @@ static fnctab_t fnctab[] = static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym) { - qse_xstr_t ea; + qse_cstr_t ea; int left, right, mid, n; left = 0; right = QSE_COUNTOF(fnctab) - 1; diff --git a/qse/lib/awk/mod-str.c b/qse/lib/awk/mod-str.c index 58435f35..d92a83be 100644 --- a/qse/lib/awk/mod-str.c +++ b/qse/lib/awk/mod-str.c @@ -30,7 +30,7 @@ static int fnc_normspace (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) * - trim leading and trailing spaces * - replace a series of spaces to a single space */ - qse_xstr_t path; + qse_cstr_t path; qse_awk_val_t* retv; qse_awk_val_t* a0; @@ -50,7 +50,7 @@ static int fnc_normspace (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) static int trim (qse_awk_rtx_t* rtx, int flags) { - qse_xstr_t path; + qse_cstr_t path; qse_char_t* npath; qse_awk_val_t* retv; qse_awk_val_t* a0; @@ -181,7 +181,7 @@ static int fnc_isxdigit (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) static int fnc_value (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) { /* return the numeric value for the first character */ - qse_xstr_t path; + qse_cstr_t path; qse_awk_val_t* retv; qse_awk_val_t* a0; @@ -248,7 +248,7 @@ static fnctab_t fnctab[] = static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym) { - qse_xstr_t ea; + qse_cstr_t ea; int left, right, mid, n; left = 0; right = QSE_COUNTOF(fnctab) - 1; diff --git a/qse/lib/awk/mod-sys.c b/qse/lib/awk/mod-sys.c index 56b53e8b..e7a15d70 100644 --- a/qse/lib/awk/mod-sys.c +++ b/qse/lib/awk/mod-sys.c @@ -681,7 +681,7 @@ static inttab_t inttab[] = static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym) { - qse_xstr_t ea; + qse_cstr_t ea; int left, right, mid, n; left = 0; right = QSE_COUNTOF(fnctab) - 1; diff --git a/qse/lib/awk/mod-uci.c b/qse/lib/awk/mod-uci.c index c817df40..0ce3c95d 100644 --- a/qse/lib/awk/mod-uci.c +++ b/qse/lib/awk/mod-uci.c @@ -573,8 +573,8 @@ static int getoption_byid ( count = 1; uci_foreach_element(&uo->v.list, tmp) { - const qse_xstr_t* subsep; - qse_xstr_t k[4]; + const qse_cstr_t* subsep; + qse_cstr_t k[4]; qse_char_t idxbuf[64]; qse_char_t* kp; qse_size_t kl; @@ -1329,7 +1329,7 @@ static fnctab_t fnctab[] = static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym) { - qse_xstr_t ea; + qse_cstr_t ea; int left, right, mid, n; left = 0; right = QSE_COUNTOF(fnctab) - 1; diff --git a/qse/lib/awk/parse.c b/qse/lib/awk/parse.c index ec1c6062..428b91fb 100644 --- a/qse/lib/awk/parse.c +++ b/qse/lib/awk/parse.c @@ -177,7 +177,7 @@ struct binmap_t static int parse_progunit (qse_awk_t* awk); static qse_awk_t* collect_globals (qse_awk_t* awk); static void adjust_static_globals (qse_awk_t* awk); -static qse_size_t find_global (qse_awk_t* awk, const qse_xstr_t* name); +static qse_size_t find_global (qse_awk_t* awk, const qse_cstr_t* name); static qse_awk_t* collect_locals ( qse_awk_t* awk, qse_size_t nlcls, int istop); @@ -237,14 +237,14 @@ static qse_awk_nde_t* parse_primary_ident ( qse_awk_t* awk, const qse_awk_loc_t* xloc); static qse_awk_nde_t* parse_hashidx ( - qse_awk_t* awk, const qse_xstr_t* name, const qse_awk_loc_t* xloc); + qse_awk_t* awk, const qse_cstr_t* name, const qse_awk_loc_t* xloc); static qse_awk_nde_t* parse_fncall ( - qse_awk_t* awk, const qse_xstr_t* name, + qse_awk_t* awk, const qse_cstr_t* name, qse_awk_fnc_t* fnc, const qse_awk_loc_t* xloc, int noarg); static qse_awk_nde_t* parse_primary_ident_segs ( - qse_awk_t* awk, const qse_awk_loc_t* xloc, const qse_xstr_t* full, - const qse_xstr_t segs[], int nsegs); + qse_awk_t* awk, const qse_awk_loc_t* xloc, const qse_cstr_t* full, + const qse_cstr_t segs[], int nsegs); static int get_token (qse_awk_t* awk); static int preget_token (qse_awk_t* awk); @@ -252,7 +252,7 @@ static int get_rexstr (qse_awk_t* awk, qse_awk_tok_t* tok); static int skip_spaces (qse_awk_t* awk); static int skip_comment (qse_awk_t* awk); -static int classify_ident (qse_awk_t* awk, const qse_xstr_t* name); +static int classify_ident (qse_awk_t* awk, const qse_cstr_t* name); static int deparse (qse_awk_t* awk); static qse_htb_walk_t deparse_func ( @@ -261,14 +261,14 @@ static int put_char (qse_awk_t* awk, qse_char_t c); static int flush_out (qse_awk_t* awk); static qse_awk_mod_t* query_module ( - qse_awk_t* awk, const qse_xstr_t segs[], int nsegs, + qse_awk_t* awk, const qse_cstr_t segs[], int nsegs, qse_awk_mod_sym_t* sym); typedef struct kwent_t kwent_t; struct kwent_t { - qse_xstr_t name; + qse_cstr_t name; int type; int trait; /* the entry is valid when this option is set */ }; @@ -419,7 +419,7 @@ static global_t gtab[] = #define SETERR_ARG_LOC(awk,code,ep,el,loc) \ do { \ - qse_xstr_t __ea; \ + qse_cstr_t __ea; \ __ea.len = (el); __ea.ptr = (ep); \ qse_awk_seterror ((awk), (code), &__ea, (loc)); \ } while (0) @@ -523,7 +523,7 @@ const qse_char_t* qse_awk_getgblname ( return QSE_LDA_DPTR(awk->parse.gbls,idx); } -void qse_awk_getkwname (qse_awk_t* awk, qse_awk_kwid_t id, qse_xstr_t* s) +void qse_awk_getkwname (qse_awk_t* awk, qse_awk_kwid_t id, qse_cstr_t* s) { *s = kwtab[id].name; } @@ -1075,7 +1075,7 @@ static int parse_progunit (qse_awk_t* awk) static qse_awk_nde_t* parse_function (qse_awk_t* awk) { - qse_xstr_t name; + qse_cstr_t name; qse_awk_nde_t* body; qse_awk_fun_t* fun; qse_size_t nargs, g; @@ -1666,7 +1666,7 @@ static void adjust_static_globals (qse_awk_t* awk) } } -static qse_size_t get_global (qse_awk_t* awk, const qse_xstr_t* name) +static qse_size_t get_global (qse_awk_t* awk, const qse_cstr_t* name) { qse_size_t i; qse_lda_t* gbls = awk->parse.gbls; @@ -1683,7 +1683,7 @@ static qse_size_t get_global (qse_awk_t* awk, const qse_xstr_t* name) return QSE_LDA_NIL; } -static qse_size_t find_global (qse_awk_t* awk, const qse_xstr_t* name) +static qse_size_t find_global (qse_awk_t* awk, const qse_cstr_t* name) { qse_size_t i; qse_lda_t* gbls = awk->parse.gbls; @@ -1699,7 +1699,7 @@ static qse_size_t find_global (qse_awk_t* awk, const qse_xstr_t* name) } static int add_global ( - qse_awk_t* awk, const qse_xstr_t* name, + qse_awk_t* awk, const qse_cstr_t* name, qse_awk_loc_t* xloc, int disabled) { qse_size_t ngbls; @@ -1785,7 +1785,7 @@ static int add_global ( int qse_awk_addgbl (qse_awk_t* awk, const qse_char_t* name) { int n; - qse_xstr_t ncs; + qse_cstr_t ncs; ncs.ptr = (qse_char_t*)name; ncs.len = qse_strlen(name);; @@ -1817,7 +1817,7 @@ int qse_awk_addgbl (qse_awk_t* awk, const qse_char_t* name) int qse_awk_delgbl (qse_awk_t* awk, const qse_char_t* name) { qse_size_t n; - qse_xstr_t ncs; + qse_cstr_t ncs; ncs.ptr = (qse_char_t*)name; ncs.len = qse_strlen (name); @@ -1855,7 +1855,7 @@ int qse_awk_delgbl (qse_awk_t* awk, const qse_char_t* name) int qse_awk_findgbl (qse_awk_t* awk, const qse_char_t* name) { qse_size_t n; - qse_xstr_t ncs; + qse_cstr_t ncs; ncs.ptr = (qse_char_t*)name; ncs.len = qse_strlen (name); @@ -1938,7 +1938,7 @@ static qse_awk_t* collect_locals ( while (1) { - qse_xstr_t lcl; + qse_cstr_t lcl; qse_size_t n; if (!MATCH(awk,TOK_IDENT)) @@ -4183,7 +4183,7 @@ static qse_awk_nde_t* parse_increment (qse_awk_t* awk, const qse_awk_loc_t* xloc #define FNTYPE_FNC 1 #define FNTYPE_FUN 2 -static QSE_INLINE int isfunname (qse_awk_t* awk, const qse_xstr_t* name) +static QSE_INLINE int isfunname (qse_awk_t* awk, const qse_cstr_t* name) { /* check if it is an awk function being processed currently */ if (awk->tree.cur_fun.ptr) @@ -4214,7 +4214,7 @@ static QSE_INLINE int isfunname (qse_awk_t* awk, const qse_xstr_t* name) return FNTYPE_UNKNOWN; } -static QSE_INLINE int isfnname (qse_awk_t* awk, const qse_xstr_t* name) +static QSE_INLINE int isfnname (qse_awk_t* awk, const qse_cstr_t* name) { if (qse_awk_findfnc (awk, name) != QSE_NULL) { @@ -4759,7 +4759,7 @@ oops: static qse_awk_nde_t* parse_variable ( qse_awk_t* awk, const qse_awk_loc_t* xloc, qse_awk_nde_type_t type, - const qse_xstr_t* name, qse_size_t idxa) + const qse_cstr_t* name, qse_size_t idxa) { qse_awk_nde_var_t* nde; @@ -4800,7 +4800,7 @@ static qse_awk_nde_t* parse_variable ( } static int dup_ident_and_get_next ( - qse_awk_t* awk, const qse_awk_loc_t* xloc, qse_xstr_t* name, int max) + qse_awk_t* awk, const qse_awk_loc_t* xloc, qse_cstr_t* name, int max) { int nsegs = 0; @@ -4854,7 +4854,7 @@ oops: } static qse_awk_nde_t* parse_primary_ident_noseg ( - qse_awk_t* awk, const qse_awk_loc_t* xloc, const qse_xstr_t* name) + qse_awk_t* awk, const qse_awk_loc_t* xloc, const qse_cstr_t* name) { qse_awk_fnc_t* fnc; qse_size_t idxa; @@ -4874,7 +4874,7 @@ static qse_awk_nde_t* parse_primary_ident_noseg ( * e.g) sin -> math::sin * cos -> math::cos */ - qse_xstr_t segs[2]; + qse_cstr_t segs[2]; QSE_ASSERT (fnc->spec.arg.spec != QSE_NULL); @@ -5030,8 +5030,8 @@ static qse_awk_nde_t* parse_primary_ident_noseg ( } static qse_awk_nde_t* parse_primary_ident_segs ( - qse_awk_t* awk, const qse_awk_loc_t* xloc, const qse_xstr_t* full, - const qse_xstr_t segs[], int nsegs) + qse_awk_t* awk, const qse_awk_loc_t* xloc, const qse_cstr_t* full, + const qse_cstr_t segs[], int nsegs) { /* parse xxx::yyy */ @@ -5098,7 +5098,7 @@ static qse_awk_nde_t* parse_primary_ident ( qse_awk_t* awk, const qse_awk_loc_t* xloc) { qse_awk_nde_t* nde = QSE_NULL; - qse_xstr_t name[2]; /* TODO: support more than 2 segments??? */ + qse_cstr_t name[2]; /* TODO: support more than 2 segments??? */ int nsegs; QSE_ASSERT (MATCH(awk,TOK_IDENT)); @@ -5113,7 +5113,7 @@ static qse_awk_nde_t* parse_primary_ident ( } else { - qse_xstr_t full; /* full name including :: */ + qse_cstr_t full; /* full name including :: */ qse_size_t capa; int i; @@ -5152,7 +5152,7 @@ static qse_awk_nde_t* parse_primary_ident ( } static qse_awk_nde_t* parse_hashidx ( - qse_awk_t* awk, const qse_xstr_t* name, const qse_awk_loc_t* xloc) + qse_awk_t* awk, const qse_cstr_t* name, const qse_awk_loc_t* xloc) { qse_awk_nde_t* idx, * tmp, * last; qse_awk_nde_var_t* nde; @@ -5303,7 +5303,7 @@ exit_func: } static qse_awk_nde_t* parse_fncall ( - qse_awk_t* awk, const qse_xstr_t* name, + qse_awk_t* awk, const qse_cstr_t* name, qse_awk_fnc_t* fnc, const qse_awk_loc_t* xloc, int noarg) { qse_awk_nde_t* head, * curr, * nde; @@ -6214,7 +6214,7 @@ static int preget_token (qse_awk_t* awk) } } -static int classify_ident (qse_awk_t* awk, const qse_xstr_t* name) +static int classify_ident (qse_awk_t* awk, const qse_cstr_t* name) { /* perform binary search */ @@ -6266,7 +6266,7 @@ static int deparse (qse_awk_t* awk) struct deparse_func_t df; int n = 0; qse_ssize_t op; - qse_xstr_t kw; + qse_cstr_t kw; QSE_ASSERT (awk->sio.outf != QSE_NULL); @@ -6376,7 +6376,7 @@ static int deparse (qse_awk_t* awk) for (nde = awk->tree.begin; nde != QSE_NULL; nde = nde->next) { - qse_xstr_t kw; + qse_cstr_t kw; qse_awk_getkwname (awk, QSE_AWK_KWID_BEGIN, &kw); @@ -6438,7 +6438,7 @@ static int deparse (qse_awk_t* awk) for (nde = awk->tree.end; nde != QSE_NULL; nde = nde->next) { - qse_xstr_t kw; + qse_cstr_t kw; qse_awk_getkwname (awk, QSE_AWK_KWID_END, &kw); @@ -6480,7 +6480,7 @@ static qse_htb_walk_t deparse_func ( struct deparse_func_t* df = (struct deparse_func_t*)arg; qse_awk_fun_t* fun = (qse_awk_fun_t*)QSE_HTB_VPTR(pair); qse_size_t i, n; - qse_xstr_t kw; + qse_cstr_t kw; QSE_ASSERT (qse_strxncmp (QSE_HTB_KPTR(pair), QSE_HTB_KLEN(pair), fun->name.ptr, fun->name.len) == 0); @@ -6641,13 +6641,13 @@ static struct #endif static qse_awk_mod_t* query_module ( - qse_awk_t* awk, const qse_xstr_t segs[], int nsegs, + qse_awk_t* awk, const qse_cstr_t segs[], int nsegs, qse_awk_mod_sym_t* sym) { qse_rbt_pair_t* pair; qse_awk_mod_data_t* mdp; - qse_xstr_t ea; + qse_cstr_t ea; int n; QSE_ASSERT (nsegs == 2); diff --git a/qse/lib/awk/parse.h b/qse/lib/awk/parse.h index ef2e9973..0b0844e9 100644 --- a/qse/lib/awk/parse.h +++ b/qse/lib/awk/parse.h @@ -77,7 +77,7 @@ const qse_char_t* qse_awk_getgblname ( void qse_awk_getkwname ( qse_awk_t* awk, qse_awk_kwid_t id, - qse_xstr_t* s + qse_cstr_t* s ); int qse_awk_initgbls ( diff --git a/qse/lib/awk/rec.c b/qse/lib/awk/rec.c index abe08938..e839c4b1 100644 --- a/qse/lib/awk/rec.c +++ b/qse/lib/awk/rec.c @@ -22,10 +22,10 @@ static int split_record (qse_awk_rtx_t* run); static int recomp_record_fields ( - qse_awk_rtx_t* run, qse_size_t lv, const qse_xstr_t* str); + qse_awk_rtx_t* run, qse_size_t lv, const qse_cstr_t* str); int qse_awk_rtx_setrec ( - qse_awk_rtx_t* run, qse_size_t idx, const qse_xstr_t* str) + qse_awk_rtx_t* run, qse_size_t idx, const qse_cstr_t* str) { qse_awk_val_t* v; @@ -94,7 +94,7 @@ int qse_awk_rtx_setrec ( static int split_record (qse_awk_rtx_t* rtx) { - qse_xstr_t tok; + qse_cstr_t tok; qse_char_t* p, * px; qse_size_t len, nflds; qse_awk_val_t* v, * fs; @@ -390,7 +390,7 @@ int qse_awk_rtx_clrrec (qse_awk_rtx_t* run, int skip_inrec_line) } static int recomp_record_fields ( - qse_awk_rtx_t* run, qse_size_t lv, const qse_xstr_t* str) + qse_awk_rtx_t* run, qse_size_t lv, const qse_cstr_t* str) { qse_awk_val_t* v; qse_size_t max, i, nflds; diff --git a/qse/lib/awk/rio.c b/qse/lib/awk/rio.c index 6009ea07..fd4e6363 100644 --- a/qse/lib/awk/rio.c +++ b/qse/lib/awk/rio.c @@ -191,7 +191,7 @@ static int find_rio_in ( } static QSE_INLINE int resolve_rs ( - qse_awk_rtx_t* rtx, qse_awk_val_t* rs, qse_xstr_t* rrs) + qse_awk_rtx_t* rtx, qse_awk_val_t* rs, qse_cstr_t* rrs) { int ret = 0; @@ -219,7 +219,7 @@ static QSE_INLINE int resolve_rs ( static QSE_INLINE int match_long_rs ( qse_awk_rtx_t* run, qse_str_t* buf, qse_awk_rio_arg_t* p) { - qse_xstr_t match; + qse_cstr_t match; qse_awk_errnum_t errnum; int ret; @@ -294,7 +294,7 @@ int qse_awk_rtx_readio ( int ret; qse_awk_val_t* rs; - qse_xstr_t rrs; + qse_cstr_t rrs; qse_size_t line_len = 0; qse_char_t c = QSE_T('\0'), pc; diff --git a/qse/lib/awk/run.c b/qse/lib/awk/run.c index 1e444600..81e0a335 100644 --- a/qse/lib/awk/run.c +++ b/qse/lib/awk/run.c @@ -77,7 +77,7 @@ struct pafv #define SETERR_ARG_LOC(rtx,code,ep,el,loc) \ do { \ - qse_xstr_t __ea; \ + qse_cstr_t __ea; \ __ea.len = (el); __ea.ptr = (ep); \ qse_awk_rtx_seterror ((rtx), (code), &__ea, (loc)); \ } while (0) @@ -278,7 +278,7 @@ QSE_INLINE qse_awk_val_t* qse_awk_rtx_getgbl (qse_awk_rtx_t* run, int id) return RTX_STACK_GBL (run, id); } -const qse_xstr_t* qse_awk_rtx_getsubsep (qse_awk_rtx_t* run) +const qse_cstr_t* qse_awk_rtx_getsubsep (qse_awk_rtx_t* run) { return &run->gbl.subsep; } @@ -347,7 +347,7 @@ static int set_global ( else { /* qse_awk_rtx_setgbl() has been called */ - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (qse_char_t*)qse_awk_getgblname (rtx->awk, idx, &ea.len); SETERR_ARGX (rtx, errnum, &ea); } @@ -367,7 +367,7 @@ static int set_global ( /* TODO: use global variable attribute. can it be a map? can it be a scalar? is it read-only???? */ - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (qse_char_t*)qse_awk_getgblname (rtx->awk, idx, &ea.len); SETERR_ARGX (rtx, QSE_AWK_ENSCALARTOMAP, &ea); return -1; @@ -578,7 +578,7 @@ static int set_global ( case QSE_AWK_GBL_RS: { - qse_xstr_t rss; + qse_cstr_t rss; if (val->type == QSE_AWK_VAL_STR) { @@ -1527,7 +1527,7 @@ qse_awk_fun_t* qse_awk_rtx_findfun (qse_awk_rtx_t* rtx, const qse_char_t* name) if (pair == QSE_NULL) { - qse_xstr_t nm; + qse_cstr_t nm; nm.ptr = (qse_char_t*)name; nm.len = qse_strlen(name); @@ -3214,7 +3214,7 @@ static qse_awk_val_t* eval_expression (qse_awk_rtx_t* rtx, qse_awk_nde_t* nde) if (v->type == QSE_AWK_VAL_REX) { - qse_xstr_t vs; + qse_cstr_t vs; int opt = 0; /* special case where a regular expression is used in @@ -3767,7 +3767,7 @@ static qse_awk_val_t* do_assignment_pos ( { qse_awk_val_t* v; qse_awk_int_t lv; - qse_xstr_t str; + qse_cstr_t str; int n; v = eval_expression (run, pos->val); @@ -4952,7 +4952,7 @@ static qse_awk_val_t* eval_binop_match0 ( const qse_awk_loc_t* lloc, const qse_awk_loc_t* rloc, int ret) { qse_awk_val_t* res; - qse_xstr_t out; + qse_cstr_t out; int n; out.ptr = qse_awk_rtx_getvalstr (rtx, left, &out.len); @@ -6726,7 +6726,7 @@ static qse_char_t* idxnde_to_str ( { /* multidimensional index */ qse_str_t idxstr; - qse_xstr_t tmp; + qse_cstr_t tmp; qse_awk_rtx_valtostr_out_t out; out.type = QSE_AWK_RTX_VALTOSTR_STRPCAT; diff --git a/qse/lib/awk/std.c b/qse/lib/awk/std.c index 6a6453a6..5b458e55 100644 --- a/qse/lib/awk/std.c +++ b/qse/lib/awk/std.c @@ -455,7 +455,7 @@ static qse_sio_t* open_sio (qse_awk_t* awk, const qse_char_t* file, int flags) sio = qse_sio_open (awk->mmgr, 0, file, flags); if (sio == QSE_NULL) { - qse_xstr_t errarg; + qse_cstr_t errarg; errarg.ptr = (qse_char_t*)file; errarg.len = qse_strlen(file); qse_awk_seterrnum (awk, QSE_AWK_EOPEN, &errarg); @@ -469,7 +469,7 @@ static qse_sio_t* open_sio_rtx (qse_awk_rtx_t* rtx, const qse_char_t* file, int sio = qse_sio_open (rtx->awk->mmgr, 0, file, flags); if (sio == QSE_NULL) { - qse_xstr_t errarg; + qse_cstr_t errarg; errarg.ptr = (qse_char_t*)file; errarg.len = qse_strlen(file); qse_awk_rtx_seterrnum (rtx, QSE_AWK_EOPEN, &errarg); @@ -477,7 +477,7 @@ static qse_sio_t* open_sio_rtx (qse_awk_rtx_t* rtx, const qse_char_t* file, int return sio; } -static qse_xstr_t sio_std_names[] = +static qse_cstr_t sio_std_names[] = { { QSE_T("stdin"), 5 }, { QSE_T("stdout"), 6 }, @@ -632,7 +632,7 @@ static qse_ssize_t sf_in_open ( if (dbuf) QSE_MMGR_FREE (awk->mmgr, dbuf); if (arg->handle == QSE_NULL) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (qse_char_t*)arg->name; ea.len = qse_strlen(ea.ptr); qse_awk_seterrnum (awk, QSE_AWK_EOPEN, &ea); @@ -692,7 +692,7 @@ static qse_ssize_t sf_in_read ( n = qse_sio_getstrn (arg->handle, data, size); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (qse_char_t*)xtn->s.in.x[xtn->s.in.xindex].u.file.path; if (ea.ptr == QSE_NULL) ea.ptr = sio_std_names[QSE_SIO_STDIN].ptr; ea.len = qse_strlen(ea.ptr); @@ -756,7 +756,7 @@ static qse_ssize_t sf_in_read ( n = qse_sio_getstrn (arg->handle, data, size); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (qse_char_t*)arg->name; ea.len = qse_strlen(ea.ptr); qse_awk_seterrnum (awk, QSE_AWK_EREAD, &ea); @@ -870,7 +870,7 @@ static qse_ssize_t sf_out ( n = qse_sio_putstrn (xtn->s.out.u.file.sio, data, size); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (qse_char_t*)xtn->s.out.x->u.file.path; if (ea.ptr == QSE_NULL) ea.ptr = sio_std_names[QSE_SIO_STDOUT].ptr; ea.len = qse_strlen(ea.ptr); @@ -1249,7 +1249,7 @@ static qse_ssize_t awk_rio_file ( handle = qse_sio_open (rtx->awk->mmgr, 0, riod->name, flags); if (handle == QSE_NULL) { - qse_xstr_t errarg; + qse_cstr_t errarg; errarg.ptr = riod->name; errarg.len = qse_strlen(riod->name); qse_awk_rtx_seterrnum (rtx, QSE_AWK_EOPEN, &errarg); @@ -1350,7 +1350,7 @@ static int open_rio_console (qse_awk_rtx_t* rtx, qse_awk_rio_arg_t* riod) qse_char_t ibuf[128]; qse_size_t ibuflen; qse_awk_val_t* v; - qse_xstr_t as; + qse_cstr_t as; nextfile: file = rxtn->c.in.files[rxtn->c.in.index]; @@ -1422,7 +1422,7 @@ static int open_rio_console (qse_awk_rtx_t* rtx, qse_awk_rio_arg_t* riod) if (qse_strlen(as.ptr) < as.len) { /* the name contains one or more '\0' */ - qse_xstr_t errarg; + qse_cstr_t errarg; errarg.ptr = as.ptr; /* use this length not to contains '\0' diff --git a/qse/lib/awk/tree.c b/qse/lib/awk/tree.c index 07be8442..a6ecbe48 100644 --- a/qse/lib/awk/tree.c +++ b/qse/lib/awk/tree.c @@ -156,7 +156,7 @@ static int print_tabs (qse_awk_t* awk, int depth) static int print_printx (qse_awk_t* awk, qse_awk_nde_print_t* px) { - qse_xstr_t kw; + qse_cstr_t kw; if (px->type == QSE_AWK_NDE_PRINT) { @@ -188,7 +188,7 @@ static int print_printx (qse_awk_t* awk, qse_awk_nde_print_t* px) static int print_expr (qse_awk_t* awk, qse_awk_nde_t* nde) { - qse_xstr_t kw; + qse_cstr_t kw; switch (nde->type) { @@ -727,7 +727,7 @@ static int print_expr_list (qse_awk_t* awk, qse_awk_nde_t* tree) static int print_stmt (qse_awk_t* awk, qse_awk_nde_t* p, int depth) { qse_size_t i; - qse_xstr_t kw; + qse_cstr_t kw; switch (p->type) { diff --git a/qse/lib/awk/tree.h b/qse/lib/awk/tree.h index e532546a..bedc1a73 100644 --- a/qse/lib/awk/tree.h +++ b/qse/lib/awk/tree.h @@ -154,7 +154,7 @@ struct qse_awk_nde_str_t struct qse_awk_nde_rex_t { QSE_AWK_NDE_HDR; - qse_xstr_t str; + qse_cstr_t str; void* code[2]; /* [0]: case sensitive, [1]: case insensitive */ }; @@ -167,7 +167,7 @@ struct qse_awk_nde_var_t QSE_AWK_NDE_HDR; struct { - qse_xstr_t name; + qse_cstr_t name; qse_size_t idxa; } id; qse_awk_nde_t* idx; /* QSE_NULL for non-XXXXIDX */ @@ -181,7 +181,7 @@ struct qse_awk_nde_fncall_t { struct { - qse_xstr_t name; + qse_cstr_t name; } fun; /* minimum information of a intrinsic function diff --git a/qse/lib/awk/val.c b/qse/lib/awk/val.c index 55cb74c2..81eba461 100644 --- a/qse/lib/awk/val.c +++ b/qse/lib/awk/val.c @@ -202,7 +202,7 @@ qse_awk_val_t* qse_awk_rtx_makefltval (qse_awk_rtx_t* rtx, qse_awk_flt_t v) } qse_awk_val_t* qse_awk_rtx_makestrvalwithxstr ( - qse_awk_rtx_t* rtx, const qse_xstr_t* str) + qse_awk_rtx_t* rtx, const qse_cstr_t* str) { qse_awk_val_str_t* val = QSE_NULL; qse_size_t rlen = str->len; @@ -256,7 +256,7 @@ qse_awk_val_t* qse_awk_rtx_makestrvalwithmbs ( return qse_awk_rtx_makestrval (rtx, mbs, qse_mbslen(mbs)); #else qse_awk_val_t* v; - qse_wxstr_t tmp; + qse_wcstr_t tmp; tmp.ptr = qse_mbstowcsdup (mbs, &tmp.len, rtx->awk->mmgr); if (tmp.ptr == QSE_NULL) @@ -276,7 +276,7 @@ qse_awk_val_t* qse_awk_rtx_makestrvalwithwcs ( { #if defined(QSE_CHAR_IS_MCHAR) qse_awk_val_t* v; - qse_mxstr_t tmp; + qse_mcstr_t tmp; tmp.ptr = qse_wcstombsdup (wcs, &tmp.len, rtx->awk->mmgr); if (tmp.ptr == QSE_NULL) @@ -300,13 +300,13 @@ qse_awk_val_t* qse_awk_rtx_makestrvalwithstr ( } qse_awk_val_t* qse_awk_rtx_makestrvalwithmxstr ( - qse_awk_rtx_t* rtx, const qse_mxstr_t* mxstr) + qse_awk_rtx_t* rtx, const qse_mcstr_t* mxstr) { #if defined(QSE_CHAR_IS_MCHAR) return qse_awk_rtx_makestrvalwithxstr (rtx, mxstr); #else qse_awk_val_t* v; - qse_wxstr_t tmp; + qse_wcstr_t tmp; qse_size_t mbslen; mbslen = mxstr->len; @@ -324,11 +324,11 @@ qse_awk_val_t* qse_awk_rtx_makestrvalwithmxstr ( } qse_awk_val_t* qse_awk_rtx_makestrvalwithwxstr ( - qse_awk_rtx_t* rtx, const qse_wxstr_t* wxstr) + qse_awk_rtx_t* rtx, const qse_wcstr_t* wxstr) { #if defined(QSE_CHAR_IS_MCHAR) qse_awk_val_t* v; - qse_mxstr_t tmp; + qse_mcstr_t tmp; qse_size_t wcslen; wcslen = wxstr->len; @@ -350,7 +350,7 @@ qse_awk_val_t* qse_awk_rtx_makestrvalwithwxstr ( qse_awk_val_t* qse_awk_rtx_makestrval ( qse_awk_rtx_t* rtx, const qse_char_t* str, qse_size_t len) { - qse_xstr_t xstr; + qse_cstr_t xstr; xstr.ptr = (qse_char_t*)str; xstr.len = len; return qse_awk_rtx_makestrvalwithxstr (rtx, &xstr); @@ -409,13 +409,13 @@ init: qse_awk_val_t* qse_awk_rtx_makenstrvalwithstr (qse_awk_rtx_t* rtx, const qse_char_t* str) { - qse_xstr_t xstr; + qse_cstr_t xstr; xstr.ptr = (qse_char_t*)str; xstr.len = qse_strlen(str); return qse_awk_rtx_makenstrvalwithxstr (rtx, &xstr); } -qse_awk_val_t* qse_awk_rtx_makenstrvalwithxstr (qse_awk_rtx_t* rtx, const qse_xstr_t* str) +qse_awk_val_t* qse_awk_rtx_makenstrvalwithxstr (qse_awk_rtx_t* rtx, const qse_cstr_t* str) { int x; qse_awk_val_t* v; @@ -439,7 +439,7 @@ qse_awk_val_t* qse_awk_rtx_makenstrvalwithxstr (qse_awk_rtx_t* rtx, const qse_xs } qse_awk_val_t* qse_awk_rtx_makerexval ( - qse_awk_rtx_t* rtx, const qse_xstr_t* str, void* code[2]) + qse_awk_rtx_t* rtx, const qse_cstr_t* str, void* code[2]) { qse_awk_val_rex_t* val; qse_size_t totsz; @@ -609,17 +609,17 @@ qse_awk_val_t* qse_awk_rtx_makemapvalwithdata (qse_awk_rtx_t* rtx, qse_awk_val_m case QSE_AWK_VAL_MAP_DATA_XSTR: case QSE_AWK_VAL_MAP_DATA_CSTR: - tmp = qse_awk_rtx_makestrvalwithxstr (rtx, (qse_xstr_t*)p->vptr); + tmp = qse_awk_rtx_makestrvalwithxstr (rtx, (qse_cstr_t*)p->vptr); break; case QSE_AWK_VAL_MAP_DATA_MXSTR: case QSE_AWK_VAL_MAP_DATA_MCSTR: - tmp = qse_awk_rtx_makestrvalwithmxstr (rtx, (qse_mxstr_t*)p->vptr); + tmp = qse_awk_rtx_makestrvalwithmxstr (rtx, (qse_mcstr_t*)p->vptr); break; case QSE_AWK_VAL_MAP_DATA_WXSTR: case QSE_AWK_VAL_MAP_DATA_WCSTR: - tmp = qse_awk_rtx_makestrvalwithwxstr (rtx, (qse_wxstr_t*)p->vptr); + tmp = qse_awk_rtx_makestrvalwithwxstr (rtx, (qse_wcstr_t*)p->vptr); break; default: @@ -1770,7 +1770,7 @@ int qse_awk_rtx_setrefval (qse_awk_rtx_t* rtx, qse_awk_val_ref_t* ref, qse_awk_v default: { - qse_xstr_t str; + qse_cstr_t str; int x; str.ptr = qse_awk_rtx_valtostrdup (rtx, val, &str.len); diff --git a/qse/lib/cmn/fs.c b/qse/lib/cmn/fs.c index 1602e09d..d81ce603 100644 --- a/qse/lib/cmn/fs.c +++ b/qse/lib/cmn/fs.c @@ -38,7 +38,7 @@ typedef struct info_t info_t; struct info_t { - qse_xstr_t name; + qse_cstr_t name; #if defined(_WIN32) HANDLE handle; diff --git a/qse/lib/cmn/glob.c b/qse/lib/cmn/glob.c index 2b925d12..caf7c2cb 100644 --- a/qse/lib/cmn/glob.c +++ b/qse/lib/cmn/glob.c @@ -346,7 +346,7 @@ static int handle_non_wild_segments (glob_t* g, segment_t* seg) /* if the segment contains escape sequences, * strip the escape letters off the segment */ - qse_xstr_t tmp; + qse_cstr_t tmp; qse_size_t i; int escaped = 0; diff --git a/qse/lib/cmn/mbwc-str.c b/qse/lib/cmn/mbwc-str.c index f5ec2370..037f3390 100644 --- a/qse/lib/cmn/mbwc-str.c +++ b/qse/lib/cmn/mbwc-str.c @@ -577,7 +577,7 @@ qse_mchar_t* qse_wcsatombsdupwithcmgr ( } qse_mchar_t* qse_wcsnatombsdupwithcmgr ( - const qse_wxstr_t wcs[], qse_size_t* mbslen, qse_mmgr_t* mmgr, qse_cmgr_t* cmgr) + const qse_wcstr_t wcs[], qse_size_t* mbslen, qse_mmgr_t* mmgr, qse_cmgr_t* cmgr) { qse_size_t wl, ml, capa, pos, i; qse_mchar_t* mbs; diff --git a/qse/lib/cmn/mbwc.c b/qse/lib/cmn/mbwc.c index 8d7ac692..74699eca 100644 --- a/qse/lib/cmn/mbwc.c +++ b/qse/lib/cmn/mbwc.c @@ -234,7 +234,7 @@ qse_mchar_t* qse_wcsatombsdup ( } qse_mchar_t* qse_wcsnatombsdup ( - const qse_wxstr_t wcs[], qse_size_t* mbslen, qse_mmgr_t* mmgr) + const qse_wcstr_t wcs[], qse_size_t* mbslen, qse_mmgr_t* mmgr) { return qse_wcsnatombsdupwithcmgr (wcs, mbslen, mmgr, dfl_cmgr); } diff --git a/qse/lib/cmn/nwad.c b/qse/lib/cmn/nwad.c index a7e3ba27..00f9fbee 100644 --- a/qse/lib/cmn/nwad.c +++ b/qse/lib/cmn/nwad.c @@ -61,7 +61,7 @@ int qse_mbsntonwad (const qse_mchar_t* str, qse_size_t len, qse_nwad_t* nwad) { const qse_mchar_t* p; const qse_mchar_t* end; - qse_mxstr_t tmp; + qse_mcstr_t tmp; qse_nwad_t tmpad; QSE_MEMSET (&tmpad, 0, QSE_SIZEOF(tmpad)); @@ -227,7 +227,7 @@ int qse_wcsntonwad (const qse_wchar_t* str, qse_size_t len, qse_nwad_t* nwad) { const qse_wchar_t* p; const qse_wchar_t* end; - qse_wxstr_t tmp; + qse_wcstr_t tmp; qse_nwad_t tmpad; QSE_MEMSET (&tmpad, 0, QSE_SIZEOF(tmpad)); diff --git a/qse/lib/cmn/rex.c b/qse/lib/cmn/rex.c index d0986884..04503603 100644 --- a/qse/lib/cmn/rex.c +++ b/qse/lib/cmn/rex.c @@ -33,7 +33,7 @@ struct comp_t { qse_rex_t* rex; - qse_xstr_t re; + qse_cstr_t re; const qse_char_t* ptr; const qse_char_t* end; @@ -490,7 +490,7 @@ else qse_printf (QSE_T("getc => %c\n"), com->c); struct ccinfo_t { - qse_xstr_t name; + qse_cstr_t name; int (*func) (exec_t* e, qse_char_t c); }; @@ -1982,8 +1982,8 @@ static void fini_exec_dds (exec_t* e) } int qse_rex_exec ( - qse_rex_t* rex, const qse_xstr_t* str, - const qse_xstr_t* substr, qse_xstr_t* matstr) + qse_rex_t* rex, const qse_cstr_t* str, + const qse_cstr_t* substr, qse_cstr_t* matstr) { exec_t e; int n = 0; @@ -2061,8 +2061,8 @@ void* qse_buildrex ( int qse_matchrex ( qse_mmgr_t* mmgr, qse_size_t depth, void* code, int option, - const qse_xstr_t* str, const qse_xstr_t* substr, - qse_xstr_t* match, qse_rex_errnum_t* errnum) + const qse_cstr_t* str, const qse_cstr_t* substr, + qse_cstr_t* match, qse_rex_errnum_t* errnum) { qse_rex_t rex; int n; diff --git a/qse/lib/cmn/str-dup.c b/qse/lib/cmn/str-dup.c index 5906583a..a6e7c7b7 100644 --- a/qse/lib/cmn/str-dup.c +++ b/qse/lib/cmn/str-dup.c @@ -92,7 +92,7 @@ qse_mchar_t* qse_mbsadup (const qse_mchar_t* str[], qse_size_t* len, qse_mmgr_t* return buf; } -qse_mchar_t* qse_mcstrdup (const qse_mxstr_t* str, qse_mmgr_t* mmgr) +qse_mchar_t* qse_mcstrdup (const qse_mcstr_t* str, qse_mmgr_t* mmgr) { qse_mchar_t* buf; @@ -106,7 +106,7 @@ qse_mchar_t* qse_mcstrdup (const qse_mxstr_t* str, qse_mmgr_t* mmgr) return buf; } -qse_mchar_t* qse_mcstradup (const qse_mxstr_t str[], qse_size_t* len, qse_mmgr_t* mmgr) +qse_mchar_t* qse_mcstradup (const qse_mcstr_t str[], qse_size_t* len, qse_mmgr_t* mmgr) { qse_mchar_t* buf, * ptr; qse_size_t i; @@ -201,7 +201,7 @@ qse_wchar_t* qse_wcsadup (const qse_wchar_t* str[], qse_size_t* len, qse_mmgr_t* return buf; } -qse_wchar_t* qse_wcstrdup (const qse_wxstr_t* str, qse_mmgr_t* mmgr) +qse_wchar_t* qse_wcstrdup (const qse_wcstr_t* str, qse_mmgr_t* mmgr) { qse_wchar_t* buf; @@ -215,7 +215,7 @@ qse_wchar_t* qse_wcstrdup (const qse_wxstr_t* str, qse_mmgr_t* mmgr) return buf; } -qse_wchar_t* qse_wcstradup (const qse_wxstr_t str[], qse_size_t* len, qse_mmgr_t* mmgr) +qse_wchar_t* qse_wcstradup (const qse_wcstr_t str[], qse_size_t* len, qse_mmgr_t* mmgr) { qse_wchar_t* buf, * ptr; qse_size_t i; diff --git a/qse/lib/cmn/str-dyn.c b/qse/lib/cmn/str-dyn.c index 62e06d4a..cad55a65 100644 --- a/qse/lib/cmn/str-dyn.c +++ b/qse/lib/cmn/str-dyn.c @@ -97,7 +97,7 @@ static int mbs_to_wcs ( /* -------------------------------------------------------- */ #undef char_t -#undef xstr_t +#undef cstr_t #undef str_sizer_t #undef T #undef strlen @@ -144,7 +144,7 @@ static int mbs_to_wcs ( #undef str_vfcat #define char_t qse_mchar_t -#define xstr_t qse_mxstr_t +#define cstr_t qse_mcstr_t #define str_sizer_t qse_mbs_sizer_t #define T(x) QSE_MT(x) #define strlen(x) qse_mbslen(x) @@ -194,7 +194,7 @@ static int mbs_to_wcs ( /* -------------------------------------------------------- */ #undef char_t -#undef xstr_t +#undef cstr_t #undef str_sizer_t #undef T #undef strlen @@ -241,7 +241,7 @@ static int mbs_to_wcs ( #undef str_vfcat #define char_t qse_wchar_t -#define xstr_t qse_wxstr_t +#define cstr_t qse_wcstr_t #define str_sizer_t qse_wcs_sizer_t #define T(x) QSE_WT(x) #define strlen(x) qse_wcslen(x) diff --git a/qse/lib/cmn/str-dyn.h b/qse/lib/cmn/str-dyn.h index 3b869d23..02ee4fe2 100644 --- a/qse/lib/cmn/str-dyn.h +++ b/qse/lib/cmn/str-dyn.h @@ -86,7 +86,7 @@ void* str_getxtn (str_t* mbs) return QSE_XTN (mbs); } -int str_yield (str_t* str, xstr_t* buf, qse_size_t newcapa) +int str_yield (str_t* str, cstr_t* buf, qse_size_t newcapa) { char_t* tmp; @@ -114,7 +114,7 @@ int str_yield (str_t* str, xstr_t* buf, qse_size_t newcapa) char_t* str_yieldptr (str_t* str, qse_size_t newcapa) { - xstr_t mx; + cstr_t mx; if (str_yield (str, &mx, newcapa) <= -1) return QSE_NULL; return mx.ptr; } diff --git a/qse/lib/cmn/str-fcpy.c b/qse/lib/cmn/str-fcpy.c index 4fc33900..02ea3da1 100644 --- a/qse/lib/cmn/str-fcpy.c +++ b/qse/lib/cmn/str-fcpy.c @@ -22,7 +22,7 @@ #undef T #undef char_t -#undef xstr_t +#undef cstr_t #undef strfcpy #undef strfncpy #undef strxfcpy @@ -30,7 +30,7 @@ #define T(x) QSE_MT(x) #define char_t qse_mchar_t -#define xstr_t qse_mxstr_t +#define cstr_t qse_mcstr_t #define strfcpy qse_mbsfcpy #define strfncpy qse_mbsfncpy #define strxfcpy qse_mbsxfcpy @@ -41,7 +41,7 @@ #undef T #undef char_t -#undef xstr_t +#undef cstr_t #undef strfcpy #undef strfncpy #undef strxfcpy @@ -49,7 +49,7 @@ #define T(x) QSE_WT(x) #define char_t qse_wchar_t -#define xstr_t qse_wxstr_t +#define cstr_t qse_wcstr_t #define strfcpy qse_wcsfcpy #define strfncpy qse_wcsfncpy #define strxfcpy qse_wcsxfcpy diff --git a/qse/lib/cmn/str-fcpy.h b/qse/lib/cmn/str-fcpy.h index cc8278c6..7dedec25 100644 --- a/qse/lib/cmn/str-fcpy.h +++ b/qse/lib/cmn/str-fcpy.h @@ -64,7 +64,7 @@ qse_size_t strfcpy ( } qse_size_t strfncpy ( - char_t* buf, const char_t* fmt, const xstr_t str[]) + char_t* buf, const char_t* fmt, const cstr_t str[]) { char_t* b = buf; const char_t* f = fmt; @@ -181,7 +181,7 @@ fini: qse_size_t strxfncpy ( char_t* buf, qse_size_t bsz, - const char_t* fmt, const xstr_t str[]) + const char_t* fmt, const cstr_t str[]) { char_t* b = buf; char_t* end = buf + bsz - 1; diff --git a/qse/lib/cmn/str-subst.c b/qse/lib/cmn/str-subst.c index 38f5ffe4..32437af5 100644 --- a/qse/lib/cmn/str-subst.c +++ b/qse/lib/cmn/str-subst.c @@ -23,7 +23,7 @@ /* ----------------------------------- */ #undef char_t -#undef xstr_t +#undef cstr_t #undef T #undef NOBUF #undef strlen @@ -34,7 +34,7 @@ #undef strxnsubst #define char_t qse_mchar_t -#define xstr_t qse_mxstr_t +#define cstr_t qse_mcstr_t #define T(x) QSE_MT(x) #define NOBUF QSE_MBSSUBST_NOBUF #define strlen qse_mbslen @@ -48,7 +48,7 @@ /* ----------------------------------- */ #undef char_t -#undef xstr_t +#undef cstr_t #undef T #undef NOBUF #undef strlen @@ -59,7 +59,7 @@ #undef strxnsubst #define char_t qse_wchar_t -#define xstr_t qse_wxstr_t +#define cstr_t qse_wcstr_t #define T(x) QSE_WT(x) #define NOBUF QSE_WCSSUBST_NOBUF #define strlen qse_wcslen diff --git a/qse/lib/cmn/str-subst.h b/qse/lib/cmn/str-subst.h index 0e1aac65..34578313 100644 --- a/qse/lib/cmn/str-subst.h +++ b/qse/lib/cmn/str-subst.h @@ -18,12 +18,12 @@ License along with QSE. If not, see . */ -#if !defined(char_t) && !defined(xstr_t) && !defined(strxsubst) +#if !defined(char_t) && !defined(cstr_t) && !defined(strxsubst) # error Never include this file #endif static const char_t* scan_dollar ( - const char_t* f, qse_size_t l, xstr_t* ident, xstr_t* dfl, int depth) + const char_t* f, qse_size_t l, cstr_t* ident, cstr_t* dfl, int depth) { const char_t* end = f + l; @@ -89,7 +89,7 @@ static const char_t* scan_dollar ( } static char_t* expand_dollar ( - char_t* buf, qse_size_t bsz, const xstr_t* ident, const xstr_t* dfl, + char_t* buf, qse_size_t bsz, const cstr_t* ident, const cstr_t* dfl, subst_t subst, void* ctx) { char_t* tmp; @@ -138,7 +138,7 @@ qse_size_t strxnsubst ( if (*(f + 1) == T('{')) { const char_t* tmp; - xstr_t ident, dfl; + cstr_t ident, dfl; tmp = scan_dollar (f, fend - f, &ident, &dfl, 0); if (tmp == QSE_NULL || ident.len <= 0) goto normal; diff --git a/qse/lib/cmn/str-tok.c b/qse/lib/cmn/str-tok.c index e724ad71..b7e255e0 100644 --- a/qse/lib/cmn/str-tok.c +++ b/qse/lib/cmn/str-tok.c @@ -22,7 +22,7 @@ #include qse_mchar_t* qse_mbstok ( - const qse_mchar_t* s, const qse_mchar_t* delim, qse_mxstr_t* tok) + const qse_mchar_t* s, const qse_mchar_t* delim, qse_mcstr_t* tok) { const qse_mchar_t* p = s, *d; const qse_mchar_t* sp = QSE_NULL, * ep = QSE_NULL; @@ -98,7 +98,7 @@ exit_loop: qse_mchar_t* qse_mbsxtok ( const qse_mchar_t* s, qse_size_t len, - const qse_mchar_t* delim, qse_mxstr_t* tok) + const qse_mchar_t* delim, qse_mcstr_t* tok) { const qse_mchar_t* p = s, *d; const qse_mchar_t* end = s + len; @@ -178,7 +178,7 @@ exit_loop: qse_mchar_t* qse_mbsxntok ( const qse_mchar_t* s, qse_size_t len, - const qse_mchar_t* delim, qse_size_t delim_len, qse_mxstr_t* tok) + const qse_mchar_t* delim, qse_size_t delim_len, qse_mcstr_t* tok) { const qse_mchar_t* p = s, *d; const qse_mchar_t* end = s + len; @@ -259,7 +259,7 @@ exit_loop: qse_wchar_t* qse_wcstok ( - const qse_wchar_t* s, const qse_wchar_t* delim, qse_wxstr_t* tok) + const qse_wchar_t* s, const qse_wchar_t* delim, qse_wcstr_t* tok) { const qse_wchar_t* p = s, *d; const qse_wchar_t* sp = QSE_NULL, * ep = QSE_NULL; @@ -335,7 +335,7 @@ exit_loop: qse_wchar_t* qse_wcsxtok ( const qse_wchar_t* s, qse_size_t len, - const qse_wchar_t* delim, qse_wxstr_t* tok) + const qse_wchar_t* delim, qse_wcstr_t* tok) { const qse_wchar_t* p = s, *d; const qse_wchar_t* end = s + len; @@ -415,7 +415,7 @@ exit_loop: qse_wchar_t* qse_wcsxntok ( const qse_wchar_t* s, qse_size_t len, - const qse_wchar_t* delim, qse_size_t delim_len, qse_wxstr_t* tok) + const qse_wchar_t* delim, qse_size_t delim_len, qse_wcstr_t* tok) { const qse_wchar_t* p = s, *d; const qse_wchar_t* end = s + len; diff --git a/qse/lib/http/htrd.c b/qse/lib/http/htrd.c index e5fa9d60..81f2ac97 100644 --- a/qse/lib/http/htrd.c +++ b/qse/lib/http/htrd.c @@ -187,7 +187,7 @@ void qse_htrd_fini (qse_htrd_t* htrd) static qse_mchar_t* parse_initial_line (qse_htrd_t* htrd, qse_mchar_t* line) { qse_mchar_t* p = line; - qse_mxstr_t tmp; + qse_mcstr_t tmp; #if 0 /* ignore leading spaces excluding crlf */ @@ -294,7 +294,7 @@ static qse_mchar_t* parse_initial_line (qse_htrd_t* htrd, qse_mchar_t* line) #if 0 qse_mchar_t* out; #endif - qse_mxstr_t param; + qse_mcstr_t param; /* skip spaces */ do p++; while (is_space_octet(*p)); @@ -1501,9 +1501,9 @@ int qse_htrd_halt (qse_htrd_t* htrd) } #if 0 -int qse_htrd_scanqparam (qse_htrd_t* htrd, const qse_mxstr_t* cstr) +int qse_htrd_scanqparam (qse_htrd_t* htrd, const qse_mcstr_t* cstr) { - qse_mxstr_t key, val; + qse_mcstr_t key, val; const qse_mchar_t* p, * end; qse_mchar_t* out; diff --git a/qse/lib/http/htre.c b/qse/lib/http/htre.c index 0c960950..7a482ddd 100644 --- a/qse/lib/http/htre.c +++ b/qse/lib/http/htre.c @@ -108,13 +108,13 @@ void qse_htre_clear (qse_htre_t* re) } int qse_htre_setstrfromcstr ( - qse_htre_t* re, qse_mbs_t* str, const qse_mxstr_t* cstr) + qse_htre_t* re, qse_mbs_t* str, const qse_mcstr_t* cstr) { return (qse_mbs_ncpy (str, cstr->ptr, cstr->len) == (qse_size_t)-1)? -1: 0; } int qse_htre_setstrfromxstr ( - qse_htre_t* re, qse_mbs_t* str, const qse_mxstr_t* xstr) + qse_htre_t* re, qse_mbs_t* str, const qse_mcstr_t* xstr) { return (qse_mbs_ncpy (str, xstr->ptr, xstr->len) == (qse_size_t)-1)? -1: 0; } diff --git a/qse/lib/http/http.c b/qse/lib/http/http.c index c833d58a..32e8f492 100644 --- a/qse/lib/http/http.c +++ b/qse/lib/http/http.c @@ -169,7 +169,7 @@ qse_http_method_t qse_mbstohttpmethod (const qse_mchar_t* name) return QSE_HTTP_OTHER; } -qse_http_method_t qse_mcstrtohttpmethod (const qse_mxstr_t* name) +qse_http_method_t qse_mcstrtohttpmethod (const qse_mcstr_t* name) { /* perform binary search */ diff --git a/qse/lib/http/httpd-cgi.c b/qse/lib/http/httpd-cgi.c index a31cd137..ecf85d49 100644 --- a/qse/lib/http/httpd-cgi.c +++ b/qse/lib/http/httpd-cgi.c @@ -33,11 +33,11 @@ typedef struct task_cgi_arg_t task_cgi_arg_t; struct task_cgi_arg_t { - qse_mxstr_t path; - qse_mxstr_t script; - qse_mxstr_t suffix; - qse_mxstr_t root; - qse_mxstr_t shebang; + qse_mcstr_t path; + qse_mcstr_t script; + qse_mcstr_t suffix; + qse_mcstr_t root; + qse_mcstr_t shebang; int nph; qse_htre_t* req; }; diff --git a/qse/lib/http/httpd-dir.c b/qse/lib/http/httpd-dir.c index 9e1172b1..c67b5c63 100644 --- a/qse/lib/http/httpd-dir.c +++ b/qse/lib/http/httpd-dir.c @@ -31,10 +31,10 @@ typedef struct task_dir_t task_dir_t; struct task_dir_t { - qse_mxstr_t path; - qse_mxstr_t qpath; - qse_mxstr_t head; - qse_mxstr_t foot; + qse_mcstr_t path; + qse_mcstr_t qpath; + qse_mcstr_t head; + qse_mcstr_t foot; qse_http_version_t version; int keepalive; int method; @@ -48,10 +48,10 @@ struct task_dseg_t int keepalive; int chunked; - qse_mxstr_t path; - qse_mxstr_t qpath; - qse_mxstr_t head; - qse_mxstr_t foot; + qse_mcstr_t path; + qse_mcstr_t qpath; + qse_mcstr_t head; + qse_mcstr_t foot; qse_ubi_t handle; qse_httpd_dirent_t dent; diff --git a/qse/lib/http/httpd-file.c b/qse/lib/http/httpd-file.c index 79095b7f..0b4d9c8a 100644 --- a/qse/lib/http/httpd-file.c +++ b/qse/lib/http/httpd-file.c @@ -31,7 +31,7 @@ typedef struct task_file_t task_file_t; struct task_file_t { - qse_mxstr_t path; + qse_mcstr_t path; qse_http_version_t version; int keepalive; @@ -41,7 +41,7 @@ struct task_file_t { struct { - qse_mxstr_t mime; + qse_mcstr_t mime; qse_mchar_t if_none_match[ETAG_LEN_MAX + 1]; qse_ntime_t if_modified_since; qse_http_range_t range; diff --git a/qse/lib/http/httpd-std.c b/qse/lib/http/httpd-std.c index 4e71b5a6..27cde3d6 100644 --- a/qse/lib/http/httpd-std.c +++ b/qse/lib/http/httpd-std.c @@ -110,7 +110,7 @@ struct server_xtn_t qse_httpd_serverstd_freersrc_t freersrc; /* temporary buffer to handle authorization */ - qse_mxstr_t auth; + qse_mcstr_t auth; }; static void set_httpd_callbacks (qse_httpd_t* httpd); diff --git a/qse/lib/sed/Sed.cpp b/qse/lib/sed/Sed.cpp index 054646e4..bd6a10ef 100644 --- a/qse/lib/sed/Sed.cpp +++ b/qse/lib/sed/Sed.cpp @@ -112,7 +112,7 @@ Sed::errnum_t Sed::getErrorNumber () const return (sed == QSE_NULL)? QSE_SED_ENOERR: qse_sed_geterrnum (sed); } -void Sed::setError (errnum_t err, const xstr_t* args, const loc_t* loc) +void Sed::setError (errnum_t err, const cstr_t* args, const loc_t* loc) { QSE_ASSERT (sed != QSE_NULL); qse_sed_seterror (sed, err, args, loc); diff --git a/qse/lib/sed/StdSed.cpp b/qse/lib/sed/StdSed.cpp index 34c80127..02baaa60 100644 --- a/qse/lib/sed/StdSed.cpp +++ b/qse/lib/sed/StdSed.cpp @@ -35,7 +35,7 @@ static qse_sio_t* open_sio (StdSed::Stream::Data& io, const qse_char_t* file, in sio = qse_sio_open (((StdSed::sed_t*)io)->mmgr, 0, file, flags); if (sio == QSE_NULL) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (StdSed::char_t*)file; ea.len = qse_strlen (file); ((Sed*)io)->setError (QSE_SED_EIOFIL, &ea); @@ -56,7 +56,7 @@ static qse_sio_t* open_sio_std (StdSed::Stream::Data& io, qse_sio_std_t std, int sio = qse_sio_openstd (((StdSed::sed_t*)io)->mmgr, 0, std, flags); if (sio == QSE_NULL) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (StdSed::char_t*)std_names[std]; ea.len = qse_strlen (std_names[std]); ((Sed*)io)->setError (QSE_SED_EIOFIL, &ea); @@ -124,7 +124,7 @@ StdSed::ssize_t StdSed::FileStream::read (Data& io, char_t* buf, size_t len) // if writing to outfile, set the error message // explicitly. other cases are handled by // the caller in sed.c. - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (char_t*)infile; ea.len = qse_strlen (infile); ((Sed*)io)->setError (QSE_SED_EIOFIL, &ea); @@ -145,7 +145,7 @@ StdSed::ssize_t StdSed::FileStream::write (Data& io, const char_t* buf, size_t l // if writing to outfile, set the error message // explicitly. other cases are handled by // the caller in sed.c. - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = (char_t*)outfile; ea.len = qse_strlen (outfile); ((Sed*)io)->setError (QSE_SED_EIOFIL, &ea); diff --git a/qse/lib/sed/err.c b/qse/lib/sed/err.c index a1e453f8..4a96bed6 100644 --- a/qse/lib/sed/err.c +++ b/qse/lib/sed/err.c @@ -111,7 +111,7 @@ void qse_sed_geterror ( } void qse_sed_seterrnum ( - qse_sed_t* sed, qse_sed_errnum_t errnum, const qse_xstr_t* errarg) + qse_sed_t* sed, qse_sed_errnum_t errnum, const qse_cstr_t* errarg) { qse_sed_seterror (sed, errnum, errarg, QSE_NULL); } @@ -128,7 +128,7 @@ void qse_sed_seterrmsg ( void qse_sed_seterror ( qse_sed_t* sed, qse_sed_errnum_t errnum, - const qse_xstr_t* errarg, const qse_sed_loc_t* errloc) + const qse_cstr_t* errarg, const qse_sed_loc_t* errloc) { const qse_char_t* errfmt; diff --git a/qse/lib/sed/sed.c b/qse/lib/sed/sed.c index 04938fc5..b0faa950 100644 --- a/qse/lib/sed/sed.c +++ b/qse/lib/sed/sed.c @@ -50,7 +50,7 @@ do { qse_sed_seterror (sed, num, QSE_NULL, loc); } while (0) #define SETERR1(sed,num,argp,argl,loc) \ do { \ - qse_xstr_t __ea__; \ + qse_cstr_t __ea__; \ __ea__.ptr = argp; __ea__.len = argl; \ qse_sed_seterror (sed, num, &__ea__, loc); \ } while (0) @@ -216,7 +216,7 @@ int qse_sed_getopt (qse_sed_t* sed, qse_sed_opt_t id, void* value) } static void* build_rex ( - qse_sed_t* sed, const qse_xstr_t* str, + qse_sed_t* sed, const qse_cstr_t* str, int ignorecase, const qse_sed_loc_t* loc) { #if defined(USE_REX) @@ -317,8 +317,8 @@ static QSE_INLINE void free_rex (qse_sed_t* sed, void* rex) #if !defined(USE_REX) static int matchtre ( qse_sed_t* sed, qse_tre_t* tre, int opt, - const qse_xstr_t* str, qse_xstr_t* mat, - qse_xstr_t submat[9], const qse_sed_loc_t* loc) + const qse_cstr_t* str, qse_cstr_t* mat, + qse_cstr_t submat[9], const qse_sed_loc_t* loc) { #if defined(QSE_CHAR_IS_MCHAR) && defined(USE_REGEX) regmatch_t match[10]; @@ -1240,7 +1240,7 @@ oops: return -1; } -static int get_file (qse_sed_t* sed, qse_xstr_t* xstr) +static int get_file (qse_sed_t* sed, qse_cstr_t* xstr) { qse_cint_t c; qse_str_t* t = QSE_NULL; @@ -2728,7 +2728,7 @@ static int emit_appends (qse_sed_t* sed) return 0; } -static const qse_char_t* trim_line (qse_sed_t* sed, qse_xstr_t* str) +static const qse_char_t* trim_line (qse_sed_t* sed, qse_cstr_t* str) { const qse_char_t* lineterm; @@ -2756,14 +2756,14 @@ static const qse_char_t* trim_line (qse_sed_t* sed, qse_xstr_t* str) static int do_subst (qse_sed_t* sed, qse_sed_cmd_t* cmd) { - qse_xstr_t mat, pmat; + qse_cstr_t mat, pmat; int opt = 0, repl = 0, n; #if defined(USE_REX) qse_rex_errnum_t errnum; #endif const qse_char_t* lineterm; - qse_xstr_t str, cur; + qse_cstr_t str, cur; const qse_char_t* str_end; qse_size_t m, i, max_count, sub_count; @@ -2790,7 +2790,7 @@ static int do_subst (qse_sed_t* sed, qse_sed_cmd_t* cmd) while (cur.ptr <= str_end) { #ifndef USE_REX - qse_xstr_t submat[9]; + qse_cstr_t submat[9]; QSE_MEMSET (submat, 0, QSE_SIZEOF(submat)); #endif @@ -3017,7 +3017,7 @@ static int do_subst (qse_sed_t* sed, qse_sed_cmd_t* cmd) } static int split_into_fields_for_cut ( - qse_sed_t* sed, qse_sed_cmd_t* cmd, const qse_xstr_t* str) + qse_sed_t* sed, qse_sed_cmd_t* cmd, const qse_cstr_t* str) { qse_size_t i, x = 0, xl = 0; @@ -3058,7 +3058,7 @@ static int split_into_fields_for_cut ( if (x >= sed->e.cutf.cflds) { - qse_xstr_t* tmp; + qse_cstr_t* tmp; qse_size_t nsz; nsz = sed->e.cutf.cflds; @@ -3100,7 +3100,7 @@ static int do_cut (qse_sed_t* sed, qse_sed_cmd_t* cmd) { qse_sed_cut_sel_t* b; const qse_char_t* lineterm; - qse_xstr_t str; + qse_cstr_t str; int out_state; qse_str_clear (&sed->e.txt.scratch); @@ -3245,9 +3245,9 @@ static int match_a (qse_sed_t* sed, qse_sed_cmd_t* cmd, qse_sed_adr_t* a) #if defined(USE_REX) int n; qse_rex_errnum_t errnum; - qse_xstr_t match; + qse_cstr_t match; #endif - qse_xstr_t line; + qse_cstr_t line; void* rex; QSE_ASSERT (a->u.rex != QSE_NULL); @@ -3792,7 +3792,7 @@ static int init_command_block_for_exec (qse_sed_t* sed, qse_sed_cmd_blk_t* b) for (i = 0; i < b->len; i++) { qse_sed_cmd_t* c = &b->buf[i]; - const qse_xstr_t* file = QSE_NULL; + const qse_cstr_t* file = QSE_NULL; /* clear states */ c->state.a1_matched = 0; @@ -3830,7 +3830,7 @@ static int init_command_block_for_exec (qse_sed_t* sed, qse_sed_cmd_blk_t* b) { /* resolve unresolved branch targets */ qse_map_pair_t* pair; - qse_xstr_t* lab = &c->u.branch.label; + qse_cstr_t* lab = &c->u.branch.label; if (lab->ptr == QSE_NULL) { @@ -4188,7 +4188,7 @@ void qse_sed_freemem (qse_sed_t* sed, void* ptr) } -void qse_sed_getspace (qse_sed_t* sed, qse_sed_space_t space, qse_xstr_t* str) +void qse_sed_getspace (qse_sed_t* sed, qse_sed_space_t space, qse_cstr_t* str) { switch (space) { diff --git a/qse/lib/sed/sed.h b/qse/lib/sed/sed.h index 7c0fcabb..476301f1 100644 --- a/qse/lib/sed/sed.h +++ b/qse/lib/sed/sed.h @@ -201,8 +201,8 @@ struct qse_sed_t { qse_size_t nflds; /**< the number of fields */ qse_size_t cflds; /**< capacity of flds field */ - qse_xstr_t sflds[128]; /**< static field buffer */ - qse_xstr_t* flds; + qse_cstr_t sflds[128]; /**< static field buffer */ + qse_cstr_t* flds; int delimited; } cutf; diff --git a/qse/lib/sed/std.c b/qse/lib/sed/std.c index e89cb649..107a7642 100644 --- a/qse/lib/sed/std.c +++ b/qse/lib/sed/std.c @@ -142,7 +142,7 @@ static qse_sio_t* open_sio_file (qse_sed_t* sed, const qse_char_t* file, int fla sio = qse_sio_open (sed->mmgr, 0, file, flags); if (sio == QSE_NULL) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = file; ea.len = qse_strlen (file); qse_sed_seterrnum (sed, QSE_SED_EIOFIL, &ea); @@ -170,7 +170,7 @@ static qse_sio_t* open_sio_std (qse_sed_t* sed, qse_sio_std_t std, int flags) sio = qse_sio_openstd (sed->mmgr, 0, std, flags); if (sio == QSE_NULL) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = sio_std_names[std].ptr; ea.len = sio_std_names[std].len; qse_sed_seterrnum (sed, QSE_SED_EIOFIL, &ea); @@ -389,7 +389,7 @@ static qse_ssize_t read_input_stream ( { if (io->type == QSE_SED_IOSTD_FILE) { - qse_xstr_t ea; + qse_cstr_t ea; if (io->u.file.path) { ea.ptr = io->u.file.path; @@ -440,7 +440,7 @@ static qse_ssize_t read_input_stream ( /* failed to open the next input stream */ if (next->type == QSE_SED_IOSTD_FILE) { - qse_xstr_t ea; + qse_cstr_t ea; if (next->u.file.path) { ea.ptr = next->u.file.path; @@ -578,7 +578,7 @@ static qse_ssize_t x_in ( n = qse_sio_getstrn (arg->handle, buf, len); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = sio_std_names[QSE_SIO_STDIN].ptr; ea.len = sio_std_names[QSE_SIO_STDIN].len; qse_sed_seterrnum (sed, QSE_SED_EIOFIL, &ea); @@ -594,7 +594,7 @@ static qse_ssize_t x_in ( n = qse_sio_getstrn (arg->handle, buf, len); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = arg->path; ea.len = qse_strlen (arg->path); qse_sed_seterrnum (sed, QSE_SED_EIOFIL, &ea); @@ -691,7 +691,7 @@ static qse_ssize_t x_out ( n = qse_sio_putstrn (arg->handle, dat, len); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = sio_std_names[QSE_SIO_STDOUT].ptr; ea.len = sio_std_names[QSE_SIO_STDOUT].len; qse_sed_seterrnum (sed, QSE_SED_EIOFIL, &ea); @@ -719,7 +719,7 @@ static qse_ssize_t x_out ( n = qse_sio_putstrn (arg->handle, dat, len); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; if (io->u.file.path) { ea.ptr = io->u.file.path; @@ -742,7 +742,7 @@ static qse_ssize_t x_out ( n = qse_sio_putstrn (arg->handle, dat, len); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = arg->path; ea.len = qse_strlen(arg->path); qse_sed_seterrnum (sed, QSE_SED_EIOFIL, &ea); @@ -849,7 +849,7 @@ int qse_sed_compstdstr (qse_sed_t* sed, const qse_char_t* script) return qse_sed_compstd (sed, in, QSE_NULL); } -int qse_sed_compstdxstr (qse_sed_t* sed, const qse_xstr_t* script) +int qse_sed_compstdxstr (qse_sed_t* sed, const qse_cstr_t* script) { qse_sed_iostd_t in[2]; @@ -889,8 +889,8 @@ int qse_sed_execstdfile ( } int qse_sed_execstdxstr ( - qse_sed_t* sed, const qse_xstr_t* instr, - qse_xstr_t* outstr, qse_cmgr_t* cmgr) + qse_sed_t* sed, const qse_cstr_t* instr, + qse_cstr_t* outstr, qse_cmgr_t* cmgr) { qse_sed_iostd_t in[2]; qse_sed_iostd_t out; diff --git a/qse/lib/xli/err.c b/qse/lib/xli/err.c index b8169a4a..a2e954b2 100644 --- a/qse/lib/xli/err.c +++ b/qse/lib/xli/err.c @@ -105,7 +105,7 @@ void qse_xli_geterror ( } void qse_xli_seterrnum ( - qse_xli_t* xli, qse_xli_errnum_t errnum, const qse_xstr_t* errarg) + qse_xli_t* xli, qse_xli_errnum_t errnum, const qse_cstr_t* errarg) { qse_xli_seterror (xli, errnum, errarg, QSE_NULL); } @@ -122,7 +122,7 @@ void qse_xli_seterrmsg ( void qse_xli_seterror ( qse_xli_t* xli, qse_xli_errnum_t errnum, - const qse_xstr_t* errarg, const qse_xli_loc_t* errloc) + const qse_cstr_t* errarg, const qse_xli_loc_t* errloc) { const qse_char_t* errfmt; diff --git a/qse/lib/xli/read.c b/qse/lib/xli/read.c index 60e2177f..8600001c 100644 --- a/qse/lib/xli/read.c +++ b/qse/lib/xli/read.c @@ -101,7 +101,7 @@ typedef struct kwent_t kwent_t; struct kwent_t { - qse_xstr_t name; + qse_cstr_t name; int type; }; @@ -198,7 +198,7 @@ static int skip_comment (qse_xli_t* xli, qse_xli_tok_t* tok) return 0; } -static int classify_ident (qse_xli_t* xli, const qse_xstr_t* name) +static int classify_ident (qse_xli_t* xli, const qse_cstr_t* name) { /* perform binary search */ @@ -601,7 +601,7 @@ retry: c != QSE_T(',') && c != QSE_T('.') && c != QSE_T('|')) { qse_char_t cc = (qse_char_t)c; - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = &cc; ea.len = 1; qse_xli_seterror (xli, QSE_XLI_ETAGCHR, &ea, &tok->loc); @@ -620,7 +620,7 @@ retry: /* not handled yet */ if (c == QSE_T('\0')) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = QSE_T(""); ea.len = 5; qse_xli_seterror (xli, QSE_XLI_ELXCHR, &ea, &tok->loc); @@ -628,7 +628,7 @@ retry: else { qse_char_t cc = (qse_char_t)c; - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = &cc; ea.len = 1; qse_xli_seterror (xli, QSE_XLI_ELXCHR, &ea, &tok->loc); @@ -662,7 +662,7 @@ static int get_token (qse_xli_t* xli) static int read_pair (qse_xli_t* xli, const qse_char_t* keytag) { - qse_xstr_t key; + qse_cstr_t key; qse_xli_loc_t kloc; qse_char_t* name; qse_xli_pair_t* pair; @@ -707,7 +707,7 @@ static int read_pair (qse_xli_t* xli, const qse_char_t* keytag) pair = qse_rbt_search (xli->schema, QSE_STR_PTR(xli->dotted_curkey), QSE_STR_LEN(xli->dotted_curkey)); if (pair == QSE_NULL) { - qse_xli_seterror (xli, QSE_XLI_EUDKEY, (const qse_xstr_t*)&key, &kloc); + qse_xli_seterror (xli, QSE_XLI_EUDKEY, (const qse_cstr_t*)&key, &kloc); goto oops; } @@ -776,7 +776,7 @@ static int read_pair (qse_xli_t* xli, const qse_char_t* keytag) { /* SCM_KEYALIAS is specified for this particular item. Let the alias be required. * If KEYALIAS is globally specified with the specific one, it's optional. */ - qse_xli_seterrnum (xli, QSE_XLI_ENOALI, (const qse_xstr_t*)&key); + qse_xli_seterrnum (xli, QSE_XLI_ENOALI, (const qse_cstr_t*)&key); goto oops; } } @@ -805,7 +805,7 @@ static int read_pair (qse_xli_t* xli, const qse_char_t* keytag) if (scm && !(scm->flags & QSE_XLI_SCM_VALSTR)) { /* check the value type */ - qse_xli_seterror (xli, QSE_XLI_EILVAL, (const qse_xstr_t*)&key, &kloc); + qse_xli_seterror (xli, QSE_XLI_EILVAL, (const qse_cstr_t*)&key, &kloc); goto oops; } @@ -868,7 +868,7 @@ static int read_pair (qse_xli_t* xli, const qse_char_t* keytag) if (scm && (segcount < scm->str_minseg || segcount > scm->str_maxseg)) { /* too many string segments for the key */ - qse_xli_seterror (xli, QSE_XLI_ESTRSEG, (const qse_xstr_t*)&key, &kloc); + qse_xli_seterror (xli, QSE_XLI_ESTRSEG, (const qse_cstr_t*)&key, &kloc); goto oops; } @@ -891,7 +891,7 @@ static int read_pair (qse_xli_t* xli, const qse_char_t* keytag) if (scm && !(scm->flags & QSE_XLI_SCM_VALLIST)) { /* check the value type */ - qse_xli_seterror (xli, QSE_XLI_EILVAL, (const qse_xstr_t*)&key, &kloc); + qse_xli_seterror (xli, QSE_XLI_EILVAL, (const qse_cstr_t*)&key, &kloc); goto oops; } @@ -924,7 +924,7 @@ static int read_pair (qse_xli_t* xli, const qse_char_t* keytag) { if (xli->opt.trait & QSE_XLI_NONIL) { - qse_xli_seterror (xli, QSE_XLI_ENOVAL, (const qse_xstr_t*)&key, &kloc); + qse_xli_seterror (xli, QSE_XLI_ENOVAL, (const qse_cstr_t*)&key, &kloc); goto oops; } @@ -932,7 +932,7 @@ static int read_pair (qse_xli_t* xli, const qse_char_t* keytag) !((scm->flags & QSE_XLI_SCM_VALSTR) && scm->str_minseg <= 0)) { /* check the value type */ - qse_xli_seterror (xli, QSE_XLI_ENOVAL, (const qse_xstr_t*)&key, &kloc); + qse_xli_seterror (xli, QSE_XLI_ENOVAL, (const qse_cstr_t*)&key, &kloc); goto oops; } diff --git a/qse/lib/xli/std.c b/qse/lib/xli/std.c index 1cbc7559..ee0c3115 100644 --- a/qse/lib/xli/std.c +++ b/qse/lib/xli/std.c @@ -114,7 +114,7 @@ static qse_sio_t* open_sio (qse_xli_t* xli, const qse_char_t* file, int flags) sio = qse_sio_open (xli->mmgr, 0, file, flags); if (sio == QSE_NULL) { - qse_xstr_t errarg; + qse_cstr_t errarg; errarg.ptr = file; errarg.len = qse_strlen(file); qse_xli_seterrnum (xli, QSE_XLI_EIOFIL, &errarg); @@ -122,7 +122,7 @@ static qse_sio_t* open_sio (qse_xli_t* xli, const qse_char_t* file, int flags) return sio; } -static qse_xstr_t sio_std_names[] = +static qse_cstr_t sio_std_names[] = { { QSE_T("stdin"), 5 }, { QSE_T("stdout"), 6 }, @@ -232,7 +232,7 @@ static qse_ssize_t sf_in_open (qse_xli_t* xli, qse_xli_io_arg_t* arg, xtn_t* xtn if (dbuf) QSE_MMGR_FREE (xli->mmgr, dbuf); if (arg->handle == QSE_NULL) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = arg->name; ea.len = qse_strlen(ea.ptr); qse_xli_seterrnum (xli, QSE_XLI_EIOFIL, &ea); @@ -290,7 +290,7 @@ static qse_ssize_t sf_in_read ( n = qse_sio_getstrn (arg->handle, data, size); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = xtn->s.in.x->u.file.path; if (ea.ptr == QSE_NULL) ea.ptr = sio_std_names[QSE_SIO_STDIN].ptr; ea.len = qse_strlen(ea.ptr); @@ -326,7 +326,7 @@ static qse_ssize_t sf_in_read ( n = qse_sio_getstrn (arg->handle, data, size); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = arg->name; ea.len = qse_strlen(ea.ptr); qse_xli_seterrnum (xli, QSE_XLI_EIOFIL, &ea); @@ -459,7 +459,7 @@ static qse_ssize_t sf_out_open (qse_xli_t* xli, qse_xli_io_arg_t* arg, xtn_t* xt if (dbuf) QSE_MMGR_FREE (xli->mmgr, dbuf); if (arg->handle == QSE_NULL) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = arg->name; ea.len = qse_strlen(ea.ptr); qse_xli_seterrnum (xli, QSE_XLI_EIOFIL, &ea); @@ -517,7 +517,7 @@ static qse_ssize_t sf_out_write ( n = qse_sio_putstrn (arg->handle, data, size); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = xtn->s.out.x->u.file.path; if (ea.ptr == QSE_NULL) ea.ptr = sio_std_names[QSE_SIO_STDOUT].ptr; ea.len = qse_strlen(ea.ptr); @@ -555,7 +555,7 @@ static qse_ssize_t sf_out_write ( n = qse_sio_putstrn (arg->handle, data, size); if (n <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = arg->name; ea.len = qse_strlen(ea.ptr); qse_xli_seterrnum (xli, QSE_XLI_EIOFIL, &ea); diff --git a/qse/lib/xli/xli.c b/qse/lib/xli/xli.c index e5277447..b2093641 100644 --- a/qse/lib/xli/xli.c +++ b/qse/lib/xli/xli.c @@ -225,7 +225,7 @@ static void insert_atom ( static qse_xli_pair_t* insert_pair ( qse_xli_t* xli, qse_xli_list_t* parent, qse_xli_atom_t* peer, - const qse_xstr_t* key, const qse_xstr_t* alias, const qse_xstr_t* keytag, qse_xli_val_t* value) + const qse_cstr_t* key, const qse_cstr_t* alias, const qse_cstr_t* keytag, qse_xli_val_t* value) { qse_xli_pair_t* pair; qse_size_t alen, tlen; @@ -270,9 +270,9 @@ qse_xli_pair_t* qse_xli_insertpair ( const qse_char_t* key, const qse_char_t* alias, const qse_char_t* keytag, qse_xli_val_t* value) { - qse_xstr_t k; - qse_xstr_t a, * ap = QSE_NULL; - qse_xstr_t t, * tp = QSE_NULL; + qse_cstr_t k; + qse_cstr_t a, * ap = QSE_NULL; + qse_cstr_t t, * tp = QSE_NULL; k.ptr = key; k.len = qse_strlen (key); @@ -312,7 +312,7 @@ qse_xli_pair_t* qse_xli_insertpairwithemptylist ( qse_xli_pair_t* qse_xli_insertpairwithstr ( qse_xli_t* xli, qse_xli_list_t* parent, qse_xli_atom_t* peer, const qse_char_t* key, const qse_char_t* alias, const qse_char_t* keytag, - const qse_xstr_t* value, const qse_char_t* strtag) + const qse_cstr_t* value, const qse_char_t* strtag) { qse_xli_str_t* val; qse_xli_pair_t* tmp; @@ -344,7 +344,7 @@ qse_xli_pair_t* qse_xli_insertpairwithstr ( qse_xli_pair_t* qse_xli_insertpairwithstrs ( qse_xli_t* xli, qse_xli_list_t* parent, qse_xli_atom_t* peer, const qse_char_t* key, const qse_char_t* alias, const qse_char_t* keytag, - const qse_xstr_t value[], qse_size_t count) + const qse_cstr_t value[], qse_size_t count) { qse_xli_pair_t* tmp; qse_xli_str_t* str; @@ -534,7 +534,7 @@ qse_xli_list_t* qse_xli_yieldroot (qse_xli_t* xli) /* ------------------------------------------------------ */ static qse_size_t count_pairs_by_key ( - qse_xli_t* xli, const qse_xli_list_t* list, const qse_xstr_t* key) + qse_xli_t* xli, const qse_xli_list_t* list, const qse_cstr_t* key) { qse_xli_atom_t* p; qse_size_t count = 0; @@ -557,7 +557,7 @@ static qse_size_t count_pairs_by_key ( static qse_xli_pair_t* find_pair_by_key_and_alias ( qse_xli_t* xli, const qse_xli_list_t* list, - const qse_xstr_t* key, const qse_xstr_t* alias) + const qse_cstr_t* key, const qse_cstr_t* alias) { qse_xli_atom_t* p; @@ -583,7 +583,7 @@ static qse_xli_pair_t* find_pair_by_key_and_alias ( static qse_xli_pair_t* find_pair_by_key_and_index ( qse_xli_t* xli, const qse_xli_list_t* list, - const qse_xstr_t* key, qse_size_t index) + const qse_cstr_t* key, qse_size_t index) { qse_xli_atom_t* p; qse_size_t count = 0; @@ -611,8 +611,8 @@ static qse_xli_pair_t* find_pair_by_key_and_index ( struct fqpn_seg_t { - qse_xstr_t ki; /* key + index */ - qse_xstr_t key; + qse_cstr_t ki; /* key + index */ + qse_cstr_t key; enum { FQPN_SEG_IDX_NONE, @@ -623,7 +623,7 @@ struct fqpn_seg_t union { qse_size_t number; - qse_xstr_t alias; + qse_cstr_t alias; } idx; }; @@ -835,7 +835,7 @@ noent: } qse_xli_str_t* qse_xli_addsegtostr ( - qse_xli_t* xli, qse_xli_str_t* str, const qse_char_t* tag, const qse_xstr_t* value) + qse_xli_t* xli, qse_xli_str_t* str, const qse_char_t* tag, const qse_cstr_t* value) { qse_xli_str_t* val; qse_size_t reqlen; @@ -917,7 +917,7 @@ int qse_xli_undefinepair (qse_xli_t* xli, const qse_char_t* fqpn) { if (qse_rbt_delete (xli->schema, fqpn, qse_strlen(fqpn)) <= -1) { - qse_xstr_t ea; + qse_cstr_t ea; ea.ptr = fqpn; ea.len = qse_strlen (ea.ptr); qse_xli_seterrnum (xli, QSE_XLI_ENOENT, &ea); diff --git a/qse/samples/awk/awk07.c b/qse/samples/awk/awk07.c index f832542c..06839fef 100644 --- a/qse/samples/awk/awk07.c +++ b/qse/samples/awk/awk07.c @@ -98,7 +98,7 @@ static int awk_main (int argc, qse_char_t* argv[]) iptr = qse_awk_rtx_getfirstmapvalitr (rtx, rtv, &itr); while (iptr) { - qse_xstr_t str; + qse_cstr_t str; /* #QSE_AWK_VAL_MAP_ITR_VAL returns the value part */ str.ptr = qse_awk_rtx_valtostrdup ( @@ -125,7 +125,7 @@ static int awk_main (int argc, qse_char_t* argv[]) { /* if it is a plain value, convert it to a string * and print it */ - qse_xstr_t str; + qse_cstr_t str; str.ptr = qse_awk_rtx_valtostrdup (rtx, rtv, &str.len); if (str.ptr == QSE_NULL) diff --git a/qse/samples/cmn/htb.c b/qse/samples/cmn/htb.c index 02f8be0f..623851c4 100644 --- a/qse/samples/cmn/htb.c +++ b/qse/samples/cmn/htb.c @@ -323,7 +323,7 @@ static qse_htb_pair_t* test5_cbserter ( qse_htb_t* htb, qse_htb_pair_t* pair, void* kptr, qse_size_t klen, void* ctx) { - qse_xstr_t* v = (qse_xstr_t*)ctx; + qse_cstr_t* v = (qse_cstr_t*)ctx; if (pair == QSE_NULL) { /* no existing key for the key */ @@ -388,7 +388,7 @@ static int test5 () for (i = 0; i < QSE_COUNTOF(vals); i++) { - qse_xstr_t ctx; + qse_cstr_t ctx; qse_printf (QSE_T("setting a key [%s] and a value [%s]: "), keys[i%QSE_COUNTOF(keys)], vals[i]); diff --git a/qse/samples/cmn/rbt.c b/qse/samples/cmn/rbt.c index 4ec81aad..6a0488f6 100644 --- a/qse/samples/cmn/rbt.c +++ b/qse/samples/cmn/rbt.c @@ -131,7 +131,7 @@ static qse_rbt_pair_t* test5_cbserter ( qse_rbt_t* rbt, qse_rbt_pair_t* pair, void* kptr, qse_size_t klen, void* ctx) { - qse_xstr_t* v = (qse_xstr_t*)ctx; + qse_cstr_t* v = (qse_cstr_t*)ctx; if (pair == QSE_NULL) { /* no existing key for the key */ @@ -196,7 +196,7 @@ static int test5 () for (i = 0; i < QSE_COUNTOF(vals); i++) { - qse_xstr_t ctx; + qse_cstr_t ctx; qse_printf (QSE_T("setting a key [%s] and a value [%s]: "), keys[i%QSE_COUNTOF(keys)], vals[i]); diff --git a/qse/samples/cmn/rex01.c b/qse/samples/cmn/rex01.c index b8b19aeb..42c5d400 100644 --- a/qse/samples/cmn/rex01.c +++ b/qse/samples/cmn/rex01.c @@ -15,8 +15,8 @@ static int rex_main (int argc, qse_char_t* argv[]) { qse_rex_t* rex; qse_rex_node_t* start; - qse_xstr_t str; - qse_xstr_t matstr; + qse_cstr_t str; + qse_cstr_t matstr; int n; if (argc != 3) diff --git a/qse/samples/cmn/str01.c b/qse/samples/cmn/str01.c index ec07e0cc..11f8e965 100644 --- a/qse/samples/cmn/str01.c +++ b/qse/samples/cmn/str01.c @@ -122,7 +122,7 @@ static int test3 () static int test4 () { qse_str_t s1; - qse_xstr_t out; + qse_cstr_t out; qse_str_init (&s1, QSE_MMGR_GETDFL(), 0); @@ -236,7 +236,7 @@ static int test12 (void) return 0; } -qse_char_t* subst (qse_char_t* buf, qse_size_t bsz, const qse_xstr_t* ident, void* ctx) +qse_char_t* subst (qse_char_t* buf, qse_size_t bsz, const qse_cstr_t* ident, void* ctx) { if (qse_strxcmp (ident->ptr, ident->len, QSE_T("USER")) == 0) { diff --git a/qse/samples/sed/sed03.c b/qse/samples/sed/sed03.c index e6d61871..62b9ccd2 100644 --- a/qse/samples/sed/sed03.c +++ b/qse/samples/sed/sed03.c @@ -5,7 +5,7 @@ static void trace_exec (qse_sed_t* sed, qse_sed_tracer_op_t op, qse_sed_cmd_t* cmd) { - qse_xstr_t h, p; + qse_cstr_t h, p; qse_sed_getspace (sed, QSE_SED_SPACE_HOLD, &h); qse_sed_getspace (sed, QSE_SED_SPACE_PATTERN, &p);