X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=osl_core.h;h=6c87d6ce7f2ab7291ff41444595f0e96f39f8c90;hp=a6342f8e74db1aa5174e0bfea2a6e128de1b8add;hb=8709b1999511701c143d803a75c3d094b93a3071;hpb=f57b24f2f5b6d8ce5ca0d5ad67b5c086695d8eb2 diff --git a/osl_core.h b/osl_core.h index a6342f8..6c87d6c 100644 --- a/osl_core.h +++ b/osl_core.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2008 Andre Noll + * Copyright (C) 2007-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -9,7 +9,7 @@ #include "rbtree.h" #include "hash.h" -static __must_check __printf_1_2 __malloc char *make_message(const char *fmt, ...); +__must_check __printf_1_2 __malloc char *make_message(const char *fmt, ...); /** Internal representation of a column of an osl table. */ struct osl_column { @@ -83,7 +83,6 @@ int init_table_structure(const struct osl_table_description *desc, int row_is_invalid(struct osl_table *t, uint32_t row_num); int get_mapped_object(const struct osl_table *t, unsigned col_num, uint32_t row_num, struct osl_object *obj); -int para_truncate(const char *filename, off_t size); int unmap_table(struct osl_table *t, enum osl_close_flags flags); int init_rbtrees(struct osl_table *t); @@ -134,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. */ @@ -166,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. @@ -304,8 +303,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); } /** @@ -473,23 +472,6 @@ _static_inline_ char *disk_storage_name_of_hash(const struct osl_table *t, HASH_ return strdup(asc); } -/** - * A wrapper for rename(2). - * - * \param old_path The source path. - * \param new_path The destination path. - * - * \return Standard. - * - * \sa rename(2). - */ -_static_inline_ int para_rename(const char *old_path, const char *new_path) -{ - if (rename(old_path, new_path) < 0) - return -ERRNO_TO_ERROR(errno); - return 1; -} - /** * Iterate over each column of an initialized table. *