aboutsummaryrefslogtreecommitdiff
path: root/c/pl.c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-06-06 00:24:13 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-06-06 00:24:13 +0200
commitc50bade7dd390784454e44a54a6bcac515d80531 (patch)
tree95ac44bfbb5d9992212b4d17531e9de5b238314c /c/pl.c
parentf9dc17e285b5d3100d3eb6dc80a38a621fafe1ae (diff)
downloadEpisodeBrowser-c50bade7dd390784454e44a54a6bcac515d80531.tar.gz
Add basic threading support.
It is much easier to implement on the Prolog side than on the C side... :-)
Diffstat (limited to 'c/pl.c')
-rw-r--r--c/pl.c20
1 files changed, 20 insertions, 0 deletions
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;