summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTushar Gohad <tushar.gohad@intel.com>2014-07-20 16:58:31 -0700
committerTushar Gohad <tushar.gohad@intel.com>2014-07-21 01:14:56 -0700
commitaf4279dfb20237bd21159927a8037d7e25898a22 (patch)
treeda74008eedfd574b57cc866e3388f2bf6590ee97 /include
parentbf219bde4f8decf64de52f46cc9af3eae513edf6 (diff)
downloadliberasurecode-af4279dfb20237bd21159927a8037d7e25898a22.tar.gz
Update encode API so liberasurecode allocates all memory
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/erasurecode/erasurecode.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/erasurecode/erasurecode.h b/include/erasurecode/erasurecode.h
index c92c9e4..6b00ce4 100644
--- a/include/erasurecode/erasurecode.h
+++ b/include/erasurecode/erasurecode.h
@@ -130,13 +130,19 @@ int liberasurecode_instance_destroy(int desc);
* from liberasurecode_instance_create()
* @param orig_data - data to encode
* @param orig_data_size - length of data to encode
- * @param encoded_data - to return k data fragments
- * @param encoded_parity - to return m parity fragments
+ * @param encoded_data - pointer to _output_ array (char **) of k data
+ * fragments (char *), allocated by the callee
+ * @param encoded_parity - pointer to _output_ array (char **) of m parity
+ * fragments (char *), allocated by the callee
+ * @param fragment_len - pointer to _output_ length of each fragment, assuming
+ * all fragments are the same length
+ *
* @return 0 on success, -error code otherwise
*/
int liberasurecode_encode(int desc,
const char *orig_data, uint64_t orig_data_size, /* input */
- char **encoded_data, char **encoded_parity); /* output */
+ char ***encoded_data, char ***encoded_parity, /* output */
+ uint64_t *fragment_len); /* output */
/**
* Reconstruct original data from a set of k encoded fragments
@@ -146,8 +152,8 @@ int liberasurecode_encode(int desc,
* @param fragments - erasure encoded fragments (> = k)
* @param num_fragments - number of fragments being passed in
* @param fragment_len - length of each fragment (assume they are the same)
- * @param out_data - output of decode
- * @param out_data_len - length of decoded output
+ * @param out_data - _output_ pointer to decoded data
+ * @param out_data_len - _output_ length of decoded output
* @return 0 on success, -error code otherwise
*/
int liberasurecode_decode(int desc,