2005-07-18 11:53:01 +00:00
|
|
|
/*
|
2007-03-22 11:19:28 +00:00
|
|
|
* $Id: dict.h,v 1.5 2007-03-22 11:19:28 bacon Exp $
|
2005-07-18 11:53:01 +00:00
|
|
|
*/
|
|
|
|
|
2007-03-22 11:19:28 +00:00
|
|
|
#ifndef _ASE_STX_DICT_H_
|
|
|
|
#define _ASE_STX_DICT_H_
|
2005-07-18 11:53:01 +00:00
|
|
|
|
2007-03-22 11:19:28 +00:00
|
|
|
#include <ase/stx/stx.h>
|
2005-07-18 11:53:01 +00:00
|
|
|
|
2007-03-22 11:19:28 +00:00
|
|
|
#define ASE_STX_ASSOCIATION_SIZE 2
|
|
|
|
#define ASE_STX_ASSOCIATION_KEY 0
|
|
|
|
#define ASE_STX_ASSOCIATION_VALUE 1
|
2005-07-18 11:53:01 +00:00
|
|
|
|
2007-03-22 11:19:28 +00:00
|
|
|
struct ase_stx_association_t
|
2005-07-18 11:53:01 +00:00
|
|
|
{
|
2007-03-22 11:19:28 +00:00
|
|
|
ase_stx_objhdr_t header;
|
|
|
|
ase_word_t key;
|
|
|
|
ase_word_t value;
|
2005-07-18 11:53:01 +00:00
|
|
|
};
|
|
|
|
|
2007-03-22 11:19:28 +00:00
|
|
|
typedef struct ase_stx_association_t ase_stx_association_t;
|
2005-07-18 11:53:01 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
#endif
|
|
|
|
|
2007-03-22 11:19:28 +00:00
|
|
|
ase_word_t ase_stx_dict_lookup (
|
|
|
|
ase_stx_t* stx, ase_word_t dict, const ase_char_t* key);
|
|
|
|
ase_word_t ase_stx_dict_get (
|
|
|
|
ase_stx_t* stx, ase_word_t dict, ase_word_t key);
|
|
|
|
ase_word_t ase_stx_dict_put (
|
|
|
|
ase_stx_t* stx, ase_word_t dict, ase_word_t key, ase_word_t value);
|
|
|
|
void ase_stx_dict_traverse (
|
|
|
|
ase_stx_t* stx, ase_word_t dict,
|
|
|
|
void (*func) (ase_stx_t*,ase_word_t,void*), void* data);
|
2005-07-19 12:08:04 +00:00
|
|
|
|
2005-07-18 11:53:01 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|