Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s/NULL/nullptr/ in our C++ codebase
[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 #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 #endif                          /* _XBT_FIFO_PRIVATE_H */