diff options
Diffstat (limited to 'src/evemu.c')
| -rw-r--r-- | src/evemu.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/evemu.c b/src/evemu.c index f37ad05..80257c6 100644 --- a/src/evemu.c +++ b/src/evemu.c | |||
| @@ -56,6 +56,16 @@ static void copy_bits(unsigned char *mask, const unsigned long *bits, int bytes) | |||
| 56 | } | 56 | } |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | /** | ||
| 60 | * evemu_new() - allocate a new evemu device | ||
| 61 | * @name: wanted input device name (or NULL to leave empty) | ||
| 62 | * | ||
| 63 | * This function allocates a new evemu device structure and | ||
| 64 | * initializes all fields to zero. If name is non-null and the length | ||
| 65 | * is sane, it is copied to the device name. | ||
| 66 | * | ||
| 67 | * Returns NULL in case of memory failure. | ||
| 68 | */ | ||
| 59 | struct evemu_device *evemu_new(const char *name) | 69 | struct evemu_device *evemu_new(const char *name) |
| 60 | { | 70 | { |
| 61 | struct evemu_device *dev = calloc(1, sizeof(struct evemu_device)); | 71 | struct evemu_device *dev = calloc(1, sizeof(struct evemu_device)); |
| @@ -69,6 +79,12 @@ struct evemu_device *evemu_new(const char *name) | |||
| 69 | return dev; | 79 | return dev; |
| 70 | } | 80 | } |
| 71 | 81 | ||
| 82 | /** | ||
| 83 | * evemu_delete() - free and allocated evemu device | ||
| 84 | * @dev: the device to free | ||
| 85 | * | ||
| 86 | * The device pointer is invalidated by this call. | ||
| 87 | */ | ||
| 72 | void evemu_delete(struct evemu_device *dev) | 88 | void evemu_delete(struct evemu_device *dev) |
| 73 | { | 89 | { |
| 74 | free(dev); | 90 | free(dev); |
