#ifndef _APP_H
#define _APP_H
-#include <yajl/yajl_gen.h>
#include "database.h"
#include "config.h"
+#include "auth.h"
#define REALM "Blerg"
#define CONTENT_401 "<html><head><title>401 Unauthorized</title></head><body><h1>401 Unauthorized</h1>DENIED</body></html>"
+#define CONTENT_403 "<html><head><title>403 Forbidden</title></head><body><h1>403 Forbidden</h1>Go away.</body></html>"
#define CONTENT_404 "<html><head><title>404 Not Found</title></head><body><h1>404 Not Found</h1>I couldn't find that.</body></html>"
#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>"
#define JSON_SUCCESS "{\"status\": \"success\"}"
uint64_t record_to;
};
+struct auth_cookie {
+ char name[MAX_TAG_LENGTH + 1];
+ char token[TOKEN_SIZE * 2 + 1];
+};
+
int parse_url_info(const char *url, struct url_info *info);
+int parse_auth_cookie(const char *str, struct auth_cookie *cookie);
uint64_t *make_sequential_list(uint64_t from, uint64_t to);
#endif /* _APP_H */