Improve table versioning.
[osl.git] / osl_core.h
index 6c87d6ce7f2ab7291ff41444595f0e96f39f8c90..1220a09eac1a9aa7cd59742828d8c7c4ca865c9d 100644 (file)
@@ -190,9 +190,27 @@ _static_inline_ size_t index_column_description_size(const char *name)
        return MIN_IDX_COLUMN_DESCRIPTION_SIZE + strlen(name) - 1;
 }
 
+/*
+ * The version used by this instance of the library. Written to the index of
+ * newly created tables.
+ */
 #define CURRENT_TABLE_VERSION 1
+
+/*
+ * The lowest library version that is able to use tables of version
+ * CURRENT_TABLE_VERSION. Also written to the index of new tables. If
+ * compat_version(table) > current_version(lib) the table can not be opened.
+ */
+#define COMPAT_TABLE_VERSION 0
+
+/*
+ * The lowest table version this library understands. On open, if
+ * current_version(table) < min_version(lib) the osl_open_table() call
+ * fails.
+ */
 #define MIN_TABLE_VERSION 1
-#define MAX_TABLE_VERSION 1
+
+
 /** An index header must be at least that many bytes long. */
 #define MIN_INDEX_HEADER_SIZE(num_cols) (MIN_IDX_COLUMN_DESCRIPTION_SIZE \
        * num_cols + IDX_COLUMN_DESCRIPTIONS)