1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5 * Copyright (C) 2009, 2010 Igalia, S.L.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
24 #define SOUP_CACHE_H 1
26 #ifdef LIBSOUP_USE_UNSTABLE_REQUEST_API
28 #include <libsoup/soup-types.h>
33 #define SOUP_TYPE_CACHE (soup_cache_get_type ())
34 #define SOUP_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_CACHE, SoupCache))
35 #define SOUP_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_CACHE, SoupCacheClass))
36 #define SOUP_IS_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_CACHE))
37 #define SOUP_IS_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_CACHE))
38 #define SOUP_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_CACHE, SoupCacheClass))
40 typedef struct _SoupCache SoupCache;
41 typedef struct _SoupCachePrivate SoupCachePrivate;
44 SOUP_CACHE_CACHEABLE = (1 << 0),
45 SOUP_CACHE_UNCACHEABLE = (1 << 1),
46 SOUP_CACHE_INVALIDATES = (1 << 2),
47 SOUP_CACHE_VALIDATES = (1 << 3)
51 SOUP_CACHE_RESPONSE_FRESH,
52 SOUP_CACHE_RESPONSE_NEEDS_VALIDATION,
53 SOUP_CACHE_RESPONSE_STALE
57 SOUP_CACHE_SINGLE_USER,
62 GObject parent_instance;
64 SoupCachePrivate *priv;
68 GObjectClass parent_class;
71 SoupCacheability (*get_cacheability) (SoupCache *cache,
74 /* Padding for future expansion */
75 void (*_libsoup_reserved1)(void);
76 void (*_libsoup_reserved2)(void);
77 void (*_libsoup_reserved3)(void);
80 GType soup_cache_get_type (void);
81 SoupCache *soup_cache_new (const char *cache_dir,
82 SoupCacheType cache_type);
83 void soup_cache_flush (SoupCache *cache);
84 void soup_cache_clear (SoupCache *cache);
86 void soup_cache_dump (SoupCache *cache);
87 void soup_cache_load (SoupCache *cache);
89 void soup_cache_set_max_size (SoupCache *cache,
91 guint soup_cache_get_max_size (SoupCache *cache);
95 #endif /* LIBSOUP_USE_UNSTABLE_REQUEST_API */
97 #endif /* SOUP_CACHE_H */