Doc fixes.
[bertos.git] / mware / list.h
old mode 100755 (executable)
new mode 100644 (file)
index 8d89b4d..ddbad8c
@@ -1,9 +1,34 @@
-/*!
+/**
  * \file
  * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction.  Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License.  This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
  * Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
  * Copyright 2001 Bernardo Innocenti <bernie@develer.com>
- * This file is part of DevLib - See README.devlib for information.
+ *
  * -->
  *
  * \version $Id$
  * \brief General pourpose double-linked lists
  */
 
-/*#*
- *#* $Log$
- *#* Revision 1.19  2006/03/20 17:50:29  bernie
- *#* Fix typo.
- *#*
- *#* Revision 1.18  2006/02/27 22:40:21  bernie
- *#* Add support for poor pre-C99 compilers.
- *#*
- *#* Revision 1.17  2006/02/24 01:18:34  bernie
- *#* LIST_ENQUEUE(): New macro; Remove obsolete names.
- *#*
- *#* Revision 1.16  2006/01/23 23:10:38  bernie
- *#* REVERSE_FOREACH_NODE(): New macro; FOREACHNODE(): Rename to FOREACH_NODE.
- *#*
- *#* Revision 1.15  2005/11/04 16:20:02  bernie
- *#* Fix reference to README.devlib in header.
- *#*
- *#* Revision 1.14  2005/07/19 07:25:18  bernie
- *#* Refactor to remove type aliasing problems.
- *#*
- *#* Revision 1.13  2005/04/11 19:10:28  bernie
- *#* Include top-level headers from cfg/ subdir.
- *#*
- *#* Revision 1.12  2005/01/22 04:21:32  bernie
- *#* Add integrity checks.
- *#*
- *#* Revision 1.11  2004/12/31 16:44:11  bernie
- *#* list_remHead(), list_remTail(): Name like normal functions.
- *#*
- *#* Revision 1.10  2004/11/28 23:21:05  bernie
- *#* Remove obsolete INITLIST macro.
- *#*
- *#* Revision 1.9  2004/10/21 09:37:55  bernie
- *#* Revamp documentation.
- *#*
- *#* Revision 1.8  2004/10/19 08:46:34  bernie
- *#* Fix header.
- *#*
- *#* Revision 1.7  2004/08/25 14:12:09  rasky
- *#* Aggiornato il comment block dei log RCS
- *#*
- *#* Revision 1.6  2004/07/30 14:34:10  rasky
- *#* Vari fix per documentazione e commenti
- *#* Aggiunte PP_CATn e STATIC_ASSERT
- *#*
- *#* Revision 1.5  2004/07/20 23:45:01  bernie
- *#* Finally remove redundant protos.
- *#*
- *#* Revision 1.4  2004/07/18 22:12:53  bernie
- *#* Fix warnings with GCC 3.3.2.
- *#*
- *#* Revision 1.3  2004/07/18 22:01:43  bernie
- *#* REMHEAD(), REMTAIL(): Move to list.h as inline functions.
- *#*
- *#* Revision 1.2  2004/06/03 11:27:09  bernie
- *#* Add dual-license information.
- *#*
- *#* Revision 1.1  2004/05/23 15:43:16  bernie
- *#* Import mware modules.
- *#*
- *#*/
 #ifndef MWARE_LIST_H
 #define MWARE_LIST_H
 
 #include <cfg/compiler.h> /* INLINE */
 #include <cfg/debug.h> /* ASSERT() */
 
-/*!
+/**
  * This structure represents a node for bidirectional lists.
  *
  * Data is usually appended to nodes by making them the first
@@ -92,7 +56,7 @@ typedef struct _Node
        struct _Node *pred;
 } Node;
 
-/*!
+/**
  * Head of a doubly-linked list of \c Node structs.
  *
  * Lists must be initialized with LIST_INIT() prior to use.
@@ -117,7 +81,7 @@ typedef struct _PriNode
 } PriNode;
 
 
-/*!
+/**
  * Template for a naked node in a list of \a T structures.
  *
  * To be used as data member in other structures:
@@ -150,11 +114,11 @@ typedef struct _PriNode
 #define DECLARE_NODE_ANON(T) \
        T *succ; T *pred;
 
-/*! Declare a typesafe node for structures of type \a T. */
+/** Declare a typesafe node for structures of type \a T. */
 #define DECLARE_NODE_TYPE(T) \
        typedef struct T##Node { T *succ; T *pred; } T##Node
 
