1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12#ifndef _SET_H_ 13#define _SET_H_ 14 15/* Implementation of a set. */ 16 17#include <glib.h> 18#include <stdbool.h> 19 20typedef GHashTable set_t; 21set_t *set(void); 22void set_insert(set_t *s, const char *item); 23bool set_contains(set_t *s, const char *item); 24void set_union(set_t *a, set_t *b); 25void set_destroy(set_t *s); 26 27typedef GHashTableIter set_iter_t; 28void set_iter(set_t *s, set_iter_t *i); 29const char *set_iter_next(set_iter_t *i); 30 31void set_foreach(set_t *s, void (*f)(void *value)); 32 33#endif 34