Changeset 8f466fc in mainline for uspace/lib/c/include/adt/list.h


Ignore:
Timestamp:
2011-05-13T14:48:09Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e0f52bf
Parents:
56273bb
Message:

cstyle (no change in functionality)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/list.h

    r56273bb r8f466fc  
    4747 *
    4848 * @param name Name of the new statically allocated list.
     49 *
    4950 */
    5051#define LIST_INITIALIZE(name)  link_t name = { \
     
    5859 *
    5960 * @param link Pointer to link_t structure to be initialized.
     61 *
    6062 */
    6163static inline void link_initialize(link_t *link)
     
    7072 *
    7173 * @param head Pointer to link_t structure representing head of the list.
     74 *
    7275 */
    7376static inline void list_initialize(link_t *head)
     
    8386 * @param link Pointer to link_t structure to be added.
    8487 * @param head Pointer to link_t structure representing head of the list.
     88 *
    8589 */
    8690static inline void list_prepend(link_t *link, link_t *head)
     
    98102 * @param link Pointer to link_t structure to be added.
    99103 * @param head Pointer to link_t structure representing head of the list.
     104 *
    100105 */
    101106static inline void list_append(link_t *link, link_t *head)
     
    123128 * Remove item from doubly-linked circular list.
    124129 *
    125  * @param link Pointer to link_t structure to be removed from the list it is contained in.
     130 * @param link Pointer to link_t structure to be removed from the list
     131 *             it is contained in.
     132 *
    126133 */
    127134static inline void list_remove(link_t *link)
     
    137144 *
    138145 * @param head Pointer to link_t structure representing head of the list.
     146 *
    139147 */
    140148static inline int list_empty(link_t *head)
     
    142150        return ((head->next == head) ? 1 : 0);
    143151}
    144 
    145152
    146153/** Split or concatenate headless doubly-linked circular list
     
    151158 * concatenates splitted lists and splits concatenated lists.
    152159 *
    153  * @param part1 Pointer to link_t structure leading the first (half of the headless) list.
    154  * @param part2 Pointer to link_t structure leading the second (half of the headless) list.
     160 * @param part1 Pointer to link_t structure leading the first
     161 *              (half of the headless) list.
     162 * @param part2 Pointer to link_t structure leading the second
     163 *              (half of the headless) list.
     164 *
    155165 */
    156166static inline void headless_list_split_or_concat(link_t *part1, link_t *part2)
     
    165175}
    166176
    167 
    168177/** Split headless doubly-linked circular list
    169178 *
    170179 * Split headless doubly-linked circular list.
    171180 *
    172  * @param part1 Pointer to link_t structure leading the first half of the headless list.
    173  * @param part2 Pointer to link_t structure leading the second half of the headless list.
     181 * @param part1 Pointer to link_t structure leading
     182 *              the first half of the headless list.
     183 * @param part2 Pointer to link_t structure leading
     184 *              the second half of the headless list.
     185 *
    174186 */
    175187static inline void headless_list_split(link_t *part1, link_t *part2)
     
    182194 * Concatenate two headless doubly-linked circular lists.
    183195 *
    184  * @param part1 Pointer to link_t structure leading the first headless list.
    185  * @param part2 Pointer to link_t structure leading the second headless list.
     196 * @param part1 Pointer to link_t structure leading
     197 *              the first headless list.
     198 * @param part2 Pointer to link_t structure leading
     199 *              the second headless list.
     200 *
    186201 */
    187202static inline void headless_list_concat(link_t *part1, link_t *part2)
     
    190205}
    191206
    192 #define list_get_instance(link, type, member)  ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member))))
     207#define list_get_instance(link, type, member) \
     208        ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member))))
    193209
    194210extern int list_member(const link_t *link, const link_t *head);
Note: See TracChangeset for help on using the changeset viewer.