aboutsummaryrefslogtreecommitdiff
path: root/src/Utility/HttpClient.h
diff options
context:
space:
mode:
authorfrosty <gabriel@bwaaa.monster>2026-03-17 12:07:07 -0400
committerfrosty <gabriel@bwaaa.monster>2026-03-17 12:07:07 -0400
commit8c6632502ff992e80051910451421c55894ed9d8 (patch)
treee4a03e8ae45e020627781ff21141626fb0ebedeb /src/Utility/HttpClient.h
parent5a6ad269745fe8cc8bc874eac4fac2479903028e (diff)
downloadomnisearch-8c6632502ff992e80051910451421c55894ed9d8.tar.gz
fix: general readability improvements
Diffstat (limited to 'src/Utility/HttpClient.h')
-rw-r--r--src/Utility/HttpClient.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Utility/HttpClient.h b/src/Utility/HttpClient.h
index 6eb002c..5eceb83 100644
--- a/src/Utility/HttpClient.h
+++ b/src/Utility/HttpClient.h
@@ -2,7 +2,9 @@
#define HTTPCLIENT_H
#include <curl/curl.h>
+#include <libxml/parser.h>
#include <stddef.h>
+#include <time.h>
typedef struct {
char *memory;
@@ -13,4 +15,18 @@ typedef struct {
HttpResponse http_get(const char *url, const char *user_agent);
void http_response_free(HttpResponse *resp);
+typedef xmlDocPtr (*XmlParserFn)(const char *data, size_t size,
+ const char *url);
+
+typedef struct {
+ char *memory;
+ size_t size;
+ void *parsed_result;
+ int success;
+} CachedHttpResponse;
+
+CachedHttpResponse cached_http_get(const char *url, const char *user_agent,
+ const char *cache_key, time_t cache_ttl,
+ XmlParserFn parser);
+
#endif