comparison include/urweb/types_cpp.h @ 2250:c275bbc41194

Start work on pure expression caching.
author Ziv Scully <ziv@mit.edu>
date Sun, 13 Sep 2015 16:02:45 -0400
parents 88cc0f44c940
children 32a407902d3b
comparison
equal deleted inserted replaced
2249:c05851bf7861 2250:c275bbc41194
121 121
122 // Caching 122 // Caching
123 123
124 #include "uthash.h" 124 #include "uthash.h"
125 125
126 typedef struct uw_sqlcache_CacheValue { 126 typedef struct uw_Sqlcache_CacheValue {
127 char *result; 127 char *result;
128 char *output; 128 char *output;
129 } uw_sqlcache_CacheValue; 129 } uw_Sqlcache_CacheValue;
130 130
131 typedef struct uw_sqlcache_CacheEntry { 131 typedef struct uw_Sqlcache_CacheEntry {
132 char *key; 132 char *key;
133 void *value; 133 void *value;
134 time_t timeValid; 134 time_t timeValid;
135 struct uw_sqlcache_CacheEntry *prev; 135 struct uw_Sqlcache_CacheEntry *prev;
136 struct uw_sqlcache_CacheEntry *next; 136 struct uw_Sqlcache_CacheEntry *next;
137 UT_hash_handle hh; 137 UT_hash_handle hh;
138 } uw_sqlcache_CacheEntry; 138 } uw_Sqlcache_CacheEntry;
139 139
140 typedef struct uw_sqlcache_CacheList { 140 typedef struct uw_Sqlcache_CacheList {
141 uw_sqlcache_CacheEntry *first; 141 uw_Sqlcache_CacheEntry *first;
142 uw_sqlcache_CacheEntry *last; 142 uw_Sqlcache_CacheEntry *last;
143 int size; 143 int size;
144 } uw_sqlcache_CacheList; 144 } uw_Sqlcache_CacheList;
145 145
146 typedef struct uw_sqlcache_Cache { 146 typedef struct uw_Sqlcache_Cache {
147 uw_sqlcache_CacheEntry *table; 147 uw_Sqlcache_CacheEntry *table;
148 time_t timeInvalid; 148 time_t timeInvalid;
149 uw_sqlcache_CacheList *lru; 149 uw_Sqlcache_CacheList *lru;
150 int height; 150 int height;
151 } uw_sqlcache_Cache; 151 } uw_Sqlcache_Cache;
152 152
153 #endif 153 #endif