ftp.nice.ch/peanuts/GeneralData/Usenet/news/1989/CSN-89.tar.gz#/comp-sys-next/1989/Oct/Prolog-for-NeXT

This is Prolog-for-NeXT in view mode; [Up]


Date: Sat, 28-Oct-1989 12:14:17 From: Unknown Subject: Prolog for NeXT >From: fai to leung <gaia@Portia.stanford.edu> The followings are diffs to make CProlog compile under NeXT. (Basically a further step to the original update, i.e. even more type casts.) I tried them on releases 0.8 & 0.9. It should work fine on 1.0. The sequence of happenings should be: make prolog -b init.pl P.S. change pathnames inside Makefile. I'd appreciate if you can post it on comp.sys.next (I have limited access on the net.) Good Luck!! Alfred CCRMA, Music Dept. Stanford University. __________________________________________________________________________ COMPARE.C 24,25c24,26 < #define code(t) (IsRef(t) ? -2 : (IsPrim(t) ? -1 : SkelP(t)->Fn->arityoffe)) < --- > #define code(t) (IsRef(t) ? -2 : (IsPrim(t) ? -1 : \ > FunctorP(SkelP(t)->Fn)->arityoffe)) > 65,66c66,68 < return strcmp(SkelP(T1)->Fn->atoffe->stofae, < SkelP(T2)->Fn->atoffe->stofae); --- > return strcmp( AtomP(FunctorP(SkelP(T1)->Fn)->atoffe)->stofae, > (AtomP(FunctorP(SkelP(T2)->Fn)->atoffe)->stofae)); > DBASE.C 52,53c52,54 < if (IsPrim(t) && IsDBRef(t)) /* if database reference */ < XtrDBRef(t)->refcofcl++; /* increment ref count of refed term */ --- > if (IsPrim(t) && IsDBRef(t)) { /* if database reference */ > ClauseP(XtrDBRef(t))->refcofcl++; > } 228,242c229,243 < r->prevofcl = NULL; < r->altofcl = rk->First; < if (rk->First) < rk->First->prevofcl = r; < rk->First = r; < if (!(rk->Last)) < rk->Last = r; < } else { /* store at the end */ < r->prevofcl = rk->Last; < r->altofcl = NULL; < if (rk->Last) < rk->Last->altofcl = r; < rk->Last = r; < if (!(rk->First)) < rk->First = r; --- > ClauseP(r)->prevofcl = NULL; > ClauseP(r)->altofcl = ((Header*)rk)->First; > if (((Header*)rk)->First) > ClauseP(((Header*)rk)->First)->prevofcl = ClauseP(r); > ((Header*)rk)->First = ClauseP(r); > if (!(((Header*)rk)->Last)) > ((Header*)rk)->Last = ClauseP(r); > } else { /* store at the end */ > ClauseP(r)->prevofcl = ((Header*)rk)->Last; > ClauseP(r)->altofcl = NULL; > if (((Header*)rk)->Last) > ClauseP(((Header*)rk)->Last)->altofcl = ClauseP(r); > ((Header*)rk)->Last = ClauseP(r); > if (!(((Header*)rk)->First)) > ((Header*)rk)->First = ClauseP(r); 346,353c347,356 < if (c->prevofcl) < c->prevofcl->altofcl = c->altofcl; < else /* first in chain */ < r->First = c->altofcl; < if (c->altofcl) /* not last in chain */ < c->altofcl->prevofcl = c->prevofcl; < else /* last in chain */ < r->Last = c->prevofcl; --- > if (ClauseP(c)->prevofcl) > ClauseP(ClauseP(c)->prevofcl)->altofcl = > ClauseP(c)->altofcl; > else /* first in chain */ > ((Header*)r)->First = ClauseP(c)->altofcl; > if (ClauseP(c)->altofcl) /* not last in chain */ > ClauseP(ClauseP(c)->altofcl)->prevofcl = > ClauseP(c)->prevofcl; > else /* last in chain */ > ((Header*)r)->Last = ClauseP(c)->prevofcl; 500c503 < if (DBType(r) == RECORD) h = p->bdyofcl; --- > if (DBType(r) == RECORD) h = ClauseP(p)->bdyofcl; MAIN.C 258c258 < savepS = savead-lcl0; --- > savepS = ((PTR)savead)-lcl0; 271c271 < llclS = savead-lcl0+2; --- > llclS = ((PTR)savead)-lcl0+2; 438,442c438,443 < if (k->NextVar == NULL || < (SC(k->NextVar,>=,pauxstk) && SC(k->NextVar,<,ptr))) { < k->VarValue += rglb; < if (k->NextVar) k->NextVar += rauxstk; < k += k->VarLen; --- > if (((VarEntry*)k)->NextVar == NULL || > (SC(((VarEntry*)k)->NextVar,>=,pauxstk) && > SC(((VarEntry*)k)->NextVar,<,ptr))) { > ((VarEntry*)k)->VarValue += rglb; > if (((VarEntry*)k)->NextVar) ((VarEntry*)k)->NextVar += rauxstk; > ((VarEntry*)k) += ((VarEntry*)k)->VarLen; 799c800 < pg = arg(Addr(SkelP(g)->Arg1),pg->Env); --- > pg = arg(Addr(SkelP(g)->Arg1),MolP(pg)->Env); 807c808 < VV->altofcf = Addr(FunctorP(No)->defsoffe->altofcl); --- > VV->altofcf = Addr(ClauseP(FunctorP(No)->defsoffe)->altofcl); 860c861 < n = SkelP(g)->Fn->arityoffe; --- > n = ((FUNCTOR*)SkelP(g)->Fn)->arityoffe; 879c880 < arity = SkelP(ta)->Fn->arityoffe; --- > arity = FunctorP(SkelP(ta)->Fn)->arityoffe; 1153c1154 < v = x+szofcf+((X->altofcf)-FlOffset)->ltofcl; --- > v = x+szofcf+ClauseP((FrameP(X)->altofcf)-FlOffset)->ltofcl; 1420c1421 < y = MolP(k1)->Env; k1 = MolP(k1)->Fn; --- > y = MolP(k1)->Env; k1 = SkelP(k1)->Fn; 1636c1637 < bn = &(SkelP(FunctorP(MolP(ARG1)->Sk)->Fn)->flgsoffe); --- > bn = &(SkelP(FunctorP(SkelP(MolP(ARG1)->Sk)->Fn)->flgsoffe)); TRACE.C 145c145 < fp = fr->altofcf; onp = NULL; --- > fp = FrameP(fr)->altofcf; onp = NULL; 163,168c163,168 < x = fr->gfofcf; < info = fr->infofcf; < if (info== (PRIM_TAG|NUM_TAG)) continue; < frg = fr->gofcf; < if (IsInp(frg)) < fre = x->gsofcf; --- > x = FrameP(fr)->gfofcf; > info = FrameP(fr)->infofcf; > if (info==(PRIM_TAG|NUM_TAG)) continue; > frg = FrameP(fr)->gofcf; > if (IsInp(frg)) > fre = FrameP(x)->gsofcf; %%Note: Fai To Leung originally placed %% 145c145 %% < fp = fr->altofcf; onp = NULL; %% --- %% > fp = FrameP(fr)->altofcf; onp = NULL; %% %%as a fix for main.c. It appears to be a fix for trace.c instead. %%-alg. 10/30/89. *****************************************************************************

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.