added more character conversion functions
This commit is contained in:
@ -181,11 +181,7 @@ static moo_pfrc_t pf_write (moo_t* moo, moo_ooi_t nargs)
|
||||
bcslen = MOO_COUNTOF(bcs);
|
||||
if ((n = moo_convootobchars (moo, &oomsg->slot[ucspos], &ucslen, bcs, &bcslen)) <= -1)
|
||||
{
|
||||
if (n != -2 || ucslen <= 0)
|
||||
{
|
||||
moo_seterrnum (moo, MOO_EECERR);
|
||||
return MOO_PF_HARD_FAILURE;
|
||||
}
|
||||
if (n != -2 || ucslen <= 0) return MOO_PF_HARD_FAILURE;
|
||||
}
|
||||
|
||||
write (con->fd, bcs, bcslen); /* TODO: error handling */
|
||||
|
@ -122,6 +122,7 @@ reterr:
|
||||
MOO_STACK_SETRETTOERROR (moo, nargs);
|
||||
return MOO_PF_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
struct bcstr_node_t
|
||||
{
|
||||
@ -141,6 +142,7 @@ static void free_bcstr_node (moo_t* moo, bcstr_node_t* bcstr)
|
||||
moo_freemem (moo, bcstr);
|
||||
}
|
||||
*/
|
||||
|
||||
static moo_pfrc_t pf_call (moo_t* moo, moo_ooi_t nargs)
|
||||
{
|
||||
#if defined(USE_DYNCALL)
|
||||
|
@ -159,11 +159,7 @@ static moo_pfrc_t __pf_puts (moo_t* moo, moo_ooi_t nargs, moo_oow_t limit)
|
||||
/* TODO: implement character conversion into stdio and use it instead of vm's conversion facility. */
|
||||
if ((n = moo_convootobchars (moo, &x->slot[ucspos], &ucslen, bcs, &bcslen)) <= -1)
|
||||
{
|
||||
if (n != -2 || ucslen <= 0)
|
||||
{
|
||||
moo_seterrnum (moo, MOO_EECERR);
|
||||
goto reterr;
|
||||
}
|
||||
if (n != -2 || ucslen <= 0) goto reterr;
|
||||
}
|
||||
|
||||
if (fwrite (bcs, 1, bcslen, rcv->fp) < bcslen)
|
||||
|
Reference in New Issue
Block a user