summaryrefslogtreecommitdiff
path: root/include/urweb/types_cpp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/urweb/types_cpp.h')
-rw-r--r--include/urweb/types_cpp.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/urweb/types_cpp.h b/include/urweb/types_cpp.h
index 0c431ff8..84423105 100644
--- a/include/urweb/types_cpp.h
+++ b/include/urweb/types_cpp.h
@@ -119,4 +119,35 @@ typedef struct {
char *start, *front, *back;
} uw_buffer;
+// Caching
+
+#include "uthash.h"
+
+typedef struct uw_Sqlcache_CacheValue {
+ char *result;
+ char *output;
+} uw_Sqlcache_CacheValue;
+
+typedef struct uw_Sqlcache_CacheEntry {
+ char *key;
+ void *value;
+ time_t timeValid;
+ struct uw_Sqlcache_CacheEntry *prev;
+ struct uw_Sqlcache_CacheEntry *next;
+ UT_hash_handle hh;
+} uw_Sqlcache_CacheEntry;
+
+typedef struct uw_Sqlcache_CacheList {
+ uw_Sqlcache_CacheEntry *first;
+ uw_Sqlcache_CacheEntry *last;
+ int size;
+} uw_Sqlcache_CacheList;
+
+typedef struct uw_Sqlcache_Cache {
+ uw_Sqlcache_CacheEntry *table;
+ time_t timeInvalid;
+ uw_Sqlcache_CacheList *lru;
+ int height;
+} uw_Sqlcache_Cache;
+
#endif