Logo AND Algorithmique Numérique Distribuée

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