extensions to interface

This commit is contained in:
Vitor Santos Costa 2010-07-15 23:35:04 +01:00
parent a45105ee04
commit 12fe06aa2e
2 changed files with 18 additions and 2 deletions

View File

@ -531,7 +531,6 @@ extern int PL_get_text(term_t l, PL_chars_t *text, int flags);
extern void PL_cleanup_fork(void); extern void PL_cleanup_fork(void);
extern int PL_rethrow(void); extern int PL_rethrow(void);
extern void PL_get_number(term_t l, number *n); extern void PL_get_number(term_t l, number *n);
extern int PL_write_term(IOSTREAM *s, term_t term, int precedence, int flags);
extern int PL_unify_atomic(term_t t, PL_atomic_t a); extern int PL_unify_atomic(term_t t, PL_atomic_t a);
#define _PL_get_arg(X,Y,Z) PL_get_arg(X,Y,Z) #define _PL_get_arg(X,Y,Z) PL_get_arg(X,Y,Z)

View File

@ -3,6 +3,14 @@
#include <stdio.h> #include <stdio.h>
#include "pl-incl.h" #include "pl-incl.h"
#define Quote_illegal_f 1
#define Ignore_ops_f 2
#define Handle_vars_f 4
#define Use_portray_f 8
#define To_heap_f 16
#define Unfold_cyclics_f 32
#ifdef HAVE_LIMITS_H #ifdef HAVE_LIMITS_H
#include <limits.h> #include <limits.h>
#endif #endif
@ -128,7 +136,16 @@ callProlog(module_t module, term_t goal, int flags, term_t *ex)
int int
PL_write_term(IOSTREAM *s, term_t term, int precedence, int flags) PL_write_term(IOSTREAM *s, term_t term, int precedence, int flags)
{ {
int nflags = 0;
if (flags & PL_WRT_QUOTED)
nflags |= Quote_illegal_f;
if (flags & PL_WRT_IGNOREOPS)
nflags |= Ignore_ops_f;
if (flags & PL_WRT_NUMBERVARS)
nflags |= Handle_vars_f;
if (flags & PL_WRT_PORTRAY)
nflags |= Use_portray_f;
/* ignore other flags for now */
YAP_Write(YAP_GetFromSlot(term), (void (*)(int))Sputc, flags); YAP_Write(YAP_GetFromSlot(term), (void (*)(int))Sputc, flags);
return TRUE; return TRUE;
} }