incremental hashing of files More...
Go to the source code of this file.
Data Structures | |
struct | GNUNET_CRYPTO_FileHashContext |
Context used when hashing a file. More... | |
Macros | |
#define | LOG(kind, ...) |
#define | LOG_STRERROR_FILE(kind, syscall, filename) |
Functions | |
static void | file_hash_finish (struct GNUNET_CRYPTO_FileHashContext *fhc, const struct GNUNET_HashCode *res) |
Report result of hash computation to callback and free associated resources. More... | |
static void | file_hash_task (void *cls) |
File hashing task. More... | |
struct GNUNET_CRYPTO_FileHashContext * | GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority, const char *filename, size_t blocksize, GNUNET_CRYPTO_HashCompletedCallback callback, void *callback_cls) |
Compute the hash of an entire file. More... | |
void | GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc) |
Cancel a file hashing operation. More... | |
incremental hashing of files
Definition in file crypto_hash_file.c.
#define LOG | ( | kind, | |
... | |||
) |
Definition at line 31 of file crypto_hash_file.c.
#define LOG_STRERROR_FILE | ( | kind, | |
syscall, | |||
filename | |||
) |
Definition at line 34 of file crypto_hash_file.c.
|
static |
Report result of hash computation to callback and free associated resources.
Definition at line 108 of file crypto_hash_file.c.
References GNUNET_CRYPTO_FileHashContext::callback, GNUNET_CRYPTO_FileHashContext::callback_cls, GNUNET_CRYPTO_FileHashContext::fh, GNUNET_CRYPTO_FileHashContext::filename, GNUNET_break, GNUNET_DISK_file_close(), GNUNET_DISK_handle_invalid(), GNUNET_free, GNUNET_OK, GNUNET_CRYPTO_FileHashContext::md, and res.
Referenced by file_hash_task().
|
static |
File hashing task.
cls | closure |
Definition at line 126 of file crypto_hash_file.c.
References GNUNET_CRYPTO_FileHashContext::bsize, GNUNET_CRYPTO_FileHashContext::buffer, delta, GNUNET_CRYPTO_FileHashContext::fh, file_hash_finish(), file_hash_task(), GNUNET_CRYPTO_FileHashContext::filename, GNUNET_CRYPTO_FileHashContext::fsize, GNUNET_assert, GNUNET_DISK_file_read(), GNUNET_ERROR_TYPE_WARNING, GNUNET_SCHEDULER_add_with_priority(), LOG_STRERROR_FILE, GNUNET_CRYPTO_FileHashContext::md, GNUNET_CRYPTO_FileHashContext::offset, GNUNET_CRYPTO_FileHashContext::priority, res, and GNUNET_CRYPTO_FileHashContext::task.
Referenced by file_hash_task(), and GNUNET_CRYPTO_hash_file().