summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2012-05-07 15:43:27 +0200
committerMichael Adam <obnox@samba.org>2012-06-26 19:57:19 +0200
commite78d647ebcdd353af3c270903b88d08ab5004a28 (patch)
treedd3a05f3b31b0265e392fd25a8b7a22244c82784 /source3
parent69add7e4fd64c0fc264414991e2d7b0edee09aed (diff)
downloadsamba-e78d647ebcdd353af3c270903b88d08ab5004a28.tar.gz
samba-e78d647ebcdd353af3c270903b88d08ab5004a28.tar.bz2
samba-e78d647ebcdd353af3c270903b88d08ab5004a28.zip
s3:registry: add function registry_value_cmp()
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/registry/reg_api_util.c8
-rw-r--r--source3/registry/reg_api_util.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/source3/registry/reg_api_util.c b/source3/registry/reg_api_util.c
index 42aaa00c61..e86e3e3fc3 100644
--- a/source3/registry/reg_api_util.c
+++ b/source3/registry/reg_api_util.c
@@ -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;
+}
diff --git a/source3/registry/reg_api_util.h b/source3/registry/reg_api_util.h
index 7009794beb..b5ce0fdbe4 100644
--- a/source3/registry/reg_api_util.h
+++ b/source3/registry/reg_api_util.h
@@ -44,4 +44,6 @@ struct registry_value *registry_value_dw(TALLOC_CTX *mem_ctx, uint32_t dw);
struct registry_value *registry_value_sz(TALLOC_CTX *mem_ctx, const char *str);
struct registry_value *registry_value_multi_sz(TALLOC_CTX *mem_ctx, const char **str);
+int registry_value_cmp(const struct registry_value *v1, const struct registry_value *v2);
+
#endif /* _REG_API_UTIL_H */