Clean up some error handling in tag listing
[blerg.git] / database / database.h
index 0ef1c7d..2f71bee 100644 (file)
@@ -1,9 +1,15 @@
+/* Blerg is (C) 2011 The Dominion of Awesome, and is distributed under a
+ * BSD-style license.  Please see the COPYING file for details.
+ */
 #ifndef _DATABASE_H
 #define _DATABASE_H
 
 #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;
@@ -34,5 +40,6 @@ int blerg_close(struct blerg *);
 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);
 
 #endif //_DATABASE_H