Go to the source code of this file.
Classes | |
| struct | HashAlgo |
| struct | Hash |
Typedefs | |
| typedef unsigned char *(* | HashFn )(const char *path, size_t *len) |
| typedef char *(* | HashDspFn )(unsigned char *hash, size_t len) |
Functions | |
| EXTERN_C_BEGIN LIBGIFTPROTO_EXPORT Hash * | hash_new (HashAlgo *algo, unsigned char *data, size_t len, BOOL copy) |
| LIBGIFTPROTO_EXPORT void | hash_free (Hash *hash) |
| LIBGIFTPROTO_EXPORT Hash * | hash_dup (Hash *hash) |
| LIBGIFTPROTO_EXPORT Hash * | hash_calc (HashAlgo *algo, const char *path) |
| LIBGIFTPROTO_EXPORT char * | hash_dsp (Hash *hash) |
| LIBGIFTPROTO_EXPORT unsigned int | hash_algo_register (struct protocol *p, const char *type, int opt, HashFn algofn, HashDspFn dspfn) |
| LIBGIFTPROTO_EXPORT unsigned int | hash_algo_unregister (struct protocol *p, const char *type) |
| LIBGIFTPROTO_EXPORT HashAlgo * | hash_algo_lookup (const char *type) |
| LIBGIFTPROTO_EXPORT BOOL | share_set_hash (struct file_share *file, const char *type, unsigned char *data, size_t len, BOOL copy) |
| LIBGIFTPROTO_EXPORT Hash * | share_get_hash (struct file_share *file, const char *type) |
| LIBGIFTPROTO_EXPORT void | share_clear_hash (struct file_share *file) |
| LIBGIFTPROTO_EXPORT void | share_foreach_hash (struct file_share *file, DatasetForeachFn func, void *udata) |
| LIBGIFTPROTO_EXPORT unsigned int | share_run_hash (struct file_share *file) |
| LIBGIFTPROTO_EXPORT char * | share_dsp_hash (struct file_share *file, const char *type) |
| LIBGIFTPROTO_EXPORT char * | hashstr_algo (const char *hashstr) |
| LIBGIFTPROTO_EXPORT char * | hashstr_data (const char *hashstr) |
There are really multiple interfaces defined here. The supplementary share interface should be moved into share.[ch] at some time.
|
|
Lookup a currently registered algorithm by name. |
|
||||||||||||||||||||||||
|
Register a new hashing algorithm. See the documentation available at Protocol::hash_handler.
|
|
||||||||||||
|
Unregister a hashing algorithm. This is used when a protocol is unloaded so that we can gracefully update the internal data structure without interfering with currently loaded protocols.
|
|
||||||||||||
|
Calculate a new hash from the supplied algorithm and file path. This is used as a work-around to the structured share_hash API, which requires a constructed FileShare to operate. |
|
|
Convert a calculated hash (see hash_calc) into a NUL-terminated ASCII representation.
|
|
|
Duplicate all entries in a hash object. This includes the original data argument. |
|
|
Destroy the result from hash_new. Please note that this will free the original data argument. |
|
||||||||||||||||||||
|
Raw interface to allocate a new hash object. Please avoid using this directly at all costs.
|
|
|
Given a giFT-specific hash string return a static reference to ALGOTYPE. The protocol has no awareness of this hack, and it is only used to serialize hashes over the interface protocol.
|
|
|
Access the data portion of the hash string. See hashstr_algo.
|
|
|
Clear all hashes associated with the given file. Management of the internal hash memory is dependent on the parameters given to share_set_hash. |
|
||||||||||||
|
Return the ASCII representation of the hash described after lookup. See share_get_hash.
|
|
||||||||||||||||
|
Iterate through all hashes currently associated with this file. Internally uses ::dataset_foreach. |
|
||||||||||||
|
Access the previously set hash. See ::share_hash_set. |
|
|
Build a hash of the supplied file for all currently registered hashing algorithms. Keep in mind that only those primary or local algos will be used here. Secondary algorithms will be used mainly for data integrity.
|
|
||||||||||||||||||||||||
|
Associate a predetermined hashed value with a share object.
|
1.3.7