1 //: You guessed right: the '000' prefix means you should start reading here. 2 //: 3 //: This project is set up to load all files with a numeric prefix. Just 4 //: create a new file and start hacking. 5 //: 6 //: The first few files (00*) are independent of what this program does, an 7 //: experimental skeleton that will hopefully make it both easier for others to 8 //: understand and more malleable, easier to rewrite and remould into radically 9 //: different shapes without breaking in subtle corner cases. The premise is 10 //: that understandability and rewrite-friendliness are related in a virtuous 11 //: cycle. Doing one well makes it easier to do the other. 12 //: 13 //: Lower down, this file contains a legal, bare-bones C++ program. It doesn't 14 //: do anything yet; subsequent files will contain :(...) directives to insert 15 //: lines into it. For example: 16 //: :(after "more events") 17 //: This directive means: insert the following lines after a line in the 18 //: program containing the words "more events". 19 //: 20 //: A simple tool is included to 'tangle' all the files together in sequence 21 //: according to their directives into a single source file containing all the 22 //: code for the project, and then feed the source file to the compiler. 23 //: (It'll drop these comments starting with a '//:' prefix that only make 24 //: sense before tangling.) 25 //: 26 //: Directives free up the programmer to order code for others to read rather 27 //: than as forced by the computer or compiler. Each individual feature can be/* * aesgcm_download.h * vim: expandtab:ts=4:sts=4:sw=4 * * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com> * Copyright (C) 2020 William Wennerström <william@wstrm.dev> * * This file is part of Profanity. * * Profanity is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Profanity is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Profanity. If not, see <https://www.gnu.org/licenses/>. * * In addition, as a special exception, the copyright holders give permission to * link the code of portions of this program with the OpenSSL library under * certain conditions as described in each individual source file, and * distribute linked combinations including the two. * * You must obey the GNU General Public License in all respects for all of the * code used other than OpenSSL. If you modify file(s) with this exception, you * may extend this exception to your version of the file(s), but you are not * obligated to do so. If you do not wish to do so, delete this exception * statement from your version. If you delete this exception statement from all * source files in the program, then also delete it here. * */ #ifndef TOOLS_AESGCM_DOWNLOAD_H #define TOOLS_AESGCM_DOWNLOAD_H #ifdef PLATFORM_CYGWIN #define SOCKET int #endif #include <sys/select.h> #include <curl/curl.h> #include "tools/http_common.h" #include "tools/http_download.h" #include "ui/win_types.h" typedef struct aesgcm_download_t { char* id; char* url; char* filename; char* cmd_template; ProfWin* window; pthread_t worker; HTTPDownload* http_dl; } AESGCMDownload; void* aesgcm_file_get(void* userdata); void aesgcm_download_cancel_processes(ProfWin* window); void aesgcm_download_add_download(AESGCMDownload* download); #endif