[Spice-devel] [cacard] simpletlv: Slight improvement to API documentation

Christophe Fergeau cfergeau at redhat.com
Tue Aug 14 12:41:59 UTC 2018


Document return value of simpletlv_get_length and simpletlv_encode and
fix a few typos.
---
 src/simpletlv.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/simpletlv.h b/src/simpletlv.h
index bf785e4..d12f52d 100644
--- a/src/simpletlv.h
+++ b/src/simpletlv.h
@@ -48,9 +48,11 @@ struct simpletlv_member {
 
 /*
  * Calculate expected length of TLV buffer
- * @param ltv         array of LTV structres to encode
+ * @param ltv         array of TLV structures to encode
  * @param tlvlen      number of members in the array to encode
  * @param buffer_type Encode only tags + lengths, values or both
+ * @return            The length of the data in the TLV record,
+ *                    -1 on errors
  */
 int
 simpletlv_get_length(struct simpletlv_member *, size_t,
@@ -72,12 +74,13 @@ simpletlv_merge(const struct simpletlv_member *a, size_t a_len,
                 const struct simpletlv_member *b, size_t b_len);
 
 /*
- * Encode strucure into SimpleLTV format, TL together with V
+ * Encode structure into SimpleTLV format, TL together with V
  * @param  tlv       array of TLV structures to encode
  * @param  tlvlen    number of members in the array to encode
  * @param  out       Byte array to write into
  * @param  outlen    The length of output array
  * @param  ptr       The end of TLV record
+ * @return           The length of the encoded data, -1 on errors
  */
 int
 simpletlv_encode(struct simpletlv_member *tlv, size_t tlv_len,
-- 
2.17.1



More information about the Spice-devel mailing list