s3:registry: add function registry_value_cmp()
[kai/samba.git] / source3 / registry / reg_api_util.c
index 42aaa00c61b1052cec761e2257fd8ec5249a40d8..e86e3e3fc32476a696d5104a09f13ab6b930118a 100644 (file)
@@ -237,3 +237,11 @@ struct registry_value *registry_value_multi_sz(TALLOC_CTX *mem_ctx, const char *
 
        return ret;
 }
+
+int registry_value_cmp(const struct registry_value* v1, const struct registry_value* v2)
+{
+       if (v1->type == v2->type) {
+               return data_blob_cmp(&v1->data, &v2->data);
+       }
+       return v1->type - v2->type;
+}