Error when fetching tags and direction isn't 1 or -1
[blerg.git] / database / database.h
index 4c5853e..412d6c7 100644 (file)
@@ -7,6 +7,9 @@
 #include <stdint.h>
 #include <time.h>
 
+#define VALID_CHAR(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '_')
+#define WHITESPACE(c) (c == ' ' || c == '\t' || c == '\n' || c == '\r')
+
 struct record {
        uint32_t offset;
        uint16_t length;
@@ -16,6 +19,7 @@ struct record {
 
 struct meta {
        uint64_t sequence;
+       uint64_t subscription_mark;
 };
 
 struct blerg {
@@ -38,5 +42,7 @@ int blerg_store(struct blerg *, const char *, int);
 int blerg_fetch(struct blerg *, int, char **, int *);
 uint64_t blerg_get_record_count(struct blerg *);
 time_t blerg_get_timestamp(struct blerg *blerg, int record);
+int blerg_set_subscription_mark(struct blerg *blerg);
+uint64_t blerg_get_subscription_mark(struct blerg *blerg);
 
 #endif //_DATABASE_H