Ruby: ext/digest/digest.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Typedefs
digest.h File Reference
`#include "ruby.h"`

Go to the source code of this file.

## Data Structures
struct | rb_digest_metadata_t

## Macros
#define | RUBY_DIGEST_API_VERSION 3
#define | DEFINE_UPDATE_FUNC_FOR_UINT(name)
#define | DEFINE_FINISH_FUNC_FROM_FINAL(name)
#define | RUBY_UNTYPED_DATA_WARNING 0

## Typedefs
typedef int(* | rb_digest_hash_init_func_t) (void *)
typedef void(* | rb_digest_hash_update_func_t) (void *, unsigned char *, size_t)
typedef int(* | rb_digest_hash_finish_func_t) (void *, unsigned char *)

## Macro Definition Documentation

## ◆ DEFINE_FINISH_FUNC_FROM_FINAL

#define DEFINE_FINISH_FUNC_FROM_FINAL | ( |  | name | ) |

Value:
int \
rb_digest_##name##_finish(void *ctx, unsigned char *ptr) \
{ \
return name##_Final(ptr, ctx); \
}
ptr
struct RIMemo * ptr
Definition: debug.c:88
name
const char * name
Definition: nkf.c:208

Definition at line 46 of file digest.h.

## ◆ DEFINE_UPDATE_FUNC_FOR_UINT

#define DEFINE_UPDATE_FUNC_FOR_UINT | ( |  | name | ) |

Value:
void \
rb_digest_##name##_update(void *ctx, unsigned char *ptr, size_t size) \
{ \
const unsigned int stride = 16384; \
\
for (; size > stride; size -= stride, ptr += stride) { \
name##_Update(ctx, ptr, stride); \
} \
if (size > 0) name##_Update(ctx, ptr, size); \
}
size
voidpf void uLong size
Definition: ioapi.h:138

Definition at line 34 of file digest.h.

## ◆ RUBY_DIGEST_API_VERSION

#define RUBY_DIGEST_API_VERSION 3

Definition at line 18 of file digest.h.

## ◆ RUBY_UNTYPED_DATA_WARNING

#define RUBY_UNTYPED_DATA_WARNING 0

## Typedef Documentation

## ◆ rb_digest_hash_finish_func_t

typedef int(* rb_digest_hash_finish_func_t) (void *, unsigned char *)

Definition at line 22 of file digest.h.

## ◆ rb_digest_hash_init_func_t

typedef int(* rb_digest_hash_init_func_t) (void *)

Definition at line 20 of file digest.h.

## ◆ rb_digest_hash_update_func_t

typedef void(* rb_digest_hash_update_func_t) (void *, unsigned char *, size_t)

Definition at line 21 of file digest.h.