annotate src/lib/hash-format.h @ 22664:fea53c2725c0

director: Fix director_max_parallel_moves/kicks type Should be uint, not time.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 09 Nov 2017 12:24:16 +0200
parents d419c6cde162
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12308
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
1 #ifndef HASH_FORMAT_H
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2 #define HASH_FORMAT_H
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 struct hash_format;
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 /* Initialize formatting hash. Format can contain text with %{sha1} style
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 variables. Each hash hash can be also truncated by specifying the number
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8 of bits to truncate to, such as %{sha1:80}. */
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 int hash_format_init(const char *format_string, struct hash_format **format_r,
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 const char **error_r);
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11 /* Add more data to hash. */
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 void hash_format_loop(struct hash_format *format,
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 const void *data, size_t size);
14695
d419c6cde162 hash-format object can now be reset to build multiple hashes.
Timo Sirainen <tss@iki.fi>
parents: 12308
diff changeset
14 /* Finish the hash and write it into given string. */
d419c6cde162 hash-format object can now be reset to build multiple hashes.
Timo Sirainen <tss@iki.fi>
parents: 12308
diff changeset
15 void hash_format_write(struct hash_format *format, string_t *dest);
d419c6cde162 hash-format object can now be reset to build multiple hashes.
Timo Sirainen <tss@iki.fi>
parents: 12308
diff changeset
16 /* Reset hash to initial state. */
d419c6cde162 hash-format object can now be reset to build multiple hashes.
Timo Sirainen <tss@iki.fi>
parents: 12308
diff changeset
17 void hash_format_reset(struct hash_format *format);
12308
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18 /* Write the hash into given string and free used memory. */
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
19 void hash_format_deinit(struct hash_format **format, string_t *dest);
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
20 /* Free used memory without writing to string. */
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
21 void hash_format_deinit_free(struct hash_format **format);
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
22
22689f4ceecb liblib: Added API for easily building hash strings based on given format string and input.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23 #endif