diff options
author | Antony Dovgal <tony2001@php.net> | 2008-04-21 15:37:46 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2008-04-21 15:37:46 +0000 |
commit | 7c98e674b59ae0bd2a2b146d34df2a4c176cfa14 (patch) | |
tree | 9aa562ffa4ec1f45636a034006f86916f9952364 /ext/hash/hash_crc32.c | |
parent | 30437c12411a2ee8d6966d1a8197bd48847f3036 (diff) | |
download | php-git-7c98e674b59ae0bd2a2b146d34df2a4c176cfa14.tar.gz |
[DOC] add hash_copy() to be able to copy hash resource
Diffstat (limited to 'ext/hash/hash_crc32.c')
-rw-r--r-- | ext/hash/hash_crc32.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/hash/hash_crc32.c b/ext/hash/hash_crc32.c index 481c2c827e..ccc6de3b0d 100644 --- a/ext/hash/hash_crc32.c +++ b/ext/hash/hash_crc32.c @@ -56,10 +56,17 @@ PHP_HASH_API void PHP_CRC32Final(unsigned char digest[4], PHP_CRC32_CTX *context context->state = 0; } +PHP_HASH_API int PHP_CRC32Copy(const php_hash_ops *ops, PHP_CRC32_CTX *orig_context, PHP_CRC32_CTX *copy_context) +{ + copy_context->state = orig_context->state; + return SUCCESS; +} + const php_hash_ops php_hash_crc32_ops = { (php_hash_init_func_t) PHP_CRC32Init, (php_hash_update_func_t) PHP_CRC32Update, (php_hash_final_func_t) PHP_CRC32Final, + (php_hash_copy_func_t) PHP_CRC32Copy, 4, /* what to say here? */ 4, sizeof(PHP_CRC32_CTX) @@ -69,6 +76,7 @@ const php_hash_ops php_hash_crc32b_ops = { (php_hash_init_func_t) PHP_CRC32Init, (php_hash_update_func_t) PHP_CRC32BUpdate, (php_hash_final_func_t) PHP_CRC32Final, + (php_hash_copy_func_t) PHP_CRC32Copy, 4, /* what to say here? */ 4, sizeof(PHP_CRC32_CTX) |