make send_callback_request() and friends take a result handler.
[paraslash.git] / osl.h
diff --git a/osl.h b/osl.h
index b0ad739101608f2ca9f3b853f5f2629ac9ed61e6..58969a4392aab2d22383cc93ecd90aa36599ec8c 100644 (file)
--- a/osl.h
+++ b/osl.h
@@ -1,13 +1,13 @@
 #include <sys/mman.h>
 /*
- * Copyright (C) 2007 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2007-2008 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
 /** \file osl.h User interface for the object storage layer. */
 
-/** decribes an object of the object storage layer (osl) */
+/** describes an object of the object storage layer (osl) */
 struct osl_object {
        /** Pointer to the data of the object. */
        void *data;
@@ -58,7 +58,9 @@ enum osl_storage_flags {
        /** The data for this column will have constant size. */
        OSL_FIXED_SIZE = 2,
        /** All values of this column will be different. */
-       OSL_UNIQUE = 4
+       OSL_UNIQUE = 4,
+       /** Do not free the data for this column (\p OSL_NO_STORAGE). */
+       OSL_DONT_FREE = 8
 };
 
 struct osl_table;
@@ -93,7 +95,7 @@ struct osl_column_description {
        char *name;
        /**
         * For columns with an associated rbtree, this must point to a function
-        * that compares the values of two objects, either a builtin function
+        * that compares the values of two objects, either a built-in function
         * or a function defined by the application may be supplied.  This
         * field is ignored if the column does not have an associated rbtree.
         *
@@ -124,7 +126,7 @@ struct osl_table_description {
        uint16_t num_columns;
        /** Further table-wide information. */
        enum osl_table_flags flags;
-       /** The array desribing the individual columns of the table. */
+       /** The array describing the individual columns of the table. */
        struct osl_column_description *column_descriptions;
 };
 
@@ -178,27 +180,8 @@ int osl_get_rank(const struct osl_table *t, struct osl_row *r,
        unsigned col_num, unsigned *rank);
 
 int for_each_file_in_dir(const char *dirname,
-       int (*func)(const char *, const void *), const void *private_data);
-int mmap_full_file(const char *filename, int open_mode, struct osl_object *obj);
+       int (*func)(const char *, void *), void *private_data);
 ssize_t para_write_all(int fd, const void *buf, size_t size);
 int para_lseek(int fd, off_t *offset, int whence);
 int para_write_file(const char *filename, const void *buf, size_t size);
 
-/**
- * A wrapper for munmap(2).
- *
- * \param start The start address of the memory mapping.
- * \param length The size of the mapping.
- *
- * \return Positive on success, \p -E_MUNMAP on errors.
- *
- * \sa munmap(2), mmap_full_file().
- */
-_static_inline_ int para_munmap(void *start, size_t length)
-{
-       if (munmap(start, length) >= 0)
-               return 1;
-       PARA_ERROR_LOG("munmap (%p/%zu) failed: %s\n", start, length,
-               strerror(errno));
-       return -E_MUNMAP;
-}