3 /* dict_elm - elements of generic dictionnaries */
4 /* This file is not to be loaded from anywhere but dict.c */
6 /* Authors: Martin Quinson */
7 /* Copyright (C) 2003,2004 Martin Quinson. */
9 /* This program is free software; you can redistribute it and/or modify it
10 under the terms of the license (GNU LGPL) which comes with this package. */
12 #ifndef _GRAS_DICT_ELM_T_
13 #define _GRAS_DICT_ELM_T_
15 #include "xbt/sysdep.h"
17 #include "xbt/error.h"
18 #include "xbt/dynar.h"
21 /*####[ Type definition ]####################################################*/
22 typedef struct gras_dictelm_ {
25 int offset; /* offset on the key */
27 void_f_pvoid_t *free_f; /*pointer to the function to call to free this ctn*/
29 gras_dynar_t sub; /* sub */
30 } s_gras_dictelm_t, *gras_dictelm_t;
32 typedef struct gras_dict_ {
33 s_gras_dictelm_t *head;
36 typedef struct gras_dict_cursor_ s_gras_dict_cursor_t;
38 /*####[ Function prototypes ]################################################*/
39 void gras_dictelm_free (s_gras_dictelm_t **pp_elm);
41 void gras_dictelm_set (s_gras_dictelm_t **pp_head,
44 void_f_pvoid_t *free_ctn);
45 void gras_dictelm_set_ext (s_gras_dictelm_t **pp_head,
49 void_f_pvoid_t *free_ctn);
51 gras_error_t gras_dictelm_get (s_gras_dictelm_t *p_head,
53 /* OUT */void **data);
54 gras_error_t gras_dictelm_get_ext (s_gras_dictelm_t *p_head,
57 /* OUT */void **data);
59 gras_error_t gras_dictelm_remove (s_gras_dictelm_t *p_head,
61 gras_error_t gras_dictelm_remove_ext(s_gras_dictelm_t *p_head,
65 void gras_dictelm_dump (s_gras_dictelm_t *p_head,
66 void_f_pvoid_t *output);
68 void gras_dictelm_print_fct (void *data);
70 #endif /* _GRAS_DICT_ELM_T_ */