Abstract utilities for run-time value enumerations.
More...
#include <gfsmMem.h>
#include <gfsmCommon.h>
#include <gfsmEnum.hi>
Go to the source code of this file.
Data Structures |
struct | gfsmEnum |
| Structure for mapping symbolic names to numeric IDs. More...
|
Accessors |
#define | gfsm_enum_next_value(en) ((en)->nxtval) |
#define | gfsm_enum_insert(en, key) gfsm_enum_insert_full(en,key,gfsmEnumNone) |
#define | gfsm_enum_get(en, key) gfsm_enum_insert(en,key) |
static gboolean | gfsm_enum_lookup_extended (gfsmEnum *en, gconstpointer lookup_key, gpointer *stored_key, gpointer *stored_val) |
static guint | gfsm_enum_lookup (gfsmEnum *en, gconstpointer key) |
static guint | gfsm_enum_insert_full (gfsmEnum *en, gpointer key, guint val) |
Detailed Description
Macro Definition Documentation
create a new gfsmDirectEnum
#define gfsm_enum_next_value |
( |
|
en | ) |
((en)->nxtval) |
Insert a (possibly new) value val for key
Typedef Documentation
Function Documentation
static gfsmEnum* gfsm_enum_new_full |
( |
gfsmDupFunc |
key_dup_func, |
|
|
GHashFunc |
key_hash_func, |
|
|
GEqualFunc |
key_equal_func, |
|
|
GDestroyNotify |
key_destroy_func |
|
) |
| |
|
inlinestatic |
static void gfsm_enum_clear |
( |
gfsmEnum * |
en | ) |
|
|
inlinestatic |
static void gfsm_enum_free |
( |
gfsmEnum * |
en | ) |
|
|
inlinestatic |
static gboolean gfsm_enum_lookup_extended |
( |
gfsmEnum * |
en, |
|
|
gconstpointer |
lookup_key, |
|
|
gpointer * |
stored_key, |
|
|
gpointer * |
stored_val |
|
) |
| |
|
inlinestatic |
Lookup the numeric value associated with lookup_key. On return, *stored_key points to the original (stored) key, if any; and *stored_value points to the stored value.
- Returns
- true iff a value for key was already stored
static guint gfsm_enum_lookup |
( |
gfsmEnum * |
en, |
|
|
gconstpointer |
key |
|
) |
| |
|
inlinestatic |
Lookup the numeric value associated with key.
- Returns
- the value associated with key, or gfsmEnumNone if no such value was found
static guint gfsm_enum_insert_full |
( |
gfsmEnum * |
en, |
|
|
gpointer |
key, |
|
|
guint |
val |
|
) |
| |
|
inlinestatic |
Insert or overwrite new value val for key. If val is gfsmEnumNone, the next available value will be used.
- Returns
- new value for key
Variable Documentation
Constant indicating failed gfsmEnum value-lookup