2 { Copyright (C) 2005 Bas Steendijk
\r
3 For conditions of distribution and use, see copyright notice in zlib_license.txt
\r
4 which is included in the package
\r
5 ----------------------------------------------------------------------------- }
\r
16 tlinklist=class(tobject)
\r
20 destructor destroy; override;
\r
23 {linklist with 2 links}
\r
24 tlinklist2=class(tlinklist)
\r
29 {linklist with one pointer}
\r
30 tplinklist=class(tlinklist)
\r
34 tstringlinklist=class(tlinklist)
\r
38 tthing=class(tlinklist)
\r
39 name:string; {name/nick}
\r
40 hashname:integer; {hash of name}
\r
44 adding new block to list (baseptr)
\r
46 procedure linklistadd(var baseptr:tlinklist;newptr:tlinklist);
\r
47 procedure linklistdel(var baseptr:tlinklist;item:tlinklist);
\r
50 procedure linklist2add(var baseptr,newptr:tlinklist2);
\r
51 procedure linklist2del(var baseptr:tlinklist2;item:tlinklist2);
\r
54 linklistdebug:integer;
\r
58 procedure linklistadd(var baseptr:tlinklist;newptr:tlinklist);
\r
64 baseptr.prev := nil;
\r
66 if p <> nil then p.prev := baseptr;
\r
69 procedure linklistdel(var baseptr:tlinklist;item:tlinklist);
\r
71 if item = baseptr then baseptr := item.next;
\r
72 if item.prev <> nil then item.prev.next := item.next;
\r
73 if item.next <> nil then item.next.prev := item.prev;
\r
76 procedure linklist2add(var baseptr,newptr:tlinklist2);
\r
82 baseptr.prev2 := nil;
\r
84 if p <> nil then p.prev2 := baseptr;
\r
87 procedure linklist2del(var baseptr:tlinklist2;item:tlinklist2);
\r
89 if item = baseptr then baseptr := item.next2;
\r
90 if item.prev2 <> nil then item.prev2.next2 := item.next2;
\r
91 if item.next2 <> nil then item.next2.prev2 := item.prev2;
\r
94 constructor tlinklist.create;
\r
100 destructor tlinklist.destroy;
\r
102 dec(linklistdebug);
\r