gdataset.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  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  */
00019 
00020 /*
00021  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
00022  * file for a list of people on the GLib Team.  See the ChangeLog
00023  * files for a list of changes.  These files are distributed with
00024  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
00025  */
00026 
00027 #ifndef __G_DATASET_H__
00028 #define __G_DATASET_H__
00029 
00030 #include <gquark.h>
00031 
00032 G_BEGIN_DECLS
00033 
00034 typedef struct _GData           GData;
00035 
00036 typedef void            (*GDataForeachFunc)     (GQuark         key_id,
00037                                                  gpointer       data,
00038                                                  gpointer       user_data);
00039 
00040 /* Keyed Data List
00041  */
00042 void      g_datalist_init                (GData          **datalist);
00043 void      g_datalist_clear               (GData          **datalist);
00044 gpointer  g_datalist_id_get_data         (GData          **datalist,
00045                                           GQuark           key_id);
00046 void      g_datalist_id_set_data_full    (GData          **datalist,
00047                                           GQuark           key_id,
00048                                           gpointer         data,
00049                                           GDestroyNotify   destroy_func);
00050 gpointer  g_datalist_id_remove_no_notify (GData          **datalist,
00051                                           GQuark           key_id);
00052 void      g_datalist_foreach             (GData          **datalist,
00053                                           GDataForeachFunc func,
00054                                           gpointer         user_data);
00055 #define   g_datalist_id_set_data(dl, q, d)      \
00056      g_datalist_id_set_data_full ((dl), (q), (d), NULL)
00057 #define   g_datalist_id_remove_data(dl, q)      \
00058      g_datalist_id_set_data ((dl), (q), NULL)
00059 #define   g_datalist_get_data(dl, k)            \
00060      (g_datalist_id_get_data ((dl), g_quark_try_string (k)))
00061 #define   g_datalist_set_data_full(dl, k, d, f) \
00062      g_datalist_id_set_data_full ((dl), g_quark_from_string (k), (d), (f))
00063 #define   g_datalist_remove_no_notify(dl, k)    \
00064      g_datalist_id_remove_no_notify ((dl), g_quark_try_string (k))
00065 #define   g_datalist_set_data(dl, k, d)         \
00066      g_datalist_set_data_full ((dl), (k), (d), NULL)
00067 #define   g_datalist_remove_data(dl, k)         \
00068      g_datalist_id_set_data ((dl), g_quark_try_string (k), NULL)
00069 
00070 
00071 /* Location Associated Keyed Data
00072  */
00073 void      g_dataset_destroy             (gconstpointer    dataset_location);
00074 gpointer  g_dataset_id_get_data         (gconstpointer    dataset_location,
00075                                          GQuark           key_id);
00076 void      g_dataset_id_set_data_full    (gconstpointer    dataset_location,
00077                                          GQuark           key_id,
00078                                          gpointer         data,
00079                                          GDestroyNotify   destroy_func);
00080 gpointer  g_dataset_id_remove_no_notify (gconstpointer    dataset_location,
00081                                          GQuark           key_id);
00082 void      g_dataset_foreach             (gconstpointer    dataset_location,
00083                                          GDataForeachFunc func,
00084                                          gpointer         user_data);
00085 #define   g_dataset_id_set_data(l, k, d)        \
00086      g_dataset_id_set_data_full ((l), (k), (d), NULL)
00087 #define   g_dataset_id_remove_data(l, k)        \
00088      g_dataset_id_set_data ((l), (k), NULL)
00089 #define   g_dataset_get_data(l, k)              \
00090      (g_dataset_id_get_data ((l), g_quark_try_string (k)))
00091 #define   g_dataset_set_data_full(l, k, d, f)   \
00092      g_dataset_id_set_data_full ((l), g_quark_from_string (k), (d), (f))
00093 #define   g_dataset_remove_no_notify(l, k)      \
00094      g_dataset_id_remove_no_notify ((l), g_quark_try_string (k))
00095 #define   g_dataset_set_data(l, k, d)           \
00096      g_dataset_set_data_full ((l), (k), (d), NULL)
00097 #define   g_dataset_remove_data(l, k)           \
00098      g_dataset_id_set_data ((l), g_quark_try_string (k), NULL)
00099 
00100 G_END_DECLS
00101 
00102 #endif /* __G_DATASET_H__ */
00103 
00104 
00105 
00106 

Generated on Tue Jul 5 14:14:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1