osl.h.in cleanups and improvments.
authorAndre Noll <maan@systemlinux.org>
Sat, 31 May 2008 15:15:57 +0000 (17:15 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 31 May 2008 15:15:57 +0000 (17:15 +0200)
- Add visibility pragmas
- More documentation
- Kill compare function pointers.

osl.h.in

index a586be293ac228382fc7413b508539bc425a2808..01b69fbb60285d88ba97c3aa0e6c616826813f2b 100644 (file)
--- a/osl.h.in
+++ b/osl.h.in
@@ -1,4 +1,3 @@
-#include <sys/mman.h>
 /*
  * Copyright (C) 2007-2008 Andre Noll <maan@systemlinux.org>
  *
@@ -7,7 +6,12 @@
 
 /** \file osl.h User interface for the object storage layer. */
 
-/** describes an object of the object storage layer (osl) */
+#include <sys/mman.h>
+
+/** Export all declarations in this file. */
+#pragma GCC visibility push(default)
+
+/** Describes an object of the object storage layer (osl) */
 struct osl_object {
        /** Pointer to the data of the object. */
        void *data;
@@ -63,7 +67,9 @@ enum osl_storage_flags {
        OSL_DONT_FREE = 8
 };
 
+/** Opaque osl table structure. */
 struct osl_table;
+/** Opaque osl row structure. */
 struct osl_row;
 
 /**
@@ -75,15 +81,20 @@ struct osl_row;
  */
 typedef int osl_compare_func(const struct osl_object *obj1,
        const struct osl_object *obj2);
-typedef int osl_rbtree_loop_func(struct osl_row *row, void *data);
 
-osl_compare_func osl_hash_compare, uint32_compare;
+/**
+ * The osl_rbreee_loop functions take a function pointer of this type. For each
+ * node in the rbtree, the given function is called.
+ *
+ * \sa osl_rbtree_loop(), osl_rbtree_loop_reverse().
+ */
+typedef int osl_rbtree_loop_func(struct osl_row *row, void *data);
 
 /**
  * Describes one column of a osl table.
  */
 struct osl_column_description {
-       /** One of zje tree possible types of storage */
+       /** One of the tree possible types of storage */
        enum osl_storage_type storage_type;
        /** Specifies further properties of the column */
        enum osl_storage_flags storage_flags;
@@ -146,8 +157,6 @@ enum osl_close_flags {
        OSL_FREE_VOLATILE = 2
 };
 
-
-
 int osl_create_table(const struct osl_table_description *desc);
 int osl_open_table(const struct osl_table_description *desc,
        struct osl_table **result);
@@ -178,4 +187,8 @@ int osl_get_nth_row(const struct osl_table *t, unsigned col_num,
        unsigned n, struct osl_row **result);
 int osl_get_rank(const struct osl_table *t, struct osl_row *r,
        unsigned col_num, unsigned *rank);
+int osl_hash_compare(const struct osl_object *obj1,
+               const struct osl_object *obj2);
 const char *osl_strerror(int nr);
+
+#pragma GCC visibility pop