summaryrefslogtreecommitdiff
path: root/ext/digest/digest.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/digest/digest.h')
-rw-r--r--ext/digest/digest.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/ext/digest/digest.h b/ext/digest/digest.h
index f8c5dd3..6e4906c 100644
--- a/ext/digest/digest.h
+++ b/ext/digest/digest.h
@@ -15,16 +15,18 @@
#include "ruby.h"
-typedef void (*hash_init_func_t)(void *);
-typedef void (*hash_update_func_t)(void *, unsigned char *, size_t);
-typedef void (*hash_finish_func_t)(void *, unsigned char *);
+#define RUBY_DIGEST_API_VERSION 2
+
+typedef void (*rb_digest_hash_init_func_t)(void *);
+typedef void (*rb_digest_hash_update_func_t)(void *, unsigned char *, size_t);
+typedef void (*rb_digest_hash_finish_func_t)(void *, unsigned char *);
typedef struct {
int api_version;
size_t digest_len;
size_t block_len;
size_t ctx_size;
- hash_init_func_t init_func;
- hash_update_func_t update_func;
- hash_finish_func_t finish_func;
-} algo_t;
+ rb_digest_hash_init_func_t init_func;
+ rb_digest_hash_update_func_t update_func;
+ rb_digest_hash_finish_func_t finish_func;
+} rb_digest_metadata_t;