/* -*- c -*- */
/*
- * Time-stamp: <11.11.2004 16:42:22h liekweg>
- * Project: libFIRM
- * File name: ir/ana2/qset.h
- * Purpose: yet another set implementation
- * Author: Florian
- * Modified by:
- * Created: Mon 18 Oct 2004
- * CVS-ID: $Id$
- * Copyright: (c) 1999-2004 Universität Karlsruhe
- * Licence: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
*/
-#ifndef _QSET_H_
-#define _QSET_H_
+/**
+ * @file
+ * @brief yet another set implementation
+ * @author Florian
+ * @date Mon 18 Oct 2004
+ * @version $Id$
+ */
+#ifndef FIRM_ANA2_QSET_H
+#define FIRM_ANA2_QSET_H
# ifndef TRUE
# define TRUE 1
/* typedef unsigned int sortable_t; */
typedef void* sortable_t;
+struct obstack; /* forward decl */
+
typedef struct qset_str
{
+ struct obstack *obst;
sortable_t *values;
int n_slots;
int n_elems;
/* QSET INTERFACE */
-/* Allocate a new qset with initial space for up to n_elems. */
-qset_t *qset_new (const int);
+/* Allocate a new qset with initial space for up to n_elems.
+ If a non-NULL obstack is given, it is used for all allocations of this qset
+ and must be initialised and deleted by the user of the qset. */
+qset_t *qset_new (const int, struct obstack*);
/* Sort the entries of the given qset. */
void qset_sort (qset_t*);
/* Delete the given value from the given qset (if it exists) */
void qset_remove (qset_t*, sortable_t);
-/* Insert the given elem into the given qset. */
-void qset_insert (qset_t*, sortable_t);
+/* Insert the given elem into the given qset; return nonzero iff any involved values change. */
+int qset_insert (qset_t*, sortable_t);
-/* Insert all elems of qset2 into qset1. qset2 is deleted. */
-void qset_insert_all (qset_t*, qset_t*);
+/* Insert all elems of qset2 into qset1. qset2 is deleted; return
+ nonzero iff any involved values change. */
+int qset_insert_all (qset_t*, qset_t*);
/* Compare two qsets. */
int qset_compare (qset_t*, qset_t*);
/* step to the next element, return NULL iff no more elems are available */
sortable_t *qset_next (qset_t*);
-#endif /* def _QSET_H_ */
+#endif
/*
$Log$
+ Revision 1.5 2004/11/30 14:47:11 liekweg
+ insert report changes
+
+ Revision 1.4 2004/11/24 14:53:56 liekweg
+ Bugfixes
+
Revision 1.3 2004/11/18 16:35:46 liekweg
Added unique ids for debugging