Changeset 17964f6 in mainline


Ignore:
Timestamp:
2025-04-09T15:06:35Z (5 days ago)
Author:
GitHub <noreply@…>
Children:
2c94501
Parents:
f6b29929 (diff), 45226285 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Wayne Thornton <wmthornton-dev@…> (2025-04-09 15:06:35)
git-committer:
GitHub <noreply@…> (2025-04-09 15:06:35)
Message:

Merge pull request #1 from HelenOS/master

Clarify the purpose and use of hash_table_foreach()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/include/adt/hash_table.h

    rf6b29929 r17964f6  
    8585        member_to_inst((item), type, member)
    8686
     87/** Iterate over all entries associated with a given key.
     88 * For iterating over all entries regardless of key, use hash_table_apply().
     89 *
     90 * Example:
     91 * struct ht_entry {
     92 *     ht_link_t my_link_member;
     93 *     void *data;
     94 *     int my_key;
     95 * }
     96 *
     97 * hash_table_t *table = ...;
     98 * int key = ...;
     99 *
     100 * hash_table_foreach(table, &key, my_link_member, struct ht_entry, item) {
     101 *     _print_entry_data(item->data);
     102 * }
     103 */
    87104#define hash_table_foreach(ht, key, member, itype, iterator) \
    88105        for (itype *iterator = NULL; \
Note: See TracChangeset for help on using the changeset viewer.