Logo AND Algorithmique Numérique Distribuée

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