gcache.h

Go to the documentation of this file.
00001 /* GLIB - Library of useful routines for C programming
00002  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
00003  * Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the
00017  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018  * Boston, MA 02111-1307, USA.
00019  */
00020 
00021 /*
00022  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
00023  * file for a list of people on the GLib Team.  See the ChangeLog
00024  * files for a list of changes.  These files are distributed with
00025  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
00026  */
00027 
00028 #ifndef __G_CACHE_H__
00029 #define __G_CACHE_H__
00030 
00031 #include <_ansi.h>
00032 #include <glib/glist.h>
00033 
00034 G_BEGIN_DECLS
00035 
00036 typedef struct _GCache          GCache;
00037 
00038 typedef gpointer        (*GCacheNewFunc)        (gpointer       key);
00039 typedef gpointer        (*GCacheDupFunc)        (gpointer       value);
00040 typedef void            (*GCacheDestroyFunc)    (gpointer       value);
00041 
00042 /* Caches
00043  */
00044 IMPORT_C GCache*  g_cache_new           (GCacheNewFunc      value_new_func,
00045                                 GCacheDestroyFunc  value_destroy_func,
00046                                 GCacheDupFunc      key_dup_func,
00047                                 GCacheDestroyFunc  key_destroy_func,
00048                                 GHashFunc          hash_key_func,
00049                                 GHashFunc          hash_value_func,
00050                                 GEqualFunc         key_equal_func);
00051 IMPORT_C void     g_cache_destroy       (GCache            *cache);
00052 IMPORT_C gpointer g_cache_insert        (GCache            *cache,
00053                                 gpointer           key);
00054 IMPORT_C void     g_cache_remove        (GCache            *cache,
00055                                 gconstpointer      value);
00056 IMPORT_C void     g_cache_key_foreach   (GCache            *cache,
00057                                 GHFunc             func,
00058                                 gpointer           user_data);
00059 #ifndef G_DISABLE_DEPRECATED
00060 IMPORT_C void     g_cache_value_foreach (GCache            *cache,
00061                                 GHFunc             func,
00062                                 gpointer           user_data);
00063 #endif
00064 
00065 G_END_DECLS
00066 
00067 #endif /* __G_CACHE_H__ */
00068 
00069 
00070 

Copyright © Nokia Corporation 2001-2008
Back to top