cmake & text support

This commit is contained in:
Vítor Santos Costa
2015-06-19 01:30:13 +01:00
parent 59de30d606
commit 1c06bfdc05
75 changed files with 1462 additions and 7041 deletions

11
C/exo.c
View File

@@ -1,3 +1,4 @@
/*************************************************************************
* *
* YAP Prolog *
@@ -39,7 +40,7 @@
#endif
bool YAP_NewExo( PredEntry *ap, size_t data, struct udi_info *udi);
bool YAP_AssertTuples( PredEntry *pe, const Term *ts, size_t m);
bool YAP_AssertTuples( PredEntry *pe, const Term *ts, size_t offset, size_t m);
//static int exo_write=FALSE;
@@ -719,20 +720,22 @@ store_exo(yamop *pc, UInt arity, Term t0)
for (i = 0; i< arity; i++) {
DerefAndCheck(t, tp[0]);
*cpc = t;
Yap_DebugPlWrite(t); fprintf(stderr,"\n");
tp++;
cpc++;
}
fprintf(stderr,"\n");
return TRUE;
}
bool
YAP_AssertTuples( PredEntry *pe, const Term *ts, size_t m)
YAP_AssertTuples( PredEntry *pe, const Term *ts, size_t offset, size_t m)
{
MegaClause *mcl = ClauseCodeToMegaClause(pe->cs.p_code.FirstClause);
size_t i, n = pe->cs.p_code.NOfClauses;
ADDR base = (ADDR)mcl->ClCode+2*sizeof(struct index_t *);
for (i=0; i<n; i++) {
yamop *ptr = (yamop *)(base+n*(mcl->ClItemSize));
for (i=0; i<m; i++) {
yamop *ptr = (yamop *)(base+offset*(mcl->ClItemSize));
store_exo( ptr, pe->ArityOfPE, ts[i]);
}
return true;