renamed hawk_setgblbyname() to hawk_setgbltostrbyname()
This commit is contained in:
parent
b7d29ffc86
commit
75cb22aaec
@ -2356,7 +2356,7 @@ HAWK_EXPORT int hawk_rtx_setgbl (
|
|||||||
hawk_val_t* val
|
hawk_val_t* val
|
||||||
);
|
);
|
||||||
|
|
||||||
HAWK_EXPORT int hawk_rtx_setgblbyname (
|
HAWK_EXPORT int hawk_rtx_setgbltostrbyname (
|
||||||
hawk_rtx_t* rtx,
|
hawk_rtx_t* rtx,
|
||||||
const hawk_ooch_t* name,
|
const hawk_ooch_t* name,
|
||||||
const hawk_ooch_t* val
|
const hawk_ooch_t* val
|
||||||
|
@ -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);
|
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;
|
int id, n;
|
||||||
hawk_val_t* v;
|
hawk_val_t* v;
|
||||||
|
@ -163,7 +163,7 @@ typedef struct rxtn_t
|
|||||||
{
|
{
|
||||||
hawk_ooch_t** files;
|
hawk_ooch_t** files;
|
||||||
hawk_oow_t index;
|
hawk_oow_t index;
|
||||||
hawk_oow_t count;
|
hawk_oow_t count; /* number of files opened so far */
|
||||||
} in;
|
} in;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
@ -1683,7 +1683,7 @@ static int check_var_assign (hawk_rtx_t* rtx, hawk_ooch_t* str)
|
|||||||
if (HAWK_UNLIKELY(!var)) return -1;
|
if (HAWK_UNLIKELY(!var)) return -1;
|
||||||
|
|
||||||
n = hawk_isvalidident(hawk_rtx_gethawk(rtx), var)?
|
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);
|
hawk_rtx_freemem (rtx, var);
|
||||||
return n;
|
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);
|
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,
|
/* if no input files is specified,
|
||||||
* open the standard input */
|
* open the standard input */
|
||||||
@ -2053,8 +2053,7 @@ static int open_rio_console (hawk_rtx_t* rtx, hawk_rio_arg_t* riod)
|
|||||||
|
|
||||||
nextfile:
|
nextfile:
|
||||||
file = rxtn->c.in.files[rxtn->c.in.index];
|
file = rxtn->c.in.files[rxtn->c.in.index];
|
||||||
|
if (!file)
|
||||||
if (file == HAWK_NULL)
|
|
||||||
{
|
{
|
||||||
/* no more input file */
|
/* no more input file */
|
||||||
|
|
||||||
@ -2100,7 +2099,7 @@ static int open_rio_console (hawk_rtx_t* rtx, hawk_rio_arg_t* riod)
|
|||||||
|
|
||||||
map = ((hawk_val_map_t*)argv)->map;
|
map = ((hawk_val_map_t*)argv)->map;
|
||||||
HAWK_ASSERT (map != HAWK_NULL);
|
HAWK_ASSERT (map != HAWK_NULL);
|
||||||
|
|
||||||
ibuflen = hawk_int_to_oocstr(rxtn->c.in.index + 1, 10, HAWK_NULL, ibuf, HAWK_COUNTOF(ibuf));
|
ibuflen = hawk_int_to_oocstr(rxtn->c.in.index + 1, 10, HAWK_NULL, ibuf, HAWK_COUNTOF(ibuf));
|
||||||
|
|
||||||
pair = hawk_htb_search(map, ibuf, ibuflen);
|
pair = hawk_htb_search(map, ibuf, ibuflen);
|
||||||
|
Loading…
Reference in New Issue
Block a user