summaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-06-19 15:10:55 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-06-19 15:10:55 +0800
commit844c85dcb6115d2bc14caae60c162a063ee402e5 (patch)
tree7b4e68095316f77cab5c379db17c832138a03ff4 /client.c
parentb4590ddec4936fd542691ac0d35628afdb9331e1 (diff)
Results page implementation
Diffstat (limited to 'client.c')
-rw-r--r--client.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/client.c b/client.c
index 512e3e4..1edee75 100644
--- a/client.c
+++ b/client.c
@@ -39,6 +39,18 @@ bool icclient_init(const char *url, const char *certificate)
return (bool)curl;
}
+void icclient_results(size_t (*handler)(void *contents, size_t size,
+ size_t nmemb, void *userdata),
+ struct icclient_catalog **catalogptr, const char *prodgroup)
+{
+ char nonspaced[strlen(prodgroup) + 1];
+ strcpy(nonspaced, prodgroup);
+ char *space = NULL;
+ while (space = strchr(nonspaced, ' '))
+ *space = '-';
+ request(handler, (void *)catalogptr, NULL, "%s", nonspaced);
+}
+
void icclient_allproducts(size_t (*handler)(void *, size_t, size_t, void *)
, icclient_catalog **catalogptr)
{