Skip to content
Snippets Groups Projects
Commit ea241475 authored by Stephan Bosch's avatar Stephan Bosch Committed by Timo Sirainen
Browse files

lib-sieve: sieve-storage - Add sieve_storage_hash()

parent acb9f90b
No related branches found
No related tags found
No related merge requests found
......@@ -132,6 +132,7 @@ int sieve_storage_setup_bin_path(struct sieve_storage *storage, mode_t mode);
int sieve_storage_cmp(const struct sieve_storage *storage1,
const struct sieve_storage *storage2);
unsigned int sieve_storage_hash(const struct sieve_storage *storage);
/*
* Active script
......
......@@ -4,6 +4,7 @@
#include "lib.h"
#include "array.h"
#include "str-sanitize.h"
#include "hash.h"
#include "home-expand.h"
#include "eacces-error.h"
#include "mkdir-parents.h"
......@@ -854,6 +855,16 @@ int sieve_storage_cmp(const struct sieve_storage *storage1,
return null_strcmp(storage1->location, storage2->location);
}
unsigned int sieve_storage_hash(const struct sieve_storage *storage)
{
unsigned int hash = 0;
hash ^= POINTER_CAST_TO(storage->storage_class, unsigned int);
hash ^= str_hash(storage->location);
return hash;
}
/*
* Script access
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.