From b69c0ba2a9c06804373abaa6fd045aef2f883ff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Manuel=20de=20Morais=20Santos=20Costa?= Date: Sat, 12 Dec 2009 23:21:25 +0000 Subject: [PATCH] add to API --- library/yap2swi/yap2swi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/yap2swi/yap2swi.c b/library/yap2swi/yap2swi.c index 282c1d08f..e8bd65a05 100644 --- a/library/yap2swi/yap2swi.c +++ b/library/yap2swi/yap2swi.c @@ -174,6 +174,17 @@ X_API char* PL_atom_chars(atom_t a) /* SAM check type */ return AtomName(SWIAtomToAtom(a)); } +X_API int +PL_chars_to_term(term_t term,const char *s) { + YAP_Term t,error; + if ( (t=YAP_ReadBuffer(s,&error))==0L ) { + Yap_PutInSlot(term, error); + return 0L; + } + Yap_PutInSlot(term,t); + return 1L; +} + /* SWI: term_t PL_copy_term_ref(term_t from) YAP: NO EQUIVALENT */