From 545a3a2b0316243a58587a65f71501468e89724c Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 30 Jul 2011 00:06:52 +0100 Subject: [PATCH] writing hook for opaque terms. --- packages/PLStream/pl-write.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/PLStream/pl-write.c b/packages/PLStream/pl-write.c index f9a6824cc..292dd888e 100644 --- a/packages/PLStream/pl-write.c +++ b/packages/PLStream/pl-write.c @@ -886,10 +886,16 @@ writePrimitive(term_t t, write_options *options) #if __YAP_PROLOG__ { - number n; - n.type = V_INTEGER; - n.value.i = 0; - return WriteNumber(&n, options); + Opaque_CallOnWrite f; + + if ( (f = Yap_blob_write_handler_from_slot(t)) ) { + return (f)(options->out, Yap_blob_tag_from_slot(t), Yap_blob_info_from_slot(t), options->flags); + } else { + number n; + n.type = V_INTEGER; + n.value.i = 0; + return WriteNumber(&n, options); + } } #endif