2020-07-05 11:21:20 -04:00
|
|
|
#ifndef TOOLS_HTTP_DOWNLOAD_H
|
|
|
|
#define TOOLS_HTTP_DOWNLOAD_H
|
|
|
|
|
|
|
|
#include <curl/curl.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
typedef struct prof_win_t ProfWin;
|
|
|
|
|
2020-07-20 07:01:05 -04:00
|
|
|
typedef struct http_download_t
|
|
|
|
{
|
|
|
|
char* url;
|
|
|
|
char* filename;
|
|
|
|
char* directory;
|
|
|
|
FILE* filehandle;
|
2020-07-05 11:21:20 -04:00
|
|
|
curl_off_t bytes_received;
|
2020-07-20 07:01:05 -04:00
|
|
|
ProfWin* window;
|
2020-07-05 11:21:20 -04:00
|
|
|
pthread_t worker;
|
|
|
|
int cancel;
|
|
|
|
} HTTPDownload;
|
|
|
|
|
2020-07-20 07:01:05 -04:00
|
|
|
void* http_file_get(void* userdata);
|
2020-07-05 11:21:20 -04:00
|
|
|
|
2020-07-20 07:01:05 -04:00
|
|
|
void http_download_cancel_processes(ProfWin* window);
|
|
|
|
void http_download_add_download(HTTPDownload* download);
|
2020-07-05 11:21:20 -04:00
|
|
|
|
|
|
|
#endif
|