gcache.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* GLIB - Library of useful routines for C programming
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * SPDX-License-Identifier: LGPL-2.1-or-later
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  18. */
  19. /*
  20. * Modified by the GLib Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GLib Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GLib at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #ifndef __G_CACHE_H__
  26. #define __G_CACHE_H__
  27. #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
  28. #error "Only <glib.h> can be included directly."
  29. #endif
  30. #include <glib/glist.h>
  31. G_BEGIN_DECLS
  32. typedef struct _GCache GCache GLIB_DEPRECATED_TYPE_IN_2_26_FOR(GHashTable);
  33. typedef gpointer (*GCacheNewFunc) (gpointer key) GLIB_DEPRECATED_TYPE_IN_2_26;
  34. typedef gpointer (*GCacheDupFunc) (gpointer value) GLIB_DEPRECATED_TYPE_IN_2_26;
  35. typedef void (*GCacheDestroyFunc) (gpointer value) GLIB_DEPRECATED_TYPE_IN_2_26;
  36. G_GNUC_BEGIN_IGNORE_DEPRECATIONS
  37. /* Caches
  38. */
  39. GLIB_DEPRECATED
  40. GCache* g_cache_new (GCacheNewFunc value_new_func,
  41. GCacheDestroyFunc value_destroy_func,
  42. GCacheDupFunc key_dup_func,
  43. GCacheDestroyFunc key_destroy_func,
  44. GHashFunc hash_key_func,
  45. GHashFunc hash_value_func,
  46. GEqualFunc key_equal_func);
  47. GLIB_DEPRECATED
  48. void g_cache_destroy (GCache *cache);
  49. GLIB_DEPRECATED
  50. gpointer g_cache_insert (GCache *cache,
  51. gpointer key);
  52. GLIB_DEPRECATED
  53. void g_cache_remove (GCache *cache,
  54. gconstpointer value);
  55. GLIB_DEPRECATED
  56. void g_cache_key_foreach (GCache *cache,
  57. GHFunc func,
  58. gpointer user_data);
  59. GLIB_DEPRECATED
  60. void g_cache_value_foreach (GCache *cache,
  61. GHFunc func,
  62. gpointer user_data);
  63. G_GNUC_END_IGNORE_DEPRECATIONS
  64. G_END_DECLS
  65. #endif /* __G_CACHE_H__ */