Ruby  2.5.0dev(2017-10-22revision60238)
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)
 

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); \
}
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); \
}
int size
Definition: encoding.c:57
const char * name
Definition: nkf.c:208

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.

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.