set.h revision ef42202ac8ed27e7ff1fc90ef8bc2590046dff25
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser 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"
set_free(*s);
}
void set_free_free(Set *s);
static inline void set_free_freep(Set **s) {
set_free_free(*s);
}
bool set_isempty(Set *s);
void set_clear_free(Set *s);
void *set_steal_first(Set *s);
char **set_get_strv(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)))