Changeset efdfebc in mainline for uspace/lib/c/include/io/kbd_event.h
- Timestamp:
- 2012-11-06T21:03:44Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 338810f
- Parents:
- de73242 (diff), 94795812 (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
-
uspace/lib/c/include/io/kbd_event.h (moved) (moved from uspace/lib/c/include/adt/hash_set.h ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/io/kbd_event.h
rde73242 refdfebc 1 1 /* 2 * Copyright (c) 2006 Jakub Jermar 3 * Copyright (c) 2011 Radim Vansa 2 * Copyright (c) 2012 Jiri Svoboda 4 3 * All rights reserved. 5 4 * … … 34 33 */ 35 34 36 #ifndef LIBC_ HASH_SET_H_37 #define LIBC_ HASH_SET_H_35 #ifndef LIBC_IO_KBD_EVENT_H_ 36 #define LIBC_IO_KBD_EVENT_H_ 38 37 39 38 #include <adt/list.h> 40 #include < unistd.h>39 #include <io/keycode.h> 41 40 42 #define HASH_SET_MIN_SIZE 8 41 typedef enum { 42 KEY_PRESS, 43 KEY_RELEASE 44 } kbd_event_type_t; 43 45 44 typedef unsigned long (*hash_set_hash)(const link_t *); 45 typedef int (*hash_set_equals)(const link_t *, const link_t *); 46 47 /** Hash table structure. */ 46 /** Console event structure. */ 48 47 typedef struct { 49 list_t *table; 48 /** List handle */ 49 link_t link; 50 50 51 /** Current table size*/52 size_t size;51 /** Press or release event. */ 52 kbd_event_type_t type; 53 53 54 /** 55 * Current number of entries. If count > size, 56 * the table is rehashed into table with double 57 * size. If (4 * count < size) && (size > min_size), 58 * the table is rehashed into table with half the size. 59 */ 60 size_t count; 54 /** Keycode of the key that was pressed or released. */ 55 keycode_t key; 61 56 62 /** Hash function*/63 hash_set_hash hash;57 /** Bitmask of modifiers held. */ 58 keymod_t mods; 64 59 65 /** Hash table item equals function */ 66 hash_set_equals equals; 67 } hash_set_t; 68 69 extern int hash_set_init(hash_set_t *, hash_set_hash, hash_set_equals, size_t); 70 extern int hash_set_insert(hash_set_t *, link_t *); 71 extern link_t *hash_set_find(hash_set_t *, const link_t *); 72 extern int hash_set_contains(const hash_set_t *, const link_t *); 73 extern size_t hash_set_count(const hash_set_t *); 74 extern link_t *hash_set_remove(hash_set_t *, const link_t *); 75 extern void hash_set_remove_selected(hash_set_t *, 76 int (*)(link_t *, void *), void *); 77 extern void hash_set_destroy(hash_set_t *); 78 extern void hash_set_apply(hash_set_t *, void (*)(link_t *, void *), void *); 79 extern void hash_set_clear(hash_set_t *, void (*)(link_t *, void *), void *); 60 /** The character that was generated or '\0' for none. */ 61 wchar_t c; 62 } kbd_event_t; 80 63 81 64 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
