renamed hawk_setgblbyname() to hawk_setgbltostrbyname()

This commit is contained in:
hyung-hwan 2020-03-05 09:04:14 +00:00
parent b7d29ffc86
commit 75cb22aaec
3 changed files with 7 additions and 8 deletions

View File

@ -2356,7 +2356,7 @@ HAWK_EXPORT int hawk_rtx_setgbl (
hawk_val_t* val
);
HAWK_EXPORT int hawk_rtx_setgblbyname (
HAWK_EXPORT int hawk_rtx_setgbltostrbyname (
hawk_rtx_t* rtx,
const hawk_ooch_t* name,
const hawk_ooch_t* val

View File

@ -634,7 +634,7 @@ HAWK_INLINE int hawk_rtx_setgbl (hawk_rtx_t* rtx, int id, hawk_val_t* val)
return set_global(rtx, id, HAWK_NULL, val, 0);
}
int hawk_rtx_setgblbyname (hawk_rtx_t* rtx, const hawk_ooch_t* name, const hawk_ooch_t* val)
int hawk_rtx_setgbltostrbyname (hawk_rtx_t* rtx, const hawk_ooch_t* name, const hawk_ooch_t* val)
{
int id, n;
hawk_val_t* v;

View File

@ -163,7 +163,7 @@ typedef struct rxtn_t
{
hawk_ooch_t** files;
hawk_oow_t index;
hawk_oow_t count;
hawk_oow_t count; /* number of files opened so far */
} in;
struct
@ -1683,7 +1683,7 @@ static int check_var_assign (hawk_rtx_t* rtx, hawk_ooch_t* str)
if (HAWK_UNLIKELY(!var)) return -1;
n = hawk_isvalidident(hawk_rtx_gethawk(rtx), var)?
((hawk_rtx_setgblbyname(rtx, var, eq + 1) <= -1)? -1: 1): 0;
((hawk_rtx_setgbltostrbyname(rtx, var, eq + 1) <= -1)? -1: 1): 0;
hawk_rtx_freemem (rtx, var);
return n;
}
@ -2017,7 +2017,7 @@ static int open_rio_console (hawk_rtx_t* rtx, hawk_rio_arg_t* riod)
{
xtn_t* xtn = (xtn_t*)GET_XTN(rtx->awk);
if (rxtn->c.in.files == HAWK_NULL)
if (!rxtn->c.in.files)
{
/* if no input files is specified,
* open the standard input */
@ -2053,8 +2053,7 @@ static int open_rio_console (hawk_rtx_t* rtx, hawk_rio_arg_t* riod)
nextfile:
file = rxtn->c.in.files[rxtn->c.in.index];
if (file == HAWK_NULL)
if (!file)
{
/* no more input file */