Hash :
1d5f8354
Author :
Thomas de Grivel
Date :
2023-01-03T12:46:52
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
/* c3
* Copyright 2022 kmx.io <contact@kmx.io>
*
* Permission is hereby granted to use this software excepted
* on Apple computers granted the above copyright notice and
* this permission paragraph are included in all copies and
* substantial portions of this software.
*
* THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
* PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
* AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef HASH_H
#define HASH_H
#include "types.h"
#define HASH_UPDATE_PROTOTYPE(type) \
void hash_update_##type (t_hash *hash, type x)
void hash_clean (t_hash *hash);
void hash_init (t_hash *hash);
uw hash_to_uw (t_hash *hash);
u64 hash_to_u64 (t_hash *hash);
void hash_update (t_hash *hash, const void *data, uw size);
void hash_update_1 (t_hash *hash, const s8 *p);
void hash_update_bool (t_hash *hash, e_bool b);
void hash_update_call (t_hash *hash, const s_call *call);
void hash_update_fact (t_hash *hash, const s_fact *fact);
HASH_UPDATE_PROTOTYPE(f32);
HASH_UPDATE_PROTOTYPE(f64);
void hash_update_ident (t_hash *hash, const s_ident *ident);
void hash_update_integer (t_hash *hash, const s_integer *i);
void hash_update_list (t_hash *hash, const s_list *list);
void hash_update_ptag (t_hash *hash, const p_tag ptag);
void hash_update_quote (t_hash *hash, const p_quote x);
HASH_UPDATE_PROTOTYPE(s8);
HASH_UPDATE_PROTOTYPE(s16);
HASH_UPDATE_PROTOTYPE(s32);
HASH_UPDATE_PROTOTYPE(s64);
void hash_update_str (t_hash *hash, const s_str *src);
void hash_update_sym (t_hash *hash, const s_sym *sym);
void hash_update_tag (t_hash *hash, const s_tag *tag);
void hash_update_tuple (t_hash *hash, const s_tuple *tuple);
HASH_UPDATE_PROTOTYPE(u8);
HASH_UPDATE_PROTOTYPE(u16);
HASH_UPDATE_PROTOTYPE(u32);
HASH_UPDATE_PROTOTYPE(u64);
#endif /* HASH_H */