annotate src/filecache.h @ 2916:ae6cdcd69d9f default tip

Merge with upstream/master.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 14 May 2019 11:46:50 +0300
parents 95507e596256
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
844
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
1 /*
2350
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
2 * Copyright (C) 2008 - 2016 The Geeqie Team
844
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
3 *
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
4 * Author: Vladimir Nadvornik
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
5 *
2350
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
6 * This program is free software; you can redistribute it and/or modify
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
7 * it under the terms of the GNU General Public License as published by
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
9 * (at your option) any later version.
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
10 *
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
11 * This program is distributed in the hope that it will be useful,
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
14 * GNU General Public License for more details.
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
15 *
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
16 * You should have received a copy of the GNU General Public License along
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
17 * with this program; if not, write to the Free Software Foundation, Inc.,
95507e596256 Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents: 2021
diff changeset
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
844
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
19 */
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
20
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
21 #ifndef FILECACHE_H
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
22 #define FILECACHE_H
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
23
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
24 #include "main.h"
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
25 #include "filedata.h"
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
26
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
27 typedef struct _FileCacheData FileCacheData;
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
28 typedef void (*FileCacheReleaseFunc)(FileData *fd);
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
29
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
30
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
31 FileCacheData *file_cache_new(FileCacheReleaseFunc release, gulong max_size);
873
470b7cdc3283 Optimize file_cache_get() by only moving element to front if needed
Laurent Monin <geeqie@norz.org>
parents: 847
diff changeset
32 gboolean file_cache_get(FileCacheData *fc, FileData *fd);
844
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
33 void file_cache_put(FileCacheData *fc, FileData *fd, gulong size);
846
cf1c9abfa524 simple cache for loaded pixbufs
Vladimir Nadvornik <nadvornik@suse.cz>
parents: 844
diff changeset
34 void file_cache_dump(FileCacheData *fc);
847
80d2ea882786 measure pixbuf cache size in bytes
Vladimir Nadvornik <nadvornik@suse.cz>
parents: 846
diff changeset
35 void file_cache_set_size(FileCacheData *fc, gulong size);
80d2ea882786 measure pixbuf cache size in bytes
Vladimir Nadvornik <nadvornik@suse.cz>
parents: 846
diff changeset
36 gulong file_cache_get_max_size(FileCacheData *fc);
80d2ea882786 measure pixbuf cache size in bytes
Vladimir Nadvornik <nadvornik@suse.cz>
parents: 846
diff changeset
37 gulong file_cache_get_size(FileCacheData *fc);
80d2ea882786 measure pixbuf cache size in bytes
Vladimir Nadvornik <nadvornik@suse.cz>
parents: 846
diff changeset
38 void file_cache_set_max_size(FileCacheData *fc, gulong size);
80d2ea882786 measure pixbuf cache size in bytes
Vladimir Nadvornik <nadvornik@suse.cz>
parents: 846
diff changeset
39
844
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
40
a311d66693d4 implemented generic FileData cache
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
diff changeset
41 #endif
1055
4bbdfab3c89a Adding a vim modeline to all files - patch by Klaus Ethgen
Vladimir Nadvornik <nadvornik@suse.cz>
parents: 873
diff changeset
42 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */