common: make qso_set_hlq_item take a HLQ version

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
3 files changed, 6 insertions(+), 5 deletions(-)

M common/include/hlog/qso-pack.h
M common/qso-pack.c
M edit-qso/edit-qso.c
M common/include/hlog/qso-pack.h +1 -1
@@ 43,7 43,7 @@ extern int qso_unpack_hlq(struct qso *qs
 extern int hlq_parse_header(struct buffer *buf, struct xuuid *uuid_r);
 extern struct val *hlq_parse_kv(struct buffer *buf, int ver, enum qso_ns *ns_r,
 				const char **key_start_r, const char **key_end);
-extern int qso_set_hlq_item(struct qso *qso, enum qso_ns ns,
+extern int qso_set_hlq_item(struct qso *qso, int ver, enum qso_ns ns,
 			    const char *key_start, const char *key_end,
 			    struct val *val);
 

          
M common/qso-pack.c +3 -3
@@ 823,8 823,8 @@ static int __unpack_side_ns(struct qso_s
 	return -ENOENT;
 }
 
-int qso_set_hlq_item(struct qso *qso, enum qso_ns ns, const char *key_start,
-		     const char *key_end, struct val *val)
+int qso_set_hlq_item(struct qso *qso, int ver, enum qso_ns ns,
+		     const char *key_start, const char *key_end, struct val *val)
 {
 	ptrdiff_t keylen;
 	char key[32];

          
@@ 887,7 887,7 @@ int qso_unpack_hlq(struct qso *qso, cons
 		if (IS_ERR(val))
 			return PTR_ERR(val);
 
-		ret = qso_set_hlq_item(qso, ns, key_start, key_end, val);
+		ret = qso_set_hlq_item(qso, ver, ns, key_start, key_end, val);
 		if (ret)
 			return ret;
 	}

          
M edit-qso/edit-qso.c +2 -1
@@ 131,7 131,8 @@ int main(int argc, char **argv)
 			goto err_free;
 		}
 
-		ret = qso_set_hlq_item(qso, ns, key_start, key_end, val);
+		ret = qso_set_hlq_item(qso, HLQ_VERSION_USE_DEFAULT, ns,
+				       key_start, key_end, val);
 		if (ret) {
 			fprintf(stderr, "Error: failed to set item (%s): %s\n",
 				argv[i], xstrerror(ret));