X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/6cb6b7ede2d178e03fa817bc28474c175f5a93b9..42a61c59a81b03130f61e805474198eada033cd8:/httpserver_20080306/blinklist.pas diff --git a/httpserver_20080306/blinklist.pas b/httpserver_20080306/blinklist.pas deleted file mode 100755 index 2079b75..0000000 --- a/httpserver_20080306/blinklist.pas +++ /dev/null @@ -1,118 +0,0 @@ -(* - * beware IRC services, blinklist.pas - * Copyright (C) 2002 Bas Steendijk - * - * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - *) -unit blinklist; -{$ifdef fpc} - {$mode delphi} -{$endif} - - -interface - -type - tlinklist=class(tobject) - next:tlinklist; - prev:tlinklist; - constructor create; - destructor destroy; override; - end; - - {linklist with 2 links} - tlinklist2=class(tlinklist) - next2:tlinklist2; - prev2:tlinklist2; - end; - - {linklist with one pointer} - tplinklist=class(tlinklist) - p:pointer - end; - - tstringlinklist=class(tlinklist) - s:string; - end; - - tthing=class(tlinklist) - name:string; {name/nick} - hashname:integer; {hash of name} - end; - -{ -adding new block to list (baseptr) -} -procedure linklistadd(var baseptr:tlinklist;newptr:tlinklist); -procedure linklistdel(var baseptr:tlinklist;item:tlinklist); - - -procedure linklist2add(var baseptr,newptr:tlinklist2); -procedure linklist2del(var baseptr:tlinklist2;item:tlinklist2); - -var - linklistdebug:integer; - -implementation - -procedure linklistadd(var baseptr:tlinklist;newptr:tlinklist); -var - p:tlinklist; -begin - p := baseptr; - baseptr := newptr; - baseptr.prev := nil; - baseptr.next := p; - if p <> nil then p.prev := baseptr; -end; - -procedure linklistdel(var baseptr:tlinklist;item:tlinklist); -begin - if item = baseptr then baseptr := item.next; - if item.prev <> nil then item.prev.next := item.next; - if item.next <> nil then item.next.prev := item.prev; -end; - -procedure linklist2add(var baseptr,newptr:tlinklist2); -var - p:tlinklist2; -begin - p := baseptr; - baseptr := newptr; - baseptr.prev2 := nil; - baseptr.next2 := p; - if p <> nil then p.prev2 := baseptr; -end; - -procedure linklist2del(var baseptr:tlinklist2;item:tlinklist2); -begin - if item = baseptr then baseptr := item.next2; - if item.prev2 <> nil then item.prev2.next2 := item.next2; - if item.next2 <> nil then item.next2.prev2 := item.prev2; -end; - -constructor tlinklist.create; -begin - inherited create; - inc(linklistdebug); -end; - -destructor tlinklist.destroy; -begin - dec(linklistdebug); - inherited destroy; -end; - -end.