summary refs log tree commit diff
path: root/btpd/http.h
diff options
context:
space:
mode:
Diffstat (limited to 'btpd/http.h')
-rw-r--r--btpd/http.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/btpd/http.h b/btpd/http.h
new file mode 100644
index 0000000..55a504f
--- /dev/null
+++ b/btpd/http.h
@@ -0,0 +1,29 @@
+#ifndef BTPD_HTTP_H
+#define BTPD_HTTP_H
+
+struct http;
+
+enum http_status {
+    HRES_OK,
+    HRES_FAIL,
+    HRES_CANCEL
+};
+
+struct http_res {
+    enum http_status res;
+    long code;
+    char *content;
+    size_t length;
+};
+
+int http_get(struct http **ret,
+    void (*cb)(struct http *, struct http_res *, void *),
+    void *arg,
+    const char *fmt, ...);
+void http_cancel(struct http *http);
+
+int http_succeeded(struct http_res *res);
+
+void http_init(void);
+
+#endif