aboutsummaryrefslogtreecommitdiff
path: root/c/datalistview.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-15 02:03:30 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-15 02:03:30 +0200
commit2f6bd216d1411bd6ec96eaebf815dc3d5ab5a2f4 (patch)
treef4ab4b455502c558a3c855f0ea7e164b1e246e04 /c/datalistview.cpp
parent095954fe8c0d1a64d8696d0ad0cd0ed395dd6c54 (diff)
downloadEpisodeBrowser-2f6bd216d1411bd6ec96eaebf815dc3d5ab5a2f4.tar.gz
Reimplement Pl with variadic templates
This is a bit safer and about as complex.
Diffstat (limited to 'c/datalistview.cpp')
-rw-r--r--c/datalistview.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp
index 661a68e..9c13ae8 100644
--- a/c/datalistview.cpp
+++ b/c/datalistview.cpp
@@ -34,7 +34,7 @@ void DataListView::ShowEpisode(int iEpisode)
lviValue.mask = LVIF_TEXT;
term_t t = PL_new_term_refs(3);
- if (!Plp(t,"I",iEpisode)) return;
+ if (!PL_put_integer(t,iEpisode)) return;
qid_t q = PL_open_query(NULL, PL_Q_NORMAL,
PL_predicate("episode_datum", 3, "episode_data"), t);
@@ -43,7 +43,8 @@ void DataListView::ShowEpisode(int iEpisode)
char *szValue;
TCHAR *tszKey, *tszValue;
- if (!Plg(t+1,"ss",&szKey,&szValue)) continue;
+ if (!(PL_get_atom_chars(t+1,&szKey) && PL_get_atom_chars(t+2,&szValue)))
+ continue;
tszKey = TszFromSz(szKey, CP_UTF8);
if (!tszKey) continue;