add SWI's PL_get_string

This commit is contained in:
Vitor Santos Costa 2010-06-30 17:54:02 +02:00
parent 0f241ae87c
commit 8f8ba6221e
2 changed files with 6 additions and 0 deletions

View File

@ -502,6 +502,7 @@ extern X_API int PL_thread_at_exit(void (*)(void *), void *, int);
extern X_API PL_engine_t PL_create_engine(const PL_thread_attr_t *);
extern X_API int PL_destroy_engine(PL_engine_t);
extern X_API int PL_set_engine(PL_engine_t,PL_engine_t *);
extern X_API int PL_get_string(term_t, char **, size_t *);
extern X_API int PL_get_string_chars(term_t, char **, size_t *);
extern X_API record_t PL_record(term_t);
extern X_API int PL_recorded(record_t, term_t);

View File

@ -684,6 +684,11 @@ X_API int PL_get_head(term_t ts, term_t h)
return 1;
}
X_API int PL_get_string(term_t t, char **s, size_t *len)
{
return PL_get_string_chars(t, s, len);
}
X_API int PL_get_string_chars(term_t t, char **s, size_t *len)
{
Term tt = Yap_GetFromSlot(t);