-/* Authors: Arnaud Legrand */
+/* $Id$ */
+
+/* Copyright (c) 2004 Arnaud Legrand. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
- under the terms of the license (GNU LGPL) which comes with this package. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt/sysdep.h"
#include "xbt/error.h"
xbt_fifo_item_t item;
void *content;
- item = xbt_fifo_pop_item(l);
- if(item==NULL) return NULL;
+ if(l==NULL) return NULL;
+ if(!(item = xbt_fifo_pop_item(l))) return NULL;
content = item->content;
xbt_fifo_freeitem(item);
xbt_fifo_item_t item;
void *content;
- item = xbt_fifo_shift_item(l);
if(l==NULL) return NULL;
-
+ if(!(item = xbt_fifo_shift_item(l))) return NULL;
+
content = item->content;
xbt_fifo_freeitem(item);
return content;
return f->count;
}
+xbt_fifo_item_t xbt_fifo_getFirstItem(xbt_fifo_t l)
+{
+ return l->head;
+}
+
+xbt_fifo_item_t xbt_fifo_getNextItem(xbt_fifo_item_t i)
+{
+ if(i) return i->next;
+ return NULL;
+}
+
+xbt_fifo_item_t xbt_fifo_getPrevItem(xbt_fifo_item_t i)
+{
+ if(i) return i->prev;
+ return NULL;
+}
+