annotate src/cache.h @ 9:d907d608745f

Sync to GQview 1.5.9 release. ######## DO NOT BASE ENHANCEMENTS OR TRANSLATION UPDATES ON CODE IN THIS CVS! This CVS is never up to date with current development and is provided solely for reference purposes, please use the latest official release package when making any changes or translation updates. ########
author gqview
date Sat, 26 Feb 2005 00:13:35 +0000
parents
children 67ba4381497e
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 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2 * GQview
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
4 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * 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
10 */
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 #ifndef CACHE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #define CACHE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15
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 #include "similar.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18
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 #define GQVIEW_CACHE_RC_THUMB GQVIEW_RC_DIR"/thumbnails"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 #define GQVIEW_CACHE_RC_METADATA GQVIEW_RC_DIR"/metadata"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 #define GQVIEW_CACHE_LOCAL_THUMB ".thumbnails"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 #define GQVIEW_CACHE_LOCAL_METADATA ".metadata"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 #define GQVIEW_CACHE_EXT_THUMB ".png"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 #define GQVIEW_CACHE_EXT_SIM ".sim"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 #define GQVIEW_CACHE_EXT_METADATA ".meta"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29
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 typedef enum {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 CACHE_TYPE_THUMB,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33 CACHE_TYPE_SIM,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 CACHE_TYPE_METADATA
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35 } CacheType;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37 typedef struct _CacheData CacheData;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 struct _CacheData
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40 gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41 gint width;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 gint height;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43 long checksum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 guchar md5sum[16];
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 ImageSimilarityData *sim;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 gint dimensions;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 gint have_checksum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49 gint have_md5sum;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50 gint similarity;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 };
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53 gint cache_time_valid(const gchar *cache, const gchar *path);
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 CacheData *cache_sim_data_new(void);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 void cache_sim_data_free(CacheData *cd);
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 gint cache_sim_data_save(CacheData *cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60 CacheData *cache_sim_data_load(const gchar *path);
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 void cache_sim_data_set_dimensions(CacheData *cd, gint w, gint h);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 void cache_sim_data_set_checksum(CacheData *cd, long checksum);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 void cache_sim_data_set_md5sum(CacheData *cd, guchar digest[16]);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65 void cache_sim_data_set_similarity(CacheData *cd, ImageSimilarityData *sd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
66 gint cache_sim_data_filled(ImageSimilarityData *sd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69 gint cache_ensure_dir_exists(gchar *path, mode_t mode);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70 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
71 gchar *cache_find_location(CacheType type, const gchar *source);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76