initial commit .. just some basics
[rxpd] / rxpd.h
1 #ifndef RXPD_H
2 #define RXPD_H
3
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <unistd.h>
7 #include <regex.h>
8 #include <>
9 #include "llist.h"
10
11 #define RXPD_COMMANDS                           \
12 {                                               \
13   RXPD_CMD(CHECK),                              \
14   RXPD_CMD(APPEND),                             \
15   RXPD_CMD(PREPEND),                            \
16   RXPD_CMD(REMOVE),                             \
17   RXPD_CMD(REPLACE),                            \
18   RXPD_CMD(LOAD),                               \
19   RXPD_CMD(SAVE),                               \
20   RXPD_CMD(DUMP),                               \
21   RXPD_CMD(LIST),                               \
22   RXPD_CMD(END)                                 \
23 }
24
25 #define RXPD_CMD(cmd) RXPD_CMD_##cmd
26 enum RXPD_COMMANDS;
27 #undef RXPD_CMD
28
29 struct base
30 {
31   char* rulesdir;
32   void* files;
33 };
34
35
36 struct file
37 {
38   char* filename;
39   struct stat last_stat;
40   llist rules;
41 };
42
43
44 struct rule
45 {
46   char* string;
47   char* regex;
48   regex_t rx;
49   llist node;
50 };
51
52
53
54
55 #endif