diff options
author | Mattias Andrée <maandree@kth.se> | 2024-09-12 17:58:24 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-09-12 17:58:24 +0200 |
commit | 833db35626bc6a57a21529c31605540ce1337686 (patch) | |
tree | be537e4b5ba5d7abf79d9cdb1b611ce58b18e80c /libhashsum.h | |
parent | Add relative_performance (diff) | |
download | libhashsum-833db35626bc6a57a21529c31605540ce1337686.tar.gz libhashsum-833db35626bc6a57a21529c31605540ce1337686.tar.bz2 libhashsum-833db35626bc6a57a21529c31605540ce1337686.tar.xz |
Replace relative_performance with libhashsum_get_relative_performance
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libhashsum.h')
-rw-r--r-- | libhashsum.h | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/libhashsum.h b/libhashsum.h index 7673a74..01d8fbd 100644 --- a/libhashsum.h +++ b/libhashsum.h @@ -9,10 +9,12 @@ # define LIBHASHSUM_USERET_ __attribute__((__warn_unused_result__)) # define LIBHASHSUM_1_NONNULL_ __attribute__((__nonnull__(1))) # define LIBHASHSUM_NONNULL_ __attribute__((__nonnull__)) +# define LIBHASHSUM_PURE_ __attribute__((__pure__)) #else # define LIBHASHSUM_USERET_ # define LIBHASHSUM_1_NONNULL_ # define LIBHASHSUM_NONNULL_ +# define LIBHASHSUM_PURE_ #endif @@ -481,18 +483,6 @@ struct libhashsum_hasher { unsigned char hash_excess_bits; /* TODO test */ /** - * Estimate, approximate performance relative to - * some unspecified reference point - * - * Higher is faster - * - * If the value is zero, no estimate is available - * - * @since 1.1 - */ - uint64_t relative_performance; /* TODO man */ - - /** * Update the hash state given additional * input data * @@ -697,6 +687,22 @@ LIBHASHSUM_NONNULL_ int libhashsum_init_hasher_from_string(struct libhashsum_hasher *this, const char *algorithm); /** + * Get an estimate, approximate performance relative, + * to some unspecified reference point, for a configured + * hash function + * + * Higher is faster + * + * @param this The hash function details + * @return Estimate, approximate performance value, + * 0 no estimate is available + * + * @since 1.1 + */ +LIBHASHSUM_NONNULL_ LIBHASHSUM_PURE_ +uint64_t libhashsum_get_relative_performance(struct libhashsum_hasher *this); + +/** * Create an initialised state for MD2 * hashing and return hash functions and details * |