Refactor set, add attaching functional

This commit is contained in:
2022-08-19 17:19:22 +03:00
parent 925a8855ed
commit b789b133e2
12 changed files with 278 additions and 315 deletions
+7 -3
View File
@@ -3,7 +3,7 @@
#include <assert.h>
#include <stdio.h>
#include "../include/extra/set.h"
#include "../include/set.h"
typedef vtype_set vset_t;
@@ -22,6 +22,7 @@ int print_value(const void* value, vtype type, void* data) {
int main(int argc, char** argv) {
vset_t set;
int a, b;
vset_init(&set, VTYPE_INT32);
@@ -29,8 +30,11 @@ int main(int argc, char** argv) {
vset_push(&set, i);
}
vset_get(&set, 13, "Get value:", print_value);
vset_pop(&set, 18, "Pop value:", print_value);
a = 13;
b = 18;
vset_get(&set, a, "Get value:", print_value);
vset_pop(&set, b, "Pop value:", print_value);
vset_foreach(&set, "Foreach loop:", print_value);