]> git.rkrishnan.org Git - tahoe-lafs/zfec.git/blobdiff - zfec/zfec/fec.h
narrow types of k and m from unsigned to unsigned short
[tahoe-lafs/zfec.git] / zfec / zfec / fec.h
index 6252f5488360c041d2b66738523b0bf32c9fda50..2ebab3249ea61d075826d826b071ea32d8ce9ef6 100644 (file)
@@ -1,5 +1,7 @@
 /**
  * zfec -- fast forward error correction library with Python interface
+ *
+ * See README.txt for documentation.
  */
 
 #include <stddef.h>
@@ -8,7 +10,7 @@ typedef unsigned char gf;
 
 typedef struct {
   unsigned long magic;
-  unsigned k, n;                     /* parameters of the code */
+  unsigned short k, n;                     /* parameters of the code */
   gf* enc_matrix;
 } fec_t;
 
@@ -22,7 +24,7 @@ typedef struct {
  * param k the number of blocks required to reconstruct
  * param m the total number of blocks created
  */
-fec_t* fec_new(unsigned k, unsigned m);
+fec_t* fec_new(unsigned short k, unsigned short m);
 void fec_free(fec_t* p);
 
 /**
@@ -30,11 +32,12 @@ void fec_free(fec_t* p);
  * @param fecs buffers into which the secondary blocks will be written
  * @param block_nums the numbers of the desired check blocks (the id >= k) which fec_encode() will produce and store into the buffers of the fecs parameter
  * @param num_block_nums the length of the block_nums array
+ * @param sz size of a packet in bytes
  */
 void fec_encode(const fec_t* code, const gf*restrict const*restrict const src, gf*restrict const*restrict const fecs, const unsigned*restrict const block_nums, size_t num_block_nums, size_t sz);
 
 /**
- * @param inpkts an array of packets (size k)
+ * @param inpkts an array of packets (size k); If a primary block, i, is present then it must be at index i. Secondary blocks can appear anywhere.
  * @param outpkts an array of buffers into which the reconstructed output packets will be written (only packets which are not present in the inpkts input will be reconstructed and written to outpkts)
  * @param index an array of the blocknums of the packets in inpkts
  * @param sz size of a packet in bytes
@@ -56,7 +59,7 @@ void fec_decode(const fec_t* code, const gf*restrict const*restrict const inpkts
 /**
  * zfec -- fast forward error correction library with Python interface
  * 
- * Copyright (C) 2007 Allmydata, Inc.
+ * Copyright (C) 2007-2008 Allmydata, Inc.
  * Author: Zooko Wilcox-O'Hearn
  * 
  * This file is part of zfec.