Top | ![]() |
![]() |
![]() |
![]() |
gint | gwy_string_to_enum () |
const gchar * | gwy_enum_to_string () |
gchar * | gwy_enuml_to_string () |
gint | gwy_string_to_flags () |
gchar * | gwy_flags_to_string () |
gint | gwy_enum_sanitize_value () |
void | gwy_enum_freev () |
GwyInventory * | gwy_enum_inventory_new () |
GwyEnum is a simple association of a string and integer enum value used in
various places in Gwyddion. An enum table can be easily used as a constant
GwyInventory base with gwy_enum_inventory_new()
.
gint gwy_string_to_enum (const gchar *str
,const GwyEnum *enum_table
,gint n
);
Creates an integer representation of a string enum value str
.
str |
A string containing one of |
|
enum_table |
A table of corresponding string-integer pairs. |
|
n |
The number of elements in |
const gchar * gwy_enum_to_string (gint enumval
,const GwyEnum *enum_table
,gint n
);
Creates a string representation of an integer enum value enumval
.
enumval |
A one integer value from |
|
enum_table |
A table of corresponding string-integer pairs. |
|
n |
The number of elements in |
gchar * gwy_enuml_to_string (gint enumval
,...
);
Creates a string representation of an integer enum value enumval
.
enumval |
Integer value to find. |
|
... |
First enum name, first value, second enum name, second value, etc.
Terminated with |
The corresponding enum name string argument if enumval
matches
some of them. Otherwise NULL
is returned (this is different
from gwy_enum_to_string()
which returns an empty string).
Since: 2.5
gint gwy_string_to_flags (const gchar *str
,const GwyEnum *enum_table
,gint n
,const gchar *delimiter
);
Creates an integer flag combination of its string representation str
.
gchar * gwy_flags_to_string (gint enumval
,const GwyEnum *enum_table
,gint n
,const gchar *glue
);
Creates a string representation of integer flag combination enumval
.
gint gwy_enum_sanitize_value (gint enumval
,GType enum_type
);
Makes sure an enum value is valid.
void
gwy_enum_freev (GwyEnum *enum_table
);
Frees a dynamically allocated enum.
More precisely, it frees all names of a GwyEnum and then frees the enum itself.
GwyInventory * gwy_enum_inventory_new (const GwyEnum *enum_table
,gint n
);
Convenience function to create a constant inventory from a GwyEnum.
The enum table is directly used and therefore must exist during the lifetime of the inventory.