![]() |
![]() |
![]() |
WritRecogn Reference Manual | ![]() |
---|---|---|---|---|
#define G_ARRAY_COPY (dest,src) #define G_ARRAY_REMOVE_ALL (array) #define G_PTR_ARRAY_REMOVE_ALL (array) gboolean (*ForeachCallbackFunc) (gpointer data, gpointer userdata); enum SetType; HashSet; HashSet* hashSet_new_auto (SetType type); HashSet* hashSet_new (SetType type, GHashFunc hash_func, GEqualFunc key_equal_func); HashSet* hashSet_new_full (SetType type, GHashFunc hash_func, GEqualFunc key_equal_func, GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func); void hashSet_reset (HashSet *s); void hashSet_copy (HashSet *dest, HashSet *src); guint hashSet_get_size (HashSet *s); gboolean hashSet_has_element (HashSet *set, gconstpointer key); GList* hashSet_get_elements (HashSet *s); gboolean hashSet_add_element (HashSet *s, gpointer key); gboolean hashSet_remove_element (HashSet *s, gconstpointer key); void hashSet_union (HashSet *result, HashSet *s1, HashSet *s2); void hashSet_interset (HashSet *result, HashSet *s1, HashSet *s2); gchar* hashSet_to_string (HashSet *s); void hashSet_destroy (HashSet *s); gint integer_compareFunc (gconstpointer a, gconstpointer b); gint g_array_find (GArray *array, gpointer key, gint keySize, GCompareFunc func); GArray* g_array_copy (GArray *dest, GArray *src);
#define G_ARRAY_COPY(dest,src) g_array_append_vals(dest,src->data,src->len)
|
|
|
#define G_ARRAY_REMOVE_ALL(array) if (array->len>0) g_array_remove_range(array,0,array->len)
|
#define G_PTR_ARRAY_REMOVE_ALL(array)if (array->len>0) g_ptr_array_remove_range(array,0,array->len)
|
gboolean (*ForeachCallbackFunc) (gpointer data, gpointer userdata);
A prototype for callback functions that used with foreach functions.
|
the element in collection |
|
other option for the callback function. |
Returns : |
TRUE to continue, FALSE to break. |
typedef enum{ INTEGER_SET, STRING_SET, DIRECT_SET, CUSTOM_SET } SetType;
Specify what will be stored in the set.
HashSet* hashSet_new (SetType type, GHashFunc hash_func, GEqualFunc key_equal_func);
|
|
|
|
|
|
Returns : |
HashSet* hashSet_new_full (SetType type, GHashFunc hash_func, GEqualFunc key_equal_func, GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func);
|
|
|
|
|
|
|
|
|
|
Returns : |
gboolean hashSet_has_element (HashSet *set, gconstpointer key);
|
|
|
|
Returns : |
gboolean hashSet_add_element (HashSet *s, gpointer key);
s
the HashSet
key
the element to be insert
|
|
|
|
Returns : |
gboolean hashSet_remove_element (HashSet *s, gconstpointer key);
|
|
|
|
Returns : |
void hashSet_interset (HashSet *result, HashSet *s1, HashSet *s2);
|
|
|
|
|
gint integer_compareFunc (gconstpointer a, gconstpointer b);
|
|
|
|
Returns : |
gint g_array_find (GArray *array, gpointer key, gint keySize, GCompareFunc func);
|
|
|
|
|
|
|
|
Returns : |