fix: general readability improvements

This commit is contained in:
frosty
2026-03-17 12:07:07 -04:00
parent 5a6ad26974
commit 8c6632502f
10 changed files with 161 additions and 73 deletions

View File

@@ -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