support outputting strings for debugging.

This commit is contained in:
Vítor Santos Costa 2014-10-02 14:17:26 +01:00
parent 37a49f2135
commit 81440607f1
2 changed files with 16 additions and 0 deletions

View File

@ -199,6 +199,14 @@ Yap_DebugPutc(int sno, wchar_t ch)
return (Sputc(ch, GLOBAL_stderr));
}
static int
Yap_DebugPuts(int sno, const char * s)
{
if (GLOBAL_Option['l' - 96])
(void) fputs(s, GLOBAL_logfile);
return (Sfputs(s, GLOBAL_stderr));
}
void
Yap_DebugPlWrite(Term t)
{
@ -212,6 +220,13 @@ Yap_DebugErrorPutc(int c)
Yap_DebugPutc (LOCAL_c_error_stream, c);
}
void
Yap_DebugErrorPuts(const char *s)
{
CACHE_REGS
Yap_DebugPuts (LOCAL_c_error_stream, s);
}
#endif

View File

@ -283,6 +283,7 @@ void *Yap_GetOutputStream(Atom at);
#ifdef DEBUG
extern void Yap_DebugPlWrite (Term t);
extern void Yap_DebugErrorPutc (int n);
extern void Yap_DebugErrorPuts (const char *s);
#endif
void Yap_PlWriteToStream(Term, int, int);
/* depth_lim.c */