1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
registers (tree)
Expenses:
----
|- Food:
----
|- Dessert(+5)
|- Dinner(
|- Auto:
----
|- Gas
|- Gas:
---
record_tags = {
"Food:Dessert"
}
balance
-------
somehow map the get_entries pipe to entry and do the foreach loop, so the loop will work async
balance = 0
balance_struct (tree) ;
for(entry in parse_entries(FILE* f, from = unix_epoch | -e, to = now)) {
date = entry->date // useful for sorting?
for (record in parse_records(entry)) {
int get_rec_ptr = record->nn_name; // to get the string name and to verify with other records
int get_val = record->amount;
balance_struct.add(get_rec_ptr, get_val); // add value 'get_val' to 'get_rec_ptr'
balance += get_val;
}
printf("-----------------\n");
printf("%s %d", denom, balance);
}