X-Git-Url: https://git.cworth.org/git?p=wordgame;a=blobdiff_plain;f=dict.h;fp=dict.h;h=622165195daf12151776f2cec9316f0aa35106b8;hp=ab962c20469bfae94808dbc8e2271a169edfd3b1;hb=0dd9b1cd908b90236fba38ef4d7402c8fbcbb99b;hpb=a46e558ad8d3243c76a9a6cafb6100be4f3f2dae diff --git a/dict.h b/dict.h index ab962c2..6221651 100644 --- a/dict.h +++ b/dict.h @@ -68,8 +68,11 @@ typedef bool_t (*dict_entry_predicate_t) (dict_entry_t entry); int -dict_count (dict_t *dict, - dict_entry_predicate_t predicate); +dict_count_if (dict_t *dict, + dict_entry_predicate_t predicate); + +int +dict_count (dict_t *dict); /* Querying a dictionary entry. The dict interface uses 1 bit. * All of the remaining bits are available for application use. @@ -83,12 +86,20 @@ int dict_print (dict_t *dict); int -dict_print_by_length (dict_t *dict); +dict_print_of_length (dict_t *dict, + int min_length, + int max_length); int dict_print_if (dict_t *dict, dict_entry_predicate_t predicate); +int +dict_print_of_length_if (dict_t *dict, + int min_length, + int max_length, + dict_entry_predicate_t predicate); + int dict_print_by_length_if (dict_t *dict, dict_entry_predicate_t predicate); @@ -102,9 +113,11 @@ dict_for_each (dict_t *dict, void *closure); int -dict_for_each_by_length (dict_t *dict, +dict_for_each_of_length (dict_t *dict, dict_action_t action, - void *closure); + void *closure, + int min_length, + int max_length); int dict_for_each_if (dict_t *dict, @@ -113,9 +126,11 @@ dict_for_each_if (dict_t *dict, dict_entry_predicate_t predicate); int -dict_for_each_by_length_if (dict_t *dict, +dict_for_each_of_length_if (dict_t *dict, dict_action_t action, void *closure, + int min_length, + int max_length, dict_entry_predicate_t predicate); /* Character-by-character perusal of the dictionary */