annotate src/cache.h @ 983:5049449ad841

Remove unneeded type casting.
author zas_
date Sat, 23 Aug 2008 17:00:59 +0000
parents 444705451f3a
children 4fe8f9656107
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 37
diff changeset
2 * Geeqie
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
475
48c8e49b571c updated copyright in source files
nadvornik
parents: 446
diff changeset
4 * Copyright (C) 2008 The Geeqie Team
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #ifndef CACHE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15 #define CACHE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 #include "similar.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20
708
444705451f3a Use G_DIR_SEPARATOR_S instead of hardcoded "/".
zas_
parents: 475
diff changeset
21 #define GQ_CACHE_RC_THUMB GQ_RC_DIR G_DIR_SEPARATOR_S "thumbnails"
444705451f3a Use G_DIR_SEPARATOR_S instead of hardcoded "/".
zas_
parents: 475
diff changeset
22 #define GQ_CACHE_RC_METADATA GQ_RC_DIR G_DIR_SEPARATOR_S "metadata"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23
283
e213fb025621 GQVIEW_* -> GQ_*
zas_
parents: 196
diff changeset
24 #define GQ_CACHE_LOCAL_THUMB ".thumbnails"
e213fb025621 GQVIEW_* -> GQ_*
zas_
parents: 196
diff changeset
25 #define GQ_CACHE_LOCAL_METADATA ".metadata"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26
283
e213fb025621 GQVIEW_* -> GQ_*
zas_
parents: 196
diff changeset
27 #define GQ_CACHE_EXT_THUMB ".png"
e213fb025621 GQVIEW_* -> GQ_*
zas_
parents: 196
diff changeset
28 #define GQ_CACHE_EXT_SIM ".sim"
e213fb025621 GQVIEW_* -> GQ_*
zas_
parents: 196
diff changeset
29 #define GQ_CACHE_EXT_METADATA ".meta"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 typedef enum {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33 CACHE_TYPE_THUMB,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 CACHE_TYPE_SIM,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35 CACHE_TYPE_METADATA
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36 } CacheType;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 typedef struct _CacheData CacheData;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 struct _CacheData
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41 gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 gint width;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43 gint height;
37
67ba4381497e Wed Apr 13 18:16:14 2005 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
44 time_t date;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 long checksum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46 guchar md5sum[16];
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 ImageSimilarityData *sim;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49 gint dimensions;
37
67ba4381497e Wed Apr 13 18:16:14 2005 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
50 gint have_date;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 gint have_checksum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52 gint have_md5sum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53 gint similarity;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54 };
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56 gint cache_time_valid(const gchar *cache, const gchar *path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
58
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 CacheData *cache_sim_data_new(void);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60 void cache_sim_data_free(CacheData *cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
61
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62 gint cache_sim_data_save(CacheData *cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 CacheData *cache_sim_data_load(const gchar *path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65 void cache_sim_data_set_dimensions(CacheData *cd, gint w, gint h);
37
67ba4381497e Wed Apr 13 18:16:14 2005 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
66 void cache_sim_data_set_date(CacheData *cd, time_t date);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67 void cache_sim_data_set_checksum(CacheData *cd, long checksum);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68 void cache_sim_data_set_md5sum(CacheData *cd, guchar digest[16]);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69 void cache_sim_data_set_similarity(CacheData *cd, ImageSimilarityData *sd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70 gint cache_sim_data_filled(ImageSimilarityData *sd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73 gint cache_ensure_dir_exists(gchar *path, mode_t mode);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 gchar *cache_get_location(CacheType type, const gchar *source, gint include_name, mode_t *mode);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75 gchar *cache_find_location(CacheType type, const gchar *source);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78 #endif