This repository has been archived on 2024-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
temporary-satori-hole/include/curl_helper.h

37 lines
1.1 KiB
C
Raw Normal View History

2023-12-27 00:35:22 +00:00
#ifndef H_SATORI_CURL_HELPER
#define H_SATORI_CURL_HELPER
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <curl/curl.h>
typedef struct _sat_curl_string {
char *str;
size_t length;
} sat_curl_string, *sat_curl_string_ptr;
sat_curl_string_ptr sat_curl_string_alloc(void);
void sat_curl_string_free(sat_curl_string_ptr str, bool freeArg);
void sat_curl_string_init(sat_curl_string_ptr str);
size_t sat_curl_string_write(char *ptr, size_t width, size_t count, sat_curl_string_ptr str);
typedef struct _sat_curl_url {
char *scheme;
char *host;
char *port;
char *path;
int flags; // don't touch this
} sat_curl_url, *sat_curl_url_ptr;
sat_curl_url_ptr sat_curl_url_alloc(void);
void sat_curl_url_free(sat_curl_url_ptr url, bool freeArg);
int sat_curl_url_parse(sat_curl_url_ptr url, char *str, char *scheme, char *host, char *port, char *path, bool supplyDefaults);
void sat_curl_url_owns_scheme(sat_curl_url_ptr url);
void sat_curl_url_owns_host(sat_curl_url_ptr url);
void sat_curl_url_owns_port(sat_curl_url_ptr url);
void sat_curl_url_owns_path(sat_curl_url_ptr url);
#endif // H_SATORI_CURL_HELPER