long range errors and other fixes
This commit is contained in:
parent
ec1e35192f
commit
b6130b0e7d
@ -1322,6 +1322,7 @@ YAP: NO EQUIVALENT */
|
||||
X_API int PL_raise_exception(term_t exception)
|
||||
{
|
||||
CACHE_REGS
|
||||
LOCAL_Error_TYPE=YAP_NO_ERROR;
|
||||
EX = Yap_StoreTermInDB(Yap_GetFromSlot(exception),0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ Term
|
||||
}
|
||||
|
||||
char *
|
||||
Yap_TermToString(Term t, char *s, size_t sz, size_t *length, encoding_t encp, int flags)
|
||||
Yap_TermToString(Term t, char *s, size_t sz, size_t *length, encoding_t *encp, int flags)
|
||||
{
|
||||
CACHE_REGS
|
||||
int sno = Yap_open_buf_write_stream(&s, &sz);
|
||||
@ -235,7 +235,7 @@ Term
|
||||
}
|
||||
|
||||
char *
|
||||
Yap_TermToString(Term t, char *s, size_t sz, size_t *length, encoding_t encp, int flags)
|
||||
Yap_TermToString(Term t, char *s, size_t sz, size_t *length, encoding_t *encp, int flags)
|
||||
{
|
||||
CACHE_REGS
|
||||
int sno = Yap_open_buf_write_stream(&s, &sz);
|
||||
@ -244,10 +244,9 @@ char *
|
||||
if (sno < 0)
|
||||
return NULL;
|
||||
LOCAL_output_stream = sno;
|
||||
if (encp)
|
||||
if (encp )
|
||||
GLOBAL_Stream[sno].encoding = encp;
|
||||
Yap_plwrite (t, GLOBAL_Stream[sno].stream_wputc, 0, flags, 1200);
|
||||
s[GLOBAL_Stream[sno].u.mem_string.pos] = '\0';
|
||||
LOCK(GLOBAL_Stream[sno].streamlock);
|
||||
GLOBAL_Stream[sno].status = Free_Stream_f;
|
||||
UNLOCK(GLOBAL_Stream[sno].streamlock);
|
||||
|
@ -1716,6 +1716,7 @@ Yap_CheckTextStream (Term arg, int kind, const char *msg)
|
||||
if ((sno = CheckStream(arg, kind, (char *)msg)) < 0)
|
||||
return -1;
|
||||
if ((GLOBAL_Stream[sno].status & Binary_Stream_f)) {
|
||||
PlIOError(PERMISSION_ERROR_INPUT_BINARY_STREAM, arg, msg);
|
||||
UNLOCK(GLOBAL_Stream[sno].streamlock);
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user