X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=database%2Fdatabase.h;h=aa2403a39d2e9c38b52e34f041f11e3803f3e896;hb=767693caf2b41c2e857688d10d2c71bc77c0bbad;hp=4c5853e72fcc5e10628be3620a99e93fdc0d1c58;hpb=54789cc8538714fc3622646721f6f2ecceae94ac;p=blerg.git diff --git a/database/database.h b/database/database.h index 4c5853e..aa2403a 100644 --- a/database/database.h +++ b/database/database.h @@ -7,6 +7,9 @@ #include #include +#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,8 +19,12 @@ struct record { struct meta { uint64_t sequence; + uint64_t subscription_mark; + uint32_t status; }; +#define BLERGMETA_MUTED 0x00000001 + struct blerg { int meta_fd; int index_fd; @@ -38,5 +45,9 @@ 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); +int blerg_set_mute(struct blerg *blerg, int v); +int blerg_get_mute(struct blerg *blerg); #endif //_DATABASE_H