Blame glib/ghash.h

Packit ae235b
/* GLIB - Library of useful routines for C programming
Packit ae235b
 * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
Packit ae235b
 *
Packit ae235b
 * This library is free software; you can redistribute it and/or
Packit ae235b
 * modify it under the terms of the GNU Lesser General Public
Packit ae235b
 * License as published by the Free Software Foundation; either
Packit ae235b
 * version 2.1 of the License, or (at your option) any later version.
Packit ae235b
 *
Packit ae235b
 * This library is distributed in the hope that it will be useful,
Packit ae235b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit ae235b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit ae235b
 * Lesser General Public License for more details.
Packit ae235b
 *
Packit ae235b
 * You should have received a copy of the GNU Lesser General Public
Packit ae235b
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit ae235b
 */
Packit ae235b
Packit ae235b
/*
Packit ae235b
 * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
Packit ae235b
 * file for a list of people on the GLib Team.  See the ChangeLog
Packit ae235b
 * files for a list of changes.  These files are distributed with
Packit ae235b
 * GLib at ftp://ftp.gtk.org/pub/gtk/.
Packit ae235b
 */
Packit ae235b
Packit ae235b
#ifndef __G_HASH_H__
Packit ae235b
#define __G_HASH_H__
Packit ae235b
Packit ae235b
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
Packit ae235b
#error "Only <glib.h> can be included directly."
Packit ae235b
#endif
Packit ae235b
Packit ae235b
#include <glib/gtypes.h>
Packit ae235b
#include <glib/glist.h>
Packit ae235b
Packit ae235b
G_BEGIN_DECLS
Packit ae235b
Packit ae235b
typedef struct _GHashTable  GHashTable;
Packit ae235b
Packit ae235b
typedef gboolean  (*GHRFunc)  (gpointer  key,
Packit ae235b
                               gpointer  value,
Packit ae235b
                               gpointer  user_data);
Packit ae235b
Packit ae235b
typedef struct _GHashTableIter GHashTableIter;
Packit ae235b
Packit ae235b
struct _GHashTableIter
Packit ae235b
{
Packit ae235b
  /*< private >*/
Packit ae235b
  gpointer      dummy1;
Packit ae235b
  gpointer      dummy2;
Packit ae235b
  gpointer      dummy3;
Packit ae235b
  int           dummy4;
Packit ae235b
  gboolean      dummy5;
Packit ae235b
  gpointer      dummy6;
Packit ae235b
};
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GHashTable* g_hash_table_new               (GHashFunc       hash_func,
Packit ae235b
                                            GEqualFunc      key_equal_func);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GHashTable* g_hash_table_new_full          (GHashFunc       hash_func,
Packit ae235b
                                            GEqualFunc      key_equal_func,
Packit ae235b
                                            GDestroyNotify  key_destroy_func,
Packit ae235b
                                            GDestroyNotify  value_destroy_func);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void        g_hash_table_destroy           (GHashTable     *hash_table);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean    g_hash_table_insert            (GHashTable     *hash_table,
Packit ae235b
                                            gpointer        key,
Packit ae235b
                                            gpointer        value);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean    g_hash_table_replace           (GHashTable     *hash_table,
Packit ae235b
                                            gpointer        key,
Packit ae235b
                                            gpointer        value);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean    g_hash_table_add               (GHashTable     *hash_table,
Packit ae235b
                                            gpointer        key);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean    g_hash_table_remove            (GHashTable     *hash_table,
Packit ae235b
                                            gconstpointer   key);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void        g_hash_table_remove_all        (GHashTable     *hash_table);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean    g_hash_table_steal             (GHashTable     *hash_table,
Packit ae235b
                                            gconstpointer   key);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void        g_hash_table_steal_all         (GHashTable     *hash_table);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gpointer    g_hash_table_lookup            (GHashTable     *hash_table,
Packit ae235b
                                            gconstpointer   key);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean    g_hash_table_contains          (GHashTable     *hash_table,
Packit ae235b
                                            gconstpointer   key);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean    g_hash_table_lookup_extended   (GHashTable     *hash_table,
Packit ae235b
                                            gconstpointer   lookup_key,
Packit ae235b
                                            gpointer       *orig_key,
Packit ae235b
                                            gpointer       *value);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void        g_hash_table_foreach           (GHashTable     *hash_table,
Packit ae235b
                                            GHFunc          func,
Packit ae235b
                                            gpointer        user_data);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gpointer    g_hash_table_find              (GHashTable     *hash_table,
Packit ae235b
                                            GHRFunc         predicate,
Packit ae235b
                                            gpointer        user_data);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
guint       g_hash_table_foreach_remove    (GHashTable     *hash_table,
Packit ae235b
                                            GHRFunc         func,
Packit ae235b
                                            gpointer        user_data);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
guint       g_hash_table_foreach_steal     (GHashTable     *hash_table,
Packit ae235b
                                            GHRFunc         func,
Packit ae235b
                                            gpointer        user_data);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
guint       g_hash_table_size              (GHashTable     *hash_table);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GList *     g_hash_table_get_keys          (GHashTable     *hash_table);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GList *     g_hash_table_get_values        (GHashTable     *hash_table);
Packit ae235b
GLIB_AVAILABLE_IN_2_40
Packit ae235b
gpointer *  g_hash_table_get_keys_as_array (GHashTable     *hash_table,
Packit ae235b
                                            guint          *length);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void        g_hash_table_iter_init         (GHashTableIter *iter,
Packit ae235b
                                            GHashTable     *hash_table);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean    g_hash_table_iter_next         (GHashTableIter *iter,
Packit ae235b
                                            gpointer       *key,
Packit ae235b
                                            gpointer       *value);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GHashTable* g_hash_table_iter_get_hash_table (GHashTableIter *iter);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void        g_hash_table_iter_remove       (GHashTableIter *iter);
Packit ae235b
GLIB_AVAILABLE_IN_2_30
Packit ae235b
void        g_hash_table_iter_replace      (GHashTableIter *iter,
Packit ae235b
                                            gpointer        value);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void        g_hash_table_iter_steal        (GHashTableIter *iter);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GHashTable* g_hash_table_ref               (GHashTable     *hash_table);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void        g_hash_table_unref             (GHashTable     *hash_table);
Packit ae235b
Packit ae235b
#ifndef G_DISABLE_DEPRECATED
Packit ae235b
#define g_hash_table_freeze(hash_table) ((void)0)
Packit ae235b
#define g_hash_table_thaw(hash_table) ((void)0)
Packit ae235b
#endif
Packit ae235b
Packit ae235b
/* Hash Functions
Packit ae235b
 */
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean g_str_equal    (gconstpointer  v1,
Packit ae235b
                         gconstpointer  v2);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
guint    g_str_hash     (gconstpointer  v);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean g_int_equal    (gconstpointer  v1,
Packit ae235b
                         gconstpointer  v2);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
guint    g_int_hash     (gconstpointer  v);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean g_int64_equal  (gconstpointer  v1,
Packit ae235b
                         gconstpointer  v2);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
guint    g_int64_hash   (gconstpointer  v);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean g_double_equal (gconstpointer  v1,
Packit ae235b
                         gconstpointer  v2);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
guint    g_double_hash  (gconstpointer  v);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
guint    g_direct_hash  (gconstpointer  v) G_GNUC_CONST;
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean g_direct_equal (gconstpointer  v1,
Packit ae235b
                         gconstpointer  v2) G_GNUC_CONST;
Packit ae235b
Packit ae235b
G_END_DECLS
Packit ae235b
Packit ae235b
#endif /* __G_HASH_H__ */