diff options
author | Patrick McHardy <kaber@trash.net> | 2010-11-14 18:14:24 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-11-14 19:09:33 +0100 |
commit | 582a7d50c70492776d9f1be4a9c9b1cdb0b6103e (patch) | |
tree | 8f41e14b60603a1a85ff5ab5984951602c8d80f6 /src/libdect.c | |
parent | 3c8698333bb75e5d25b5df2a0f9bacd0e1a63f93 (diff) |
libdect: support allocating per-handle private space
Similar to other objects, support a private data area for libdect handles
for applications dealing with multiple handles simultenously.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/libdect.c')
-rw-r--r-- | src/libdect.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libdect.c b/src/libdect.c index cf89591..ea6f37c 100644 --- a/src/libdect.c +++ b/src/libdect.c @@ -31,7 +31,7 @@ static struct dect_handle *dect_alloc_handle(struct dect_ops *ops) if (ops->free == NULL) ops->free = free; - dh = ops->malloc(sizeof(*dh)); + dh = ops->malloc(sizeof(*dh) + ops->priv_size); if (dh == NULL) return NULL; memset(dh, 0, sizeof(*dh)); @@ -92,4 +92,10 @@ void dect_close_handle(struct dect_handle *dh) } EXPORT_SYMBOL(dect_close_handle); +void *dect_handle_priv(struct dect_handle *dh) +{ + return dh->priv; +} +EXPORT_SYMBOL(dect_handle_priv); + /** @} */ |