renamed some variables
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b913ab5403
commit
110cb0b767
@ -451,7 +451,7 @@ static int feed_loop (hcl_t* hcl, xtn_t* xtn, int cflags, int verbose)
|
|||||||
{
|
{
|
||||||
/* override the default cnode handler. the default one simply
|
/* override the default cnode handler. the default one simply
|
||||||
* compiles the expression node without execution */
|
* compiles the expression node without execution */
|
||||||
if (hcl_beginfeed (hcl, hcl_isstdreadertty(hcl)? on_fed_cnode_in_interactive_mode: HCL_NULL) <= -1)
|
if (hcl_beginfeed(hcl, hcl_isstdreadertty(hcl)? on_fed_cnode_in_interactive_mode: HCL_NULL) <= -1)
|
||||||
{
|
{
|
||||||
hcl_logbfmt (hcl, HCL_LOG_STDERR, "ERROR: cannot begin feed - [%d] %js\n", hcl_geterrnum(hcl), hcl_geterrmsg(hcl));
|
hcl_logbfmt (hcl, HCL_LOG_STDERR, "ERROR: cannot begin feed - [%d] %js\n", hcl_geterrnum(hcl), hcl_geterrmsg(hcl));
|
||||||
goto oops;
|
goto oops;
|
||||||
|
19
lib/std.c
19
lib/std.c
@ -3200,7 +3200,7 @@ static const hcl_bch_t* get_base_name (const hcl_bch_t* path)
|
|||||||
return (last == HCL_NULL)? path: (last + 1);
|
return (last == HCL_NULL)? path: (last + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HCL_INLINE int open_sr_stream (hcl_t* hcl, hcl_iosrarg_t* arg)
|
static HCL_INLINE int open_sin_stream (hcl_t* hcl, hcl_iosrarg_t* arg)
|
||||||
{
|
{
|
||||||
xtn_t* xtn = GET_XTN(hcl);
|
xtn_t* xtn = GET_XTN(hcl);
|
||||||
bb_t* bb = HCL_NULL;
|
bb_t* bb = HCL_NULL;
|
||||||
@ -3298,7 +3298,7 @@ oops:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HCL_INLINE int close_sr_stream (hcl_t* hcl, hcl_iosrarg_t* arg)
|
static HCL_INLINE int close_sin_stream (hcl_t* hcl, hcl_iosrarg_t* arg)
|
||||||
{
|
{
|
||||||
/*xtn_t* xtn = GET_XTN(hcl);*/
|
/*xtn_t* xtn = GET_XTN(hcl);*/
|
||||||
bb_t* bb;
|
bb_t* bb;
|
||||||
@ -3321,7 +3321,7 @@ static HCL_INLINE int close_sr_stream (hcl_t* hcl, hcl_iosrarg_t* arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HCL_INLINE int read_sr_stream (hcl_t* hcl, hcl_iosrarg_t* arg)
|
static HCL_INLINE int read_sin_stream (hcl_t* hcl, hcl_iosrarg_t* arg)
|
||||||
{
|
{
|
||||||
/*xtn_t* xtn = GET_XTN(hcl);*/
|
/*xtn_t* xtn = GET_XTN(hcl);*/
|
||||||
bb_t* bb;
|
bb_t* bb;
|
||||||
@ -3371,18 +3371,19 @@ static HCL_INLINE int read_sr_stream (hcl_t* hcl, hcl_iosrarg_t* arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int read_handler (hcl_t* hcl, hcl_iocmd_t cmd, void* arg)
|
/* source input stream handler */
|
||||||
|
static int sin_handler (hcl_t* hcl, hcl_iocmd_t cmd, void* arg)
|
||||||
{
|
{
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
case HCL_IO_OPEN:
|
case HCL_IO_OPEN:
|
||||||
return open_sr_stream(hcl, (hcl_iosrarg_t*)arg);
|
return open_sin_stream(hcl, (hcl_iosrarg_t*)arg);
|
||||||
|
|
||||||
case HCL_IO_CLOSE:
|
case HCL_IO_CLOSE:
|
||||||
return close_sr_stream(hcl, (hcl_iosrarg_t*)arg);
|
return close_sin_stream(hcl, (hcl_iosrarg_t*)arg);
|
||||||
|
|
||||||
case HCL_IO_READ:
|
case HCL_IO_READ:
|
||||||
return read_sr_stream(hcl, (hcl_iosrarg_t*)arg);
|
return read_sin_stream(hcl, (hcl_iosrarg_t*)arg);
|
||||||
|
|
||||||
case HCL_IO_FLUSH:
|
case HCL_IO_FLUSH:
|
||||||
/* no effect on an input stream */
|
/* no effect on an input stream */
|
||||||
@ -3671,7 +3672,7 @@ int hcl_attachiostdwithbcstr (hcl_t* hcl, const hcl_bch_t* read_file, const hcl_
|
|||||||
xtn->scan_path = scan_file;
|
xtn->scan_path = scan_file;
|
||||||
xtn->print_path = print_file;
|
xtn->print_path = print_file;
|
||||||
|
|
||||||
n = hcl_attachio(hcl, read_handler, scan_handler, print_handler);
|
n = hcl_attachio(hcl, sin_handler, scan_handler, print_handler);
|
||||||
|
|
||||||
xtn->read_path = HCL_NULL;
|
xtn->read_path = HCL_NULL;
|
||||||
xtn->scan_path = HCL_NULL;
|
xtn->scan_path = HCL_NULL;
|
||||||
@ -3710,7 +3711,7 @@ int hcl_attachiostdwithucstr (hcl_t* hcl, const hcl_uch_t* read_file, const hcl_
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
n = hcl_attachio(hcl, read_handler, scan_handler, print_handler);
|
n = hcl_attachio(hcl, sin_handler, scan_handler, print_handler);
|
||||||
|
|
||||||
hcl_freemem (hcl, (void*)xtn->read_path);
|
hcl_freemem (hcl, (void*)xtn->read_path);
|
||||||
hcl_freemem (hcl, (void*)xtn->scan_path);
|
hcl_freemem (hcl, (void*)xtn->scan_path);
|
||||||
|
Loading…
Reference in New Issue
Block a user