Add RSS CGI, also quite a lot of refactoring
[blerg.git] / common / app.h
1 #ifndef _APP_H
2 #define _APP_H
3
4 #include <yajl/yajl_gen.h>
5 #include "database.h"
6
7 #define REALM "Blerg"
8
9 #define CONTENT_401 "<html><head><title>401 Unauthorized</title></head><body><h1>401 Unauthorized</h1>DENIED</body></html>"
10 #define CONTENT_404 "<html><head><title>404 Not Found</title></head><body><h1>404 Not Found</h1>I couldn't find that.</body></html>"
11 #define CONTENT_405 "<html><head><title>405 Method Not Allowed</title></head><body><h1>405 Method Not Allowed</h1>I'm sorry, Dave. I'm afraid I can't do that.</body></html>"
12 #define JSON_SUCCESS "{\"status\": \"success\"}"
13 #define JSON_FAILURE "{\"status\": \"failure\"}"
14
15 #define URL_INFO_AUTHOR    0x1
16 #define URL_INFO_RECORD    0x2
17 #define URL_INFO_RECORD_TO 0x4
18 #define DERP "DERP DERP DERP"
19
20 struct url_info {
21         unsigned int contents;
22         char author[33];
23         uint64_t record;
24         uint64_t record_to;
25 };
26
27 int parse_url_info(const char *url, struct url_info *info);
28 uint64_t *make_sequential_list(uint64_t from, uint64_t to);
29
30 #endif /* _APP_H */