Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
- Reput hook for raw sockets, needed for BW experiments
[simgrid.git] / src / xbt / dict_private.h
1 /* $Id$ */
2
3 /* dict_elm - elements of generic dictionnaries                             */
4 /* This file is not to be loaded from anywhere but dict.c                   */
5
6 /* Authors: Martin Quinson                                                  */
7 /* Copyright (C) 2003,2004 Martin Quinson.                                  */
8
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. */
11
12 #ifndef _GRAS_DICT_ELM_T_
13 #define _GRAS_DICT_ELM_T_
14
15 /*####[ Type definition ]####################################################*/
16 typedef struct gras_dictelm_ {
17   char           *key;
18   int             key_len;
19   int             offset; /* offset on the key */
20   void           *content;
21   void_f_pvoid_t *free_ctn; /*pointer to the function to call to free this ctn*/
22
23   gras_dynar_t   *sub; /* sub */
24 } gras_dictelm_t;
25
26 struct gras_dict_ {
27   gras_dictelm_t *head;
28 };
29
30 /*####[ Function prototypes ]################################################*/
31 void         gras_dictelm_free      (gras_dictelm_t **pp_elm);
32
33 gras_error_t gras_dictelm_set       (gras_dictelm_t **pp_head,
34                                      const char      *_key,
35                                      void            *data,
36                                      void_f_pvoid_t  *free_ctn);
37 gras_error_t gras_dictelm_set_ext   (gras_dictelm_t **pp_head,
38                                      const char      *_key,
39                                      int              key_len,
40                                      void            *data,
41                                      void_f_pvoid_t  *free_ctn);
42
43 gras_error_t gras_dictelm_get       (gras_dictelm_t *p_head,
44                                      const char     *key,
45                                      /* OUT */void **data);
46 gras_error_t gras_dictelm_get_ext   (gras_dictelm_t *p_head,
47                                      const char     *key,
48                                      int             key_len,
49                                      /* OUT */void **data);
50
51 gras_error_t gras_dictelm_remove    (gras_dictelm_t *p_head,
52                                      const char  *key);
53 gras_error_t gras_dictelm_remove_ext(gras_dictelm_t *p_head,
54                                        const char  *key,
55                                        int          key_len);
56
57 gras_error_t gras_dictelm_dump      (gras_dictelm_t *p_head,
58                                      void_f_pvoid_t *output);
59
60 void         gras_dictelm_print_fct (void *data);
61
62 #endif  /* _GRAS_DICT_ELM_T_ */
63