3 /* dict_elm - elements of generic dictionnaries */
4 /* This file is not to be loaded from anywhere but dict.c */
6 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */
8 /* This program is free software; you can redistribute it and/or modify it
9 * under the terms of the license (GNU LGPL) which comes with this package. */
11 #ifndef _XBT_DICT_ELM_T_
12 #define _XBT_DICT_ELM_T_
14 #include "xbt/sysdep.h"
16 #include "xbt/error.h"
17 #include "xbt/dynar.h"
20 /*####[ Type definition ]####################################################*/
21 typedef struct xbt_dictelm_ {
24 int offset; /* offset on the key */
26 void_f_pvoid_t *free_f; /*pointer to the function to call to free this ctn*/
28 xbt_dynar_t sub; /* sub */
29 } s_xbt_dictelm_t, *xbt_dictelm_t;
31 typedef struct xbt_dict_ {
32 s_xbt_dictelm_t *head;
35 typedef struct xbt_dict_cursor_ s_xbt_dict_cursor_t;
37 /*####[ Function prototypes ]################################################*/
38 void xbt_dictelm_free (s_xbt_dictelm_t **pp_elm);
40 void xbt_dictelm_set (s_xbt_dictelm_t **pp_head,
43 void_f_pvoid_t *free_ctn);
44 void xbt_dictelm_set_ext (s_xbt_dictelm_t **pp_head,
48 void_f_pvoid_t *free_ctn);
50 xbt_error_t xbt_dictelm_get (s_xbt_dictelm_t *p_head,
52 /* OUT */void **data);
53 xbt_error_t xbt_dictelm_get_ext (s_xbt_dictelm_t *p_head,
56 /* OUT */void **data);
58 xbt_error_t xbt_dictelm_remove (s_xbt_dictelm_t *p_head,
60 xbt_error_t xbt_dictelm_remove_ext(s_xbt_dictelm_t *p_head,
64 void xbt_dictelm_dump (s_xbt_dictelm_t *p_head,
65 void_f_pvoid_t *output);
67 void xbt_dictelm_print_fct (void *data);
69 #endif /* _XBT_DICT_ELM_T_ */