aboutsummaryrefslogtreecommitdiffstats
path: root/src/dblayer.c
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-09-19 23:59:37 +0300
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-09-19 23:59:37 +0300
commit22fca0324c162fa9a6abc5192aea2b5453c057b5 (patch)
treeb799fde22ee67221e69f8cf3c5445c0373a7cfca /src/dblayer.c
parent8702ce8bbd4d1435cc81fa8fcd7f5309d3c7b003 (diff)
downloadck-22fca0324c162fa9a6abc5192aea2b5453c057b5.tar.gz
ck-22fca0324c162fa9a6abc5192aea2b5453c057b5.tar.bz2
ck-22fca0324c162fa9a6abc5192aea2b5453c057b5.zip
Add list action (no docs)
Diffstat (limited to 'src/dblayer.c')
-rw-r--r--src/dblayer.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/dblayer.c b/src/dblayer.c
index 4a356be..2e19c5a 100644
--- a/src/dblayer.c
+++ b/src/dblayer.c
@@ -431,3 +431,23 @@ int list_get_paths(DB *db, cklist *ckl) {
return 1;
}
+
+int list_get_programs(DB *db, cklist *ckl) {
+ sqlite3_stmt *stmt;
+ int rc;
+
+ char sql[STR_M];
+ dbh_form_query_select_programs(sql);
+
+ rc = sqlite3_prepare_v2(db->ptr, sql, -1, &stmt, 0);
+ if (rc != SQLITE_OK) {
+ return -2;
+ }
+
+ while (sqlite3_step(stmt) == SQLITE_ROW) {
+ list_add(ckl, (char *)sqlite3_column_text(stmt, 0));
+ }
+ sqlite3_finalize(stmt);
+
+ return 1;
+}