Changeset 7dd2561 in mainline for generic/include/list.h


Ignore:
Timestamp:
2005-12-15T15:24:52Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
80d2bdb
Parents:
dc747e3
Message:

Add LIST_INITIALIZE() macro to declare and initialize statically allocated lists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/include/list.h

    rdc747e3 r7dd2561  
    3333#include <typedefs.h>
    3434
     35/** Doubly linked list head and link type. */
    3536struct link {
    36         link_t *prev;
    37         link_t *next;
     37        link_t *prev;   /**< Pointer to the previous item in the list. */
     38        link_t *next;   /**< Pointer to the next item in the list. */
    3839};
     40
     41/** Declare and initialize statically allocated list.
     42 *
     43 * @param name Name of the new statically allocated list.
     44 */
     45#define LIST_INITIALIZE(name)           link_t name = { .prev = &name, .next = &name }
    3946
    4047/** Initialize doubly-linked circular list link
Note: See TracChangeset for help on using the changeset viewer.