/builds/xfbs/passgen/src/pattern/set.c
Line | Count | Source |
1 | | #include "passgen/pattern/set.h" |
2 | | #include "passgen/pattern/range.h" |
3 | | #include <stdlib.h> |
4 | | |
5 | 3.09k | void passgen_pattern_set_init(passgen_pattern_set *set) { |
6 | 3.09k | passgen_stack_init(&set->items, sizeof(passgen_pattern_range)); |
7 | 3.09k | |
8 | 3.09k | set->choices_list = NULL; |
9 | 3.09k | } |
10 | | |
11 | 3.09k | void passgen_pattern_set_free(passgen_pattern_set *set) { |
12 | 3.09k | passgen_stack_free(&set->items); |
13 | 3.09k | |
14 | 3.09k | free(set->choices_list); |
15 | 3.09k | } |
16 | | |
17 | | passgen_pattern_range * |
18 | 19.5k | passgen_pattern_set_range_append(passgen_pattern_set *set) { |
19 | 19.5k | return passgen_stack_push(&set->items, NULL); |
20 | 19.5k | } |
21 | | |
22 | | passgen_pattern_range * |
23 | 8 | passgen_pattern_set_range_get(passgen_pattern_set *set, size_t n) { |
24 | 8 | return passgen_stack_get(&set->items, n); |
25 | 8 | } |