summaryrefslogtreecommitdiff
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
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>
-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)
}
}
+/**
+ * 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);