From c50bade7dd390784454e44a54a6bcac515d80531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 6 Jun 2022 00:24:13 +0200 Subject: Add basic threading support. It is much easier to implement on the Prolog side than on the C side... :-) --- c/pl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'c/pl.c') diff --git a/c/pl.c b/c/pl.c index acb6ba3..50f5429 100644 --- a/c/pl.c +++ b/c/pl.c @@ -58,6 +58,13 @@ Plpv(term_t t, char *szFmt, va_list vl) if (!PL_put_integer(t+i, x)) return 0; break; } + case 'A': + { + atom_t x; + x = va_arg(vl, atom_t); + if (!PL_put_atom(t+i, x)) return 0; + break; + } case 'S': { atom_t a; @@ -70,6 +77,9 @@ Plpv(term_t t, char *szFmt, va_list vl) case 'i': va_arg(vl, int *); break; + case 'a': + va_arg(vl, atom_t *); + break; case 's': va_arg(vl, char **); break; @@ -102,6 +112,13 @@ Plgv(term_t t, char *szFmt, va_list vl) if (!PL_get_integer(t+i, lp)) return 0; break; } + case 'a': + { + atom_t *lp; + lp = va_arg(vl, atom_t *); + if (!PL_get_atom(t+i, lp)) return 0; + break; + } case 's': { char **lp; @@ -112,6 +129,9 @@ Plgv(term_t t, char *szFmt, va_list vl) case 'I': va_arg(vl, int); break; + case 'A': + va_arg(vl, atom_t); + break; case 'S': va_arg(vl, char *); break; -- cgit v1.2.3