Rizin
unix-like reverse engineering framework and cli tools
set.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2019 pancake <pancake@nopcode.org>
2 // SPDX-License-Identifier: MIT
3 
4 #include "set.h"
5 
6 // p
7 
9  return ht_pp_new0();
10 }
11 
12 RZ_API void set_p_add(SetP *s, const void *u) {
13  ht_pp_insert(s, u, (void *)1);
14 }
15 
16 RZ_API bool set_p_contains(SetP *s, const void *u) {
17  return ht_pp_find(s, u, NULL) != NULL;
18 }
19 
20 RZ_API void set_p_delete(SetP *s, const void *u) {
21  ht_pp_delete(s, u);
22 }
23 
25  ht_pp_free((HtPP *)p);
26 }
27 
28 // u
29 
31  return (SetU *)ht_up_new0();
32 }
33 
34 RZ_API void set_u_add(SetU *s, ut64 u) {
35  ht_up_insert(s, u, (void *)1);
36 }
37 
39  return ht_up_find(s, u, NULL) != NULL;
40 }
41 
43  ht_up_delete(s, u);
44 }
45 
47  ht_up_free(s);
48 }
#define RZ_API
#define NULL
Definition: cris-opc.c:27
void * p
Definition: libc.cpp:67
static RzSocket * s
Definition: rtr.c:28
RZ_API void set_p_free(SetP *p)
Definition: set.c:24
RZ_API SetU * set_u_new(void)
Definition: set.c:30
RZ_API void set_p_delete(SetP *s, const void *u)
Definition: set.c:20
RZ_API bool set_p_contains(SetP *s, const void *u)
Definition: set.c:16
RZ_API SetP * set_p_new(void)
Definition: set.c:8
RZ_API void set_p_add(SetP *s, const void *u)
Definition: set.c:12
RZ_API void set_u_free(SetU *s)
Definition: set.c:46
RZ_API void set_u_delete(SetU *s, ut64 u)
Definition: set.c:42
RZ_API void set_u_add(SetU *s, ut64 u)
Definition: set.c:34
RZ_API bool set_u_contains(SetU *s, ut64 u)
Definition: set.c:38
HtPP SetP
Definition: set.h:14
HtUP SetU
Definition: set.h:22
ut64(WINAPI *w32_GetEnabledXStateFeatures)()