|
Packit Service |
ca3877 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
|
Packit Service |
ca3877 |
/*
|
|
Packit Service |
ca3877 |
* soup-cache.h:
|
|
Packit Service |
ca3877 |
*
|
|
Packit Service |
ca3877 |
* Copyright (C) 2009, 2010 Igalia, S.L.
|
|
Packit Service |
ca3877 |
*
|
|
Packit Service |
ca3877 |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
ca3877 |
* modify it under the terms of the GNU Library General Public
|
|
Packit Service |
ca3877 |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
ca3877 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit Service |
ca3877 |
*
|
|
Packit Service |
ca3877 |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
ca3877 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
ca3877 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
ca3877 |
* Library General Public License for more details.
|
|
Packit Service |
ca3877 |
*
|
|
Packit Service |
ca3877 |
* You should have received a copy of the GNU Library General Public License
|
|
Packit Service |
ca3877 |
* along with this library; see the file COPYING.LIB. If not, write to
|
|
Packit Service |
ca3877 |
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
Packit Service |
ca3877 |
* Boston, MA 02110-1301, USA.
|
|
Packit Service |
ca3877 |
*/
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
#ifndef SOUP_CACHE_H
|
|
Packit Service |
ca3877 |
#define SOUP_CACHE_H 1
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
#include <libsoup/soup-types.h>
|
|
Packit Service |
ca3877 |
#include <gio/gio.h>
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
G_BEGIN_DECLS
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
#define SOUP_TYPE_CACHE (soup_cache_get_type ())
|
|
Packit Service |
ca3877 |
#define SOUP_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_CACHE, SoupCache))
|
|
Packit Service |
ca3877 |
#define SOUP_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_CACHE, SoupCacheClass))
|
|
Packit Service |
ca3877 |
#define SOUP_IS_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_CACHE))
|
|
Packit Service |
ca3877 |
#define SOUP_IS_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_CACHE))
|
|
Packit Service |
ca3877 |
#define SOUP_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_CACHE, SoupCacheClass))
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
typedef struct _SoupCache SoupCache;
|
|
Packit Service |
ca3877 |
typedef struct _SoupCachePrivate SoupCachePrivate;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
typedef enum {
|
|
Packit Service |
ca3877 |
SOUP_CACHE_CACHEABLE = (1 << 0),
|
|
Packit Service |
ca3877 |
SOUP_CACHE_UNCACHEABLE = (1 << 1),
|
|
Packit Service |
ca3877 |
SOUP_CACHE_INVALIDATES = (1 << 2),
|
|
Packit Service |
ca3877 |
SOUP_CACHE_VALIDATES = (1 << 3)
|
|
Packit Service |
ca3877 |
} SoupCacheability;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
typedef enum {
|
|
Packit Service |
ca3877 |
SOUP_CACHE_RESPONSE_FRESH,
|
|
Packit Service |
ca3877 |
SOUP_CACHE_RESPONSE_NEEDS_VALIDATION,
|
|
Packit Service |
ca3877 |
SOUP_CACHE_RESPONSE_STALE
|
|
Packit Service |
ca3877 |
} SoupCacheResponse;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
typedef enum {
|
|
Packit Service |
ca3877 |
SOUP_CACHE_SINGLE_USER,
|
|
Packit Service |
ca3877 |
SOUP_CACHE_SHARED
|
|
Packit Service |
ca3877 |
} SoupCacheType;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
struct _SoupCache {
|
|
Packit Service |
ca3877 |
GObject parent_instance;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SoupCachePrivate *priv;
|
|
Packit Service |
ca3877 |
};
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
typedef struct {
|
|
Packit Service |
ca3877 |
GObjectClass parent_class;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
/* methods */
|
|
Packit Service |
ca3877 |
SoupCacheability (*get_cacheability) (SoupCache *cache,
|
|
Packit Service |
ca3877 |
SoupMessage *msg);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
/* Padding for future expansion */
|
|
Packit Service |
ca3877 |
void (*_libsoup_reserved1)(void);
|
|
Packit Service |
ca3877 |
void (*_libsoup_reserved2)(void);
|
|
Packit Service |
ca3877 |
void (*_libsoup_reserved3)(void);
|
|
Packit Service |
ca3877 |
} SoupCacheClass;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_34
|
|
Packit Service |
ca3877 |
GType soup_cache_get_type (void);
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_34
|
|
Packit Service |
ca3877 |
SoupCache *soup_cache_new (const char *cache_dir,
|
|
Packit Service |
ca3877 |
SoupCacheType cache_type);
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_34
|
|
Packit Service |
ca3877 |
void soup_cache_flush (SoupCache *cache);
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_34
|
|
Packit Service |
ca3877 |
void soup_cache_clear (SoupCache *cache);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_34
|
|
Packit Service |
ca3877 |
void soup_cache_dump (SoupCache *cache);
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_34
|
|
Packit Service |
ca3877 |
void soup_cache_load (SoupCache *cache);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_34
|
|
Packit Service |
ca3877 |
void soup_cache_set_max_size (SoupCache *cache,
|
|
Packit Service |
ca3877 |
guint max_size);
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_34
|
|
Packit Service |
ca3877 |
guint soup_cache_get_max_size (SoupCache *cache);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
G_END_DECLS
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
#endif /* SOUP_CACHE_H */
|
|
Packit Service |
ca3877 |
|