web: Create man page with groff rather than man2html.
[osl.git] / osl_core.h
index 8a575c685e9e698995d5f8b8c41cb704620812cb..6046d8c768cc35906387be94e8304a99aede35ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2007-2009 Andre Noll <maan@tuebingen.mpg.de>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -133,7 +133,7 @@ _static_inline_ struct osl_column_description *get_column_description(
  */
 enum index_header_offsets {
        /** Bytes 0-8: PARASLASH. */
-       IDX_PARA_MAGIC = 0,
+       IDX_OSL_MAGIC = 0,
        /** Byte 9: Dirty flag (nonzero if table is mapped). */
        IDX_DIRTY_FLAG = 9,
        /** Byte 10: osl table version number. */
@@ -165,7 +165,7 @@ enum index_column_desc_offsets {
 };
 
 /** Magic string contained in the header of the index file of each osl table. */
-#define PARA_MAGIC "PARASLASH"
+#define OSL_MAGIC "PARASLASH"
 
 /**
  * The minimal number of bytes for a column in the index header.
@@ -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)
@@ -303,8 +321,8 @@ _static_inline_ int get_cell_index(const struct osl_table *t, uint32_t row_num,
 _static_inline_ void update_cell_index(char *row_index, struct osl_column *col,
                uint32_t map_size, uint32_t object_size)
 {
-       write_u32(row_index + col->index_offset, map_size - object_size - 1);
-       write_u32(row_index + col->index_offset + 4, object_size + 1);
+       write_u32(row_index + col->index_offset, map_size - object_size);
+       write_u32(row_index + col->index_offset + 4, object_size);
 }
 
 /**