diff options
Diffstat (limited to 'src/libdcache/dcache_get_data.c')
-rw-r--r-- | src/libdcache/dcache_get_data.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libdcache/dcache_get_data.c b/src/libdcache/dcache_get_data.c new file mode 100644 index 0000000..f14977c --- /dev/null +++ b/src/libdcache/dcache_get_data.c @@ -0,0 +1,16 @@ +/* ISC license. */ + +#include <stdint.h> + +#include <skalibs/uint16.h> + +#include <shibari/dcache.h> + +void dcache_get_data (dcache *z, uint32_t nid, dcache_string *data) +{ + dcache_node *node = DNODE(z, nid) ; + uint16_t qlen ; + uint16_unpack_big(node->sa.s + 2, &qlen) ; + data->s = node->sa.s + 4 + qlen ; + data->len = node->sa.len - qlen - 4 ; +} |