summaryrefslogtreecommitdiff
path: root/src/rewrites/rewrites.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rewrites/rewrites.h')
-rw-r--r--src/rewrites/rewrites.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/rewrites/rewrites.h b/src/rewrites/rewrites.h
new file mode 100644
index 0000000..14b77b2
--- /dev/null
+++ b/src/rewrites/rewrites.h
@@ -0,0 +1,29 @@
+#ifndef REWRITES_H
+#define REWRITES_H
+
+#include "str/str.h"
+#include "list/list.h"
+
+
+typedef struct url {
+ str path;
+ str query;
+} url;
+
+typedef struct rewrite {
+ str pattern;
+ url output;
+} rewrite;
+
+
+void read_url_rewrites(str file);
+void free_url_rewrites(void);
+
+int check_pattern(str text, str pattern, str tokens[9]);
+str fill_blueprint(str bp, str tokens[9]);
+url url_rewrite(str url, rewrite rwt);
+url url_check(str url);
+
+void print_url_rewrites(void);
+
+#endif \ No newline at end of file