![]() |
reactor-c 1.0
C Runtime for Lingua Franca
|
A hash set implementation in C. More...
#include <stdlib.h>Go to the source code of this file.
Data Structures | |
| struct | hashset_st |
| A hashset. More... | |
Typedefs | |
| typedef struct hashset_st * | hashset_t |
Functions | |
| int | hashset_add (hashset_t set, void *item) |
| Add a pointer to the hashset. | |
| hashset_t | hashset_create (unsigned short nbits) |
| Create a hashset instance. | |
| void | hashset_destroy (hashset_t set) |
| Destroy the hashset instance, freeing allocated memory. | |
| int | hashset_is_member (hashset_t set, void *item) |
| Returns non-zero if the item is in the hashset and zero otherwise. | |
| size_t | hashset_num_items (hashset_t set) |
| Return the number of items in the hashset. | |
| int | hashset_remove (hashset_t set, void *item) |
| Remove an item from the hashset. | |
A hash set implementation in C.
This is a modified version of the hash set implementation in C from: https://github.com/avsej/hashset.c
Example usage:
The corresponding .c files are in reactor-c/core/utils/hashset
Copyright 2012 Couchbase, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Modified in 2022 by Edward A. Lee to conform to documentation standards. Also, changed so that hashset_create() takes an initial capacity argument.
| typedef struct hashset_st* hashset_t |