summaryrefslogtreecommitdiff
path: root/include/urweb/types_cpp.h
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2015-12-23 16:01:51 -0500
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2015-12-23 16:01:51 -0500
commit3d3886672433f0775f772d8d2ee47c5f5e0bc745 (patch)
tree072d171c17d92a6696024256c4b2f5aaa760df35 /include/urweb/types_cpp.h
parentbf037ce78c2c76a34ecca0fb8bafa5d5be38968a (diff)
parent4be7962adf740a35222bfd99608c04329a802a04 (diff)
Merge branch 'upstream' into dfsg_clean20151220+dfsg
Diffstat (limited to 'include/urweb/types_cpp.h')
-rw-r--r--include/urweb/types_cpp.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/urweb/types_cpp.h b/include/urweb/types_cpp.h
index 0c431ff8..ce0f2825 100644
--- a/include/urweb/types_cpp.h
+++ b/include/urweb/types_cpp.h
@@ -119,4 +119,27 @@ typedef struct {
char *start, *front, *back;
} uw_buffer;
+// Caching
+
+#include <pthread.h>
+#include "uthash.h"
+
+typedef struct uw_Sqlcache_Value {
+ char *result;
+ char *output;
+ unsigned long timeValid;
+} uw_Sqlcache_Value;
+
+typedef struct uw_Sqlcache_Entry uw_Sqlcache_Entry;
+
+typedef struct uw_Sqlcache_Cache {
+ pthread_rwlock_t lockOut;
+ pthread_rwlock_t lockIn;
+ uw_Sqlcache_Entry *table;
+ unsigned long timeInvalid;
+ unsigned long timeNow;
+ size_t numKeys;
+ UT_hash_handle hh;
+} uw_Sqlcache_Cache;
+
#endif