diff src/lru_cache.sml @ 2240:88cc0f44c940

Rename C functions and remove functors nested inside modules.
author Ziv Scully <ziv@mit.edu>
date Sun, 19 Jul 2015 19:03:11 -0700
parents 2f7ed04332a0
children c275bbc41194
line wrap: on
line diff
--- a/src/lru_cache.sml	Tue Jul 07 00:07:24 2015 -0700
+++ b/src/lru_cache.sml	Sun Jul 19 19:03:11 2015 -0700
@@ -64,7 +64,7 @@
 
     in
         Print.box
-            [string ("static Cache cacheStruct" ^ i ^ " = {"),
+            [string ("static uw_sqlcache_Cache cacheStruct" ^ i ^ " = {"),
              newline,
              string "  .table = NULL,",
              newline,
@@ -74,7 +74,7 @@
              newline,
              string ("  .height = " ^ Int.toString (params - 1) ^ "};"),
              newline,
-             string ("static Cache *cache" ^ i ^ " = &cacheStruct" ^ i ^ ";"),
+             string ("static uw_sqlcache_Cache *cache" ^ i ^ " = &cacheStruct" ^ i ^ ";"),
              newline,
              newline,
 
@@ -83,7 +83,7 @@
              newline,
              string ("  char *ks[] = {" ^ revArgs ^ "};"),
              newline,
-             string ("  CacheValue *v = check(cache" ^ i ^ ", ks);"),
+             string ("  uw_sqlcache_CacheValue *v = uw_sqlcache_check(cache" ^ i ^ ", ks);"),
              newline,
              string "  if (v) {",
              newline,
@@ -112,7 +112,7 @@
              newline,
              string ("  char *ks[] = {" ^ revArgs ^ "};"),
              newline,
-             string ("  CacheValue *v = malloc(sizeof(CacheValue));"),
+             string ("  uw_sqlcache_CacheValue *v = malloc(sizeof(uw_sqlcache_CacheValue));"),
              newline,
              string "  v->result = strdup(s);",
              newline,
@@ -120,7 +120,7 @@
              newline,
              string ("  puts(\"SQLCACHE: stored " ^ i ^ ".\");"),
              newline,
-             string ("  store(cache" ^ i ^ ", ks, v);"),
+             string ("  uw_sqlcache_store(cache" ^ i ^ ", ks, v);"),
              newline,
              string "  return uw_unit_v;",
              newline,
@@ -133,7 +133,7 @@
              newline,
              string ("  char *ks[] = {" ^ revArgs ^ "};"),
              newline,
-             string ("  flush(cache" ^ i ^ ", ks);"),
+             string ("  uw_sqlcache_flush(cache" ^ i ^ ", ks);"),
              newline,
              string "  return uw_unit_v;",
              newline,