Logo Search packages:      
Sourcecode: ion3 version File versions


 * ion/ioncore/llist.c
 * Copyright (c) Tuomo Valkonen 1999-2006. 
 * 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.

#include "common.h"
#include "llist.h"

/*{{{ WMPlex numbered/mut.ex. list stuff */

void llist_iter_init(WLListIterTmp *tmp, WLListNode *llist)

WLListNode *llist_iter(WLListIterTmp *tmp)
    WLListNode *mgd=*tmp;
    return mgd;

WRegion *llist_iter_regions(WLListIterTmp *tmp)
    WLListNode *lnode=llist_iter(tmp);
    return (lnode==NULL ? NULL : lnode->st->reg);

WLListNode *llist_nth_node(WLListNode *list, uint n)
    WLListIterTmp tmp;
    llist_iter_init(&tmp, list);
    return (WLListNode*)iterable_nth(n, (VoidIterator*)llist_iter, &tmp);

void llist_link_after(WLListNode **list, 
                      WLListNode *after, WLListNode *node)
        LINK_ITEM_AFTER(*list, after, node, next, prev);
        LINK_ITEM_FIRST(*list, node, next, prev);

void llist_link_last(WLListNode **list, WLListNode *node)
    LINK_ITEM_LAST(*list, node, next, prev);

WLListNode *llist_index_to_after(WLListNode *list, 
                                 WLListNode *current,
                                 int index)
    WLListNode *after=NULL;
        return current;
    }else if(index<0){
        return (list!=NULL ? list->prev : NULL);
    }else if(index==0){
        return NULL;
    }else{ /* index>0 */
        return llist_nth_node(list, index-1);

void llist_unlink(WLListNode **list, WLListNode *node)
    UNLINK_ITEM(*list, node, next, prev);


Generated by  Doxygen 1.6.0   Back to index