qse_awk_addfncwithmbs(), qse_awk_addfncwithwcs(), qse_awk_delfncwithmbs(), qse_awk_delfncwithwcs()
qse_awk_getmerrmsg(), qse_awk_getwerrmsg(), qse_awk_rtx_getmerrmsg(), qse_awk_rtx_getwerrmsg()
This commit is contained in:
parent
165ecc7643
commit
510bde2abc
@ -225,7 +225,7 @@ static qse_htb_walk_t set_global (qse_htb_t* map, qse_htb_pair_t* pair, void* ar
|
|||||||
qse_awk_rtx_t* rtx = (qse_awk_rtx_t*)arg;
|
qse_awk_rtx_t* rtx = (qse_awk_rtx_t*)arg;
|
||||||
struct gvmv_t* gvmv = (struct gvmv_t*)QSE_HTB_VPTR(pair);
|
struct gvmv_t* gvmv = (struct gvmv_t*)QSE_HTB_VPTR(pair);
|
||||||
|
|
||||||
v = qse_awk_rtx_makenstrvalwithxstr(rtx, &gvmv->str);
|
v = qse_awk_rtx_makenstrvalwithcstr(rtx, &gvmv->str);
|
||||||
if (v == QSE_NULL) return QSE_HTB_WALK_STOP;
|
if (v == QSE_NULL) return QSE_HTB_WALK_STOP;
|
||||||
|
|
||||||
qse_awk_rtx_refupval (rtx, v);
|
qse_awk_rtx_refupval (rtx, v);
|
||||||
|
@ -1125,7 +1125,11 @@ public:
|
|||||||
/// \return integer >= 0 on success, -1 on failure.
|
/// \return integer >= 0 on success, -1 on failure.
|
||||||
///
|
///
|
||||||
int addGlobal (
|
int addGlobal (
|
||||||
const char_t* name ///< variable name
|
const qse_mchar_t* name ///< variable name
|
||||||
|
);
|
||||||
|
|
||||||
|
int addGlobal (
|
||||||
|
const qse_wchar_t* name ///< variable name
|
||||||
);
|
);
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -1134,16 +1138,23 @@ public:
|
|||||||
/// \return 0 on success, -1 on failure.
|
/// \return 0 on success, -1 on failure.
|
||||||
///
|
///
|
||||||
int deleteGlobal (
|
int deleteGlobal (
|
||||||
const char_t* name ///< variable name
|
const qse_mchar_t* name ///< variable name
|
||||||
|
);
|
||||||
|
|
||||||
|
int deleteGlobal (
|
||||||
|
const qse_wchar_t* name ///< variable name
|
||||||
);
|
);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The addGlobal() function returns the numeric ID of an intrinsic
|
/// The findGlobal() function returns the numeric ID of an intrinsic
|
||||||
// global variable.
|
// global variable.
|
||||||
/// \return integer >= 0 on success, -1 on failure.
|
/// \return integer >= 0 on success, -1 on failure.
|
||||||
///
|
///
|
||||||
int findGlobal (
|
int findGlobal (
|
||||||
const char_t* name ///> variable name
|
const qse_mchar_t* name ///> variable name
|
||||||
|
);
|
||||||
|
int findGlobal (
|
||||||
|
const qse_wchar_t* name ///> variable name
|
||||||
);
|
);
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -1186,12 +1197,21 @@ public:
|
|||||||
/// function.
|
/// function.
|
||||||
///
|
///
|
||||||
int addFunction (
|
int addFunction (
|
||||||
const char_t* name, ///< function name
|
const qse_mchar_t* name, ///< function name
|
||||||
size_t minArgs, ///< minimum numbers of arguments
|
size_t minArgs, ///< minimum numbers of arguments
|
||||||
size_t maxArgs, ///< maximum numbers of arguments
|
size_t maxArgs, ///< maximum numbers of arguments
|
||||||
const char_t* argSpec, ///< argument specification
|
const qse_mchar_t* argSpec, ///< argument specification
|
||||||
FunctionHandler handler, ///< function handler
|
FunctionHandler handler, ///< function handler
|
||||||
int validOpts = 0 ///< valid if these options are set
|
int validOpts = 0 ///< valid if these options are set
|
||||||
|
);
|
||||||
|
|
||||||
|
int addFunction (
|
||||||
|
const qse_wchar_t* name, ///< function name
|
||||||
|
size_t minArgs, ///< minimum numbers of arguments
|
||||||
|
size_t maxArgs, ///< maximum numbers of arguments
|
||||||
|
const qse_wchar_t* argSpec, ///< argument specification
|
||||||
|
FunctionHandler handler, ///< function handler
|
||||||
|
int validOpts = 0 ///< valid if these options are set
|
||||||
);
|
);
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -815,7 +815,6 @@ typedef struct qse_awk_rio_t qse_awk_rio_t;
|
|||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
typedef struct qse_awk_fnc_t qse_awk_fnc_t;
|
typedef struct qse_awk_fnc_t qse_awk_fnc_t;
|
||||||
typedef struct qse_awk_fnc_spec_t qse_awk_fnc_spec_t;
|
|
||||||
typedef struct qse_awk_fnc_info_t qse_awk_fnc_info_t;
|
typedef struct qse_awk_fnc_info_t qse_awk_fnc_info_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -827,15 +826,15 @@ typedef int (*qse_awk_fnc_impl_t) (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_awk_fnc_arg_t type defines a structure to describe arguments
|
* The qse_awk_fnc_marg_t type defines a structure to describe arguments
|
||||||
* to an implicit function.
|
* to an implicit function.
|
||||||
*/
|
*/
|
||||||
struct qse_awk_fnc_arg_t
|
struct qse_awk_fnc_marg_t
|
||||||
{
|
{
|
||||||
/** numbers of argument for a function */
|
/** minimum numbers of argument for a function */
|
||||||
qse_size_t min;
|
qse_size_t min;
|
||||||
|
|
||||||
/** numbers of argument for a function */
|
/** maximum numbers of argument for a function */
|
||||||
qse_size_t max;
|
qse_size_t max;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -848,18 +847,30 @@ struct qse_awk_fnc_arg_t
|
|||||||
* - r: reference
|
* - r: reference
|
||||||
* - x: regular expression
|
* - x: regular expression
|
||||||
*/
|
*/
|
||||||
const qse_char_t* spec;
|
const qse_mchar_t* spec;
|
||||||
};
|
};
|
||||||
typedef struct qse_awk_fnc_arg_t qse_awk_fnc_arg_t;
|
typedef struct qse_awk_fnc_marg_t qse_awk_fnc_marg_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_awk_fnc_spec_t type defines a structure to hold the specification
|
* The qse_awk_fnc_warg_t type defines a structure to describe arguments
|
||||||
|
* to an implicit function.
|
||||||
|
*/
|
||||||
|
struct qse_awk_fnc_warg_t
|
||||||
|
{
|
||||||
|
qse_size_t min;
|
||||||
|
qse_size_t max;
|
||||||
|
const qse_wchar_t* spec;
|
||||||
|
};
|
||||||
|
typedef struct qse_awk_fnc_warg_t qse_awk_fnc_warg_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The qse_awk_fnc_mspec_t type defines a structure to hold the specification
|
||||||
* of an intrinsic function or a module function.
|
* of an intrinsic function or a module function.
|
||||||
*/
|
*/
|
||||||
struct qse_awk_fnc_spec_t
|
struct qse_awk_fnc_mspec_t
|
||||||
{
|
{
|
||||||
/** argument descriptor */
|
/** argument descriptor */
|
||||||
qse_awk_fnc_arg_t arg;
|
qse_awk_fnc_marg_t arg;
|
||||||
|
|
||||||
/** pointer to the function implementing this function */
|
/** pointer to the function implementing this function */
|
||||||
qse_awk_fnc_impl_t impl;
|
qse_awk_fnc_impl_t impl;
|
||||||
@ -874,6 +885,39 @@ struct qse_awk_fnc_spec_t
|
|||||||
*/
|
*/
|
||||||
int trait;
|
int trait;
|
||||||
};
|
};
|
||||||
|
typedef struct qse_awk_fnc_mspec_t qse_awk_fnc_mspec_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The qse_awk_fnc_wspec_t type defines a structure to hold the specification
|
||||||
|
* of an intrinsic function or a module function.
|
||||||
|
*/
|
||||||
|
struct qse_awk_fnc_wspec_t
|
||||||
|
{
|
||||||
|
/** argument descriptor */
|
||||||
|
qse_awk_fnc_warg_t arg;
|
||||||
|
|
||||||
|
/** pointer to the function implementing this function */
|
||||||
|
qse_awk_fnc_impl_t impl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* when this field is set to a non-zero value bitwise-ORed of
|
||||||
|
* #qse_awk_trait_t enumerators, the function is available if
|
||||||
|
* this field bitwise-ANDed with the global trait option produces
|
||||||
|
* this field itself.
|
||||||
|
*
|
||||||
|
* this field doesn't take effect for a module function.
|
||||||
|
*/
|
||||||
|
int trait;
|
||||||
|
};
|
||||||
|
typedef struct qse_awk_fnc_wspec_t qse_awk_fnc_wspec_t;
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
typedef qse_awk_fnc_marg_t qse_awk_fnc_arg_t;
|
||||||
|
typedef qse_awk_fnc_mspec_t qse_awk_fnc_spec_t;
|
||||||
|
#else
|
||||||
|
typedef qse_awk_fnc_warg_t qse_awk_fnc_arg_t;
|
||||||
|
typedef qse_awk_fnc_wspec_t qse_awk_fnc_spec_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
@ -1368,13 +1412,14 @@ enum qse_awk_errnum_t
|
|||||||
};
|
};
|
||||||
typedef enum qse_awk_errnum_t qse_awk_errnum_t;
|
typedef enum qse_awk_errnum_t qse_awk_errnum_t;
|
||||||
|
|
||||||
|
#define QSE_AWK_ERRINF_MSG_SIZE 256
|
||||||
/**
|
/**
|
||||||
* The qse_awk_errinf_t type defines a placeholder for error information.
|
* The qse_awk_errinf_t type defines a placeholder for error information.
|
||||||
*/
|
*/
|
||||||
struct qse_awk_errinf_t
|
struct qse_awk_errinf_t
|
||||||
{
|
{
|
||||||
qse_awk_errnum_t num; /**< error number */
|
qse_awk_errnum_t num; /**< error number */
|
||||||
qse_char_t msg[256]; /**< error message */
|
qse_char_t msg[QSE_AWK_ERRINF_MSG_SIZE]; /**< error message */
|
||||||
qse_awk_loc_t loc; /**< error location */
|
qse_awk_loc_t loc; /**< error location */
|
||||||
};
|
};
|
||||||
typedef struct qse_awk_errinf_t qse_awk_errinf_t;
|
typedef struct qse_awk_errinf_t qse_awk_errinf_t;
|
||||||
@ -1662,15 +1707,33 @@ QSE_EXPORT const qse_awk_loc_t* qse_awk_geterrloc (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_awk_geterrmsg() function returns the error message describing
|
* The qse_awk_getmerrmsg() function returns the error message describing
|
||||||
* the last error occurred.
|
* the last error occurred.
|
||||||
*
|
*
|
||||||
* \return error message
|
* \return error message
|
||||||
*/
|
*/
|
||||||
QSE_EXPORT const qse_char_t* qse_awk_geterrmsg (
|
QSE_EXPORT const qse_mchar_t* qse_awk_getmerrmsg (
|
||||||
qse_awk_t* awk /**< awk */
|
qse_awk_t* awk /**< awk */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The qse_awk_getwerrmsg() function returns the error message describing
|
||||||
|
* the last error occurred.
|
||||||
|
*
|
||||||
|
* \return error message
|
||||||
|
*/
|
||||||
|
QSE_EXPORT const qse_wchar_t* qse_awk_getwerrmsg (
|
||||||
|
qse_awk_t* awk /**< awk */
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
# define qse_awk_geterrmsg qse_awk_getmerrmsg
|
||||||
|
#else
|
||||||
|
# define qse_awk_geterrmsg qse_awk_getwerrmsg
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
QSE_EXPORT const qse_char_t* qse_awk_backuperrmsg (
|
QSE_EXPORT const qse_char_t* qse_awk_backuperrmsg (
|
||||||
qse_awk_t* awk /**< awk */
|
qse_awk_t* awk /**< awk */
|
||||||
);
|
);
|
||||||
@ -1846,23 +1909,49 @@ QSE_EXPORT int qse_awk_findgblwithwcs (
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_awk_addfnc() function adds an intrinsic function.
|
* The qse_awk_addfncwithmbs() function adds an intrinsic function.
|
||||||
*/
|
*/
|
||||||
QSE_EXPORT qse_awk_fnc_t* qse_awk_addfnc (
|
QSE_EXPORT qse_awk_fnc_t* qse_awk_addfncwithmbs (
|
||||||
qse_awk_t* awk,
|
qse_awk_t* awk,
|
||||||
const qse_char_t* name,
|
const qse_mchar_t* name,
|
||||||
const qse_awk_fnc_spec_t* spec
|
const qse_awk_fnc_mspec_t* spec
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_awk_delfnc() function deletes an intrinsic function by name.
|
* The qse_awk_addfncwithwcs() function adds an intrinsic function.
|
||||||
|
*/
|
||||||
|
QSE_EXPORT qse_awk_fnc_t* qse_awk_addfncwithwcs (
|
||||||
|
qse_awk_t* awk,
|
||||||
|
const qse_wchar_t* name,
|
||||||
|
const qse_awk_fnc_wspec_t* spec
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The qse_awk_delfncwithmbs() function deletes an intrinsic function by name.
|
||||||
* \return 0 on success, -1 on failure
|
* \return 0 on success, -1 on failure
|
||||||
*/
|
*/
|
||||||
QSE_EXPORT int qse_awk_delfnc (
|
QSE_EXPORT int qse_awk_delfncwithmbs (
|
||||||
qse_awk_t* awk, /**< awk */
|
qse_awk_t* awk, /**< awk */
|
||||||
const qse_char_t* name /**< function name */
|
const qse_mchar_t* name /**< function name */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The qse_awk_delfncwithwcs() function deletes an intrinsic function by name.
|
||||||
|
* \return 0 on success, -1 on failure
|
||||||
|
*/
|
||||||
|
QSE_EXPORT int qse_awk_delfncwithwcs (
|
||||||
|
qse_awk_t* awk, /**< awk */
|
||||||
|
const qse_wchar_t* name /**< function name */
|
||||||
|
);
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
# define qse_awk_addfnc qse_awk_addfncwithmbs
|
||||||
|
# define qse_awk_delfnc qse_awk_delfncwithmbs
|
||||||
|
#else
|
||||||
|
# define qse_awk_addfnc qse_awk_addfncwithwcs
|
||||||
|
# define qse_awk_delfnc qse_awk_delfncwithwcs
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_awk_clrfnc() function deletes all intrinsic functions
|
* The qse_awk_clrfnc() function deletes all intrinsic functions
|
||||||
*/
|
*/
|
||||||
@ -2007,12 +2096,26 @@ QSE_EXPORT qse_wchar_t* qse_awk_mbstowcsdup (
|
|||||||
qse_size_t* wcslen
|
qse_size_t* wcslen
|
||||||
);
|
);
|
||||||
|
|
||||||
|
QSE_EXPORT qse_wchar_t* qse_awk_mbsntowcsdup (
|
||||||
|
qse_awk_t* awk,
|
||||||
|
const qse_mchar_t* mbs,
|
||||||
|
qse_size_t mbslen,
|
||||||
|
qse_size_t* wcslen
|
||||||
|
);
|
||||||
|
|
||||||
QSE_EXPORT qse_mchar_t* qse_awk_wcstombsdup (
|
QSE_EXPORT qse_mchar_t* qse_awk_wcstombsdup (
|
||||||
qse_awk_t* awk,
|
qse_awk_t* awk,
|
||||||
const qse_wchar_t* wcs,
|
const qse_wchar_t* wcs,
|
||||||
qse_size_t* mbslen
|
qse_size_t* mbslen
|
||||||
);
|
);
|
||||||
|
|
||||||
|
qse_mchar_t* qse_awk_wcsntombsdup (
|
||||||
|
qse_awk_t* awk,
|
||||||
|
const qse_wchar_t* wcs,
|
||||||
|
qse_size_t wcslen,
|
||||||
|
qse_size_t* mbslen
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_awk_mbsxtoint() function converts a multi-byte string to an integer.
|
* The qse_awk_mbsxtoint() function converts a multi-byte string to an integer.
|
||||||
*/
|
*/
|
||||||
@ -2398,14 +2501,29 @@ QSE_EXPORT const qse_awk_loc_t* qse_awk_rtx_geterrloc (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_awk_rtx_geterrmsg() function gets the string describing the last
|
* The qse_awk_rtx_getmerrmsg() function gets the string describing the last
|
||||||
* error occurred during runtime.
|
* error occurred during runtime.
|
||||||
* \return error message
|
* \return error message
|
||||||
*/
|
*/
|
||||||
QSE_EXPORT const qse_char_t* qse_awk_rtx_geterrmsg (
|
QSE_EXPORT const qse_mchar_t* qse_awk_rtx_getmerrmsg (
|
||||||
qse_awk_rtx_t* rtx /**< runtime context */
|
qse_awk_rtx_t* rtx /**< runtime context */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The qse_awk_rtx_getwerrmsg() function gets the string describing the last
|
||||||
|
* error occurred during runtime.
|
||||||
|
* \return error message
|
||||||
|
*/
|
||||||
|
QSE_EXPORT const qse_wchar_t* qse_awk_rtx_getwerrmsg (
|
||||||
|
qse_awk_rtx_t* rtx /**< runtime context */
|
||||||
|
);
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
# define qse_awk_rtx_geterrmsg qse_awk_rtx_getmerrmsg
|
||||||
|
#else
|
||||||
|
# define qse_awk_rtx_geterrmsg qse_awk_rtx_getwerrmsg
|
||||||
|
#endif
|
||||||
|
|
||||||
QSE_EXPORT const qse_char_t* qse_awk_rtx_backuperrmsg (
|
QSE_EXPORT const qse_char_t* qse_awk_rtx_backuperrmsg (
|
||||||
qse_awk_rtx_t* rtx /**< runtime context */
|
qse_awk_rtx_t* rtx /**< runtime context */
|
||||||
);
|
);
|
||||||
@ -2555,20 +2673,20 @@ QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithwcs (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_awk_rtx_makestrvalwithxstr() function creates a string value.
|
* The qse_awk_rtx_makestrvalwithcstr() function creates a string value.
|
||||||
* \return value on success, #QSE_NULL on failure
|
* \return value on success, #QSE_NULL on failure
|
||||||
*/
|
*/
|
||||||
QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithxstr (
|
QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithcstr (
|
||||||
qse_awk_rtx_t* rtx,
|
qse_awk_rtx_t* rtx,
|
||||||
const qse_cstr_t* str
|
const qse_cstr_t* str
|
||||||
);
|
);
|
||||||
|
|
||||||
QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithmxstr (
|
QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithmcstr (
|
||||||
qse_awk_rtx_t* rtx,
|
qse_awk_rtx_t* rtx,
|
||||||
const qse_mcstr_t* mxstr
|
const qse_mcstr_t* mxstr
|
||||||
);
|
);
|
||||||
|
|
||||||
QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithwxstr (
|
QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makestrvalwithwcstr (
|
||||||
qse_awk_rtx_t* rtx,
|
qse_awk_rtx_t* rtx,
|
||||||
const qse_wcstr_t* wxstr
|
const qse_wcstr_t* wxstr
|
||||||
);
|
);
|
||||||
@ -2614,7 +2732,7 @@ QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makenstrvalwithstr (
|
|||||||
* \b nstr is 1.
|
* \b nstr is 1.
|
||||||
* \return value on success, #QSE_NULL on failure
|
* \return value on success, #QSE_NULL on failure
|
||||||
*/
|
*/
|
||||||
QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makenstrvalwithxstr (
|
QSE_EXPORT qse_awk_val_t* qse_awk_rtx_makenstrvalwithcstr (
|
||||||
qse_awk_rtx_t* rtx,
|
qse_awk_rtx_t* rtx,
|
||||||
const qse_cstr_t* str
|
const qse_cstr_t* str
|
||||||
);
|
);
|
||||||
@ -2629,7 +2747,7 @@ qse_awk_val_t* qse_awk_rtx_makembsval (
|
|||||||
qse_size_t len
|
qse_size_t len
|
||||||
);
|
);
|
||||||
|
|
||||||
qse_awk_val_t* qse_awk_rtx_makembsvalwithmxstr (
|
qse_awk_val_t* qse_awk_rtx_makembsvalwithmcstr (
|
||||||
qse_awk_rtx_t* rtx,
|
qse_awk_rtx_t* rtx,
|
||||||
const qse_mcstr_t* mxstr
|
const qse_mcstr_t* mxstr
|
||||||
);
|
);
|
||||||
|
@ -615,8 +615,8 @@ int Awk::Value::setStr (Run* r, const char_t* str, size_t len, bool numeric)
|
|||||||
cstr.ptr = (char_t*)str;
|
cstr.ptr = (char_t*)str;
|
||||||
cstr.len = len;
|
cstr.len = len;
|
||||||
|
|
||||||
tmp = numeric? qse_awk_rtx_makenstrvalwithxstr (r->rtx, &cstr):
|
tmp = numeric? qse_awk_rtx_makenstrvalwithcstr (r->rtx, &cstr):
|
||||||
qse_awk_rtx_makestrvalwithxstr (r->rtx, &cstr);
|
qse_awk_rtx_makestrvalwithcstr (r->rtx, &cstr);
|
||||||
if (tmp == QSE_NULL)
|
if (tmp == QSE_NULL)
|
||||||
{
|
{
|
||||||
r->awk->retrieveError (r);
|
r->awk->retrieveError (r);
|
||||||
@ -776,8 +776,8 @@ int Awk::Value::setIndexedStr (
|
|||||||
cstr.ptr = (char_t*)str;
|
cstr.ptr = (char_t*)str;
|
||||||
cstr.len = len;
|
cstr.len = len;
|
||||||
|
|
||||||
tmp = numeric? qse_awk_rtx_makenstrvalwithxstr (r->rtx, &cstr):
|
tmp = numeric? qse_awk_rtx_makenstrvalwithcstr (r->rtx, &cstr):
|
||||||
qse_awk_rtx_makestrvalwithxstr (r->rtx, &cstr);
|
qse_awk_rtx_makestrvalwithcstr (r->rtx, &cstr);
|
||||||
if (tmp == QSE_NULL)
|
if (tmp == QSE_NULL)
|
||||||
{
|
{
|
||||||
r->awk->retrieveError (r);
|
r->awk->retrieveError (r);
|
||||||
@ -1641,14 +1641,14 @@ void Awk::xstrs_t::clear (awk_t* awk)
|
|||||||
int Awk::addArgument (const char_t* arg, size_t len)
|
int Awk::addArgument (const char_t* arg, size_t len)
|
||||||
{
|
{
|
||||||
QSE_ASSERT (awk != QSE_NULL);
|
QSE_ASSERT (awk != QSE_NULL);
|
||||||
int n = runarg.add (awk, arg, len);
|
int n = runarg.add(awk, arg, len);
|
||||||
if (n <= -1) this->setError (QSE_AWK_ENOMEM);
|
if (n <= -1) this->setError (QSE_AWK_ENOMEM);
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Awk::addArgument (const char_t* arg)
|
int Awk::addArgument (const char_t* arg)
|
||||||
{
|
{
|
||||||
return addArgument (arg, qse_strlen(arg));
|
return addArgument(arg, qse_strlen(arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Awk::clearArguments ()
|
void Awk::clearArguments ()
|
||||||
@ -1656,26 +1656,51 @@ void Awk::clearArguments ()
|
|||||||
runarg.clear (awk);
|
runarg.clear (awk);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Awk::addGlobal (const char_t* name)
|
int Awk::addGlobal(const qse_mchar_t* name)
|
||||||
{
|
{
|
||||||
QSE_ASSERT (awk != QSE_NULL);
|
QSE_ASSERT (awk != QSE_NULL);
|
||||||
int n = qse_awk_addgbl (awk, name);
|
int n = qse_awk_addgblwithmbs(awk, name);
|
||||||
if (n <= -1) this->retrieveError ();
|
if (n <= -1) this->retrieveError ();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Awk::deleteGlobal (const char_t* name)
|
int Awk::addGlobal(const qse_wchar_t* name)
|
||||||
{
|
{
|
||||||
QSE_ASSERT (awk != QSE_NULL);
|
QSE_ASSERT (awk != QSE_NULL);
|
||||||
int n = qse_awk_delgbl (awk, name);
|
int n = qse_awk_addgblwithwcs(awk, name);
|
||||||
if (n <= -1) this->retrieveError ();
|
if (n <= -1) this->retrieveError ();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Awk::findGlobal (const char_t* name)
|
int Awk::deleteGlobal (const qse_mchar_t* name)
|
||||||
{
|
{
|
||||||
QSE_ASSERT (awk != QSE_NULL);
|
QSE_ASSERT (awk != QSE_NULL);
|
||||||
int n = qse_awk_findgbl (awk, name);
|
int n = qse_awk_delgblwithmbs(awk, name);
|
||||||
|
if (n <= -1) this->retrieveError ();
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Awk::deleteGlobal (const qse_wchar_t* name)
|
||||||
|
{
|
||||||
|
QSE_ASSERT (awk != QSE_NULL);
|
||||||
|
int n = qse_awk_delgblwithwcs(awk, name);
|
||||||
|
if (n <= -1) this->retrieveError ();
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Awk::findGlobal (const qse_mchar_t* name)
|
||||||
|
{
|
||||||
|
QSE_ASSERT (awk != QSE_NULL);
|
||||||
|
int n = qse_awk_findgblwithmbs(awk, name);
|
||||||
|
if (n <= -1) this->retrieveError ();
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Awk::findGlobal (const qse_wchar_t* name)
|
||||||
|
{
|
||||||
|
QSE_ASSERT (awk != QSE_NULL);
|
||||||
|
int n = qse_awk_findgblwithwcs(awk, name);
|
||||||
if (n <= -1) this->retrieveError ();
|
if (n <= -1) this->retrieveError ();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
@ -1707,12 +1732,12 @@ int Awk::getGlobal (int id, Value& v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Awk::addFunction (
|
int Awk::addFunction (
|
||||||
const char_t* name, size_t minArgs, size_t maxArgs,
|
const qse_mchar_t* name, size_t minArgs, size_t maxArgs,
|
||||||
const char_t* argSpec, FunctionHandler handler, int validOpts)
|
const qse_mchar_t* argSpec, FunctionHandler handler, int validOpts)
|
||||||
{
|
{
|
||||||
QSE_ASSERT (awk != QSE_NULL);
|
QSE_ASSERT (awk != QSE_NULL);
|
||||||
|
|
||||||
fnc_spec_t spec;
|
qse_awk_fnc_mspec_t spec;
|
||||||
|
|
||||||
QSE_MEMSET (&spec, 0, QSE_SIZEOF(spec));
|
QSE_MEMSET (&spec, 0, QSE_SIZEOF(spec));
|
||||||
spec.arg.min = minArgs;
|
spec.arg.min = minArgs;
|
||||||
@ -1721,7 +1746,7 @@ int Awk::addFunction (
|
|||||||
spec.impl = this->functionHandler;
|
spec.impl = this->functionHandler;
|
||||||
spec.trait = validOpts;
|
spec.trait = validOpts;
|
||||||
|
|
||||||
qse_awk_fnc_t* fnc = qse_awk_addfnc (awk, name, &spec);
|
qse_awk_fnc_t* fnc = qse_awk_addfncwithmbs(awk, name, &spec);
|
||||||
if (fnc == QSE_NULL)
|
if (fnc == QSE_NULL)
|
||||||
{
|
{
|
||||||
this->retrieveError ();
|
this->retrieveError ();
|
||||||
@ -1735,17 +1760,62 @@ int Awk::addFunction (
|
|||||||
//
|
//
|
||||||
// the function name exists in the underlying function table.
|
// the function name exists in the underlying function table.
|
||||||
// use the pointer to the name to maintain the hash table.
|
// use the pointer to the name to maintain the hash table.
|
||||||
qse_htb_pair_t* pair = qse_htb_upsert (
|
qse_htb_pair_t* pair = qse_htb_upsert(this->functionMap, (char_t*)fnc->name.ptr, fnc->name.len, &handler, QSE_SIZEOF(handler));
|
||||||
this->functionMap, (char_t*)fnc->name.ptr, fnc->name.len, &handler, QSE_SIZEOF(handler));
|
|
||||||
#else
|
#else
|
||||||
FunctionMap::Pair* pair;
|
FunctionMap::Pair* pair;
|
||||||
try { pair = this->functionMap.upsert (Cstr(fnc->name.ptr, fnc->name.len), handler); }
|
try { pair = this->functionMap.upsert(Cstr(fnc->name.ptr, fnc->name.len), handler); }
|
||||||
catch (...) { pair = QSE_NULL; }
|
catch (...) { pair = QSE_NULL; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pair == QSE_NULL)
|
if (pair == QSE_NULL)
|
||||||
{
|
{
|
||||||
qse_awk_delfnc (awk, name);
|
qse_awk_delfncwithmbs (awk, name);
|
||||||
|
this->setError (QSE_AWK_ENOMEM);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Awk::addFunction (
|
||||||
|
const qse_wchar_t* name, size_t minArgs, size_t maxArgs,
|
||||||
|
const qse_wchar_t* argSpec, FunctionHandler handler, int validOpts)
|
||||||
|
{
|
||||||
|
QSE_ASSERT (awk != QSE_NULL);
|
||||||
|
|
||||||
|
qse_awk_fnc_wspec_t spec;
|
||||||
|
|
||||||
|
QSE_MEMSET (&spec, 0, QSE_SIZEOF(spec));
|
||||||
|
spec.arg.min = minArgs;
|
||||||
|
spec.arg.max = maxArgs;
|
||||||
|
spec.arg.spec = argSpec;
|
||||||
|
spec.impl = this->functionHandler;
|
||||||
|
spec.trait = validOpts;
|
||||||
|
|
||||||
|
qse_awk_fnc_t* fnc = qse_awk_addfncwithwcs(awk, name, &spec);
|
||||||
|
if (fnc == QSE_NULL)
|
||||||
|
{
|
||||||
|
this->retrieveError ();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(QSE_AWK_USE_HTB_FOR_FUNCTION_MAP)
|
||||||
|
// handler is a pointer to a member function.
|
||||||
|
// sizeof(handler) is likely to be greater than sizeof(void*)
|
||||||
|
// copy the handler pointer into the table.
|
||||||
|
//
|
||||||
|
// the function name exists in the underlying function table.
|
||||||
|
// use the pointer to the name to maintain the hash table.
|
||||||
|
qse_htb_pair_t* pair = qse_htb_upsert(this->functionMap, (char_t*)fnc->name.ptr, fnc->name.len, &handler, QSE_SIZEOF(handler));
|
||||||
|
#else
|
||||||
|
FunctionMap::Pair* pair;
|
||||||
|
try { pair = this->functionMap.upsert(Cstr(fnc->name.ptr, fnc->name.len), handler); }
|
||||||
|
catch (...) { pair = QSE_NULL; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (pair == QSE_NULL)
|
||||||
|
{
|
||||||
|
qse_awk_delfncwithwcs (awk, name);
|
||||||
this->setError (QSE_AWK_ENOMEM);
|
this->setError (QSE_AWK_ENOMEM);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1757,7 +1827,7 @@ int Awk::deleteFunction (const char_t* name)
|
|||||||
{
|
{
|
||||||
QSE_ASSERT (awk != QSE_NULL);
|
QSE_ASSERT (awk != QSE_NULL);
|
||||||
|
|
||||||
int n = qse_awk_delfnc (awk, name);
|
int n = qse_awk_delfnc(awk, name);
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
{
|
{
|
||||||
#if defined(QSE_AWK_USE_HTB_FOR_FUNCTION_MAP)
|
#if defined(QSE_AWK_USE_HTB_FOR_FUNCTION_MAP)
|
||||||
|
@ -304,7 +304,12 @@ struct qse_awk_t
|
|||||||
/* housekeeping */
|
/* housekeeping */
|
||||||
qse_awk_errstr_t errstr;
|
qse_awk_errstr_t errstr;
|
||||||
qse_awk_errinf_t errinf;
|
qse_awk_errinf_t errinf;
|
||||||
qse_char_t errmsg_backup[256];
|
qse_char_t errmsg_backup[QSE_AWK_ERRINF_MSG_SIZE];
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
qse_wchar_t werrmsg[QSE_AWK_ERRINF_MSG_SIZE];
|
||||||
|
#else
|
||||||
|
qse_mchar_t merrmsg[QSE_AWK_ERRINF_MSG_SIZE * 2];
|
||||||
|
#endif
|
||||||
|
|
||||||
int stopall;
|
int stopall;
|
||||||
qse_awk_ecb_t* ecb;
|
qse_awk_ecb_t* ecb;
|
||||||
@ -441,7 +446,12 @@ struct qse_awk_rtx_t
|
|||||||
} depth;
|
} depth;
|
||||||
|
|
||||||
qse_awk_errinf_t errinf;
|
qse_awk_errinf_t errinf;
|
||||||
qse_char_t errmsg_backup[256];
|
qse_char_t errmsg_backup[QSE_AWK_ERRINF_MSG_SIZE];
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
qse_wchar_t werrmsg[QSE_AWK_ERRINF_MSG_SIZE];
|
||||||
|
#else
|
||||||
|
qse_mchar_t merrmsg[QSE_AWK_ERRINF_MSG_SIZE * 2];
|
||||||
|
#endif
|
||||||
|
|
||||||
qse_awk_rtx_ecb_t* ecb;
|
qse_awk_rtx_ecb_t* ecb;
|
||||||
};
|
};
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "awk-prv.h"
|
#include "awk-prv.h"
|
||||||
|
#include <qse/cmn/mbwc.h>
|
||||||
|
|
||||||
const qse_char_t* qse_awk_dflerrstr (qse_awk_t* awk, qse_awk_errnum_t errnum)
|
const qse_char_t* qse_awk_dflerrstr (qse_awk_t* awk, qse_awk_errnum_t errnum)
|
||||||
{
|
{
|
||||||
@ -193,10 +194,43 @@ const qse_awk_loc_t* qse_awk_geterrloc (qse_awk_t* awk)
|
|||||||
return &awk->errinf.loc;
|
return &awk->errinf.loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
const qse_char_t* qse_awk_geterrmsg (qse_awk_t* awk)
|
const qse_mchar_t* qse_awk_getmerrmsg (qse_awk_t* awk)
|
||||||
{
|
{
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
return (awk->errinf.msg[0] == QSE_T('\0'))?
|
return (awk->errinf.msg[0] == QSE_T('\0'))?
|
||||||
qse_awk_geterrstr(awk)(awk,awk->errinf.num): awk->errinf.msg;
|
qse_awk_geterrstr(awk)(awk,awk->errinf.num): awk->errinf.msg;
|
||||||
|
#else
|
||||||
|
const qse_char_t* msg;
|
||||||
|
qse_size_t wcslen, mbslen;
|
||||||
|
|
||||||
|
msg = (awk->errinf.msg[0] == QSE_T('\0'))?
|
||||||
|
qse_awk_geterrstr(awk)(awk,awk->errinf.num): awk->errinf.msg;
|
||||||
|
|
||||||
|
mbslen = QSE_COUNTOF(awk->merrmsg);
|
||||||
|
qse_wcstombswithcmgr(msg, &wcslen, awk->merrmsg, &mbslen, qse_awk_getcmgr(awk));
|
||||||
|
|
||||||
|
return awk->merrmsg;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
const qse_wchar_t* qse_awk_getwerrmsg (qse_awk_t* awk)
|
||||||
|
{
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
const qse_char_t* msg;
|
||||||
|
qse_size_t wcslen, mbslen;
|
||||||
|
|
||||||
|
msg = (awk->errinf.msg[0] == QSE_T('\0'))?
|
||||||
|
qse_awk_geterrstr(awk)(awk,awk->errinf.num): awk->errinf.msg;
|
||||||
|
|
||||||
|
wcslen = QSE_COUNTOF(awk->werrmsg);
|
||||||
|
qse_mbstowcsallwithcmgr (msg, &mbslen, awk->werrmsg, &wcslen, qse_awk_getcmgr(awk));
|
||||||
|
|
||||||
|
return awk->werrmsg;
|
||||||
|
#else
|
||||||
|
return (awk->errinf.msg[0] == QSE_T('\0'))?
|
||||||
|
qse_awk_geterrstr(awk)(awk,awk->errinf.num): awk->errinf.msg;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qse_awk_geterrinf (qse_awk_t* awk, qse_awk_errinf_t* errinf)
|
void qse_awk_geterrinf (qse_awk_t* awk, qse_awk_errinf_t* errinf)
|
||||||
@ -276,10 +310,42 @@ const qse_awk_loc_t* qse_awk_rtx_geterrloc (qse_awk_rtx_t* rtx)
|
|||||||
return &rtx->errinf.loc;
|
return &rtx->errinf.loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
const qse_char_t* qse_awk_rtx_geterrmsg (qse_awk_rtx_t* rtx)
|
const qse_mchar_t* qse_awk_rtx_getmerrmsg (qse_awk_rtx_t* rtx)
|
||||||
{
|
{
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
return (rtx->errinf.msg[0] == QSE_T('\0')) ?
|
return (rtx->errinf.msg[0] == QSE_T('\0')) ?
|
||||||
qse_awk_geterrstr(rtx->awk)(rtx->awk,rtx->errinf.num): rtx->errinf.msg;
|
qse_awk_geterrstr(rtx->awk)(rtx->awk,rtx->errinf.num): rtx->errinf.msg;
|
||||||
|
#else
|
||||||
|
const qse_char_t* msg;
|
||||||
|
qse_size_t wcslen, mbslen;
|
||||||
|
|
||||||
|
msg = (rtx->errinf.msg[0] == QSE_T('\0')) ?
|
||||||
|
qse_awk_geterrstr(rtx->awk)(rtx->awk,rtx->errinf.num): rtx->errinf.msg;
|
||||||
|
|
||||||
|
mbslen = QSE_COUNTOF(rtx->merrmsg);
|
||||||
|
qse_wcstombswithcmgr(msg, &wcslen, rtx->merrmsg, &mbslen, qse_awk_rtx_getcmgr(rtx));
|
||||||
|
|
||||||
|
return rtx->merrmsg;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
const qse_wchar_t* qse_awk_rtx_getwerrmsg (qse_awk_rtx_t* rtx)
|
||||||
|
{
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
const qse_char_t* msg;
|
||||||
|
qse_size_t wcslen, mbslen;
|
||||||
|
|
||||||
|
msg = (rtx->errinf.msg[0] == QSE_T('\0')) ?
|
||||||
|
qse_awk_geterrstr(rtx->awk)(rtx->awk,rtx->errinf.num): rtx->errinf.msg;
|
||||||
|
|
||||||
|
wcslen = QSE_COUNTOF(rtx->werrmsg);
|
||||||
|
qse_mbstowcsallwithcmgr (msg, &mbslen, rtx->werrmsg, &wcslen, qse_awk_rtx_getcmgr(rtx));
|
||||||
|
|
||||||
|
return rtx->werrmsg;
|
||||||
|
#else
|
||||||
|
return (rtx->errinf.msg[0] == QSE_T('\0')) ?
|
||||||
|
qse_awk_geterrstr(rtx->awk)(rtx->awk,rtx->errinf.num): rtx->errinf.msg;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void qse_awk_rtx_geterrinf (qse_awk_rtx_t* rtx, qse_awk_errinf_t* errinf)
|
void qse_awk_rtx_geterrinf (qse_awk_rtx_t* rtx, qse_awk_errinf_t* errinf)
|
||||||
|
@ -96,7 +96,7 @@ static qse_awk_fnc_t sysfnctab[] =
|
|||||||
{ {QSE_T("systime"), 7}, 0, { {A_MAX, 0, QSE_T("sys") }, QSE_NULL, 0 }, QSE_NULL}
|
{ {QSE_T("systime"), 7}, 0, { {A_MAX, 0, QSE_T("sys") }, QSE_NULL, 0 }, QSE_NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
qse_awk_fnc_t* qse_awk_addfnc (qse_awk_t* awk, const qse_char_t* name, const qse_awk_fnc_spec_t* spec)
|
static qse_awk_fnc_t* add_fnc (qse_awk_t* awk, const qse_char_t* name, const qse_awk_fnc_spec_t* spec)
|
||||||
{
|
{
|
||||||
qse_awk_fnc_t* fnc;
|
qse_awk_fnc_t* fnc;
|
||||||
qse_size_t fnc_size;
|
qse_size_t fnc_size;
|
||||||
@ -104,7 +104,7 @@ qse_awk_fnc_t* qse_awk_addfnc (qse_awk_t* awk, const qse_char_t* name, const qse
|
|||||||
qse_cstr_t ncs;
|
qse_cstr_t ncs;
|
||||||
|
|
||||||
ncs.ptr = (qse_char_t*)name;
|
ncs.ptr = (qse_char_t*)name;
|
||||||
ncs.len = qse_strlen (name);
|
ncs.len = qse_strlen(name);
|
||||||
if (ncs.len <= 0)
|
if (ncs.len <= 0)
|
||||||
{
|
{
|
||||||
qse_awk_seterrnum (awk, QSE_AWK_EINVAL, QSE_NULL);
|
qse_awk_seterrnum (awk, QSE_AWK_EINVAL, QSE_NULL);
|
||||||
@ -115,7 +115,7 @@ qse_awk_fnc_t* qse_awk_addfnc (qse_awk_t* awk, const qse_char_t* name, const qse
|
|||||||
* such a function registered won't take effect because
|
* such a function registered won't take effect because
|
||||||
* the word is treated as a keyword */
|
* the word is treated as a keyword */
|
||||||
|
|
||||||
if (qse_awk_findfnc(awk, &ncs) != QSE_NULL)
|
if (qse_awk_findfncwithcstr(awk, &ncs) != QSE_NULL)
|
||||||
{
|
{
|
||||||
qse_awk_seterrnum (awk, QSE_AWK_EEXIST, &ncs);
|
qse_awk_seterrnum (awk, QSE_AWK_EEXIST, &ncs);
|
||||||
return QSE_NULL;
|
return QSE_NULL;
|
||||||
@ -130,7 +130,7 @@ qse_awk_fnc_t* qse_awk_addfnc (qse_awk_t* awk, const qse_char_t* name, const qse
|
|||||||
qse_char_t* tmp;
|
qse_char_t* tmp;
|
||||||
|
|
||||||
tmp = (qse_char_t*)(fnc + 1);
|
tmp = (qse_char_t*)(fnc + 1);
|
||||||
fnc->name.len = qse_strcpy (tmp, ncs.ptr);
|
fnc->name.len = qse_strcpy(tmp, ncs.ptr);
|
||||||
fnc->name.ptr = tmp;
|
fnc->name.ptr = tmp;
|
||||||
|
|
||||||
fnc->spec = *spec;
|
fnc->spec = *spec;
|
||||||
@ -152,18 +152,126 @@ qse_awk_fnc_t* qse_awk_addfnc (qse_awk_t* awk, const qse_char_t* name, const qse
|
|||||||
return fnc;
|
return fnc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qse_awk_delfnc (qse_awk_t* awk, const qse_char_t* name)
|
qse_awk_fnc_t* qse_awk_addfncwithmbs (qse_awk_t* awk, const qse_mchar_t* name, const qse_awk_fnc_mspec_t* spec)
|
||||||
{
|
{
|
||||||
qse_cstr_t ncs;
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
return add_fnc(awk, name, spec);
|
||||||
|
#else
|
||||||
|
qse_wcstr_t wcs;
|
||||||
|
qse_awk_fnc_t* fnc;
|
||||||
|
qse_awk_fnc_spec_t wspec;
|
||||||
|
|
||||||
ncs.ptr = (qse_char_t*)name;
|
QSE_STATIC_ASSERT (QSE_SIZEOF(*spec) == QSE_SIZEOF(wspec));
|
||||||
ncs.len = qse_strlen (name);
|
|
||||||
|
|
||||||
|
QSE_MEMCPY (&wspec, spec, QSE_SIZEOF(wspec));
|
||||||
|
if (spec->arg.spec)
|
||||||
|
{
|
||||||
|
wcs.ptr = qse_awk_mbstowcsdup(awk, spec->arg.spec, &wcs.len);
|
||||||
|
if (!wcs.ptr) return QSE_NULL;
|
||||||
|
wspec.arg.spec = wcs.ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
wcs.ptr = qse_awk_mbstowcsdup(awk, name, &wcs.len);
|
||||||
|
if (!wcs.ptr)
|
||||||
|
{
|
||||||
|
if (wspec.arg.spec) qse_awk_freemem (awk, (qse_wchar_t*)wspec.arg.spec);
|
||||||
|
return QSE_NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
fnc = add_fnc(awk, wcs.ptr, &wspec);
|
||||||
|
qse_awk_freemem (awk, wcs.ptr);
|
||||||
|
if (wspec.arg.spec) qse_awk_freemem (awk, (qse_wchar_t*)wspec.arg.spec);
|
||||||
|
return fnc;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
qse_awk_fnc_t* qse_awk_addfncwithwcs (qse_awk_t* awk, const qse_wchar_t* name, const qse_awk_fnc_wspec_t* spec)
|
||||||
|
{
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
qse_mcstr_t mbs;
|
||||||
|
qse_awk_fnc_t* fnc;
|
||||||
|
qse_awk_fnc_spec_t mspec;
|
||||||
|
|
||||||
|
QSE_STATIC_ASSERT (QSE_SIZEOF(*spec) == QSE_SIZEOF(mspec));
|
||||||
|
|
||||||
|
QSE_MEMCPY (&mspec, spec, QSE_SIZEOF(mspec));
|
||||||
|
if (spec->arg.spec)
|
||||||
|
{
|
||||||
|
mbs.ptr = qse_awk_wcstombsdup(awk, spec->arg.spec, &mbs.len);
|
||||||
|
if (!mbs.ptr) return QSE_NULL;
|
||||||
|
mspec.arg.spec = mbs.ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
mbs.ptr = qse_awk_wcstombsdup(awk, name, &mbs.len);
|
||||||
|
if (!mbs.ptr)
|
||||||
|
{
|
||||||
|
if (mspec.arg.spec) qse_awk_freemem (awk, (qse_mchar_t*)mspec.arg.spec);
|
||||||
|
return QSE_NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
fnc = add_fnc(awk, mbs.ptr, &mspec);
|
||||||
|
qse_awk_freemem (awk, mbs.ptr);
|
||||||
|
if (mspec.arg.spec) qse_awk_freemem (awk, (qse_mchar_t*)mspec.arg.spec);
|
||||||
|
return fnc;
|
||||||
|
#else
|
||||||
|
return add_fnc(awk, name, spec);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int qse_awk_delfncwithmbs (qse_awk_t* awk, const qse_mchar_t* name)
|
||||||
|
{
|
||||||
|
qse_mcstr_t ncs;
|
||||||
|
qse_wcstr_t wcs;
|
||||||
|
|
||||||
|
ncs.ptr = (qse_mchar_t*)name;
|
||||||
|
ncs.len = qse_mbslen(name);
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
if (qse_htb_delete(awk->fnc.user, ncs.ptr, ncs.len) <= -1)
|
if (qse_htb_delete(awk->fnc.user, ncs.ptr, ncs.len) <= -1)
|
||||||
{
|
{
|
||||||
qse_awk_seterrnum (awk, QSE_AWK_ENOENT, &ncs);
|
qse_awk_seterrnum (awk, QSE_AWK_ENOENT, &ncs);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
wcs.ptr = qse_awk_mbstowcsdup(awk, ncs.ptr, &wcs.len);
|
||||||
|
if (!wcs.ptr) return -1;
|
||||||
|
if (qse_htb_delete(awk->fnc.user, wcs.ptr, wcs.len) <= -1)
|
||||||
|
{
|
||||||
|
qse_awk_seterrnum (awk, QSE_AWK_ENOENT, &wcs);
|
||||||
|
qse_awk_freemem (awk, wcs.ptr);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
qse_awk_freemem (awk, wcs.ptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int qse_awk_delfncwithwcs (qse_awk_t* awk, const qse_wchar_t* name)
|
||||||
|
{
|
||||||
|
qse_wcstr_t ncs;
|
||||||
|
qse_mcstr_t mbs;
|
||||||
|
|
||||||
|
ncs.ptr = (qse_wchar_t*)name;
|
||||||
|
ncs.len = qse_wcslen(name);
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
mbs.ptr = qse_awk_wcstombsdup(awk, ncs.ptr, &mbs.len);
|
||||||
|
if (!mbs.ptr) return -1;
|
||||||
|
if (qse_htb_delete(awk->fnc.user, mbs.ptr, mbs.len) <= -1)
|
||||||
|
{
|
||||||
|
qse_awk_seterrnum (awk, QSE_AWK_ENOENT, &mbs);
|
||||||
|
qse_awk_freemem (awk, mbs.ptr);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
qse_awk_freemem (awk, mbs.ptr);
|
||||||
|
#else
|
||||||
|
if (qse_htb_delete(awk->fnc.user, ncs.ptr, ncs.len) <= -1)
|
||||||
|
{
|
||||||
|
qse_awk_seterrnum (awk, QSE_AWK_ENOENT, &ncs);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -173,7 +281,7 @@ void qse_awk_clrfnc (qse_awk_t* awk)
|
|||||||
qse_htb_clear (awk->fnc.user);
|
qse_htb_clear (awk->fnc.user);
|
||||||
}
|
}
|
||||||
|
|
||||||
qse_awk_fnc_t* qse_awk_findfnc (qse_awk_t* awk, const qse_cstr_t* name)
|
static qse_awk_fnc_t* find_fnc (qse_awk_t* awk, const qse_cstr_t* name)
|
||||||
{
|
{
|
||||||
qse_htb_pair_t* pair;
|
qse_htb_pair_t* pair;
|
||||||
int i;
|
int i;
|
||||||
@ -192,7 +300,7 @@ qse_awk_fnc_t* qse_awk_findfnc (qse_awk_t* awk, const qse_cstr_t* name)
|
|||||||
name->ptr, name->len) == 0) return &sysfnctab[i];
|
name->ptr, name->len) == 0) return &sysfnctab[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
pair = qse_htb_search (awk->fnc.user, name->ptr, name->len);
|
pair = qse_htb_search(awk->fnc.user, name->ptr, name->len);
|
||||||
if (pair)
|
if (pair)
|
||||||
{
|
{
|
||||||
qse_awk_fnc_t* fnc;
|
qse_awk_fnc_t* fnc;
|
||||||
@ -200,9 +308,43 @@ qse_awk_fnc_t* qse_awk_findfnc (qse_awk_t* awk, const qse_cstr_t* name)
|
|||||||
if ((awk->opt.trait & fnc->spec.trait) == fnc->spec.trait) return fnc;
|
if ((awk->opt.trait & fnc->spec.trait) == fnc->spec.trait) return fnc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qse_awk_seterrnum (awk, QSE_AWK_ENOENT, name);
|
||||||
return QSE_NULL;
|
return QSE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qse_awk_fnc_t* qse_awk_findfncwithmcstr (qse_awk_t* awk, const qse_mcstr_t* name)
|
||||||
|
{
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
return find_fnc(awk, name);
|
||||||
|
#else
|
||||||
|
qse_wcstr_t wcs;
|
||||||
|
qse_awk_fnc_t* fnc;
|
||||||
|
|
||||||
|
wcs.ptr = qse_awk_mbsntowcsdup(awk, name->ptr, name->len, &wcs.len);
|
||||||
|
if (!wcs.ptr) return QSE_NULL;
|
||||||
|
fnc = find_fnc(awk, &wcs);
|
||||||
|
qse_awk_freemem (awk, wcs.ptr);
|
||||||
|
return fnc;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
qse_awk_fnc_t* qse_awk_findfncwithwcstr (qse_awk_t* awk, const qse_wcstr_t* name)
|
||||||
|
{
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
qse_mcstr_t mbs;
|
||||||
|
qse_awk_fnc_t* fnc;
|
||||||
|
|
||||||
|
mbs.ptr = qse_awk_wcsntombsdup(awk, name->ptr, name->len, &mbs.len);
|
||||||
|
if (!mbs.ptr) return QSE_NULL;
|
||||||
|
fnc = find_fnc(awk, &mbs);
|
||||||
|
qse_awk_freemem (awk, mbs.ptr);
|
||||||
|
return fnc;
|
||||||
|
#else
|
||||||
|
return find_fnc(awk, name);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int fnc_close (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
static int fnc_close (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
||||||
{
|
{
|
||||||
qse_size_t nargs;
|
qse_size_t nargs;
|
||||||
@ -817,8 +959,8 @@ int qse_awk_fnc_split (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
|||||||
|
|
||||||
/* create the field string - however, the split function must
|
/* create the field string - however, the split function must
|
||||||
* create a numeric string if the string is a number */
|
* create a numeric string if the string is a number */
|
||||||
/*t2 = qse_awk_rtx_makestrvalwithxstr (rtx, &tok);*/
|
/*t2 = qse_awk_rtx_makestrvalwithcstr (rtx, &tok);*/
|
||||||
t2 = qse_awk_rtx_makenstrvalwithxstr (rtx, &tok);
|
t2 = qse_awk_rtx_makenstrvalwithcstr (rtx, &tok);
|
||||||
if (t2 == QSE_NULL) goto oops;
|
if (t2 == QSE_NULL) goto oops;
|
||||||
|
|
||||||
/* put it into the map */
|
/* put it into the map */
|
||||||
@ -887,7 +1029,7 @@ int qse_awk_fnc_tolower (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
|||||||
qse_mcstr_t str;
|
qse_mcstr_t str;
|
||||||
str.ptr = qse_awk_rtx_getvalmbs(rtx, a0, &str.len);
|
str.ptr = qse_awk_rtx_getvalmbs(rtx, a0, &str.len);
|
||||||
if (!str.ptr) return -1;
|
if (!str.ptr) return -1;
|
||||||
r = qse_awk_rtx_makembsvalwithmxstr(rtx, &str);
|
r = qse_awk_rtx_makembsvalwithmcstr(rtx, &str);
|
||||||
qse_awk_rtx_freevalmbs (rtx, a0, str.ptr);
|
qse_awk_rtx_freevalmbs (rtx, a0, str.ptr);
|
||||||
if (!r) return -1;
|
if (!r) return -1;
|
||||||
str.ptr = ((qse_awk_val_mbs_t*)r)->val.ptr;
|
str.ptr = ((qse_awk_val_mbs_t*)r)->val.ptr;
|
||||||
@ -899,7 +1041,7 @@ int qse_awk_fnc_tolower (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
|||||||
qse_cstr_t str;
|
qse_cstr_t str;
|
||||||
str.ptr = qse_awk_rtx_getvalstr(rtx, a0, &str.len);
|
str.ptr = qse_awk_rtx_getvalstr(rtx, a0, &str.len);
|
||||||
if (!str.ptr) return -1;
|
if (!str.ptr) return -1;
|
||||||
r = qse_awk_rtx_makestrvalwithxstr(rtx, &str);
|
r = qse_awk_rtx_makestrvalwithcstr(rtx, &str);
|
||||||
qse_awk_rtx_freevalstr (rtx, a0, str.ptr);
|
qse_awk_rtx_freevalstr (rtx, a0, str.ptr);
|
||||||
if (!r) return -1;
|
if (!r) return -1;
|
||||||
str.ptr = ((qse_awk_val_str_t*)r)->val.ptr;
|
str.ptr = ((qse_awk_val_str_t*)r)->val.ptr;
|
||||||
@ -925,7 +1067,7 @@ int qse_awk_fnc_toupper (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
|||||||
qse_mcstr_t str;
|
qse_mcstr_t str;
|
||||||
str.ptr = qse_awk_rtx_getvalmbs(rtx, a0, &str.len);
|
str.ptr = qse_awk_rtx_getvalmbs(rtx, a0, &str.len);
|
||||||
if (!str.ptr) return -1;
|
if (!str.ptr) return -1;
|
||||||
r = qse_awk_rtx_makembsvalwithmxstr(rtx, &str);
|
r = qse_awk_rtx_makembsvalwithmcstr(rtx, &str);
|
||||||
qse_awk_rtx_freevalmbs (rtx, a0, str.ptr);
|
qse_awk_rtx_freevalmbs (rtx, a0, str.ptr);
|
||||||
if (!r) return -1;
|
if (!r) return -1;
|
||||||
str.ptr = ((qse_awk_val_mbs_t*)r)->val.ptr;
|
str.ptr = ((qse_awk_val_mbs_t*)r)->val.ptr;
|
||||||
@ -937,7 +1079,7 @@ int qse_awk_fnc_toupper (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
|||||||
qse_cstr_t str;
|
qse_cstr_t str;
|
||||||
str.ptr = qse_awk_rtx_getvalstr(rtx, a0, &str.len);
|
str.ptr = qse_awk_rtx_getvalstr(rtx, a0, &str.len);
|
||||||
if (!str.ptr) return -1;
|
if (!str.ptr) return -1;
|
||||||
r = qse_awk_rtx_makestrvalwithxstr(rtx, &str);
|
r = qse_awk_rtx_makestrvalwithcstr(rtx, &str);
|
||||||
qse_awk_rtx_freevalstr (rtx, a0, str.ptr);
|
qse_awk_rtx_freevalstr (rtx, a0, str.ptr);
|
||||||
if (!r) return -1;
|
if (!r) return -1;
|
||||||
str.ptr = ((qse_awk_val_str_t*)r)->val.ptr;
|
str.ptr = ((qse_awk_val_str_t*)r)->val.ptr;
|
||||||
@ -1164,7 +1306,7 @@ static int __substitute (qse_awk_rtx_t* rtx, qse_awk_int_t max_count)
|
|||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
v = qse_awk_rtx_makestrvalwithxstr(rtx, QSE_STR_XSTR(&new));
|
v = qse_awk_rtx_makestrvalwithcstr(rtx, QSE_STR_XSTR(&new));
|
||||||
if (v == QSE_NULL) goto oops;
|
if (v == QSE_NULL) goto oops;
|
||||||
qse_awk_rtx_refupval (rtx, v);
|
qse_awk_rtx_refupval (rtx, v);
|
||||||
n = qse_awk_rtx_setrefval(rtx, (qse_awk_val_ref_t*)a2, v);
|
n = qse_awk_rtx_setrefval(rtx, (qse_awk_val_ref_t*)a2, v);
|
||||||
@ -1398,7 +1540,7 @@ int qse_awk_fnc_sprintf (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
|||||||
qse_awk_rtx_freevalmbs (rtx, a0, cs0.ptr);
|
qse_awk_rtx_freevalmbs (rtx, a0, cs0.ptr);
|
||||||
if (!x.ptr) goto oops_mbs;
|
if (!x.ptr) goto oops_mbs;
|
||||||
|
|
||||||
a0 = qse_awk_rtx_makembsvalwithmxstr(rtx, &x);
|
a0 = qse_awk_rtx_makembsvalwithmcstr(rtx, &x);
|
||||||
if (a0 == QSE_NULL) goto oops_mbs;
|
if (a0 == QSE_NULL) goto oops_mbs;
|
||||||
|
|
||||||
qse_mbs_fini (&fbu);
|
qse_mbs_fini (&fbu);
|
||||||
@ -1439,7 +1581,7 @@ int qse_awk_fnc_sprintf (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
|||||||
qse_awk_rtx_freevalstr (rtx, a0, cs0.ptr);
|
qse_awk_rtx_freevalstr (rtx, a0, cs0.ptr);
|
||||||
if (!x.ptr) goto oops;
|
if (!x.ptr) goto oops;
|
||||||
|
|
||||||
a0 = qse_awk_rtx_makestrvalwithxstr(rtx, &x);
|
a0 = qse_awk_rtx_makestrvalwithcstr(rtx, &x);
|
||||||
if (a0 == QSE_NULL) goto oops;
|
if (a0 == QSE_NULL) goto oops;
|
||||||
|
|
||||||
qse_str_fini (&fbu);
|
qse_str_fini (&fbu);
|
||||||
@ -1625,7 +1767,7 @@ static QSE_INLINE int __fnc_asort (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t*
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
const qse_cstr_t* key = QSE_AWK_VAL_MAP_ITR_KEY(&itr);
|
const qse_cstr_t* key = QSE_AWK_VAL_MAP_ITR_KEY(&itr);
|
||||||
va[i] = qse_awk_rtx_makestrvalwithxstr(rtx, key);
|
va[i] = qse_awk_rtx_makestrvalwithcstr(rtx, key);
|
||||||
if (!va[i])
|
if (!va[i])
|
||||||
{
|
{
|
||||||
while (i > 0)
|
while (i > 0)
|
||||||
|
@ -48,7 +48,14 @@ struct qse_awk_fnc_t
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qse_awk_fnc_t* qse_awk_findfnc (qse_awk_t* awk, const qse_cstr_t* name);
|
qse_awk_fnc_t* qse_awk_findfncwithmcstr (qse_awk_t* awk, const qse_mcstr_t* name);
|
||||||
|
qse_awk_fnc_t* qse_awk_findfncwithwcstr (qse_awk_t* awk, const qse_wcstr_t* name);
|
||||||
|
|
||||||
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
|
# define qse_awk_findfncwithcstr qse_awk_findfncwithmcstr
|
||||||
|
#else
|
||||||
|
# define qse_awk_findfncwithcstr qse_awk_findfncwithwcstr
|
||||||
|
#endif
|
||||||
|
|
||||||
/* EXPORT is required for linking on windows as they are referenced by mod-str.c */
|
/* EXPORT is required for linking on windows as they are referenced by mod-str.c */
|
||||||
QSE_EXPORT int qse_awk_fnc_gsub (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi);
|
QSE_EXPORT int qse_awk_fnc_gsub (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi);
|
||||||
|
@ -88,17 +88,18 @@ qse_wchar_t* qse_awk_mbstowcsdup (qse_awk_t* awk, const qse_mchar_t* mbs, qse_si
|
|||||||
|
|
||||||
/* if i use qse_mbstowcsdupwithcmgr(), i cannot pinpoint the exact failure cause.
|
/* if i use qse_mbstowcsdupwithcmgr(), i cannot pinpoint the exact failure cause.
|
||||||
* let's do it differently. */
|
* let's do it differently. */
|
||||||
if (qse_mbstowcswithcmgr(mbs, &mbslen, QSE_NULL, &wcslen, awk->_cmgr) <= -1)
|
if (qse_mbstowcswithcmgr(mbs, &mbslen, QSE_NULL, &wcslen, qse_awk_getcmgr(awk)) <= -1)
|
||||||
{
|
{
|
||||||
qse_awk_seterrnum (awk, QSE_AWK_EINVAL, QSE_NULL);
|
qse_awk_seterrnum (awk, QSE_AWK_EINVAL, QSE_NULL);
|
||||||
return QSE_NULL;
|
return QSE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wcs = qse_awk_allocmem(awk, QSE_SIZEOF(*wcs) * (wcslen + 1));
|
wcslen = wcslen + 1; /* for terminating null */
|
||||||
|
|
||||||
|
wcs = qse_awk_allocmem(awk, QSE_SIZEOF(*wcs) * wcslen);
|
||||||
if (!wcs) return QSE_NULL;
|
if (!wcs) return QSE_NULL;
|
||||||
|
|
||||||
wcslen = wcslen + 1;
|
qse_mbstowcswithcmgr (mbs, &mbslen, wcs, &wcslen, qse_awk_getcmgr(awk));
|
||||||
qse_mbstowcswithcmgr (mbs, &mbslen, wcs, &wcslen, awk->_cmgr);
|
|
||||||
if (_wcslen) *_wcslen = wcslen;
|
if (_wcslen) *_wcslen = wcslen;
|
||||||
return wcs;
|
return wcs;
|
||||||
}
|
}
|
||||||
@ -108,7 +109,56 @@ qse_mchar_t* qse_awk_wcstombsdup (qse_awk_t* awk, const qse_wchar_t* wcs, qse_si
|
|||||||
qse_size_t mbslen, wcslen;
|
qse_size_t mbslen, wcslen;
|
||||||
qse_mchar_t* mbs;
|
qse_mchar_t* mbs;
|
||||||
|
|
||||||
if (qse_wcstombswithcmgr(wcs, &wcslen, QSE_NULL, &mbslen, awk->_cmgr) <= -1)
|
if (qse_wcstombswithcmgr(wcs, &wcslen, QSE_NULL, &mbslen, qse_awk_getcmgr(awk)) <= -1)
|
||||||
|
{
|
||||||
|
qse_awk_seterrnum (awk, QSE_AWK_EINVAL, QSE_NULL);
|
||||||
|
return QSE_NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
mbslen = mbslen + 1; /* for terminating null */
|
||||||
|
|
||||||
|
mbs = qse_awk_allocmem(awk, QSE_SIZEOF(*mbs) * mbslen);
|
||||||
|
if (!mbs) return QSE_NULL;
|
||||||
|
|
||||||
|
qse_wcstombswithcmgr (wcs, &wcslen, mbs, &mbslen, qse_awk_getcmgr(awk));
|
||||||
|
if (_mbslen) *_mbslen = mbslen;
|
||||||
|
return mbs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
qse_wchar_t* qse_awk_mbsntowcsdup (qse_awk_t* awk, const qse_mchar_t* mbs, qse_size_t _mbslen, qse_size_t* _wcslen)
|
||||||
|
{
|
||||||
|
qse_size_t mbslen, wcslen;
|
||||||
|
qse_wchar_t* wcs;
|
||||||
|
|
||||||
|
/* if i use qse_mbstowcsdupwithcmgr(), i cannot pinpoint the exact failure cause.
|
||||||
|
* let's do it differently. */
|
||||||
|
mbslen = _mbslen;
|
||||||
|
if (qse_mbsntowcsnwithcmgr(mbs, &mbslen, QSE_NULL, &wcslen, qse_awk_getcmgr(awk)) <= -1)
|
||||||
|
{
|
||||||
|
qse_awk_seterrnum (awk, QSE_AWK_EINVAL, QSE_NULL);
|
||||||
|
return QSE_NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
wcs = qse_awk_allocmem(awk, QSE_SIZEOF(*wcs) * (wcslen + 1));
|
||||||
|
if (!wcs) return QSE_NULL;
|
||||||
|
|
||||||
|
mbslen= _mbslen;
|
||||||
|
qse_mbsntowcsnwithcmgr (mbs, &mbslen, wcs, &wcslen, qse_awk_getcmgr(awk));
|
||||||
|
wcs[wcslen] = QSE_WT('\0');
|
||||||
|
|
||||||
|
if (_wcslen) *_wcslen = wcslen;
|
||||||
|
return wcs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
qse_mchar_t* qse_awk_wcsntombsdup (qse_awk_t* awk, const qse_wchar_t* wcs, qse_size_t _wcslen, qse_size_t* _mbslen)
|
||||||
|
{
|
||||||
|
qse_size_t mbslen, wcslen;
|
||||||
|
qse_mchar_t* mbs;
|
||||||
|
|
||||||
|
wcslen = _wcslen;
|
||||||
|
if (qse_wcsntombsnwithcmgr(wcs, &wcslen, QSE_NULL, &mbslen, qse_awk_getcmgr(awk)) <= -1)
|
||||||
{
|
{
|
||||||
qse_awk_seterrnum (awk, QSE_AWK_EINVAL, QSE_NULL);
|
qse_awk_seterrnum (awk, QSE_AWK_EINVAL, QSE_NULL);
|
||||||
return QSE_NULL;
|
return QSE_NULL;
|
||||||
@ -117,8 +167,10 @@ qse_mchar_t* qse_awk_wcstombsdup (qse_awk_t* awk, const qse_wchar_t* wcs, qse_si
|
|||||||
mbs = qse_awk_allocmem(awk, QSE_SIZEOF(*mbs) * (mbslen + 1));
|
mbs = qse_awk_allocmem(awk, QSE_SIZEOF(*mbs) * (mbslen + 1));
|
||||||
if (!mbs) return QSE_NULL;
|
if (!mbs) return QSE_NULL;
|
||||||
|
|
||||||
mbslen = mbslen + 1;
|
wcslen = _wcslen;
|
||||||
qse_wcstombswithcmgr (wcs, &wcslen, mbs, &mbslen, awk->_cmgr);
|
qse_wcsntombsnwithcmgr (wcs, &wcslen, mbs, &mbslen, qse_awk_getcmgr(awk));
|
||||||
|
mbs[mbslen] = QSE_MT('\0');
|
||||||
|
|
||||||
if (_mbslen) *_mbslen = mbslen;
|
if (_mbslen) *_mbslen = mbslen;
|
||||||
return mbs;
|
return mbs;
|
||||||
}
|
}
|
||||||
|
@ -401,7 +401,7 @@ static int fnc_frommbs (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
|||||||
qse_cstr_t str;
|
qse_cstr_t str;
|
||||||
str.ptr = qse_awk_rtx_getvalstrwithcmgr(rtx, a0, &str.len, cmgr);
|
str.ptr = qse_awk_rtx_getvalstrwithcmgr(rtx, a0, &str.len, cmgr);
|
||||||
if (!str.ptr) return -1;
|
if (!str.ptr) return -1;
|
||||||
r = qse_awk_rtx_makestrvalwithxstr(rtx, &str);
|
r = qse_awk_rtx_makestrvalwithcstr(rtx, &str);
|
||||||
qse_awk_rtx_freevalstr (rtx, a0, str.ptr);
|
qse_awk_rtx_freevalstr (rtx, a0, str.ptr);
|
||||||
if (!r) return -1;
|
if (!r) return -1;
|
||||||
break;
|
break;
|
||||||
@ -457,7 +457,7 @@ static int fnc_tombs (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
|||||||
qse_mcstr_t str;
|
qse_mcstr_t str;
|
||||||
str.ptr = qse_awk_rtx_getvalmbswithcmgr(rtx, a0, &str.len, cmgr);
|
str.ptr = qse_awk_rtx_getvalmbswithcmgr(rtx, a0, &str.len, cmgr);
|
||||||
if (!str.ptr) return -1;
|
if (!str.ptr) return -1;
|
||||||
r = qse_awk_rtx_makembsvalwithmxstr(rtx, &str);
|
r = qse_awk_rtx_makembsvalwithmcstr(rtx, &str);
|
||||||
qse_awk_rtx_freevalmbs (rtx, a0, str.ptr);
|
qse_awk_rtx_freevalmbs (rtx, a0, str.ptr);
|
||||||
if (!r) return -1;
|
if (!r) return -1;
|
||||||
break;
|
break;
|
||||||
|
@ -1227,7 +1227,7 @@ static qse_awk_nde_t* parse_function (qse_awk_t* awk)
|
|||||||
/* note that i'm assigning to rederr in the 'if' conditions below.
|
/* note that i'm assigning to rederr in the 'if' conditions below.
|
||||||
* i'm not checking equality */
|
* i'm not checking equality */
|
||||||
/* check if it is a builtin function */
|
/* check if it is a builtin function */
|
||||||
if ((qse_awk_findfnc (awk, &name) != QSE_NULL && (rederr = QSE_AWK_EFNCRED)) ||
|
if ((qse_awk_findfncwithcstr(awk, &name) != QSE_NULL && (rederr = QSE_AWK_EFNCRED)) ||
|
||||||
/* check if it has already been defined as a function */
|
/* check if it has already been defined as a function */
|
||||||
(qse_htb_search (awk->tree.funs, name.ptr, name.len) != QSE_NULL && (rederr = QSE_AWK_EFUNRED)) ||
|
(qse_htb_search (awk->tree.funs, name.ptr, name.len) != QSE_NULL && (rederr = QSE_AWK_EFUNRED)) ||
|
||||||
/* check if it conflicts with a named variable */
|
/* check if it conflicts with a named variable */
|
||||||
@ -1830,7 +1830,7 @@ static int add_global (qse_awk_t* awk, const qse_cstr_t* name, qse_awk_loc_t* xl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* check if it conflicts with a builtin function name */
|
/* check if it conflicts with a builtin function name */
|
||||||
if (qse_awk_findfnc(awk, name) != QSE_NULL)
|
if (qse_awk_findfncwithcstr(awk, name) != QSE_NULL)
|
||||||
{
|
{
|
||||||
SETERR_ARG_LOC (awk, QSE_AWK_EFNCRED, name->ptr, name->len, xloc);
|
SETERR_ARG_LOC (awk, QSE_AWK_EFNCRED, name->ptr, name->len, xloc);
|
||||||
return -1;
|
return -1;
|
||||||
@ -2225,7 +2225,7 @@ static qse_awk_t* collect_locals (qse_awk_t* awk, qse_size_t nlcls, int istop)
|
|||||||
|
|
||||||
/* check if it conflicts with a builtin function name
|
/* check if it conflicts with a builtin function name
|
||||||
* function f() { local length; } */
|
* function f() { local length; } */
|
||||||
if (qse_awk_findfnc (awk, &lcl) != QSE_NULL)
|
if (qse_awk_findfncwithcstr(awk, &lcl) != QSE_NULL)
|
||||||
{
|
{
|
||||||
SETERR_ARG_LOC (awk, QSE_AWK_EFNCRED, lcl.ptr, lcl.len, &awk->tok.loc);
|
SETERR_ARG_LOC (awk, QSE_AWK_EFNCRED, lcl.ptr, lcl.len, &awk->tok.loc);
|
||||||
return QSE_NULL;
|
return QSE_NULL;
|
||||||
@ -4500,7 +4500,7 @@ static QSE_INLINE int isfunname (qse_awk_t* awk, const qse_cstr_t* name, qse_awk
|
|||||||
|
|
||||||
static QSE_INLINE int isfnname (qse_awk_t* awk, const qse_cstr_t* name)
|
static QSE_INLINE int isfnname (qse_awk_t* awk, const qse_cstr_t* name)
|
||||||
{
|
{
|
||||||
if (qse_awk_findfnc(awk, name) != QSE_NULL)
|
if (qse_awk_findfncwithcstr(awk, name) != QSE_NULL)
|
||||||
{
|
{
|
||||||
/* implicit function */
|
/* implicit function */
|
||||||
return FNTYPE_FNC;
|
return FNTYPE_FNC;
|
||||||
@ -5223,7 +5223,7 @@ static qse_awk_nde_t* parse_primary_ident_noseg (qse_awk_t* awk, const qse_awk_l
|
|||||||
qse_awk_nde_t* nde = QSE_NULL;
|
qse_awk_nde_t* nde = QSE_NULL;
|
||||||
|
|
||||||
/* check if name is an intrinsic function name */
|
/* check if name is an intrinsic function name */
|
||||||
fnc = qse_awk_findfnc(awk, name);
|
fnc = qse_awk_findfncwithcstr(awk, name);
|
||||||
if (fnc)
|
if (fnc)
|
||||||
{
|
{
|
||||||
if (MATCH(awk,TOK_LPAREN) || fnc->dfl0)
|
if (MATCH(awk,TOK_LPAREN) || fnc->dfl0)
|
||||||
|
@ -54,7 +54,7 @@ int qse_awk_rtx_setrec (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
v = qse_awk_rtx_makenstrvalwithxstr (run, str);
|
v = qse_awk_rtx_makenstrvalwithcstr (run, str);
|
||||||
|
|
||||||
if (v == QSE_NULL)
|
if (v == QSE_NULL)
|
||||||
{
|
{
|
||||||
@ -83,7 +83,7 @@ int qse_awk_rtx_setrec (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* recompose $0 */
|
/* recompose $0 */
|
||||||
v = qse_awk_rtx_makestrvalwithxstr (run, QSE_STR_XSTR(&run->inrec.line));
|
v = qse_awk_rtx_makestrvalwithcstr (run, QSE_STR_XSTR(&run->inrec.line));
|
||||||
if (v == QSE_NULL)
|
if (v == QSE_NULL)
|
||||||
{
|
{
|
||||||
qse_awk_rtx_clrrec (run, 0);
|
qse_awk_rtx_clrrec (run, 0);
|
||||||
@ -321,7 +321,7 @@ static int split_record (qse_awk_rtx_t* rtx)
|
|||||||
|
|
||||||
rtx->inrec.flds[rtx->inrec.nflds].ptr = tok.ptr;
|
rtx->inrec.flds[rtx->inrec.nflds].ptr = tok.ptr;
|
||||||
rtx->inrec.flds[rtx->inrec.nflds].len = tok.len;
|
rtx->inrec.flds[rtx->inrec.nflds].len = tok.len;
|
||||||
rtx->inrec.flds[rtx->inrec.nflds].val = qse_awk_rtx_makenstrvalwithxstr (rtx, &tok);
|
rtx->inrec.flds[rtx->inrec.nflds].val = qse_awk_rtx_makenstrvalwithcstr (rtx, &tok);
|
||||||
|
|
||||||
if (rtx->inrec.flds[rtx->inrec.nflds].val == QSE_NULL)
|
if (rtx->inrec.flds[rtx->inrec.nflds].val == QSE_NULL)
|
||||||
{
|
{
|
||||||
@ -446,7 +446,7 @@ static int recomp_record_fields (qse_awk_rtx_t* run, qse_size_t lv, const qse_cs
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = qse_awk_rtx_makestrvalwithxstr (run, str);
|
tmp = qse_awk_rtx_makestrvalwithcstr (run, str);
|
||||||
if (tmp == QSE_NULL) return -1;
|
if (tmp == QSE_NULL) return -1;
|
||||||
|
|
||||||
if (i < nflds)
|
if (i < nflds)
|
||||||
|
@ -6754,7 +6754,7 @@ read_console_again:
|
|||||||
{
|
{
|
||||||
qse_awk_val_t* v;
|
qse_awk_val_t* v;
|
||||||
|
|
||||||
v = qse_awk_rtx_makestrvalwithxstr(rtx, QSE_STR_XSTR(buf));
|
v = qse_awk_rtx_makestrvalwithcstr(rtx, QSE_STR_XSTR(buf));
|
||||||
if (v == QSE_NULL)
|
if (v == QSE_NULL)
|
||||||
{
|
{
|
||||||
ADJERR_LOC (rtx, &nde->loc);
|
ADJERR_LOC (rtx, &nde->loc);
|
||||||
@ -6933,7 +6933,7 @@ static int shorten_record (qse_awk_rtx_t* rtx, qse_size_t nflds)
|
|||||||
if (ofs_free) qse_awk_rtx_freemem (rtx, ofs_free);
|
if (ofs_free) qse_awk_rtx_freemem (rtx, ofs_free);
|
||||||
if (nflds > 1) qse_awk_rtx_refdownval (rtx, v);
|
if (nflds > 1) qse_awk_rtx_refdownval (rtx, v);
|
||||||
|
|
||||||
v = (qse_awk_val_t*)qse_awk_rtx_makestrvalwithxstr(rtx, QSE_STR_XSTR(&tmp));
|
v = (qse_awk_val_t*)qse_awk_rtx_makestrvalwithcstr(rtx, QSE_STR_XSTR(&tmp));
|
||||||
if (!v)
|
if (!v)
|
||||||
{
|
{
|
||||||
qse_str_fini (&tmp);
|
qse_str_fini (&tmp);
|
||||||
|
@ -165,7 +165,7 @@ qse_awk_val_t* qse_awk_rtx_makefltval (qse_awk_rtx_t* rtx, qse_awk_flt_t v)
|
|||||||
return (qse_awk_val_t*)val;
|
return (qse_awk_val_t*)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
qse_awk_val_t* qse_awk_rtx_makestrvalwithxstr (qse_awk_rtx_t* rtx, const qse_cstr_t* str)
|
qse_awk_val_t* qse_awk_rtx_makestrvalwithcstr (qse_awk_rtx_t* rtx, const qse_cstr_t* str)
|
||||||
{
|
{
|
||||||
qse_awk_val_str_t* val = QSE_NULL;
|
qse_awk_val_str_t* val = QSE_NULL;
|
||||||
qse_size_t rlen = str->len;
|
qse_size_t rlen = str->len;
|
||||||
@ -224,7 +224,7 @@ qse_awk_val_t* qse_awk_rtx_makestrvalwithmbs (qse_awk_rtx_t* rtx, const qse_mcha
|
|||||||
return QSE_NULL;
|
return QSE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
v = qse_awk_rtx_makestrvalwithxstr (rtx, &tmp);
|
v = qse_awk_rtx_makestrvalwithcstr (rtx, &tmp);
|
||||||
qse_awk_rtx_freemem (rtx, tmp.ptr);
|
qse_awk_rtx_freemem (rtx, tmp.ptr);
|
||||||
return v;
|
return v;
|
||||||
#endif
|
#endif
|
||||||
@ -243,7 +243,7 @@ qse_awk_val_t* qse_awk_rtx_makestrvalwithwcs (qse_awk_rtx_t* rtx, const qse_wcha
|
|||||||
return QSE_NULL;
|
return QSE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
v = qse_awk_rtx_makestrvalwithxstr (rtx, &tmp);
|
v = qse_awk_rtx_makestrvalwithcstr (rtx, &tmp);
|
||||||
qse_awk_rtx_freemem (rtx, tmp.ptr);
|
qse_awk_rtx_freemem (rtx, tmp.ptr);
|
||||||
return v;
|
return v;
|
||||||
#else
|
#else
|
||||||
@ -256,10 +256,10 @@ qse_awk_val_t* qse_awk_rtx_makestrvalwithstr (qse_awk_rtx_t* rtx, const qse_char
|
|||||||
return qse_awk_rtx_makestrval(rtx, str, qse_strlen(str));
|
return qse_awk_rtx_makestrval(rtx, str, qse_strlen(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
qse_awk_val_t* qse_awk_rtx_makestrvalwithmxstr (qse_awk_rtx_t* rtx, const qse_mcstr_t* mxstr)
|
qse_awk_val_t* qse_awk_rtx_makestrvalwithmcstr (qse_awk_rtx_t* rtx, const qse_mcstr_t* mxstr)
|
||||||
{
|
{
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
return qse_awk_rtx_makestrvalwithxstr(rtx, mxstr);
|
return qse_awk_rtx_makestrvalwithcstr(rtx, mxstr);
|
||||||
#else
|
#else
|
||||||
qse_awk_val_t* v;
|
qse_awk_val_t* v;
|
||||||
qse_wcstr_t tmp;
|
qse_wcstr_t tmp;
|
||||||
@ -273,13 +273,13 @@ qse_awk_val_t* qse_awk_rtx_makestrvalwithmxstr (qse_awk_rtx_t* rtx, const qse_mc
|
|||||||
return QSE_NULL;
|
return QSE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
v = qse_awk_rtx_makestrvalwithxstr(rtx, &tmp);
|
v = qse_awk_rtx_makestrvalwithcstr(rtx, &tmp);
|
||||||
qse_awk_rtx_freemem (rtx, tmp.ptr);
|
qse_awk_rtx_freemem (rtx, tmp.ptr);
|
||||||
return v;
|
return v;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
qse_awk_val_t* qse_awk_rtx_makestrvalwithwxstr (qse_awk_rtx_t* rtx, const qse_wcstr_t* wxstr)
|
qse_awk_val_t* qse_awk_rtx_makestrvalwithwcstr (qse_awk_rtx_t* rtx, const qse_wcstr_t* wxstr)
|
||||||
{
|
{
|
||||||
#if defined(QSE_CHAR_IS_MCHAR)
|
#if defined(QSE_CHAR_IS_MCHAR)
|
||||||
qse_awk_val_t* v;
|
qse_awk_val_t* v;
|
||||||
@ -294,11 +294,11 @@ qse_awk_val_t* qse_awk_rtx_makestrvalwithwxstr (qse_awk_rtx_t* rtx, const qse_wc
|
|||||||
return QSE_NULL;
|
return QSE_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
v = qse_awk_rtx_makestrvalwithxstr(rtx, &tmp);
|
v = qse_awk_rtx_makestrvalwithcstr(rtx, &tmp);
|
||||||
qse_awk_rtx_freemem (rtx, tmp.ptr);
|
qse_awk_rtx_freemem (rtx, tmp.ptr);
|
||||||
return v;
|
return v;
|
||||||
#else
|
#else
|
||||||
return qse_awk_rtx_makestrvalwithxstr(rtx, wxstr);
|
return qse_awk_rtx_makestrvalwithcstr(rtx, wxstr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ qse_awk_val_t* qse_awk_rtx_makestrval (qse_awk_rtx_t* rtx, const qse_char_t* str
|
|||||||
qse_cstr_t xstr;
|
qse_cstr_t xstr;
|
||||||
xstr.ptr = (qse_char_t*)str;
|
xstr.ptr = (qse_char_t*)str;
|
||||||
xstr.len = len;
|
xstr.len = len;
|
||||||
return qse_awk_rtx_makestrvalwithxstr(rtx, &xstr);
|
return qse_awk_rtx_makestrvalwithcstr(rtx, &xstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
qse_awk_val_t* qse_awk_rtx_makestrval2 (qse_awk_rtx_t* rtx, const qse_char_t* str1, qse_size_t len1, const qse_char_t* str2, qse_size_t len2)
|
qse_awk_val_t* qse_awk_rtx_makestrval2 (qse_awk_rtx_t* rtx, const qse_char_t* str1, qse_size_t len1, const qse_char_t* str2, qse_size_t len2)
|
||||||
@ -357,10 +357,10 @@ qse_awk_val_t* qse_awk_rtx_makenstrvalwithstr (qse_awk_rtx_t* rtx, const qse_cha
|
|||||||
qse_cstr_t xstr;
|
qse_cstr_t xstr;
|
||||||
xstr.ptr = (qse_char_t*)str;
|
xstr.ptr = (qse_char_t*)str;
|
||||||
xstr.len = qse_strlen(str);
|
xstr.len = qse_strlen(str);
|
||||||
return qse_awk_rtx_makenstrvalwithxstr (rtx, &xstr);
|
return qse_awk_rtx_makenstrvalwithcstr (rtx, &xstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
qse_awk_val_t* qse_awk_rtx_makenstrvalwithxstr (qse_awk_rtx_t* rtx, const qse_cstr_t* str)
|
qse_awk_val_t* qse_awk_rtx_makenstrvalwithcstr (qse_awk_rtx_t* rtx, const qse_cstr_t* str)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
qse_awk_val_t* v;
|
qse_awk_val_t* v;
|
||||||
@ -368,7 +368,7 @@ qse_awk_val_t* qse_awk_rtx_makenstrvalwithxstr (qse_awk_rtx_t* rtx, const qse_cs
|
|||||||
qse_awk_flt_t r;
|
qse_awk_flt_t r;
|
||||||
|
|
||||||
x = qse_awk_rtx_strtonum(rtx, QSE_AWK_RTX_STRTONUM_MAKE_OPTION(1, 0), str->ptr, str->len, &l, &r);
|
x = qse_awk_rtx_strtonum(rtx, QSE_AWK_RTX_STRTONUM_MAKE_OPTION(1, 0), str->ptr, str->len, &l, &r);
|
||||||
v = qse_awk_rtx_makestrvalwithxstr(rtx, str);
|
v = qse_awk_rtx_makestrvalwithcstr(rtx, str);
|
||||||
|
|
||||||
if (v == QSE_NULL) return QSE_NULL;
|
if (v == QSE_NULL) return QSE_NULL;
|
||||||
|
|
||||||
@ -408,7 +408,7 @@ qse_awk_val_t* qse_awk_rtx_makembsval (qse_awk_rtx_t* rtx, const qse_mchar_t* pt
|
|||||||
return (qse_awk_val_t*)val;
|
return (qse_awk_val_t*)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
qse_awk_val_t* qse_awk_rtx_makembsvalwithmxstr (qse_awk_rtx_t* rtx, const qse_mcstr_t* mxstr)
|
qse_awk_val_t* qse_awk_rtx_makembsvalwithmcstr (qse_awk_rtx_t* rtx, const qse_mcstr_t* mxstr)
|
||||||
{
|
{
|
||||||
return qse_awk_rtx_makembsval(rtx, mxstr->ptr, mxstr->len);
|
return qse_awk_rtx_makembsval(rtx, mxstr->ptr, mxstr->len);
|
||||||
}
|
}
|
||||||
@ -566,17 +566,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_XSTR:
|
||||||
case QSE_AWK_VAL_MAP_DATA_CSTR:
|
case QSE_AWK_VAL_MAP_DATA_CSTR:
|
||||||
tmp = qse_awk_rtx_makestrvalwithxstr(rtx, (qse_cstr_t*)p->vptr);
|
tmp = qse_awk_rtx_makestrvalwithcstr(rtx, (qse_cstr_t*)p->vptr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QSE_AWK_VAL_MAP_DATA_MXSTR:
|
case QSE_AWK_VAL_MAP_DATA_MXSTR:
|
||||||
case QSE_AWK_VAL_MAP_DATA_MCSTR:
|
case QSE_AWK_VAL_MAP_DATA_MCSTR:
|
||||||
tmp = qse_awk_rtx_makestrvalwithmxstr(rtx, (qse_mcstr_t*)p->vptr);
|
tmp = qse_awk_rtx_makestrvalwithmcstr(rtx, (qse_mcstr_t*)p->vptr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QSE_AWK_VAL_MAP_DATA_WXSTR:
|
case QSE_AWK_VAL_MAP_DATA_WXSTR:
|
||||||
case QSE_AWK_VAL_MAP_DATA_WCSTR:
|
case QSE_AWK_VAL_MAP_DATA_WCSTR:
|
||||||
tmp = qse_awk_rtx_makestrvalwithwxstr(rtx, (qse_wcstr_t*)p->vptr);
|
tmp = qse_awk_rtx_makestrvalwithwcstr(rtx, (qse_wcstr_t*)p->vptr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -182,7 +182,7 @@ static int fnc_str_to_str (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
|||||||
goto oops;
|
goto oops;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = qse_awk_rtx_makestrvalwithxstr (rtx, &outstr);
|
tmp = qse_awk_rtx_makestrvalwithcstr (rtx, &outstr);
|
||||||
qse_sed_freemem (sed, outstr.ptr);
|
qse_sed_freemem (sed, outstr.ptr);
|
||||||
|
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
|
@ -518,7 +518,7 @@ qse_mchar_t* qse_wcstombsdupwithcmgr (
|
|||||||
|
|
||||||
ml++; /* for the terminating null character */
|
ml++; /* for the terminating null character */
|
||||||
|
|
||||||
mbs = QSE_MMGR_ALLOC (mmgr, ml * QSE_SIZEOF(*mbs));
|
mbs = QSE_MMGR_ALLOC(mmgr, ml * QSE_SIZEOF(*mbs));
|
||||||
if (mbs == QSE_NULL) return QSE_NULL;
|
if (mbs == QSE_NULL) return QSE_NULL;
|
||||||
|
|
||||||
qse_wcstombswithcmgr (wcs, &wl, mbs, &ml, cmgr);
|
qse_wcstombswithcmgr (wcs, &wl, mbs, &ml, cmgr);
|
||||||
@ -531,15 +531,17 @@ qse_mchar_t* qse_wcsntombsdupwithcmgr (
|
|||||||
const qse_wchar_t* wcs, qse_size_t wcslen,
|
const qse_wchar_t* wcs, qse_size_t wcslen,
|
||||||
qse_size_t* mbslen, qse_mmgr_t* mmgr, qse_cmgr_t* cmgr)
|
qse_size_t* mbslen, qse_mmgr_t* mmgr, qse_cmgr_t* cmgr)
|
||||||
{
|
{
|
||||||
qse_size_t ml;
|
qse_size_t wl, ml;
|
||||||
qse_mchar_t* mbs;
|
qse_mchar_t* mbs;
|
||||||
|
|
||||||
if (qse_wcsntombsnwithcmgr (wcs, &wcslen, QSE_NULL, &ml, cmgr) <= -1) return QSE_NULL;
|
wl = wcslen;
|
||||||
|
if (qse_wcsntombsnwithcmgr(wcs, &wl, QSE_NULL, &ml, cmgr) <= -1) return QSE_NULL;
|
||||||
|
|
||||||
mbs = QSE_MMGR_ALLOC (mmgr, (ml + 1) * QSE_SIZEOF(*mbs));
|
mbs = QSE_MMGR_ALLOC (mmgr, (ml + 1) * QSE_SIZEOF(*mbs));
|
||||||
if (mbs == QSE_NULL) return QSE_NULL;
|
if (mbs == QSE_NULL) return QSE_NULL;
|
||||||
|
|
||||||
qse_wcsntombsnwithcmgr (wcs, &wcslen, mbs, &ml, cmgr);
|
wl = wcslen;
|
||||||
|
qse_wcsntombsnwithcmgr (wcs, &wl, mbs, &ml, cmgr);
|
||||||
mbs[ml] = QSE_MT('\0');
|
mbs[ml] = QSE_MT('\0');
|
||||||
|
|
||||||
if (mbslen) *mbslen = ml;
|
if (mbslen) *mbslen = ml;
|
||||||
|
@ -937,7 +937,7 @@ my hello
|
|||||||
my hello
|
my hello
|
||||||
my hello
|
my hello
|
||||||
my hello
|
my hello
|
||||||
ERROR: CODE 17 LINE 6 COLUMN 1 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-002.awk - block nested too deeply
|
ERROR: CODE 17 LINE 6 COLUMN 1 FILE lang-002.awk - block nested too deeply
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-003.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-003.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -956,7 +956,7 @@ BEGIN {
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-004.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-004.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 44 LINE 3 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-004.awk - function 'a' redefined
|
ERROR: CODE 44 LINE 3 COLUMN 9 FILE lang-004.awk - function 'a' redefined
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --implicit=off --newline=on -d- -f lang-005.awk </dev/stdin 2>&1
|
[CMD] qseawk --implicit=off --newline=on -d- -f lang-005.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -984,7 +984,7 @@ BEGIN {
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --implicit=off --newline=on -d- -f lang-006.awk </dev/stdin 2>&1
|
[CMD] qseawk --implicit=off --newline=on -d- -f lang-006.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 45 LINE 5 COLUMN 10 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-006.awk - global variable 'a' redefined
|
ERROR: CODE 45 LINE 5 COLUMN 10 FILE lang-006.awk - global variable 'a' redefined
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --implicit=on --newline=on -d- -f lang-007.awk </dev/stdin 2>&1
|
[CMD] qseawk --implicit=on --newline=on -d- -f lang-007.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -1352,7 +1352,7 @@ BEGIN {
|
|||||||
printf ("%s\n",10.34);
|
printf ("%s\n",10.34);
|
||||||
}
|
}
|
||||||
|
|
||||||
ERROR: CODE 110 LINE 3 COLUMN 2 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-013.awk - recursion detected in format conversion
|
ERROR: CODE 110 LINE 3 COLUMN 2 FILE lang-013.awk - recursion detected in format conversion
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-014.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-014.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -1367,7 +1367,7 @@ BEGIN {
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-015.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-015.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 17 LINE 3 COLUMN 50 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-015.awk - block nested too deeply
|
ERROR: CODE 17 LINE 3 COLUMN 50 FILE lang-015.awk - block nested too deeply
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-016.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-016.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -1481,27 +1481,27 @@ END {
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-018.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-018.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 49 LINE 1 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-018.awk - duplicate global variable 'ARGV'
|
ERROR: CODE 49 LINE 1 COLUMN 9 FILE lang-018.awk - duplicate global variable 'ARGV'
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-019.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-019.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 51 LINE 1 COLUMN 15 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-019.awk - '+' not a valid parameter name
|
ERROR: CODE 51 LINE 1 COLUMN 15 FILE lang-019.awk - '+' not a valid parameter name
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-020.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-020.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 52 LINE 1 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-020.awk - '+' not a valid variable name
|
ERROR: CODE 52 LINE 1 COLUMN 9 FILE lang-020.awk - '+' not a valid variable name
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-021.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-021.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 52 LINE 3 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-021.awk - '+' not a valid variable name
|
ERROR: CODE 52 LINE 3 COLUMN 9 FILE lang-021.awk - '+' not a valid variable name
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-022.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-022.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 25 LINE 2 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-022.awk - left parenthesis expected in place of '='
|
ERROR: CODE 25 LINE 2 COLUMN 9 FILE lang-022.awk - left parenthesis expected in place of '='
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-023.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-023.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 30 LINE 5 COLUMN 20 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-023.awk - colon expected in place of ';'
|
ERROR: CODE 30 LINE 5 COLUMN 20 FILE lang-023.awk - colon expected in place of ';'
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-024.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-024.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -1533,7 +1533,7 @@ BEGIN {
|
|||||||
delete iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix;
|
delete iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix;
|
||||||
}
|
}
|
||||||
|
|
||||||
ERROR: CODE 81 LINE 3 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-025.awk - 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix' not deletable
|
ERROR: CODE 81 LINE 3 COLUMN 9 FILE lang-025.awk - 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix' not deletable
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-026.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-026.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -1549,15 +1549,15 @@ abc
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-027.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-027.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 19 LINE 2 COLUMN 1 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-027.awk - invalid character '<NUL>'
|
ERROR: CODE 19 LINE 2 COLUMN 1 FILE lang-027.awk - invalid character '<NUL>'
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-028.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-028.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 43 LINE 2 COLUMN 10 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-028.awk - intrinsic function 'substr' redefined
|
ERROR: CODE 43 LINE 2 COLUMN 10 FILE lang-028.awk - intrinsic function 'substr' redefined
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-029.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-029.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 44 LINE 9 COLUMN 10 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-029.awk - function 'abc' redefined
|
ERROR: CODE 44 LINE 9 COLUMN 10 FILE lang-029.awk - function 'abc' redefined
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-030.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-030.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -1667,7 +1667,7 @@ BEGIN {
|
|||||||
---------------------
|
---------------------
|
||||||
9210
|
9210
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -vdatadir=/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk -vdatafile=passwd.dat -f lang-033.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -vdatadir=awk -vdatafile=passwd.dat -f lang-033.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
BEGIN {
|
BEGIN {
|
||||||
while (((((("cat " datadir) "/") datafile) | getline x) > 0))
|
while (((((("cat " datadir) "/") datafile) | getline x) > 0))
|
||||||
@ -1734,7 +1734,7 @@ xx: 13
|
|||||||
xx: 14
|
xx: 14
|
||||||
xx: 15
|
xx: 15
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -vdatadir=/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk -vdatafile=lang-035.dat1 -vgroupname=lang-035 -f lang-035.awk lang-035.dat2 </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -vdatadir=awk -vdatafile=lang-035.dat1 -vgroupname=lang-035 -f lang-035.awk lang-035.dat2 </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
BEGIN {
|
BEGIN {
|
||||||
max_cid_vars = 100;
|
max_cid_vars = 100;
|
||||||
@ -2344,7 +2344,7 @@ nan
|
|||||||
8103.08
|
8103.08
|
||||||
3
|
3
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -vdatadir=/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk -vdatafile=lang-046.dat1 -f lang-046.awk lang-046.dat2 </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -vdatadir=awk -vdatafile=lang-046.dat1 -f lang-046.awk lang-046.dat2 </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
|
||||||
@ -2456,7 +2456,7 @@ BEGIN {
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on -d- -f lang-049.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on -d- -f lang-049.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
ERROR: CODE 62 LINE 2 COLUMN 9 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-049.awk - no argument provided
|
ERROR: CODE 62 LINE 2 COLUMN 9 FILE lang-049.awk - no argument provided
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on --flexmap=off -d- -f lang-050.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on --flexmap=off -d- -f lang-050.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -2467,7 +2467,7 @@ BEGIN {
|
|||||||
print i,a[i];
|
print i,a[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
ERROR: CODE 91 LINE 6 COLUMN 2 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-050.awk - cannot change a scalar to a map
|
ERROR: CODE 91 LINE 6 COLUMN 2 FILE lang-050.awk - cannot change a scalar to a map
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on --flexmap=on -d- -f lang-050.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on --flexmap=on -d- -f lang-050.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -2488,7 +2488,7 @@ BEGIN {
|
|||||||
print i,ARGC[i];
|
print i,ARGC[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
ERROR: CODE 94 LINE 7 COLUMN 2 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-051.awk - cannot change a scalar 'ARGC' to a map
|
ERROR: CODE 94 LINE 7 COLUMN 2 FILE lang-051.awk - cannot change a scalar 'ARGC' to a map
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on --flexmap=on -d- -f lang-051.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on --flexmap=on -d- -f lang-051.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -2544,7 +2544,7 @@ BEGIN {
|
|||||||
print i,a[i];
|
print i,a[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
ERROR: CODE 92 LINE 10 COLUMN 2 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-053.awk - cannot change a map 'a' to another map
|
ERROR: CODE 92 LINE 10 COLUMN 2 FILE lang-053.awk - cannot change a map 'a' to another map
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on --flexmap=on -d- -f lang-053.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on --flexmap=on -d- -f lang-053.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -2568,7 +2568,7 @@ BEGIN {
|
|||||||
print ARGV;
|
print ARGV;
|
||||||
}
|
}
|
||||||
|
|
||||||
ERROR: CODE 93 LINE 4 COLUMN 8 FILE /home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk/lang-054.awk - cannot change a map 'ARGV' to a scalar
|
ERROR: CODE 93 LINE 4 COLUMN 8 FILE lang-054.awk - cannot change a map 'ARGV' to a scalar
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk --newline=on --flexmap=on -d- -f lang-054.awk </dev/stdin 2>&1
|
[CMD] qseawk --newline=on --flexmap=on -d- -f lang-054.awk </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -2666,7 +2666,7 @@ Result Ra Rb Connect Error
|
|||||||
1.E12
|
1.E12
|
||||||
99X
|
99X
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
[CMD] qseawk -vQSEAWK="/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/cmd/awk/.libs/qseawk" -vSCRIPT_PATH="/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/../../regress/awk" -f quicksort2.awk quicksort2.dat </dev/stdin 2>&1
|
[CMD] qseawk -vQSEAWK="/home/hyung-hwan/workspace/qse/bld/x86_64-linux-wchar-debug-shared/cmd/awk/.libs/qseawk" -vSCRIPT_PATH="awk" -f quicksort2.awk quicksort2.dat </dev/stdin 2>&1
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
0.0000000000
|
0.0000000000
|
||||||
0.11111111111111111111111111111
|
0.11111111111111111111111111111
|
||||||
|
Loading…
Reference in New Issue
Block a user