-/*! Template for a list of \a T structures. */
+/** Template for a list of \a T structures. */
 #define DECLARE_LIST_TYPE(T) \
        DECLARE_NODE_TYPE(T); \
        typedef struct T##List { \
@@ -165,14 +129,14 @@ typedef struct _PriNode
 #define NODE_TYPE(T) T##Node
 #define LIST_TYPE(T) T##List
 
-/*!
+/**
  * Get a pointer to the first node in a list.
  *
  * If \a l is empty, result points to l->tail.
  */
 #define LIST_HEAD(l) ((l)->head.succ)
 
-/*!
+/**
  * Get a pointer to the last node in a list.
  *
  * If \a l is empty, result points to l->head.
@@ -186,7 +150,7 @@ typedef struct _PriNode
        #define TYPEOF_OR_VOIDPTR(type) void *
 #endif
 
-/*!
+/**
  * Iterate over all nodes in a list.
  *
  * This macro generates a "for" statement using the following parameters:
@@ -200,7 +164,7 @@ typedef struct _PriNode
                (n) = (TYPEOF_OR_VOIDPTR(n))(((Node *)(n))->succ) \
        )
 
-/*!
+/**
  * Iterate backwards over all nodes in a list.
  *
  * This macro generates a "for" statement using the following parameters:
@@ -214,7 +178,7 @@ typedef struct _PriNode
                (n) = (TYPEOF_OR_VOIDPTR(n))(((Node *)(n))->pred) \
        )
 
-/*! Initialize a list. */
+/** Initialize a list. */
 #define LIST_INIT(l) \
        do { \
                (l)->head.succ = (TYPEOF_OR_VOIDPTR((l)->head.succ)) &(l)->tail; \
@@ -224,7 +188,7 @@ typedef struct _PriNode
        } while (0)
 
 #ifdef _DEBUG
-       /*! Make sure that a list is valid (it was initialized and is not corrupted). */
+       /** Make sure that a list is valid (it was initialized and is not corrupted). */
        #define LIST_ASSERT_VALID(l) \
                do { \
                        Node *n, *pred; \
@@ -247,7 +211,7 @@ typedef struct _PriNode
        #define INVALIDATE_NODE(n) do {} while (0)
 #endif
 
-/*! Add node to list head. */
+/** Add node to list head. */
 #define ADDHEAD(l,n) \
        do { \
                ASSERT(l); \
@@ -258,7 +222,7 @@ typedef struct _PriNode
                (n)->pred->succ = (n); \
        } while (0)
 
-/*! Add node to list tail. */
+/** Add node to list tail. */
 #define ADDTAIL(l,n) \
        do { \
                ASSERT(l); \
@@ -269,7 +233,7 @@ typedef struct _PriNode
                (l)->tail.pred = (n); \
        } while (0)
 
-/*!
+/**
  * Insert node \a n before node \a ln.
  *
  * \note You can't pass in a list header as \a ln, but
@@ -283,7 +247,7 @@ typedef struct _PriNode
                (ln)->pred = (n); \
        } while (0)
 
-/*!
+/**
  * Remove \a n from whatever list it is in.
  *
  * \note Removing a node that has not previously been
@@ -296,7 +260,7 @@ typedef struct _PriNode
                INVALIDATE_NODE(n); \
        } while (0)
 
-/*! Tell whether a list is empty. */
+/** Tell whether a list is empty. */
 #define LIST_EMPTY(l)  ( (void *)((l)->head.succ) == (void *)(&(l)->tail) )
 
 /**
@@ -316,7 +280,7 @@ typedef struct _PriNode
        } while (0)
 
 
-/*!
+/**
  * Unlink a node from the head of the list \a l.
  *
  * \return Pointer to node, or NULL if the list was empty.
@@ -336,7 +300,7 @@ INLINE Node *list_remHead(List *l)
        return n;
 }
 
-/*!
+/**
  * Unlink a node from the tail of the list \a l.
  *
  * \return Pointer to node, or NULL if the list was empty.