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.
10 #define VALID_CHAR(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '_')
11 #define WHITESPACE(c) (c == ' ' || c == '\t' || c == '\n' || c == '\r')
22 uint64_t subscription_mark;
26 /* meta.status is a bitfield of these options */
27 /* Muted - if set, tags/refs and subscriptions are not calculated */
28 #define BLERGSTATUS_MUTED 0x00000001
29 /* Mentioned - if set, user has been mentioned. */
30 #define BLERGSTATUS_MENTIONED 0x00000002
45 #define BLERG_INVALID_RECORD 0xFFFFFFFFFFFFFFFF
48 int blerg_exists(const char *name);
49 struct blerg *blerg_open(const char *name);
50 int blerg_close(struct blerg *blerg);
51 uint64_t blerg_store(struct blerg *blerg, const char *data, int length);
52 int blerg_fetch(struct blerg *blerg, uint64_t record, char **data, int *length);
53 uint64_t blerg_get_record_count(struct blerg *);
54 time_t blerg_get_timestamp(struct blerg *blerg, uint64_t record);
55 int blerg_set_subscription_mark(struct blerg *blerg);
56 uint64_t blerg_get_subscription_mark(struct blerg *blerg);
57 int blerg_set_status(struct blerg *blerg, uint32_t status, int v);
58 int blerg_get_status(struct blerg *blerg, uint32_t status);