qse/ase/stx/hash.h

49 lines
1020 B
C
Raw Normal View History

2005-05-08 15:54:44 +00:00
/*
2005-06-08 16:00:51 +00:00
* $Id: hash.h,v 1.9 2005-06-08 16:00:51 bacon Exp $
2005-05-08 15:54:44 +00:00
*/
#ifndef _XP_STX_HASH_H_
#define _XP_STX_HASH_H_
2005-05-10 06:02:19 +00:00
#include <xp/stx/stx.h>
2005-05-18 04:01:51 +00:00
#define XP_STX_PAIRLINK_SIZE 3
#define XP_STX_PAIRLINK_LINK 0
#define XP_STX_PAIRLINK_KEY 1
#define XP_STX_PAIRLINK_VALUE 2
2005-05-22 15:03:20 +00:00
struct xp_stx_pairlink_t
{
xp_stx_objhdr_t header;
2005-06-08 16:00:51 +00:00
xp_word_t link;
xp_word_t key;
xp_word_t value;
2005-05-22 15:03:20 +00:00
};
typedef struct xp_stx_pairlink_t xp_stx_pairlink_t;
2005-05-08 15:54:44 +00:00
#ifdef __cplusplus
extern "C"
#endif
2005-05-15 18:37:00 +00:00
/* hash table manipulation */
2005-06-08 16:00:51 +00:00
xp_word_t xp_stx_new_plink (
xp_stx_t* stx, xp_word_t key, xp_word_t value);
xp_word_t xp_stx_hash_lookup (
xp_stx_t* stx, xp_word_t table,
xp_word_t hash, xp_word_t key);
xp_word_t xp_stx_hash_lookup_symbol (
xp_stx_t* stx, xp_word_t table, const xp_char_t* name);
2005-05-10 06:02:19 +00:00
void xp_stx_hash_insert (
2005-06-08 16:00:51 +00:00
xp_stx_t* stx, xp_word_t table,
xp_word_t hash, xp_word_t key, xp_word_t value);
2005-05-12 15:25:06 +00:00
void xp_stx_hash_traverse (
2005-06-08 16:00:51 +00:00
xp_stx_t* stx, xp_word_t table,
void (*func) (xp_stx_t*,xp_word_t));
2005-05-12 15:25:06 +00:00
2005-05-08 15:54:44 +00:00
#ifdef __cplusplus
}
#endif
#endif