more SWI compatibility changes.

This commit is contained in:
Vítor Santos Costa
2011-02-11 01:22:07 +00:00
parent 02c791fc3d
commit b475be5692
7 changed files with 22 additions and 17 deletions

View File

@@ -24,6 +24,12 @@
#include "swi.h"
static PL_blob_t unregistered_blob_atom =
{ PL_BLOB_MAGIC,
PL_BLOB_NOCOPY|PL_BLOB_TEXT,
"unregistered"
};
PL_EXPORT(int)
PL_is_blob(term_t t, PL_blob_t **type)
@@ -75,13 +81,13 @@ PL_blob_data(atom_t a, size_t *len, struct PL_blob_t **type)
if ( len )
*len = wcslen(x->WStrOfAE);
if ( type )
*type = SWI_Blobs;
*type = &unregistered_blob_atom;
return x->WStrOfAE;
}
if ( len )
*len = strlen(x->StrOfAE);
if ( type )
*type = SWI_Blobs;
*type = &unregistered_blob_atom;
return x->StrOfAE;
}
if ( len )
@@ -112,7 +118,7 @@ YAP_find_blob_type(YAP_Atom at)
{
AtomEntry *a = RepAtom((Atom)at);
if (!IsBlob(a)) {
return SWI_Blobs;
return &unregistered_blob_atom;
}
return RepBlobProp(a->PropsOfAE)->blob_t;
}

View File

@@ -2115,11 +2115,9 @@ X_API int
PL_recorded(record_t db, term_t ts)
{
Term t = YAP_Recorded((void *)db);
fprintf(stderr,"PL_recorded %ld\n", t);
if (t == ((CELL)0))
return FALSE;
Yap_PutInSlot(ts,t);
fprintf(stderr,"PL_recorded\n");
return TRUE;
}