b417f1861e
* OPT: Great overhaul of List algorithms. Beware: Still buggy. * OPT: Make list chunks carry multiple Variants to improve cache locality. * OPT: Don't traverse List forwards/backwards when the absolute value of index is past the half of Count. * NEW: Introduce List.Backwards - a virtual object to enumerate backwards * NEW: Don't use List.Current as enumeration pointer. * NEW: Begin enumeration at the first/last node. * NEW: Traverse backwards when given negative index to _get. * NEW: Make Current invalid by default. * NEW: Assign first/last element when MoveNext()/MovePrev() is issued on an invalid Current. * NEW: Use List.Current as pointer for the Find*() methods, too. * NEW: Assign first/last element when FindNext()/FindPrev() is issued on an invalid Current. * NEW: Don't return an index from Find*() methods because it is not the way linked list are dealt with. * NEW: Make insertion and removal of elements safe in enumerations. * NEW: When Current (or enumerator) is removed, the pointer remains relative to the beginning of the List but it never wraps around the end. * BUG: Correctly *cycle* with {Move,Find}{Next,Prev}() git-svn-id: svn://localhost/gambas/trunk@5302 867c0c6c-44f3-4631-809d-bfa615b0a4ec
37 lines
1 KiB
C
37 lines
1 KiB
C
/*
|
|
* c_list.h
|
|
*
|
|
* Copyright (C) 2012 Tobias Boege <tobias@gambas-buch.de>
|
|
*
|
|
* This program 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, 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 Street, Fifth Floor, Boston,
|
|
* MA 02110-1301, USA.
|
|
*/
|
|
|
|
#ifndef __C_LIST_H
|
|
#define __C_LIST_H
|
|
|
|
#include "gambas.h"
|
|
#include "list.h"
|
|
|
|
extern GB_INTERFACE GB;
|
|
|
|
#ifndef __C_LIST_C
|
|
extern GB_DESC CListDesc[];
|
|
extern GB_DESC CListBackwardsDesc[];
|
|
|
|
extern void CLIST_exit(void);
|
|
#endif
|
|
|
|
#endif /* !__C_LIST_H */
|