diff options
author | Henrik Rydberg <rydberg@bitmath.org> | 2010-12-21 20:43:07 +0100 |
---|---|---|
committer | Henrik Rydberg <rydberg@bitmath.org> | 2010-12-21 20:43:07 +0100 |
commit | 4ed945b6d8f3035dd5beaff3f331e9c06fef6ee2 (patch) | |
tree | c868aff4409ec56e99c4988d4830773570585937 /src | |
parent | ad3b7453ccb1abf1284a0ee32e81d35abb8991a1 (diff) |
Document the new/delete semantics
There is more to do on documentation, but since these are new,
add documentation for them first.
Diffstat (limited to 'src')
-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) } } +/** + * evemu_new() - allocate a new evemu device + * @name: wanted input device name (or NULL to leave empty) + * + * This function allocates a new evemu device structure and + * initializes all fields to zero. If name is non-null and the length + * is sane, it is copied to the device name. + * + * Returns NULL in case of memory failure. + */ struct evemu_device *evemu_new(const char *name) { struct evemu_device *dev = calloc(1, sizeof(struct evemu_device)); @@ -69,6 +79,12 @@ struct evemu_device *evemu_new(const char *name) return dev; } +/** + * evemu_delete() - free and allocated evemu device + * @dev: the device to free + * + * The device pointer is invalidated by this call. + */ void evemu_delete(struct evemu_device *dev) { free(dev); |