Merge branch 'master' of yap.dcc.fc.up.pt:yap-6

This commit is contained in:
Vítor Santos Costa
2010-07-05 16:01:10 +01:00
10 changed files with 60 additions and 24 deletions

View File

@@ -167,8 +167,8 @@ SWIFunctorToFunctor(functor_t at)
{
if (IsAtomTerm(at))
return (Functor)at;
if ((CELL)(at) & 1)
return SWI_Functors[((CELL)at)/2];
if ((CELL)(at) & 2)
return SWI_Functors[((CELL)at)/4];
return (Functor)at;
}
@@ -181,7 +181,7 @@ Yap_InitSWIHash(void)
add_to_hash(i*2+1, (ADDR)SWI_Atoms[i]);
}
for (j=0; j < N_SWI_FUNCTORS; j++) {
add_to_hash((((CELL)(j))*2+1), (ADDR)SWI_Functors[j]);
add_to_hash((((CELL)(j))*4+2), (ADDR)SWI_Functors[j]);
}
}
@@ -684,6 +684,11 @@ X_API int PL_get_head(term_t ts, term_t h)
return 1;
}
X_API int PL_get_string(term_t t, char **s, size_t *len)
{
return PL_get_string_chars(t, s, len);
}
X_API int PL_get_string_chars(term_t t, char **s, size_t *len)
{
Term tt = Yap_GetFromSlot(t);