Changeset 1ebc1a62 in mainline for uspace/app/sbi/src/intmap.c
- Timestamp:
- 2010-03-29T20:30:29Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a95310e
- Parents:
- 5da468e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sbi/src/intmap.c
r5da468e r1ebc1a62 29 29 /** @file Integer map. 30 30 * 31 * Maps integers to pointers (void *). 31 * Maps integers to pointers (void *). Current implementation is trivial 32 * (linked list of key-value pairs). 32 33 */ 33 34 … … 40 41 #include "intmap.h" 41 42 42 /** Initialize map. */ 43 /** Initialize map. 44 * 45 * @param intmap Map to initialize. 46 */ 43 47 void intmap_init(intmap_t *intmap) 44 48 { … … 46 50 } 47 51 48 /** Set value corresponding to a key. */ 52 /** Set value corresponding to a key. 53 * 54 * If there already exists a mapping for @a key in the map, it is 55 * silently replaced. If @a value is @c NULL, the mapping for @a key 56 * is removed from the map. 57 * 58 * @param intmap Map. 59 * @param key Key (integer). 60 * @param value Value (must be a pointer) or @c NULL. 61 */ 49 62 void intmap_set(intmap_t *intmap, int key, void *value) 50 63 { … … 83 96 } 84 97 85 /** Get value corresponding to a key. */ 98 /** Get value corresponding to a key. 99 * 100 * @param intmap Map. 101 * @param key Key for which to retrieve mapping. 102 * 103 * @return Value correspoding to @a key or @c NULL if no mapping 104 * exists. 105 */ 86 106 void *intmap_get(intmap_t *intmap, int key) 87 107 {
Note:
See TracChangeset
for help on using the changeset viewer.