set.h revision d7832d2c6e0ef5f2839a2296c1cc2fc85c7d9632
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foosethfoo
#define foosethfoo
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
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.
systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>.
***/
/* Pretty straightforward set implementation. Internally based on the
* hashmap. That means that as a minor optimization a NULL set
* object will be treated as empty set for all read
* operations. That way it is not necessary to instantiate an object
* for each set use. */
#include "hashmap.h"
void set_free_free(Set *s);
bool set_isempty(Set *s);
void *set_steal_first(Set *s);
#define SET_FOREACH(e, s, i) \
#define SET_FOREACH_BACKWARDS(e, s, i) \
for ((i) = ITERATOR_LAST, (e) = set_iterate_backwards((s), &(i)); (e); (e) = set_iterate_backwards((s), &(i)))
#endif