From 4f04f33f36933aaec7626154e055687b2abe903c Mon Sep 17 00:00:00 2001
From: Philipp Gesang <phg42.2a@gmail.com>
Date: Sat, 31 Aug 2013 19:59:24 +0200
Subject: [db] document new db layout for rewrite

---
 luaotfload-database.lua | 38 +++++++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 7 deletions(-)

diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index 067b48c..6e49556 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -238,17 +238,41 @@ end
 This is a sketch of the luaotfload db:
 
     type dbobj = {
-        formats         : string list; // { "otf", "ttf", "ttc", "dfont" }
         mappings        : fontentry list;
-        status          : filestatus;
-        version         : float;
-        // new in v2.3; these supersede the basenames / barenames
-        // hashes from v2.2
+        index           : filestatus;
+        families        : familytable;
+        names           : namedata; // TODO: check for relevance after db is finalized
+        meta            : metadata;
         filenames       : filemap;
     }
+    and familytable = {
+        texmf  : (format, familyentry) hash;
+        system : (format, familyentry) hash;
+    }
+    and familyentry = {
+        regular     : sizes;
+        italic      : sizes;
+        bold        : sizes;
+        bolditalic  : sizes;
+    }
+    and sizes = {
+        default = int;              // points into mappings or names
+        other   = (int, int) list;  // design size -> index entry
+    }
+    and metadata = {
+        formats     : string list; // { "otf", "ttf", "ttc", "dfont" }
+        statistics  : TODO;
+        version     : float;
+    }
     and filemap = {
-        base : (string, int) hash; // basename -> idx
-        bare : (string, int) hash; // barename -> idx
+        base : {
+            texmf  : (string, int) hash; // basename -> idx
+            system : (string, int) hash;
+        };
+        bare : {
+            texmf  : (string, (string, int) hash) hash; // format -> (barename -> idx)
+            system : (string, (string, int) hash) hash;
+        };
         full : (int, string) hash; // idx -> full path
     }
     and fontentry = {
-- 
cgit v1.2.3