1 /* 2 * Icon file serve operations 3 * Copyright (C) 2012 Andy Brown 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef __IMAGE_CACHE_H__ 20 #define __IMAGE_CACHE_H__ 21 22 #include <pthread.h> 23 #include "idnode.h" 24 25 struct imagecache_config { 26 idnode_t idnode; 27 int enabled; 28 int ignore_sslcert; 29 uint32_t ok_period; 30 uint32_t fail_period; 31 }; 32 33 extern struct imagecache_config imagecache_conf; 34 extern const idclass_t imagecache_class; 35 36 extern pthread_mutex_t imagecache_mutex; 37 38 void imagecache_init ( void ); 39 void imagecache_done ( void ); 40 41 void imagecache_clean ( void ); 42 void imagecache_trigger ( void ); 43 44 // Note: will return 0 if invalid (must serve original URL) 45 int imagecache_get_id ( const char *url ); 46 47 int imagecache_filename ( int id, char *name, size_t len ); 48 49 #endif /* __IMAGE_CACHE_H__ */ 50