Logo Search packages:      
Sourcecode: ion3 version File versions  Download package

llist.h

/*
 * ion/ioncore/llist.h
 *
 * Copyright (c) Tuomo Valkonen 2005-2007. 
 * 
 * Ion is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 */

#ifndef ION_IONCORE_LLIST_H
#define ION_IONCORE_LLIST_H

#include <limits.h>

#include "mplex.h"
#include "mplexpholder.h"
#include "extlconv.h"
#include "stacking.h"


DECLSTRUCT(WLListNode){
    WLListNode *next, *prev;
    WMPlexPHolder *phs;
    WStacking *st;
};

typedef WLListNode *WLListIterTmp;


#define FOR_ALL_NODES_ON_LLIST(NODE, LL, TMP) \
    FOR_ALL_ITER(llist_iter_init, llist_iter, NODE, LL, &(TMP))

#define FOR_ALL_REGIONS_ON_LLIST(NODE, LL, TMP) \
    FOR_ALL_ITER(llist_iter_init, llist_iter_regions, NODE, LL, &(TMP))


extern void llist_iter_init(WLListIterTmp *tmp, WLListNode *llist);
extern WLListNode *llist_iter(WLListIterTmp *tmp);
extern WRegion *llist_iter_regions(WLListIterTmp *tmp);
extern WLListNode *llist_nth_node(WLListNode *list, uint n);
extern ExtlTab llist_to_table(WLListNode *list);
extern void llist_link_after(WLListNode **list, 
                             WLListNode *after, WLListNode *node);
extern void llist_link_last(WLListNode **list, WLListNode *node);
extern WLListNode *llist_index_to_after(WLListNode *list, 
                                        WLListNode *current,
                                        int index);
extern void llist_unlink(WLListNode **list, WLListNode *node);

#define LLIST_INDEX_LAST              (-1)
#define LLIST_INDEX_AFTER_CURRENT     (-2)
#define LLIST_INDEX_AFTER_CURRENT_ACT (-3)

#endif /* ION_IONCORE_LLIST_H */

Generated by  Doxygen 1.6.0   Back to index