summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-12-21 20:38:59 +0100
committerHenrik Rydberg <rydberg@euromail.se>2010-12-21 20:38:59 +0100
commitada89929b3b1489f3e6025db5af5b0971a9982a8 (patch)
treec868aff4409ec56e99c4988d4830773570585937 /src
parent9c9387d12c557b5487ca96a5ad7d56facbe487c6 (diff)
Document the new/delete semantics
There is more to do on documentation, but since these are new, add documentation for them first. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src')
-rw-r--r--src/evemu.c16
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 */
59struct evemu_device *evemu_new(const char *name) 69struct 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 */
72void evemu_delete(struct evemu_device *dev) 88void evemu_delete(struct evemu_device *dev)
73{ 89{
74 free(dev); 90 free(dev);