Skip to content

Commit b2a9d89

Browse files
committed
Add shared header file
1 parent 80cbd56 commit b2a9d89

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

d.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#include <stdbool.h>
2+
#include <stddef.h>
3+
4+
typedef struct Group {
5+
char const *name;
6+
struct Entry **entries;
7+
} Group;
8+
9+
typedef struct Entry {
10+
char const *category;
11+
char const *source;
12+
char const *destination;
13+
} Entry;
14+
15+
// clang-format off
16+
#define Home(path, category) { \
17+
.source = Src category path, \
18+
.destination = Dst path \
19+
}
20+
#define Config(path, category) { \
21+
.source = Src category ".config/" path, \
22+
.destination = Dst ".config/" path \
23+
}
24+
#define Data(path, category) { \
25+
.source = Src category ".local/share/" path, \
26+
.destination = Dst ".local/share/" path \
27+
}
28+
#define Done { \
29+
.source = NULL, \
30+
.destination = NULL \
31+
}
32+
// clang-format on
33+
34+
#define HomeEntry(path, category) { Home(path, category), Done }
35+
#define ConfigEntry(path, category) { Config(path, category), Done }
36+
#define DataEntry(path, category) { Data(path, category), Done }

0 commit comments

Comments
 (0)