fix calling of Write and Read for new SWI style interface.

This commit is contained in:
Vitor Santos Costa
2011-07-22 15:49:40 +01:00
parent eea7f83e09
commit a16a7d5b1c
9 changed files with 51 additions and 35 deletions

View File

@@ -1121,6 +1121,9 @@ Yap_StreamPosition(IOSTREAM *st)
return StreamPosition(st);
}
IOSTREAM *STD_PROTO(Yap_Scurin, (void));
int STD_PROTO(Yap_dowrite, (Term, IOSTREAM *, int, int));
IOSTREAM *
Yap_Scurin(void)
{
@@ -1128,6 +1131,32 @@ Yap_Scurin(void)
return Scurin;
}
int
Yap_dowrite(Term t, IOSTREAM *stream, int flags, int priority)
/* term to be written */
/* consumer */
/* write options */
{
CACHE_REGS
int swi_flags;
int res;
Int slot = Yap_InitSlot(t PASS_REGS);
swi_flags = 0;
if (flags & Quote_illegal_f)
swi_flags |= PL_WRT_QUOTED;
if (flags & Handle_vars_f)
swi_flags |= PL_WRT_NUMBERVARS;
if (flags & Use_portray_f)
swi_flags |= PL_WRT_PORTRAY;
if (flags & Ignore_ops_f)
swi_flags |= PL_WRT_IGNOREOPS;
res = PL_write_term(stream, slot, priority, swi_flags);
Yap_RecoverSlots(1 PASS_REGS);
return res;
}
#if THREADS
@@ -1178,6 +1207,7 @@ error:
return rc;
}
int
recursiveMutexInit(recursiveMutex *m)
{