fix blob output
This commit is contained in:
parent
03879aa778
commit
80dc774a5f
12
C/write.c
12
C/write.c
@ -409,12 +409,17 @@ wrputref(CODEADDR ref, int Quote_illegal, struct write_globs *wglb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* writes a blob (default) */
|
/* writes a blob (default) */
|
||||||
static void
|
static int
|
||||||
wrputblob(CODEADDR ref, int Quote_illegal, struct write_globs *wglb)
|
wrputblob(AtomEntry * ref, int Quote_illegal, struct write_globs *wglb)
|
||||||
{
|
{
|
||||||
char s[256];
|
char s[256];
|
||||||
wrf stream = wglb->stream;
|
wrf stream = wglb->stream;
|
||||||
|
PL_blob_t *type = RepBlobProp(ref->PropsOfAE)->blob_t;
|
||||||
|
|
||||||
|
if (type->write) {
|
||||||
|
atom_t at = YAP_SWIAtomFromAtom(AbsAtom(ref));
|
||||||
|
return type->write(stream, at, 0);
|
||||||
|
} else {
|
||||||
putAtom(AtomSWIStream, Quote_illegal, wglb);
|
putAtom(AtomSWIStream, Quote_illegal, wglb);
|
||||||
#if defined(__linux__) || defined(__APPLE__)
|
#if defined(__linux__) || defined(__APPLE__)
|
||||||
sprintf(s, "(%p)", ref);
|
sprintf(s, "(%p)", ref);
|
||||||
@ -422,6 +427,7 @@ wrputblob(CODEADDR ref, int Quote_illegal, struct write_globs *wglb)
|
|||||||
sprintf(s, "(0x%p)", ref);
|
sprintf(s, "(0x%p)", ref);
|
||||||
#endif
|
#endif
|
||||||
wrputs(s, stream);
|
wrputs(s, stream);
|
||||||
|
}
|
||||||
lastw = alphanum;
|
lastw = alphanum;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -546,7 +552,7 @@ putAtom(Atom atom, int Quote_illegal, struct write_globs *wglb)
|
|||||||
wrf stream = wglb->stream;
|
wrf stream = wglb->stream;
|
||||||
|
|
||||||
if (IsBlob(atom)) {
|
if (IsBlob(atom)) {
|
||||||
wrputblob((CODEADDR)RepAtom(atom),wglb->Quote_illegal,wglb);
|
wrputblob(RepAtom(atom),wglb->Quote_illegal,wglb);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (IsWideAtom(atom)) {
|
if (IsWideAtom(atom)) {
|
||||||
|
Reference in New Issue
Block a user