Blame glib/gdataset.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_DATASET_H__
Packit ae235b
#define __G_DATASET_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/gquark.h>
Packit ae235b
Packit ae235b
G_BEGIN_DECLS
Packit ae235b
Packit ae235b
typedef struct _GData           GData;
Packit ae235b
Packit ae235b
typedef void            (*GDataForeachFunc)     (GQuark         key_id,
Packit ae235b
                                                 gpointer       data,
Packit ae235b
                                                 gpointer       user_data);
Packit ae235b
Packit ae235b
/* Keyed Data List
Packit ae235b
 */
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void     g_datalist_init                (GData            **datalist);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void     g_datalist_clear               (GData            **datalist);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gpointer g_datalist_id_get_data         (GData            **datalist,
Packit ae235b
					 GQuark             key_id);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void     g_datalist_id_set_data_full    (GData            **datalist,
Packit ae235b
					 GQuark             key_id,
Packit ae235b
					 gpointer           data,
Packit ae235b
					 GDestroyNotify     destroy_func);
Packit ae235b
Packit ae235b
typedef gpointer (*GDuplicateFunc) (gpointer data, gpointer user_data);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_34
Packit ae235b
gpointer g_datalist_id_dup_data         (GData            **datalist,
Packit ae235b
                                         GQuark             key_id,
Packit ae235b
                                         GDuplicateFunc     dup_func,
Packit ae235b
					 gpointer           user_data);
Packit ae235b
GLIB_AVAILABLE_IN_2_34
Packit ae235b
gboolean g_datalist_id_replace_data     (GData            **datalist,
Packit ae235b
                                         GQuark             key_id,
Packit ae235b
                                         gpointer           oldval,
Packit ae235b
                                         gpointer           newval,
Packit ae235b
                                         GDestroyNotify     destroy,
Packit ae235b
					 GDestroyNotify    *old_destroy);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gpointer g_datalist_id_remove_no_notify (GData            **datalist,
Packit ae235b
					 GQuark             key_id);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void     g_datalist_foreach             (GData            **datalist,
Packit ae235b
					 GDataForeachFunc   func,
Packit ae235b
					 gpointer           user_data);
Packit ae235b
Packit ae235b
/**
Packit ae235b
 * G_DATALIST_FLAGS_MASK:
Packit ae235b
 *
Packit ae235b
 * A bitmask that restricts the possible flags passed to
Packit ae235b
 * g_datalist_set_flags(). Passing a flags value where
Packit ae235b
 * flags & ~G_DATALIST_FLAGS_MASK != 0 is an error.
Packit ae235b
 */
Packit ae235b
#define G_DATALIST_FLAGS_MASK 0x3
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void     g_datalist_set_flags           (GData            **datalist,
Packit ae235b
					 guint              flags);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void     g_datalist_unset_flags         (GData            **datalist,
Packit ae235b
					 guint              flags);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
guint    g_datalist_get_flags           (GData            **datalist);
Packit ae235b
Packit ae235b
#define   g_datalist_id_set_data(dl, q, d)      \
Packit ae235b
     g_datalist_id_set_data_full ((dl), (q), (d), NULL)
Packit ae235b
#define   g_datalist_id_remove_data(dl, q)      \
Packit ae235b
     g_datalist_id_set_data ((dl), (q), NULL)
Packit ae235b
#define   g_datalist_set_data_full(dl, k, d, f) \
Packit ae235b
     g_datalist_id_set_data_full ((dl), g_quark_from_string (k), (d), (f))
Packit ae235b
#define   g_datalist_remove_no_notify(dl, k)    \
Packit ae235b
     g_datalist_id_remove_no_notify ((dl), g_quark_try_string (k))
Packit ae235b
#define   g_datalist_set_data(dl, k, d)         \
Packit ae235b
     g_datalist_set_data_full ((dl), (k), (d), NULL)
Packit ae235b
#define   g_datalist_remove_data(dl, k)         \
Packit ae235b
     g_datalist_id_set_data ((dl), g_quark_try_string (k), NULL)
Packit ae235b
Packit ae235b
/* Location Associated Keyed Data
Packit ae235b
 */
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void      g_dataset_destroy             (gconstpointer    dataset_location);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gpointer  g_dataset_id_get_data         (gconstpointer    dataset_location,
Packit ae235b
                                         GQuark           key_id);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gpointer  g_datalist_get_data            (GData	 **datalist,
Packit ae235b
					  const gchar *key);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void      g_dataset_id_set_data_full    (gconstpointer    dataset_location,
Packit ae235b
                                         GQuark           key_id,
Packit ae235b
                                         gpointer         data,
Packit ae235b
                                         GDestroyNotify   destroy_func);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gpointer  g_dataset_id_remove_no_notify (gconstpointer    dataset_location,
Packit ae235b
                                         GQuark           key_id);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void      g_dataset_foreach             (gconstpointer    dataset_location,
Packit ae235b
                                         GDataForeachFunc func,
Packit ae235b
                                         gpointer         user_data);
Packit ae235b
#define   g_dataset_id_set_data(l, k, d)        \
Packit ae235b
     g_dataset_id_set_data_full ((l), (k), (d), NULL)
Packit ae235b
#define   g_dataset_id_remove_data(l, k)        \
Packit ae235b
     g_dataset_id_set_data ((l), (k), NULL)
Packit ae235b
#define   g_dataset_get_data(l, k)              \
Packit ae235b
     (g_dataset_id_get_data ((l), g_quark_try_string (k)))
Packit ae235b
#define   g_dataset_set_data_full(l, k, d, f)   \
Packit ae235b
     g_dataset_id_set_data_full ((l), g_quark_from_string (k), (d), (f))
Packit ae235b
#define   g_dataset_remove_no_notify(l, k)      \
Packit ae235b
     g_dataset_id_remove_no_notify ((l), g_quark_try_string (k))
Packit ae235b
#define   g_dataset_set_data(l, k, d)           \
Packit ae235b
     g_dataset_set_data_full ((l), (k), (d), NULL)
Packit ae235b
#define   g_dataset_remove_data(l, k)           \
Packit ae235b
     g_dataset_id_set_data ((l), g_quark_try_string (k), NULL)
Packit ae235b
Packit ae235b
G_END_DECLS
Packit ae235b
Packit ae235b
#endif /* __G_DATASET_H__ */