Changeset 89c57b6 in mainline for uspace/lib/c/include/adt/char_map.h
- Timestamp:
- 2011-04-13T14:45:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 88634420
- Parents:
- cefb126 (diff), 17279ead (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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/char_map.h
rcefb126 r89c57b6 27 27 */ 28 28 29 /** @addtogroup arp29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * ARP module functions. 35 * The functions are used as ARP module entry points. 34 * Character string to integer map. 36 35 */ 37 36 38 #ifndef __NET_ARP_MODULE_H__39 #define __NET_ARP_MODULE_H__37 #ifndef LIBC_CHAR_MAP_H_ 38 #define LIBC_CHAR_MAP_H_ 40 39 41 #include < ipc/ipc.h>40 #include <libarch/types.h> 42 41 43 /** Initializes the ARP module. 44 * @param[in] client_connection The client connection processing function. The module skeleton propagates its own one. 45 * @returns EOK on success. 46 * @returns ENOMEM if there is not enough memory left. 42 /** Invalid assigned value used also if an entry does not exist. */ 43 #define CHAR_MAP_NULL (-1) 44 45 /** Type definition of the character string to integer map. 46 * @see char_map 47 47 */ 48 int arp_initialize(async_client_conn_t client_connection);48 typedef struct char_map char_map_t; 49 49 50 /** Processes the ARP message. 51 * @param[in] callid The message identifier. 52 * @param[in] call The message parameters. 53 * @param[out] answer The message answer parameters. 54 * @param[out] answer_count The last parameter for the actual answer in the answer parameter. 55 * @returns EOK on success. 56 * @returns ENOTSUP if the message is not known. 57 * @see arp_interface.h 58 * @see IS_NET_ARP_MESSAGE() 50 /** Character string to integer map item. 51 * 52 * This structure recursivelly contains itself as a character by character tree. 53 * The actually mapped character string consists of all the parent characters 54 * and the actual one. 59 55 */ 60 int arp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count); 56 struct char_map { 57 /** Actually mapped character. */ 58 uint8_t c; 59 /** Stored integral value. */ 60 int value; 61 /** Next character array size. */ 62 int size; 63 /** First free position in the next character array. */ 64 int next; 65 /** Next character array. */ 66 char_map_t **items; 67 /** Consistency check magic value. */ 68 int magic; 69 }; 70 71 extern int char_map_initialize(char_map_t *); 72 extern void char_map_destroy(char_map_t *); 73 extern int char_map_exclude(char_map_t *, const uint8_t *, size_t); 74 extern int char_map_add(char_map_t *, const uint8_t *, size_t, const int); 75 extern int char_map_find(const char_map_t *, const uint8_t *, size_t); 76 extern int char_map_update(char_map_t *, const uint8_t *, size_t, const int); 61 77 62 78 #endif
Note:
See TracChangeset
for help on using the changeset viewer.