Mercurial > geeqie
annotate src/filecache.h @ 873:bd3bdceb1230
Optimize file_cache_get() by only moving element to front if needed
(most of the time there is no need).
Reduce code redundancy in file_cache_put() by calling file_cache_get().
Enhance debugging code.
author | zas_ |
---|---|
date | Wed, 02 Jul 2008 08:38:47 +0000 |
parents | 77fc0ea3457d |
children | 1646720364cf |
rev | line source |
---|---|
844 | 1 /* |
2 * Geeqie | |
3 * Copyright (C) 2008 The Geeqie Team | |
4 * | |
5 * Author: Vladimir Nadvornik | |
6 * | |
7 * This software is released under the GNU General Public License (GNU GPL). | |
8 * Please read the included file COPYING for more information. | |
9 * This software comes with no warranty of any kind, use at your own risk! | |
10 */ | |
11 | |
12 #ifndef FILECACHE_H | |
13 #define FILECACHE_H | |
14 | |
15 #include "main.h" | |
16 #include "filedata.h" | |
17 | |
18 typedef struct _FileCacheData FileCacheData; | |
19 typedef void (*FileCacheReleaseFunc)(FileData *fd); | |
20 | |
21 | |
22 FileCacheData *file_cache_new(FileCacheReleaseFunc release, gulong max_size); | |
873
bd3bdceb1230
Optimize file_cache_get() by only moving element to front if needed
zas_
parents:
847
diff
changeset
|
23 gboolean file_cache_get(FileCacheData *fc, FileData *fd); |
844 | 24 void file_cache_put(FileCacheData *fc, FileData *fd, gulong size); |
846 | 25 void file_cache_dump(FileCacheData *fc); |
847 | 26 void file_cache_set_size(FileCacheData *fc, gulong size); |
27 gulong file_cache_get_max_size(FileCacheData *fc); | |
28 gulong file_cache_get_size(FileCacheData *fc); | |
29 void file_cache_set_max_size(FileCacheData *fc, gulong size); | |
30 | |
844 | 31 |
32 #endif |