Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add the possibility to remove an item in the middle of the list.
[simgrid.git] / src / xbt / fifo_private.h
1 /* Authors: Arnaud Legrand                                                  */
2
3 /* This program is free software; you can redistribute it and/or modify it
4    under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef _XBT_FIFO_PRIVATE_H
7 #define _XBT_FIFO_PRIVATE_H
8 #include "xbt/fifo.h"
9
10 /* Bucket structure */
11 typedef struct xbt_fifo_item {
12   void *content;
13   struct xbt_fifo_item *next;
14   struct xbt_fifo_item *prev;
15 } s_xbt_fifo_item_t;
16
17 /* FIFO structure */
18 typedef struct xbt_fifo {
19   int count;
20   xbt_fifo_item_t head;
21   xbt_fifo_item_t tail;
22 } s_xbt_fifo_t;
23
24
25 #define xbt_fifo_getFirstitem(l) ((l)?(l)->head:NULL)
26 #define xbt_fifo_getNextitem(i) ((i)?(i)->next:NULL)
27 #define xbt_fifo_getPrevitem(i) ((i)?(i)->prev:NULL)
28 #define xbt_fifo_getItemcontent(i) ((i)?(i)->content:NULL)
29 #define xbt_fifo_Itemcontent(i) ((i)->content)
30 #define xbt_fifo_setItemcontent(i,v) (i->content=v)
31
32
33 /* static __inline__ xbt_fifo_item_t xbt_fifo_getFirstitem(xbt_fifo_t l) */
34 /* { */
35 /*   return l->head; */
36 /* } */
37 /* static __inline__ xbt_fifo_item_t xbt_fifo_getNextitem(xbt_fifo_item_t i)  */
38 /* { */
39 /*   if(i) return i->next; */
40 /*   return NULL; */
41 /* } */
42 /* static __inline__ xbt_fifo_item_t xbt_fifo_getPrevitem(xbt_fifo_item_t i) */
43 /* { */
44 /*   if(i) return i->prev; */
45 /*   return NULL; */
46 /* } */
47
48 #endif                          /* _XBT_FIFO_PRIVATE_H */