some more naming changes
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:
47
lib/std.c
47
lib/std.c
@ -3324,7 +3324,16 @@ static HCL_INLINE int read_cci_stream (hcl_t* hcl, hcl_io_cciarg_t* arg)
|
||||
int x;
|
||||
|
||||
bb = (bb_t*)arg->handle;
|
||||
HCL_ASSERT (hcl, bb != HCL_NULL && bb->fp != HCL_NULL);
|
||||
HCL_ASSERT (hcl, bb != HCL_NULL);
|
||||
|
||||
if (!bb->fp)
|
||||
{
|
||||
HCL_ASSERT (hcl, arg->includer == HCL_NULL);
|
||||
/* the main stream is opened with no associated file in open_cci_stream(). return no data */
|
||||
arg->xlen = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
x = fgetc(bb->fp);
|
||||
@ -3359,7 +3368,7 @@ static HCL_INLINE int read_cci_stream (hcl_t* hcl, hcl_io_cciarg_t* arg)
|
||||
#endif
|
||||
|
||||
remlen = bb->len - bcslen;
|
||||
if (remlen > 0) memmove (bb->buf, &bb->buf[bcslen], remlen);
|
||||
if (remlen > 0) HCL_MEMMOVE (bb->buf, &bb->buf[bcslen], remlen);
|
||||
bb->len = remlen;
|
||||
|
||||
arg->xlen = ucslen;
|
||||
@ -3391,7 +3400,7 @@ static int cci_handler (hcl_t* hcl, hcl_io_cmd_t cmd, void* arg)
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
static HCL_INLINE int open_in_stream (hcl_t* hcl, hcl_io_udiarg_t* arg)
|
||||
static HCL_INLINE int open_udi_stream (hcl_t* hcl, hcl_io_udiarg_t* arg)
|
||||
{
|
||||
xtn_t* xtn = GET_XTN(hcl);
|
||||
bb_t* bb = HCL_NULL;
|
||||
@ -3433,7 +3442,7 @@ oops:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static HCL_INLINE int close_in_stream (hcl_t* hcl, hcl_io_udiarg_t* arg)
|
||||
static HCL_INLINE int close_udi_stream (hcl_t* hcl, hcl_io_udiarg_t* arg)
|
||||
{
|
||||
/*xtn_t* xtn = GET_XTN(hcl);*/
|
||||
bb_t* bb;
|
||||
@ -3448,7 +3457,7 @@ static HCL_INLINE int close_in_stream (hcl_t* hcl, hcl_io_udiarg_t* arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HCL_INLINE int read_in_stream (hcl_t* hcl, hcl_io_udiarg_t* arg)
|
||||
static HCL_INLINE int read_udi_stream (hcl_t* hcl, hcl_io_udiarg_t* arg)
|
||||
{
|
||||
/*xtn_t* xtn = GET_XTN(hcl);*/
|
||||
bb_t* bb;
|
||||
@ -3491,7 +3500,7 @@ static HCL_INLINE int read_in_stream (hcl_t* hcl, hcl_io_udiarg_t* arg)
|
||||
#endif
|
||||
|
||||
remlen = bb->len - bcslen;
|
||||
if (remlen > 0) memmove (bb->buf, &bb->buf[bcslen], remlen);
|
||||
if (remlen > 0) HCL_MEMMOVE (bb->buf, &bb->buf[bcslen], remlen);
|
||||
bb->len = remlen;
|
||||
|
||||
arg->xlen = ucslen;
|
||||
@ -3503,13 +3512,13 @@ static int udi_handler (hcl_t* hcl, hcl_io_cmd_t cmd, void* arg)
|
||||
switch (cmd)
|
||||
{
|
||||
case HCL_IO_OPEN:
|
||||
return open_in_stream(hcl, (hcl_io_udiarg_t*)arg);
|
||||
return open_udi_stream(hcl, (hcl_io_udiarg_t*)arg);
|
||||
|
||||
case HCL_IO_CLOSE:
|
||||
return close_in_stream(hcl, (hcl_io_udiarg_t*)arg);
|
||||
return close_udi_stream(hcl, (hcl_io_udiarg_t*)arg);
|
||||
|
||||
case HCL_IO_READ:
|
||||
return read_in_stream(hcl, (hcl_io_udiarg_t*)arg);
|
||||
return read_udi_stream(hcl, (hcl_io_udiarg_t*)arg);
|
||||
|
||||
case HCL_IO_FLUSH:
|
||||
/* no effect on an input stream */
|
||||
@ -3523,7 +3532,7 @@ static int udi_handler (hcl_t* hcl, hcl_io_cmd_t cmd, void* arg)
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
static HCL_INLINE int open_out_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
static HCL_INLINE int open_udo_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
{
|
||||
xtn_t* xtn = GET_XTN(hcl);
|
||||
FILE* fp;
|
||||
@ -3547,7 +3556,7 @@ static HCL_INLINE int open_out_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HCL_INLINE int close_out_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
static HCL_INLINE int close_udo_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
{
|
||||
/*xtn_t* xtn = GET_XTN(hcl);*/
|
||||
FILE* fp;
|
||||
@ -3559,7 +3568,7 @@ static HCL_INLINE int close_out_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HCL_INLINE int write_out_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
static HCL_INLINE int write_udo_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
{
|
||||
/*xtn_t* xtn = GET_XTN(hcl);*/
|
||||
const hcl_ooch_t* ptr;
|
||||
@ -3599,7 +3608,7 @@ static HCL_INLINE int write_out_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HCL_INLINE int write_bytes_out_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
static HCL_INLINE int write_bytes_udo_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
{
|
||||
/*xtn_t* xtn = GET_XTN(hcl);*/
|
||||
const hcl_uint8_t* ptr;
|
||||
@ -3616,7 +3625,7 @@ static HCL_INLINE int write_bytes_out_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HCL_INLINE int flush_out_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
static HCL_INLINE int flush_udo_stream (hcl_t* hcl, hcl_io_udoarg_t* arg)
|
||||
{
|
||||
FILE* fp;
|
||||
|
||||
@ -3632,19 +3641,19 @@ static int udo_handler (hcl_t* hcl, hcl_io_cmd_t cmd, void* arg)
|
||||
switch (cmd)
|
||||
{
|
||||
case HCL_IO_OPEN:
|
||||
return open_out_stream(hcl, (hcl_io_udoarg_t*)arg);
|
||||
return open_udo_stream(hcl, (hcl_io_udoarg_t*)arg);
|
||||
|
||||
case HCL_IO_CLOSE:
|
||||
return close_out_stream(hcl, (hcl_io_udoarg_t*)arg);
|
||||
return close_udo_stream(hcl, (hcl_io_udoarg_t*)arg);
|
||||
|
||||
case HCL_IO_WRITE:
|
||||
return write_out_stream(hcl, (hcl_io_udoarg_t*)arg);
|
||||
return write_udo_stream(hcl, (hcl_io_udoarg_t*)arg);
|
||||
|
||||
case HCL_IO_WRITE_BYTES:
|
||||
return write_bytes_out_stream(hcl, (hcl_io_udoarg_t*)arg);
|
||||
return write_bytes_udo_stream(hcl, (hcl_io_udoarg_t*)arg);
|
||||
|
||||
case HCL_IO_FLUSH:
|
||||
return flush_out_stream(hcl, (hcl_io_udoarg_t*)arg);
|
||||
return flush_udo_stream(hcl, (hcl_io_udoarg_t*)arg);
|
||||
|
||||
default:
|
||||
hcl_seterrnum (hcl, HCL_EINTERN);
|
||||
|
Reference in New Issue
Block a user