1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 Copyright (C) 2004 Sebastien Granjoux
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program 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
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 typedef struct _NPWValueHeap NPWValueHeap
;
27 typedef struct _NPWValue NPWValue
;
30 NPW_EMPTY_VALUE
= 0, /* value should be NULL */
31 NPW_VALID_VALUE
= 1 << 0, /* non empty, valid value */
32 NPW_OLD_VALUE
= 1 << 1, /* non empty, removed value */
33 NPW_DEFAULT_VALUE
= 1 << 2 /* default value = could be overwritten */
36 NPWValueHeap
* npw_value_heap_new (void);
37 void npw_value_heap_free (NPWValueHeap
* this);
39 NPWValue
* npw_value_heap_find_value (NPWValueHeap
* this, const gchar
* name
);
41 gboolean
npw_value_heap_set_value (NPWValueHeap
* this, NPWValue
* node
, const gchar
* value
, NPWValueTag tag
);
42 const gchar
* npw_value_heap_get_value (const NPWValueHeap
* this, const NPWValue
* node
);
44 const gchar
* npw_value_heap_get_name (const NPWValueHeap
* this, const NPWValue
* node
);
45 NPWValueTag
npw_value_heap_get_tag (const NPWValueHeap
* this, const NPWValue
* node
);
47 typedef void (*NPWValueHeapForeachFunc
) (const gchar
* name
, const gchar
* value
, NPWValueTag tag
, gpointer user_data
);
48 void npw_value_heap_foreach_value (const NPWValueHeap
* this, NPWValueHeapForeachFunc func
, gpointer user_data
);