Fix ordering in perl subscription_list
[blerg.git] / common / app.h
1 /* Blerg is (C) 2011 The Dominion of Awesome, and is distributed under a
2  * BSD-style license.  Please see the COPYING file for details.
3  */
4 #ifndef _APP_H
5 #define _APP_H
6
7 #include "database.h"
8 #include "config.h"
9 #include "auth.h"
10
11 #define REALM "Blerg"
12
13 #define CONTENT_401 "<html><head><title>401 Unauthorized</title></head><body><h1>401 Unauthorized</h1>DENIED</body></html>"
14 #define CONTENT_403 "<html><head><title>403 Forbidden</title></head><body><h1>403 Forbidden</h1>Go away.</body></html>"
15 #define CONTENT_404 "<html><head><title>404 Not Found</title></head><body><h1>404 Not Found</h1>I couldn't find that.</body></html>"
16 #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>"
17 #define JSON_SUCCESS "{\"status\": \"success\"}"
18 #define JSON_FAILURE "{\"status\": \"failure\"}"
19
20 #define URL_INFO_NAME      0x1
21 #define URL_INFO_RECORD    0x2
22 #define URL_INFO_RECORD_TO 0x4
23 #define DERP "DERP DERP DERP"
24
25 struct url_info {
26         unsigned int contents;
27         char name[MAX_TAG_LENGTH + 1];
28         uint64_t record;
29         uint64_t record_to;
30 };
31
32 struct auth_cookie {
33         char name[MAX_TAG_LENGTH + 1];
34         char token[TOKEN_SIZE * 2 + 1];
35 };
36
37 int parse_url_info(const char *url, struct url_info *info);
38 int parse_auth_cookie(const char *str, struct auth_cookie *cookie);
39 uint64_t *make_sequential_list(uint64_t from, uint64_t to);
40
41 #endif /* _APP_H */