Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
A few more functions usefull in MSG. They should not be written like functions though...
[simgrid.git] / src / xbt / fifo.c
index 2f191af..3084fa7 100644 (file)
@@ -1,12 +1,16 @@
-/* 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"
 #include "fifo_private.h"
 
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(fifo,xbt,"FIFO");
+
 /*
  * xbt_fifo_new()
  */
@@ -304,4 +308,21 @@ int xbt_fifo_size(xbt_fifo_t f)
   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;
+}
+