GNU header update.
[cacao.git] / src / toolbox / chain.h
index e065c07fedcbea5df79519db9f3bd0ae2cd39b28..4397de2ea1b1101959fc143bfe0f42abe5ba3a59 100644 (file)
@@ -1,38 +1,63 @@
-/************************* toolbox/chain.h *************************************
+/* toolbox/chain.h - management of doubly linked lists with external linking
 
-       Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   Institut f. Computersprachen - TU Wien
 
-       See file COPYRIGHT for information on usage and disclaimer of warranties
+   This file is part of CACAO.
 
-       dient zur Verwaltung doppelt verketteter Listen mit externer Verkettung
+   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.
 
-       Authors: Reinhard Grafl      EMAIL: cacao@complang.tuwien.ac.at
+   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.
 
-       Last Change: 1996/10/03
+   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.
 
-*******************************************************************************/
+   Contact: cacao@complang.tuwien.ac.at
 
-typedef struct chainlink {          /* Struktur f"ur ein Listenelement */
-       struct chainlink *next,*prev;
+   Authors: Reinhard Grafl
+
+   $Id: chain.h 1735 2004-12-07 14:33:27Z twisti $
+
+*/
+
+
+#ifndef _CHAIN_H
+#define _CHAIN_H
+
+typedef struct chainlink {          /* structure for list element */
+       struct chainlink *next;
+       struct chainlink *prev;
        void *element;
-       } chainlink;
+} chainlink;
 
-typedef struct chain {             /* Struktur f"ur eine Liste */
+typedef struct chain {             /* structure for list */
        int  usedump;   
 
-       chainlink *first,*last;
+       chainlink *first;
+       chainlink *last;
        chainlink *active;
-       } chain;
+} chain;
 
 
-chain *chain_new ();
-chain *chain_dnew ();
+/* function prototypes */
+chain *chain_new();
+chain *chain_dnew();
 void chain_free(chain *c);
 
 void chain_addafter(chain *c, void *element);
 void chain_addbefore(chain *c, void *element);
-void chain_addlast (chain *c, void *element);
-void chain_addfirst (chain *c, void *element);
+void chain_addlast(chain *c, void *element);
+void chain_addfirst(chain *c, void *element);
 
 void chain_remove(chain *c);
 void *chain_remove_go_prev(chain *c);
@@ -47,46 +72,55 @@ void *chain_last(chain *c);
 
 
 /*
---------------------------- Schnittstellenbeschreibung ------------------------
+--------------------------- interface description ------------------------
 
-Bei Verwendung dieser Funktionen f"ur die Listenverwaltung mu"s, im
-Gegenstatz zum Modul 'list', keine zus"atzliche Vorbereitung in den 
-Element-Strukturen gemacht werden.
+Usage of these functions for list management is possible without additional
+preparation in the element structures, as opposed to the module 'list'.
 
-Diese Funktionen sind daher auch ein wenig langsamer und brauchen 
-mehr Speicher.
+Consequently, the functions are a little slower and need more memory.
 
-Eine neue Liste wird mit 
-                 chain_new
-       oder  chain_dnew 
-angelegt. Der Unterschied ist, da"s bei der zweiten Variante alle
-zus"atzlichen Datenstrukturen am DUMP-Speicher angelegt werden (was
-schneller geht, und ein explizites Freigeben am Ende der Verarbeitung
-unn"otig macht). Dabei mu"s man aber achtgeben, da"s man nicht 
-versehentlich Teile dieser Strukturen durch ein verfr"uhtes 'dump_release'
-freigibt.
+A new list is created with
+       chain_new
+or  chain_dnew.
+The latter allocates all additional data structures on the dump memory (faster)
+for which no explicit freeing is necessary after the processing. Care needs to
+be taken to not accidentally free parts of these structures by calling
+'dump_release' too early.
 
-Eine nicht mehr verwendete Liste kann mit
-               chain_free
-freigegeben werden (nur verwenden, wenn mit 'chain_new' angefordert)
+After usage, a list can be freed with
+       chain_free.
+(use only if the list was created with 'chain_new')
 
 
-Das Eintragen neuer Elemente geht sehr einfach mit:
+Adding elements is easy with:
        chain_addafter, chain_addlast, chain_addbefore, chain_addfirst          
        
-Durchsuchen der Liste mit:
+Search the list with:
        chain_first, chain_last, chain_prev, chain_next, chain_this
        
-L"oschen von Elementen aus der Liste:
+Delete elements from the list:
        chain_remove, chain_remove_go_prev, chain_removespecific
        
        
-ACHTUNG: In den zu verkettenden Elementen gibt es ja (wie oben gesagt) keine
-       Referenzen auf die Liste oder irgendwelche Listenknoten, deshalb k"onnen
-       die Elemente nicht als Ortsangabe innerhalb der Liste fungieren.
-       Es gibt vielmehr ein Art 'Cursor', der ein Element als das gerade
-       aktuelle festh"alt, und alle Ein-/und Ausf"ugeoperationen geschehen
-       relativ zu diesem Cursor.
+ATTENTION: As mentioned earlier, there are no pointers to the list or to other
+nodes inside the list elements, so list elements cannot be used as pointers
+into the list. Therefore a 'cursor' is used to make one element current. Every
+insertion/deletion occurs at a position relative to this cursor.
 
 */
 
+#endif /* _CHAIN_H */
+
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */