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..2f154e1f 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 CacheValue {
+ char *result;
+ char *output;
+} CacheValue;
+
+typedef struct CacheEntry {
+ char *key;
+ void *value;
+ time_t timeValid;
+ struct CacheEntry *prev;
+ struct CacheEntry *next;
+ UT_hash_handle hh;
+} CacheEntry;
+
+typedef struct CacheList {
+ CacheEntry *first;
+ CacheEntry *last;
+ int size;
+} CacheList;
+
+typedef struct Cache {
+ CacheEntry *table;
+ time_t timeInvalid;
+ CacheList *lru;
+ int height;
+} Cache;
+
#endif