libnl 3.12.0
hashtable-api.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Private resizable hash table API for libnl.
4 */
5
6#ifndef NETLINK_HASHTABLE_API_H_
7#define NETLINK_HASHTABLE_API_H_
8
9#include "nl-priv-dynamic-core/object-api.h"
10
11/* Opaque resizable hash table handle. */
12typedef struct nl_rhash_table nl_rhash_table_t;
13
14/* Allocation / Deletion */
15nl_rhash_table_t *nl_rhash_table_alloc(void);
16void nl_rhash_table_free(nl_rhash_table_t *ht);
17
18/* Access helpers */
19struct nl_object *nl_rhash_table_lookup(nl_rhash_table_t *ht,
20 struct nl_object *obj);
21int nl_rhash_table_add(nl_rhash_table_t *ht, struct nl_object *obj);
22int nl_rhash_table_del(nl_rhash_table_t *ht, struct nl_object *obj);
23
24#endif /* NETLINK_HASHTABLE_API_H_ */
void nl_rhash_table_free(nl_rhash_table_t *ht)
Free resizeable hashtable including all nodes.
Definition hashtable.c:306
int nl_rhash_table_add(nl_rhash_table_t *ht, struct nl_object *obj)
Add object to resizeable hashtable.
Definition hashtable.c:341
int nl_rhash_table_del(nl_rhash_table_t *ht, struct nl_object *obj)
Remove object from resizeable hashtable.
Definition hashtable.c:379
struct nl_object * nl_rhash_table_lookup(nl_rhash_table_t *ht, struct nl_object *obj)
Lookup identical object in resizeable hashtable.
Definition hashtable.c:322
nl_rhash_table_t * nl_rhash_table_alloc(void)
Allocate resizeable hashtable.
Definition hashtable.c:279