From e1421f207e3a2bcddd4c5f63acafaba9de496569 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 22 May 2009 13:23:51 -0500 Subject: [PATCH] use DebugPlWrite for debugging writes --- C/errors.c | 16 ++++++++-------- C/index.c | 52 ++++++++++++++++++++++++++-------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/C/errors.c b/C/errors.c index ae55a56f5..ffb58bbc6 100644 --- a/C/errors.c +++ b/C/errors.c @@ -117,14 +117,14 @@ DumpActiveGoals (void) if (first++ == 1) fprintf(stderr,"Active ancestors:\n"); if (pe->ModuleOfPred) mod = pe->ModuleOfPred; - Yap_plwrite (mod, Yap_DebugPutc, 0); + Yap_DebugPlWrite (mod); Yap_DebugPutc (Yap_c_error_stream,':'); if (pe->ArityOfPE == 0) { - Yap_plwrite (MkAtomTerm ((Atom)f), Yap_DebugPutc, 0); + Yap_DebugPlWrite (MkAtomTerm ((Atom)f)); } else { - Yap_plwrite (MkAtomTerm (NameOfFunctor (f)), Yap_DebugPutc, 0); + Yap_DebugPlWrite (MkAtomTerm (NameOfFunctor (f))); Yap_DebugPutc (Yap_c_error_stream,'/'); - Yap_plwrite (MkIntTerm (ArityOfFunctor (f)), Yap_DebugPutc, 0); + Yap_DebugPlWrite (MkIntTerm (ArityOfFunctor (f))); } Yap_DebugPutc (Yap_c_error_stream,'\n'); } else { @@ -151,18 +151,18 @@ DumpActiveGoals (void) if (pe->ModuleOfPred) mod = pe->ModuleOfPred; else mod = TermProlog; - Yap_plwrite (mod, Yap_DebugPutc, 0); + Yap_DebugPlWrite (mod); Yap_DebugPutc (Yap_c_error_stream,':'); if (pe->ArityOfPE == 0) { - Yap_plwrite (MkAtomTerm (NameOfFunctor(f)), Yap_DebugPutc, 0); + Yap_DebugPlWrite (MkAtomTerm (NameOfFunctor(f))); } else { Int i = 0, arity = pe->ArityOfPE; Term *args = &(b_ptr->cp_a1); - Yap_plwrite (MkAtomTerm (NameOfFunctor (f)), Yap_DebugPutc, 0); + Yap_DebugPlWrite (MkAtomTerm (NameOfFunctor (f))); Yap_DebugPutc (Yap_c_error_stream,'('); for (i= 0; i < arity; i++) { if (i > 0) Yap_DebugPutc (Yap_c_error_stream,','); - Yap_plwrite(args[i], Yap_DebugPutc, Handle_vars_f); + Yap_DebugPlWrite(args[i]); } Yap_DebugPutc (Yap_c_error_stream,')'); } diff --git a/C/index.c b/C/index.c index 483de93b4..7231e46ae 100644 --- a/C/index.c +++ b/C/index.c @@ -4447,42 +4447,42 @@ ExpandIndex(PredEntry *ap, int ExtraArgs) { Yap_LockStream(Yap_c_error_stream); if (!tmod) tmod = TermProlog; #if THREADS - Yap_plwrite(MkIntegerTerm(worker_id), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkIntegerTerm(worker_id)); Yap_DebugPutc(Yap_c_error_stream,' '); #endif Yap_DebugPutc(Yap_c_error_stream,'>'); Yap_DebugPutc(Yap_c_error_stream,'\t'); - Yap_plwrite(tmod, Yap_DebugPutc, 0); + Yap_DebugPlWrite(tmod); Yap_DebugPutc(Yap_c_error_stream,':'); if (ap->ModuleOfPred == IDB_MODULE) { Term t = Deref(ARG1); if (IsAtomTerm(t)) { - Yap_plwrite(t, Yap_DebugPutc, 0); + Yap_DebugPlWrite(t); } else if (IsIntegerTerm(t)) { - Yap_plwrite(t, Yap_DebugPutc, 0); + Yap_DebugPlWrite(t); } else { Functor f = FunctorOfTerm(t); Atom At = NameOfFunctor(f); - Yap_plwrite(MkAtomTerm(At), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkAtomTerm(At)); Yap_DebugPutc(Yap_c_error_stream,'/'); - Yap_plwrite(MkIntegerTerm(ArityOfFunctor(f)), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkIntegerTerm(ArityOfFunctor(f))); } } else { if (ap->ArityOfPE == 0) { Atom At = (Atom)ap->FunctorOfPred; - Yap_plwrite(MkAtomTerm(At), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkAtomTerm(At)); } else { Functor f = ap->FunctorOfPred; Atom At = NameOfFunctor(f); - Yap_plwrite(MkAtomTerm(At), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkAtomTerm(At)); Yap_DebugPutc(Yap_c_error_stream,'/'); - Yap_plwrite(MkIntegerTerm(ArityOfFunctor(f)), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkIntegerTerm(ArityOfFunctor(f))); } Yap_UnLockStream(Yap_c_error_stream); } Yap_DebugPutc(Yap_c_error_stream,'\n'); #if THREADS - Yap_plwrite(MkIntegerTerm(worker_id), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkIntegerTerm(worker_id)); Yap_DebugPutc(Yap_c_error_stream,' '); #endif Yap_UnLockStream(Yap_c_error_stream); @@ -5919,31 +5919,31 @@ Yap_AddClauseToIndex(PredEntry *ap, yamop *beg, int first) { if (!tmod) tmod = TermProlog; Yap_DebugPutc(Yap_c_error_stream,'+'); Yap_DebugPutc(Yap_c_error_stream,'\t'); - Yap_plwrite(tmod, Yap_DebugPutc, 0); + Yap_DebugPlWrite(tmod); Yap_DebugPutc(Yap_c_error_stream,':'); if (ap->ModuleOfPred == IDB_MODULE) { Term t = Deref(ARG1); if (IsAtomTerm(t)) { - Yap_plwrite(t, Yap_DebugPutc, 0); + Yap_DebugPlWrite(t); } else if (IsIntegerTerm(t)) { - Yap_plwrite(t, Yap_DebugPutc, 0); + Yap_DebugPlWrite(t); } else { Functor f = FunctorOfTerm(t); Atom At = NameOfFunctor(f); - Yap_plwrite(MkAtomTerm(At), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkAtomTerm(At)); Yap_DebugPutc(Yap_c_error_stream,'/'); - Yap_plwrite(MkIntegerTerm(ArityOfFunctor(f)), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkIntegerTerm(ArityOfFunctor(f))); } } else { if (ap->ArityOfPE == 0) { Atom At = (Atom)ap->FunctorOfPred; - Yap_plwrite(MkAtomTerm(At), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkAtomTerm(At)); } else { Functor f = ap->FunctorOfPred; Atom At = NameOfFunctor(f); - Yap_plwrite(MkAtomTerm(At), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkAtomTerm(At)); Yap_DebugPutc(Yap_c_error_stream,'/'); - Yap_plwrite(MkIntegerTerm(ArityOfFunctor(f)), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkIntegerTerm(ArityOfFunctor(f))); } } Yap_DebugPutc(Yap_c_error_stream,'\n'); @@ -6414,32 +6414,32 @@ Yap_RemoveClauseFromIndex(PredEntry *ap, yamop *beg) { Yap_LockStream(Yap_c_error_stream); Yap_DebugPutc(Yap_c_error_stream,'-'); Yap_DebugPutc(Yap_c_error_stream,'\t'); - Yap_plwrite(tmod, Yap_DebugPutc, 0); + Yap_DebugPlWrite(tmod); Yap_DebugPutc(Yap_c_error_stream,':'); if (ap->ModuleOfPred != IDB_MODULE) { if (ap->ArityOfPE == 0) { Atom At = (Atom)ap->FunctorOfPred; - Yap_plwrite(MkAtomTerm(At), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkAtomTerm(At)); } else { Functor f = ap->FunctorOfPred; Atom At = NameOfFunctor(f); - Yap_plwrite(MkAtomTerm(At), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkAtomTerm(At)); Yap_DebugPutc(Yap_c_error_stream,'/'); - Yap_plwrite(MkIntegerTerm(ArityOfFunctor(f)), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkIntegerTerm(ArityOfFunctor(f))); } } else { if (ap->PredFlags & NumberDBPredFlag) { Int id = ap->src.IndxId; - Yap_plwrite(MkIntegerTerm(id), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkIntegerTerm(id)); } else if (ap->PredFlags & AtomDBPredFlag) { Atom At = (Atom)ap->FunctorOfPred; - Yap_plwrite(MkAtomTerm(At), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkAtomTerm(At)); } else { Functor f = ap->FunctorOfPred; Atom At = NameOfFunctor(f); - Yap_plwrite(MkAtomTerm(At), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkAtomTerm(At)); Yap_DebugPutc(Yap_c_error_stream,'/'); - Yap_plwrite(MkIntegerTerm(ArityOfFunctor(f)), Yap_DebugPutc, 0); + Yap_DebugPlWrite(MkIntegerTerm(ArityOfFunctor(f))); } } Yap_DebugPutc(Yap_c_error_stream,'\n');